Commit graph

821 commits

Author SHA1 Message Date
Thibault Saunier
dcb3ad620d ges: Plug some leaks 2020-03-25 11:26:29 -03:00
Thibault Saunier
ae6124e282 validate: Add support to seek in frames 2020-03-25 11:26:29 -03:00
Thibault Saunier
0c87b44fae ges: support test clips assets natural size/framerate
This way we can test this kind of behaviour without requiring
real sources.

Also add simple tests.
2020-03-25 11:26:29 -03:00
Thibault Saunier
e835042f04 ges: Add APIs to have a sens of frame numbers
APIs:
   - ges_timeline_get_frame_time
   - ges_timeline_get_frame_at
   - ges_clip_asset_get_frame_time
   - ges_clip_get_timeline_time_from_source_frame

Extracting ges_util_structure_get_clocktime to internal utilities adding
support for specifying timing values in frames with the special
f<frame-number> synthax.
2020-03-25 11:26:29 -03:00
Thibault Saunier
ff2180b284 ges: Use #pragma once everywhere 2020-03-19 21:09:18 +00:00
Thibault Saunier
314db9f1bd clip: Allow setting max-duration clips without TrackElements
Otherwise this breaks quite a few assumption in user code, several
pitivi tests broke because of that.
2020-03-18 21:58:11 -03:00
Thibault Saunier
fc0333922f ges: Make it so core elements can be re added to their 'owners'
The user might want to add/remove/add core children to clips and be able
to regroup ungrouped clip. This is needed for undo/redo in Pitivi for
example
2020-03-18 21:58:11 -03:00
Henry Wilkes
658e64432d timeline-element: make max-duration cap in-point
Do not allow the in-point to exceed the max-duration of any timeline
element.
2020-03-16 14:19:52 +00:00
Henry Wilkes
d03e0fa8c5 clip: only allow children with the same timeline
Refuse the addition of children whose timeline is neither NULL nor the
clip's timeline.
2020-03-16 14:19:52 +00:00
Henry Wilkes
cd9cba55c0 clip: re-handle child in-point and max-duration
The in-point of a clip is kept in sync with its core children, unless they
have no has-internal-source.

The max-duration is defined as the minimum max-duration amongst the
clip's core children. If it is set to a new value, this sets the
max-duration of its core children to the same value if they have
has-internal-source set as TRUE.

Non-core children (such as effects on a source clip) do not influence
these values.

As part of this, we no longer track in-point in GESContainer. Unlike start
and duration, the in-point of a timeline element does not refer to its
extent in the timeline. As such, it has little meaning for most
collections of timeline-elements, in particular GESGroups. As such, there
is no generic way to relate the in-point of a container to its children.
2020-03-16 14:19:52 +00:00
Henry Wilkes
dc4ca15ba8 clip: copy and paste control bindings
Previously the control bindings were not properly copied into the pasted
clip. Also changed the order so that elements are added to the clip
before the clip is added to the timeline.
2020-03-16 14:19:52 +00:00
Henry Wilkes
c63fb5db0e timeline-element: add signals for child properties
Add the child-property-added and child-property-removed signals to
GESTimelineElement.

GESContainer is able to use this to keep their child properties in sync
with their children: if they are added or removed from the child, they
are also added or removed from the container.
2020-03-16 14:19:52 +00:00
Henry Wilkes
74ae0ba5df container: freeze notifies during add and remove
Hold the notify signals for the container and the children until after
the child has been fully added or removed.

After the previous commit, this was used to ensure that the
notify::priority signal was sent for children of a clip *after* the
child-removed signal. This stopped being the case when the code in
->child_removed was moved to ->remove_child (the latter is called before
the child-removed signal is emitted, whilst the former is called
afterwards). Rather than undo this move of code, which was necessary to
ensure that ->add_child was always reversed, the notify::priority signal
is now simply delayed until after removing the child has completed. This
was done for all notify signals, as well as in the add method, to ensure
consistency.

This allows the test_clips.py test_signal_order_when_removing_effect to
pass.

Also make subclasses take a copy of the list of the children before
setting the start and duration, since this can potentially re-order the
children (if they have the SET_SIMPLE flag set).
2020-03-16 14:19:52 +00:00
Henry Wilkes
91b5a5804a clip: only allow core elements as children
Only allow elements that were created by ges_clip_create_track_elements
(or copied from such an element) to be added to a clip. This prevents
users from adding arbitrary elements to a clip.

As an exception, a user can add GESBaseEffects to clips whose class
supports it, i.e. to a GESSourceClip and a GESBaseEffectClip.

This change also introduces a distinction between the core elements of a
clip (created by ges_clip_create_track_elements) and non-core elements
(currently, only GESBaseEffects, for some classes). In particular,
GESBaseEffectClip will now distinguish between its core elements and
effects added by the user. This means that the core elements will always
have the lowest priority, and will not be listed as top effects. This is
desirable because it brings the behaviour of GESBaseEffectClip in line
with other clip types.
2020-03-16 14:19:51 +00:00
Thibault Saunier
6b7c658b6a ges: Make setting start/duration move or trim generic
We were implementing the logic for moving/trimming elements specific
to SourceClip but this was not correct ass the new timeline tree allows
us to handle that for all element types in a generic and nice way.

This make us need to have groups trimming properly implemented in the
timeline tree, leading to some fixes in the group tests.

This adds tests for the various cases known to not be handled properly
by the previous code.

Fixes https://gitlab.freedesktop.org/gstreamer/gst-editing-services/issues/92
2020-03-09 11:48:37 -03:00
Thibault Saunier
b66290d1be group: Update priority when a child is removed
Fixes https://gitlab.freedesktop.org/gstreamer/gst-editing-services/issues/93
2020-03-06 18:18:28 +00:00
Thibault Saunier
f8091262b5 clip: Don't split clips at illegal position
Make sure that when we split a clip, the resulting timeline would
not be in an illegal state.

Fixes https://gitlab.freedesktop.org/gstreamer/gst-editing-services/issues/94
2020-03-06 18:18:28 +00:00
Henry Wilkes
7f65b7be0c asset: fix handling of proxies
Previous usage of the property proxy-target seemed to alternate between
the two definitions:
+ The asset we are the default proxy of
+ The asset we are in the proxy list of
Now, the latter definition is used, which seems more useful to a user
since knowing the latter can easily allow you to find out the former.

The previous behaviour of ges_asset_set_proxy (asset, NULL) was not very
clear. It is now defined so that it clears all the proxies for 'asset'.
This means that after this call, the GESAsset:proxy property will indeed
be NULL.

Also fixed:
+ We can call ges_asset_set_proxy (asset, proxy) when 'proxy' is already
  in the proxy list of 'asset'.
+ Handling of removing the default proxy in ges_asset_unproxy. This was
  sending out the wrong notifies.
+ Prohibiting circular proxying. Before we could only prevent one case,
  we should now be able to prevent all cases. This will prevent a hang
  in ges_asset_request.
2020-03-05 17:04:51 -03:00
Henry Wilkes
b03915bc87 test: remove asset test that needs internal method
The test_proxy_asset test needs the internal method
ges_asset_finish_proxy. The test also uses the associated internal methods
ges_asset_try_proxy and ges_asset_cache_lookup. However, these are
marked with GES_API in ges-internal.h, which allows us access to them
here.
The new method is not marked as GES_API because it would not allow us to
remove the method in the future without removing it from the symbols list.
We do not want to add to the problem.

The test was simply commented out since we may wish to support tests
that access internal methods in the future using meson.
2020-03-05 17:04:51 -03:00
Henry Wilkes
c12b84788d asset: move set_proxy (NULL, proxy) behaviour to new method
We should not be accepting ges_asset_set_proxy (NULL, proxy) as part of
the API! This behaviour was used internally in combination with
ges_asset_try_proxy, which is called on a still loading asset, so it was
moved to ges_asset_finish_proxy.
2020-03-05 17:04:51 -03:00
Henry Wilkes
b6fb2ed531 pythontests: change num layers in timeline to 1
In the test_timeline.test_auto_transition, the corresponding xges only
has one layer, so we should only expect one layer when we extract the
timeline. This fixes a change that was missing from commit
d3e2cf55e3
2020-03-05 17:04:51 -03:00
Thibault Saunier
3b182342e0 python: Add a Timeline.iter_clips() helper to iterate clips 2020-03-02 19:14:01 -03:00
Thibault Saunier
9cf986c71c framepositioner: Reposition source when the user positioned them
Keeping the same proportion in the size and position and only if
the aspect ratio is conserved.
2020-02-26 13:39:29 -03:00
Thibault Saunier
53637ad749 ges: Properly position video sources in the scene by default
We try to do our best to have the video frames scaled the best way
to fill most space on the final frames, keeping aspect ratio. The user
can later on rescale or move the sources as usual but it makes the
default behaviour a better and more natural especially now that we
set default restriction caps to the video tracks.

And fix the unit test to take that change into account
2020-02-26 13:36:30 -03:00
Thibault Saunier
df6058c802 framepositioner: Stop lying about the source size
Basically we were advertising that the source size would be the
size of the track if it hadn't been defined by end user, but since
we started to let scaling happen in the compositor, this is not true
as the source size is now the natural size of the underlying video
stream.

Remove the unit test and reimplemented using a validate scenario which
make the test much simpler to read :=)
2020-02-26 13:36:30 -03:00
Henry Wilkes
7b5f655c9a ges-source-clip: fixed return of duration setter
In general, brought the behaviour of the `start`, `duration` and
`inpoint` setters in line with each other. In particular:
1. fixed return value the GESSourceClip `duration` setter
2. changed the GESClip `start` setter
3. fixed the inpoint callback for GESContainer
4. changed the type of `res` in GESTimelineElement to be gint to
   emphasise that the GES library is using the hack that a return of -1
   from klass->set_duration means no notify signal should be sent out.

Also added a new test for clips to ensure that the setters work for
clips within and outside of timelines, and that the `start`, `inpoint`
and `duration` of a clip will match its children.
2019-12-14 18:12:51 +00:00
Thibault Saunier
3d04bd2b2b validate: Move to the new GstValidateEncodingTestInterface API 2019-11-20 18:07:22 -03:00
Henry Wilkes
44420b2e56 marker: add color meta
Support optionally coloring markers by reserving GES_META_MARKER_COLOR
for an ARGB guint.
2019-10-24 09:45:19 +00:00
Henry Wilkes
cab4a52dde marker-list: add prev position to ::marker-moved
Additionally give the previous marker position in the
GESMarkerList::marker-moved signal, since a user may want to know
where a move was from.

Also, fixed the documentation for GESMarkerList::marker-added

https://gitlab.freedesktop.org/gstreamer/gst-editing-services/issues/78
2019-10-16 17:58:15 +01:00
Tim-Philipp Müller
0c96b9dd10 Remove autotools build system
Todo:
 - hook up data/completions/ges-launch-1.0 in Meson (#77)
2019-10-13 13:54:19 +01:00
Thibault Saunier
d3e2cf55e3 tests: Fix transition project tests
Basically the test project was plain broken as it had fully overlapping
clips is prohibited since the timeline edition API was reimplemented.

Fixes https://gitlab.freedesktop.org/gstreamer/gst-editing-services/issues/62
2019-08-28 13:51:02 +00:00
Millan Castro
68288a76f7 markerlist: implement GESMarkerList
Co-authored by Mathieu Duponchelle <mathieu@centricular.com>
2019-08-22 21:24:02 +02:00
Thibault Saunier
eac22d333a tests:nle: Unref the bus before unrefing the pipeline
Aiming at fixing a rare race condition where we get:

    ../subprojects/gstreamer/libs/gst/check/gstcheck.c:1258:F:nlecomposition:test_seek_on_nested:0: nested_src0_0x1a1a310 is not destroyed, 1 refcounts left!

The idea is that there might have a remaining GstMessage
with the nested_src as `message.src` on the bus that has
yet to be processed in some conditions leading to a reference
still existing when unrefing the pipeline.
2019-08-12 17:40:33 -04:00
Thibault Saunier
955d177dd6 formatter: Plug lists of TimedValue leak 2019-07-26 13:48:52 -04:00
Thibault Saunier
c125093bb1 xml-formatter: Fix loading sources
And fix the project file which couldn't be load now that we
properly check clips coherency
2019-07-26 13:48:51 -04:00
Thibault Saunier
a5fa2c35aa ges: Implement subprojects
Subprojects simply consist of adding the GESProject
to the main project asset list. Then those are recursively
serialized in the main project in the <asset> not, when deserializing,
temporary files are created and those will be used in clips
as necessary
2019-07-26 13:48:48 -04:00
Thibault Saunier
b3bac67f58 nle: Check seeking on deeply nested composition 2019-07-05 18:30:41 -04:00
Swayamjeet
147cbcd6e1 tests: Add ges-sample-path-recurse with projects location
So that project files are found when using nested timelines
2019-07-05 18:30:41 -04:00
Thibault Saunier
8bf3256ddf validate: Add a way to use validate configs with scenarios
Config files should have the-scenario-name.scenario.config to be picked automatically
2019-07-05 18:30:41 -04:00
Thibault Saunier
b8b9441adb validate: Use proper sink and give them good names 2019-07-05 18:30:41 -04:00
Thibault Saunier
564505e16f uri-asset: Fix retrieving a relocated asset sync twice
Add a simple test for that.
2019-07-05 18:11:04 -04:00
Thibault Saunier
e903f15380 nlecomposition: Shutdown children when setting state to NULL
Otherwise if we shutdown a composition whith an nested composition
(inside a source in the test) and leak it, we end up with the nested
composition task still running (in READY) which is bad.

Add a test for that which leaks the pipeline on purpose.
2019-07-05 18:01:51 -04:00
Swayamjeet
ad6d1964af tests: Implement nested timelines tests 2019-07-05 18:00:33 -04:00
Thibault Saunier
3d11893fd7 nle: Add a seeking test for nested composition 2019-07-05 17:54:40 -04:00
Thibault Saunier
14d1f558b1 xml-formatter: Load assets before their proxies
Paving the way to removing pending fields to make the code
simpler to follow.
2019-07-05 17:44:31 -04:00
Thibault Saunier
b3e449fd4f container: Handle children pasting failures 2019-06-05 00:43:48 +00:00
Thibault Saunier
3b95bec095 clip: Fix layer managament when copying a clip that was pasted 2019-06-05 00:43:48 +00:00
Thibault Saunier
ded3a5fb2f element: Properly handle the fact that pasting can return NULL
And fix paste annotation
2019-06-05 00:43:48 +00:00
Thibault Saunier
dafc1cd8d1 tests: Simply include ges-internal.h instead of redefining the same macros 2019-05-23 17:16:27 -04:00
Thibault Saunier
4ded3b8838 python: Avoid warning about using deprecated methods
Fixes https://gitlab.freedesktop.org/gstreamer/gst-editing-services/issues/69
2019-05-04 10:47:27 -04:00
Thibault Saunier
2d8be79cb7 xml-formatter: Fix some asset leaks 2019-04-15 17:11:48 -04:00
Thibault Saunier
86ac3b3159 tests: Plug misc leaks 2019-04-15 17:11:48 -04:00
Thibault Saunier
cfd5fda38d title: Deprecate method that return newly allocated const gchar*
This is just plain broken 190643508f
but we can't do anything about it.
2019-04-15 17:11:48 -04:00
Thibault Saunier
2b79c0db5e tests: Avoid random timeout and let the launcher set it up for us 2019-04-15 17:11:48 -04:00
Thibault Saunier
adc4843f53 xml-formatter: Plug leaks of pending groups 2019-04-15 17:11:48 -04:00
Thibault Saunier
7f0810bae7 Fix splitting control bindings leaks 2019-04-15 17:11:48 -04:00
Thibault Saunier
49b004fe30 tests: Fix a leak in the 'asset' test 2019-04-15 16:18:11 -04:00
Thibault Saunier
a46390ff56 Reimplement the timeline editing API
This is implemented on top of a Tree that represents the whole timeline.

SourceClips can not fully overlap anymore and the tests have been
updated to take that into account. Some new tests were added to verify
that behaviour in greater details
2019-03-15 23:51:55 +00:00
Thibault Saunier
4a1679f698 tests: Add utilities to print the timeline
Making debugging tests simpler
2019-03-15 23:51:55 +00:00
Thibault Saunier
7c5f2d11b2 timeline-element: Add a method to retrieve layer priority
Each timeline element is in a layer (potentially spanning
over several), it is very often useful to retrieve an element
layer priority (from an app perspective more than the element
priority itself as that is a bit of an implementation detail
in the end).

Port tests to it
2019-03-15 23:51:55 +00:00
Thibault Saunier
85e4262917 tests:python: assertEquals is deprecated, use assertEqual 2019-03-15 23:51:55 +00:00
Thibault Saunier
df731aba35 tests: python: Move assertTimelineTopology to the baseclass 2019-03-15 23:51:55 +00:00
Thibault Saunier
1c2784daa6 clip: Add a method to get the priority of the layer it is in
Just an helper method to get the 'priority of a the clip'
2019-03-15 23:51:55 +00:00
Thibault Saunier
c901e4289a clip: Rollback moving clips when moving a contained TrackElement fails
And fix unit tests to match the correct behaviour
2019-03-15 23:51:55 +00:00
Thibault Saunier
957d9a01fe Shorten GES_FORMAT output 2019-03-15 23:51:55 +00:00
Thibault Saunier
430719d172 clip: Make sure to remove and re add effects when adding clips to layer
And make re add them in the same order.

And enhance tests to check that
2019-03-15 23:51:55 +00:00
Thibault Saunier
cef58baf9f meson: Build benchmarks 2019-03-15 16:18:58 -03:00
Seungha Yang
12d8448cf8 tests: Add inconsistent init/deinit test case 2019-03-12 15:17:18 +00:00
Thibault Saunier
facea28b28 tests:python: Use proper GES.Project constructor
Avoiding a g_critical
2019-03-07 12:38:23 +00:00
Thibault Saunier
35e39083a2 tests: Fix usage of undefined class 2019-01-30 19:00:10 +00:00
Yeongjin Jeong
4bf91bda31 tests: ges: Fix various leak 2019-01-29 16:17:22 +09:00
Alexandru Băluț
c750345c75 timeline: Better handle loading inconsistent timelines
Auto transition when having 3 overlapping clips in a same point in the
timeline is not supported as we can't handle it in a nice way. Before we
to avoid creating 2 overlapping transitions (which is plain broken in
NLE) were completely disabling `auto-transition` and removing all
auto-transitions in the timeline but this is pretty weird for the end
user. This commit changes and now makes sure 2 transitions are not
created in the same place.

Also cleanup previous test case.
2019-01-28 21:32:58 -03:00
Thibault Saunier
bad64296d9 uri-asset: Use the same code path for sync discovery as the async one
And start handling relocated assets.

Also expose the discoverer callback as a vmethod so that we can
overridde the discoverer when necessary (to handle discovering of
timeline through gesdemux for example)
2019-01-29 00:06:32 +00:00
Thibault Saunier
c596f80c63 nlecomposition: Get overall pipeline position by recursing up
And handle NLEComposition inside NLEComposition

Fixes https://gitlab.freedesktop.org/gstreamer/gst-editing-services/issues/39
2019-01-29 00:06:32 +00:00
Thibault Saunier
dea6f0df98 layer: Resort clips before syncing priorities
We set the priorities making the assumption that `start_clips` is properly
ordered by start!

Fixes https://gitlab.gnome.org/GNOME/pitivi/issues/2254
2019-01-28 19:19:46 -03:00
Seungha Yang
044c2a2d75 tests: asset: Add test async asset request with custom GMainContext
... and test call ges_{init/deinit} multiple times in a unit test.
2019-01-28 19:31:52 +09:00
Seungha Yang
23845faa90 tests: asset: Remove out-of-date comment 2019-01-28 17:35:04 +09:00
Seungha Yang
27212f2d10 tests: asset: Remove pointless gst_init()
It's done by GST_CHECK_MAIN() already
2019-01-28 17:35:04 +09:00
Seungha Yang
78b38f26a7 tests: init/deinit per test case
... in order to verify init/deinit pair.
2019-01-28 17:35:04 +09:00
Seungha Yang
61c2eb6735 tests: nle: Fix various leak
Don't leak GError and GstPad object
2019-01-18 20:32:02 +00:00
Seungha Yang
a157c9fa10 tests: nle: Fix GList leak 2019-01-18 20:32:02 +00:00
Seungha Yang
a799e1be23 tests: ges: Fix various leak 2019-01-18 20:32:02 +00:00
Seungha Yang
e2533a68dc tests: Increase timeout value to 360 sec
Use consistent timeout value with core and other plugins.
Otherwise, valgrind sometimes timed out with default timeout 30sec.
2019-01-18 09:40:25 +09:00
Alexandru Băluț
f987db47a7 clip: Emit additional signals after child-removed
When removing an effect from a clip, first the notify::priority signals
were being emitted for the remaining effects which changed priority, and only
at the end the child-removed signal. Now the child-removed signal is emitted
first.
2018-11-07 09:09:22 -03:00
Thibault Saunier
2443b1a413 clip: Resync priorities when removing an effect
When removing a top effect in the list of top effects, other
effects priorities need to take that into account to avoid
holes in the indices.
2018-09-05 21:52:37 -03:00
Nirbheek Chauhan
efa220a615 meson: Add a feature option for tests
This autodetection is needed on iOS inside Cerbero where
gstreamer-check-1.0 is not available.
2018-09-01 12:18:21 +05:30
Nirbheek Chauhan
6a806a0dd7 meson: There is no gstreamer-plugins-good-1.0.pc
There is no installed version of that, only an uninstalled version.
2018-08-15 19:15:02 +05:30
Thibault Saunier
bfb943be1b formatter: Serialize Transition border and invert properties
Marking them as children properties and properly allow serializing
clips children properties.

This doesn't handle several TrackElement of a same type with
different property values but this require more worked already
marked as fixme to allow specifying full path of elements in the
children properties API.

See https://gitlab.gnome.org/GNOME/pitivi/issues/1687
2018-07-28 14:25:07 -04:00
Thibault Saunier
d6d8f35563 validate: Let testsuites define scenarios path
The code was not taking into account the fact that testsuite could be
located in a different folder that the default one.

Now the testsuite is responsible for providing a path if it wants
to set extra scenarios or the user can set one by hand.
2018-07-23 00:16:22 -04:00
Thibault Saunier
e6a270c80c tests: Minor assertion enahncements 2018-07-21 12:03:02 -04:00
Thibault Saunier
8e61a5a9ed validate: Handle scenario only based tests
Meaning tests that do not need project at all
2018-07-21 12:01:29 -04:00
Thibault Saunier
db827dbd00 python: Fix GES.Timelineset_child_property
Implementing it in the overrides as PyGObject won't be able to properly
convert python values to GValues in some cases. Using
g_object_set_property works as some logic is implemented inside
PyGObject for that particular case. This is a "regression" due
to https://bugzilla.gnome.org/review?bug=769789&attachment=348766 were
we end up with an OverflowError while setting G_TYPE_UINT children
properties.
2018-07-08 16:02:28 -04:00
Thibault Saunier
1ddc54ee05 tests: Use gst-validate-launcher to run python tests 2018-06-15 18:09:37 -04:00
Thibault Saunier
33d6490308 clip: Make sure to never snap when splitting clips
It makes no sense to snap in that context.

https://gitlab.gnome.org/GNOME/pitivi/issues/2193
2018-05-14 10:42:56 -04:00
Thibault Saunier
ab956c20e8 validate: Run IQA tests when possible
Meaning that a reference file has to be present on disk with a
`.expected_result` extension.
2018-05-13 16:37:21 -04:00
Thibault Saunier
36aa60b010 validate: Stop forcing I420 in profiles restriction caps
This was a workaround for encoders bad behavior in the reconfigure case.

https://bugzilla.gnome.org/show_bug.cgi?id=795420
2018-05-06 16:21:46 +02:00
Thibault Saunier
136456e180 Deprecate ges_layer_set_priority
Keep old behaviour but deprecate the method and property as
ges_timeline_move_layer should be used instead.
2018-03-31 13:44:14 -03:00
Thibault Saunier
bd142e285d clip: Make sure to create transition after a clip is splitted
In the (now tested) scenario where we have a transition on the right
side of a clip we are splitting, auto transitions can't be created
because we resize the clip after adding the new one, meaning that
there are 3 elements in the "transition zone", we need to force
auto transition creation after the splitting.

Fixes https://gitlab.gnome.org/GNOME/pitivi/issues/2142
2018-03-18 11:31:17 -03:00
Thibault Saunier
f219111631 test: Plug minor leaks 2018-02-27 10:00:32 -03:00
Edward Hervey
da9b08c618 check: Fix minor leak in test 2017-12-20 14:28:33 +01:00