platform/upstream/gstreamer.git
4 years agoges: Ensure that assets are added to project before adding clip to timeline
Thibault Saunier [Mon, 18 May 2020 12:49:53 +0000 (08:49 -0400)]
ges: Ensure that assets are added to project before adding clip to timeline

It is the right ordering and in Pitivi we set the project size
when adding the first (relevant) asset, meaning that our code to
reposition clips would kick in (in the unit tests) if we do not respect
that ordering.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-editing-services/-/merge_requests/176>

4 years agotrack-element: Add is_core method to API
Henry Wilkes [Wed, 13 May 2020 11:11:32 +0000 (12:11 +0100)]
track-element: Add is_core method to API

Open up the method to the user, since they may need the information.
Also added more documentation on what a core track element is to a clip
and how they are treated.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-editing-services/-/merge_requests/169>

4 years agoasset: unref requested assets
Henry Wilkes [Fri, 1 May 2020 11:40:58 +0000 (12:40 +0100)]
asset: unref requested assets

Prevent a few memory leaks in the tests.

Also mark ges_project_save as transfer full for the formatter asset.

Also make sure that ges_project_request_sync is transfer full on the
returned asset.

Fixes https://gitlab.freedesktop.org/gstreamer/gst-editing-services/-/issues/104

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-editing-services/-/merge_requests/169>

4 years agoclip: enforce duration-limit
Henry Wilkes [Thu, 30 Apr 2020 11:10:22 +0000 (12:10 +0100)]
clip: enforce duration-limit

Prevent setting of properties or that of children, if the clip would not
be able to set the corresponding duration if the duration-limit would
drop below the currently set duration.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-editing-services/-/merge_requests/169>

4 years agoclip: make sure core child is active for non-core in same track
Henry Wilkes [Thu, 30 Apr 2020 11:01:52 +0000 (12:01 +0100)]
clip: make sure core child is active for non-core in same track

Each active non-core child must have a corresponding active core child
in the same track. Therefore, if we de-activate a core child, we also
need to de-activate all the non-core children in the same track.
Similarly, if we activate a non-core child, we need to activate the
corresponding core child as well.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-editing-services/-/merge_requests/169>

4 years agoclip: be more robust in handling priority
Henry Wilkes [Thu, 30 Apr 2020 10:50:08 +0000 (11:50 +0100)]
clip: be more robust in handling priority

Make less assumptions about the priority of effects and core elements so
that the code would still work if the priority of an element was set
directly. In particular, the index of a top effect will always be its
position in the effect ordering.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-editing-services/-/merge_requests/169>

4 years agocontainer: stop storing priority offset in child mapping
Henry Wilkes [Tue, 28 Apr 2020 16:29:22 +0000 (17:29 +0100)]
container: stop storing priority offset in child mapping

GESGroup no longer uses this, and GESClip can be made simpler without
it.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-editing-services/-/merge_requests/169>

4 years agoclip: preserve auto-transition in split
Henry Wilkes [Mon, 27 Apr 2020 18:11:16 +0000 (19:11 +0100)]
clip: preserve auto-transition in split

When splitting a clip, keep the auto-transition at the end of the clip
alive and move its source to that of the corresponding split track
element.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-editing-services/-/merge_requests/169>

4 years agoclip: change order of split
Henry Wilkes [Tue, 21 Apr 2020 11:55:34 +0000 (12:55 +0100)]
clip: change order of split

We first change the duration of the splitted clip, then we add the new
clip to the layer and assign the tracks for its children. Normally, when
a clip is added to a layer it will have its track elements created, if
needed, and then assigned to their tracks. This will fail if any sources
would fully or triple overlap existing sources in the same track.

However, here we were adding the clip to the layer *and* avoiding the
track assignment process and instead setting the tracks explicitly. In
particular, the order was:

+ add new clip to layer with no tracks assigned
+ shrink the split clip
+ assign the tracks for the new clip

This has been changed to:

+ shrink the split clip
+ add new clip to layer with no tracks assigned
+ assign the tracks for the new clip

Thus, the order of events for any users connecting to object signals
will be close to that of adding another clip to the layer.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-editing-services/-/merge_requests/169>

4 years agotimeline: create auto-transitions during track-element-added
Henry Wilkes [Mon, 27 Apr 2020 15:27:15 +0000 (16:27 +0100)]
timeline: create auto-transitions during track-element-added

Any time a track element is added to a track, we need to check whether
we need to create a new corresponding auto-transition. This simply moves
the code from ges-clip.c to ges-timeline.c, where it is more appropriate.

Moreover, it technically opens the possibility for creating
auto-transitions for track elements in the timeline that have no
corresponding clip.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-editing-services/-/merge_requests/169>

4 years agotimeline-tree: also trim non-core track elements
Henry Wilkes [Mon, 27 Apr 2020 15:05:54 +0000 (16:05 +0100)]
timeline-tree: also trim non-core track elements

Also trim the in-point of non-core children of clips to ensure that
their content will appear in the timeline at the same position.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-editing-services/-/merge_requests/169>

4 years agotimeline: make sure appended layer has lowest priority
Henry Wilkes [Fri, 24 Apr 2020 20:00:18 +0000 (21:00 +0100)]
timeline: make sure appended layer has lowest priority

Make sure that the priority of an appended layer is the lowest (highest
in value) when appending a layer to the timeline. This change is
important when appending a layer to a timeline, which can easily have a
gap in priorities if a layer has been removed.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-editing-services/-/merge_requests/169>

4 years agotests: add tests for new editing behaviour
Henry Wilkes [Thu, 23 Apr 2020 16:34:52 +0000 (17:34 +0100)]
tests: add tests for new editing behaviour

These tests expose some of the new editing behaviour in timeline
tree. In particular, we test:
+ edits for clips within groups within a group
+ that an edit can succeed if a snap allows it to
+ that snapping occurs at a specific point, and that we alternate
  between one call to snapping-started and one call to snapping-ended
  with corresponding values
+ that an edit can fail if a snap causes it to
+ no snapping is released when an edit fails
+ We tests for the expected changes, and otherwise check that the
  configuration of the timeline has remained unchanged
+ The timeline configuration remains the same when an edit fails
+ That each clip overlap has a corresponding auto-transition
+ That particular auto-transitions are created when a new overlap is
  formed
+ That particular auto-transitions are destroyed when an overlap ends
+ That auto-transitions are not replaced when two clips move but
  maintain their overlap
+ That the timeline does not contain any unaccounted for clips

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-editing-services/-/merge_requests/169>

4 years agolayer: don't set timeline when moving clip
Henry Wilkes [Thu, 23 Apr 2020 16:30:17 +0000 (17:30 +0100)]
layer: don't set timeline when moving clip

If a clip is moving we should not unset its timeline when it is removed
from the layer. Logic has been moved to ges_timeline_add_clip and
ges_timeline_remove_clip.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-editing-services/-/merge_requests/169>

4 years agotimeline-tree: freeze auto-transitions whilst editing
Henry Wilkes [Wed, 22 Apr 2020 14:06:32 +0000 (15:06 +0100)]
timeline-tree: freeze auto-transitions whilst editing

Freeze the auto-tranistions so they do not destroy themselves during an
edit. Once complete the auto-transitions can move themselves back into
position, or remove themselves if their sources are no longer
overlapping.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-editing-services/-/merge_requests/169>

4 years agoclip: make auto-transitions less expensive when adding to track
Henry Wilkes [Tue, 21 Apr 2020 14:06:03 +0000 (15:06 +0100)]
clip: make auto-transitions less expensive when adding to track

Only check the overlaps with the actual track element that was just added
to the track. This reduces the tree traversal by one order.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-editing-services/-/merge_requests/169>

4 years agoclip: remove children if failed to add to layer
Henry Wilkes [Tue, 21 Apr 2020 13:05:55 +0000 (14:05 +0100)]
clip: remove children if failed to add to layer

If adding to a layer fails during ges_timeline_add_clip, any new children
that were created during this process should be removed from the clip to
put it back into its previous state.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-editing-services/-/merge_requests/169>

4 years agogroup: let timeline-tree handle layer priority
Henry Wilkes [Tue, 21 Apr 2020 10:36:58 +0000 (11:36 +0100)]
group: let timeline-tree handle layer priority

Since a group can only have its priority set whilst it is part of a
timeline, we can simply let the timeline-tree handle the move, which it
can already do, whilst checking that the move would be legal (not break
the timeline configuration). All the group has to do now if update its
priority value if the priority of any of its children changes. It
doesn't even need to keep track of the layer priority offsets.

Also, added a check to ensure added children belong to the same
timeline.

Also moved the sigids from the GObject data to a g_hash_table, which is
clearer.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-editing-services/-/merge_requests/169>

4 years agotimeline-element: stop using edit vmethods
Henry Wilkes [Mon, 20 Apr 2020 13:56:55 +0000 (14:56 +0100)]
timeline-element: stop using edit vmethods

These were all redirecting to essentially ges_timeline_element_edit
anyway.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-editing-services/-/merge_requests/169>

4 years agotimeline-element: simplify check for being edited
Henry Wilkes [Mon, 20 Apr 2020 12:13:48 +0000 (13:13 +0100)]
timeline-element: simplify check for being edited

It should be sufficient to set the edit flag only on the toplevel, which
allows all of its children to know they are being edited and should not
move in response.

Also, removed some unnecessary setting/checking of this.

Also, supplied the ges_timeline_element_peak_toplevel, which unlike
ges_timeline_element_get_toplevel_parent, does not add a reference to
the toplevel. Some corresponding leaks in auto-transition have been
fixed by using this instead.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-editing-services/-/merge_requests/169>

4 years agotimeline: emit snapping-started with new valid time
Henry Wilkes [Mon, 27 Apr 2020 13:05:38 +0000 (14:05 +0100)]
timeline: emit snapping-started with new valid time

Only emit snapping-ended if we have a valid snap time. Moreover, we
should emit a new snapping-started even if we are snapping at the same
location. This is because a new snap will always correspond to a new edit,
possibly involving different snapping elements, which a user would want
to know about.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-editing-services/-/merge_requests/169>

4 years agotimeline-tree: simplify and fix editing
Henry Wilkes [Mon, 27 Apr 2020 12:58:38 +0000 (13:58 +0100)]
timeline-tree: simplify and fix editing

Editing has been simplified by breaking down each edit into a
combination of three basic single-element edits: MOVE, TRIM_START, and
TRIM_END.

Each edit follows these steps:
+ Determine which elements are to be edited and under which basic mode
+ Determine which track elements will move as a result
+ Snap the edit position to one of the edges of the main edited element,
  (or the edge of one of its descendants, in the case of MOVE), avoiding
  moving elements.
  NOTE: in particular, we can *not* snap to the edge of a neighbouring
  element in a roll edit. This was previously possible, even though the
  neighbour was moving!
+ Determine the edit positions for clips (or track elements with no
  parent) using the snapped value. In addition, we replace any edits of
  a group with an edit of its descendant clips. If any value would be
  out of bounds (e.g. negative start) we do not edit.
  NOTE: this is now done *after* checking the snapping. This allows the
  edit to succeed if snapping would cause it to go from being invalid to
  valid!
+ Determine whether the collection of edits would result in a valid
  timeline-configuration which does not break the rules for sources
  overlapping.
+ If all this succeeds, we emit snapping-started on the timeline.
+ We then perform all the edits. At this point they should all succeed.

The simplification/unification should make it easier to make other
changes.

Fixes https://gitlab.freedesktop.org/gstreamer/gst-editing-services/-/issues/97
Fixes https://gitlab.freedesktop.org/gstreamer/gst-editing-services/-/issues/98

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-editing-services/-/merge_requests/169>

4 years agogroup: fix priority setting
Henry Wilkes [Sat, 18 Apr 2020 15:49:31 +0000 (16:49 +0100)]
group: fix priority setting

Stop moving the group if a child clip is being edited by timeline-tree,
a child group is updating its own priority, or a layer that a clip is in
has changed priority. A group should only move if a descendant moves
layers outside of a timeline-tree edit, or the priority of the group is
set by the user.

Fixes https://gitlab.freedesktop.org/gstreamer/gst-editing-services/-/issues/89

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-editing-services/-/merge_requests/169>

4 years agocontainer: keep start and duration up to date
Henry Wilkes [Sat, 18 Apr 2020 15:34:56 +0000 (16:34 +0100)]
container: keep start and duration up to date

Simplified keeping the start and the duration of a container/group up to
date with the earliest start of the children and the last end of the
children. The previous logic was spread between ges-group and
ges-container, now all the position handling is in ges-container.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-editing-services/-/merge_requests/169>

4 years agouri-clip: use duration-limit in set_max_duration
Henry Wilkes [Tue, 28 Apr 2020 17:01:04 +0000 (18:01 +0100)]
uri-clip: use duration-limit in set_max_duration

Use the duration-limit rather than max-duration - in-point, since the
former will be able to take other factors, such as effects, into
account.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-editing-services/-/merge_requests/169>

4 years agoclip: add the duration-limit property
Henry Wilkes [Mon, 13 Apr 2020 16:42:22 +0000 (17:42 +0100)]
clip: add the duration-limit property

The duration-limit is the maximum duration that can be set for the clip
given its current children and their properties. If a change in the
children properties causes this to drop below the current duration, it
is automatically capped by this limit.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-editing-services/-/merge_requests/169>

4 years agoges: Output otio formatter loading issues in debug logs
Thibault Saunier [Mon, 4 May 2020 14:35:25 +0000 (10:35 -0400)]
ges: Output otio formatter loading issues in debug logs

Instead of spamming the terminal with a python traceback

Fixes https://gitlab.freedesktop.org/gstreamer/gst-editing-services/-/issues/107

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-editing-services/-/merge_requests/173>

4 years agotests: Stop recording segment position in seek_with_stop
Thibault Saunier [Wed, 6 May 2020 03:03:36 +0000 (23:03 -0400)]
tests: Stop recording segment position in seek_with_stop

There are two valid timing in GstAggregator where the segment event
is pushed before GstAggregator sets its srcpad->segment.position in
gst_aggregator_pad_chain_internal. Segment.position is basically
a helper field for internal elements use so we should not require
a specific value here as we are not checking a particular element
behavior.

Fixes https://gitlab.freedesktop.org/gstreamer/gst-editing-services/-/issues/106

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-editing-services/-/merge_requests/174>

4 years agotest: Add support for .validatetest in the launcher app
Thibault Saunier [Sat, 2 May 2020 05:24:18 +0000 (01:24 -0400)]
test: Add support for .validatetest in the launcher app

4 years agocontainer: return TRUE if adding doesn't cause any errors
Henry Wilkes [Fri, 1 May 2020 13:26:32 +0000 (14:26 +0100)]
container: return TRUE if adding doesn't cause any errors

If `add_child` and `set_parent` succeed we want to return TRUE, even if
the added element is no longer a child by the end of the method. This is
because some users may call ges_container_remove during `child-added`.
This shouldn't be considered an error.

4 years agoges:tests: Fix the `ignore-fields` format in validatetests
Thibault Saunier [Thu, 30 Apr 2020 21:44:33 +0000 (17:44 -0400)]
ges:tests: Fix the `ignore-fields` format in validatetests

They are needed as those are not 100% reproducible with GES.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-editing-services/-/merge_requests/168>

4 years agoplugin: Fix a race removing tracks from timeline from the wrong thread
Thibault Saunier [Thu, 30 Apr 2020 17:23:05 +0000 (13:23 -0400)]
plugin: Fix a race removing tracks from timeline from the wrong thread

The case was that the timeline state was being changed from the parent
composition's action thread before the timeline was committed, leading
to the SELECT_STREAM event to be pushed from the track to the nested
timeline from the wrong composition thread.

```
**
GES:ERROR:../subprojects/gst-editing-services/ges/ges-track.c:1263:ges_track_remove_element: assertion failed: (track->priv->valid_thread == g_thread_self())
Bail out! GES:ERROR:../subprojects/gst-editing-services/ges/ges-track.c:1263:ges_track_remove_element: assertion failed: (track->priv->valid_thread == g_thread_self())

   Thread 1 (Thread 0x7f6ec2d43700 (LWP 1228982)):
   #0  0x00007f6ed85b2a25 in raise () at /lib64/libc.so.6
   #1  0x00007f6ed859b895 in abort () at /lib64/libc.so.6
   #2  0x00007f6ed899cb8c in g_assertion_message (domain=<optimized out>, file=0x7f6ed8d7fd58 "../subprojects/gst-editing-services/ges/ges-track.c", line=<optimized out>, func=<optimized out>, message=<optimized out>) at ../glib/gtestutils.c:2914
   #3  0x00007f6ed89fa9ff in g_assertion_message_expr (domain=domain@entry=0x7f6ed8d76875 "GES", file=file@entry=0x7f6ed8d7fd58 "../subprojects/gst-editing-services/ges/ges-track.c", line=line@entry=1263, func=func@entry=0x7f6ed8d805b0 <__func__.6> "ges_track_remove_element", expr=expr@entry=0x7f6ed8d801e8 "track->priv->valid_thread == g_thread_self()") at ../glib/gtestutils.c:2940
   #4  0x00007f6ed8d2658f in ges_track_remove_element (track=track@entry=0x7f6eb4119b20 [GESAudioTrack], object=object@entry=0x106f240 [GESAudioUriSource]) at ../subprojects/gst-editing-services/ges/ges-track.c:1263
   #5  0x00007f6ed8d10842 in ges_clip_empty_from_track (clip=0x7f6e7803ee80 [GESUriClip], track=track@entry=0x7f6eb4119b20 [GESAudioTrack]) at ../subprojects/gst-editing-services/ges/ges-clip.c:1086
   #6  0x00007f6ed8d01453 in ges_timeline_remove_track (timeline=timeline@entry=0x7f6e6c01ae50 [GESTimeline], track=0x7f6eb4119b20 [GESAudioTrack]) at ../subprojects/gst-editing-services/ges/ges-timeline.c:2460
   #7  0x00007f6ed8d0286b in ges_timeline_send_event (element=<optimized out>, event=<optimized out>) at ../subprojects/gst-editing-services/ges/ges-timeline.c:484
   #8  0x00007f6ed8bf466c in gst_element_send_event (element=0x7f6e6c01ae50 [GESTimeline], event=event@entry=0x7f6eb410f9f0) at ../subprojects/gstreamer/gst/gstelement.c:1934
   #9  0x00007f6ed8d242cd in ges_track_handle_message (bin=0xd846f0 [GESVideoTrack], message=0x7f6eb411ac90) at ../subprojects/gst-editing-services/ges/ges-track.c:477
   #10 0x00007f6ed8bc9128 in bin_bus_handler (bus=<optimized out>, message=<optimized out>, bin=<optimized out>) at ../subprojects/gstreamer/gst/gstbin.c:3286
   #11 0x00007f6ed8bdbae2 in gst_bus_post (bus=bus@entry=0xfdf440 [GstBus], message=message@entry=0x7f6eb411ac90) at ../subprojects/gstreamer/gst/gstbus.c:359
   #12 0x00007f6ed8bf1396 in gst_element_post_message_default (element=element@entry=0x10261d0 [NleComposition], message=0x7f6eb411ac90) at ../subprojects/gstreamer/gst/gstelement.c:2067
   #13 0x00007f6ed8bccbee in gst_bin_post_message (element=0x10261d0 [NleComposition], msg=0x7f6eb411ac90) at ../subprojects/gstreamer/gst/gstmessage.h:376
   #14 0x00007f6ed8bf4b66 in gst_element_post_message (element=0x10261d0 [NleComposition], message=0x7f6eb411ac90) at ../subprojects/gstreamer/gst/gstelement.c:2110
   #15 0x00007f6ed8bc9128 in bin_bus_handler (bus=<optimized out>, message=<optimized out>, bin=<optimized out>) at ../subprojects/gstreamer/gst/gstbin.c:3286
   #16 0x00007f6ed8bdbae2 in gst_bus_post (bus=bus@entry=0xfdf2c0 [GstBus], message=message@entry=0x7f6eb411ac90) at ../subprojects/gstreamer/gst/gstbus.c:359
   #17 0x00007f6ed8bf1396 in gst_element_post_message_default (element=element@entry=0x1029110 [GstBin], message=0x7f6eb411ac90) at ../subprojects/gstreamer/gst/gstelement.c:2067
   #18 0x00007f6ed8bccbee in gst_bin_post_message (element=0x1029110 [GstBin], msg=0x7f6eb411ac90) at ../subprojects/gstreamer/gst/gstmessage.h:376
   #19 0x00007f6ed8bf4b66 in gst_element_post_message (element=0x1029110 [GstBin], message=0x7f6eb411ac90) at ../subprojects/gstreamer/gst/gstelement.c:2110
   #20 0x00007f6ed8bc9128 in bin_bus_handler (bus=<optimized out>, message=<optimized out>, bin=<optimized out>) at ../subprojects/gstreamer/gst/gstbin.c:3286
   #21 0x00007f6ed8bdbae2 in gst_bus_post (bus=bus@entry=0xfdf500 [GstBus], message=message@entry=0x7f6eb411ac90) at ../subprojects/gstreamer/gst/gstbus.c:359
   #22 0x00007f6ed8bf1396 in gst_element_post_message_default (element=element@entry=0xd705e0 [NleSource], message=0x7f6eb411ac90) at ../subprojects/gstreamer/gst/gstelement.c:2067
   #23 0x00007f6ed8bccbee in gst_bin_post_message (element=0xd705e0 [NleSource], msg=0x7f6eb411ac90) at ../subprojects/gstreamer/gst/gstmessage.h:376
   #24 0x00007f6ed8bf4b66 in gst_element_post_message (element=0xd705e0 [NleSource], message=0x7f6eb411ac90) at ../subprojects/gstreamer/gst/gstelement.c:2110
   #25 0x00007f6ed8bc9128 in bin_bus_handler (bus=<optimized out>, message=<optimized out>, bin=<optimized out>) at ../subprojects/gstreamer/gst/gstbin.c:3286
   #26 0x00007f6ed8bdbae2 in gst_bus_post (bus=bus@entry=0x1042400 [GstBus], message=message@entry=0x7f6eb411ac90) at ../subprojects/gstreamer/gst/gstbus.c:359
   #27 0x00007f6ed8bf1396 in gst_element_post_message_default (element=element@entry=0x1029450 [GstBin], message=0x7f6eb411ac90) at ../subprojects/gstreamer/gst/gstelement.c:2067
   #28 0x00007f6ed8bccbee in gst_bin_post_message (element=0x1029450 [GstBin], msg=0x7f6eb411ac90) at ../subprojects/gstreamer/gst/gstmessage.h:376
   #29 0x00007f6ed8bf4b66 in gst_element_post_message (element=0x1029450 [GstBin], message=0x7f6eb411ac90) at ../subprojects/gstreamer/gst/gstelement.c:2110
   #30 0x00007f6ed8bc9128 in bin_bus_handler (bus=<optimized out>, message=<optimized out>, bin=<optimized out>) at ../subprojects/gstreamer/gst/gstbin.c:3286
   #31 0x00007f6ed8bdbae2 in gst_bus_post (bus=bus@entry=0x1042640 [GstBus], message=message@entry=0x7f6eb411ac90) at ../subprojects/gstreamer/gst/gstbus.c:359
   #32 0x00007f6ed8bf1396 in gst_element_post_message_default (element=element@entry=0x7f6eb42fc7a0 [GstURIDecodeBin], message=0x7f6eb411ac90) at ../subprojects/gstreamer/gst/gstelement.c:2067
   #33 0x00007f6ed8bccbee in gst_bin_post_message (element=0x7f6eb42fc7a0 [GstURIDecodeBin], msg=0x7f6eb411ac90) at ../subprojects/gstreamer/gst/gstmessage.h:376
   #34 0x00007f6ed8bf4b66 in gst_element_post_message (element=0x7f6eb42fc7a0 [GstURIDecodeBin], message=0x7f6eb411ac90) at ../subprojects/gstreamer/gst/gstelement.c:2110
   #35 0x00007f6ed8bc9128 in bin_bus_handler (bus=<optimized out>, message=<optimized out>, bin=<optimized out>) at ../subprojects/gstreamer/gst/gstbin.c:3286
   #36 0x00007f6ed8bdbae2 in gst_bus_post (bus=bus@entry=0x7f6eb80a7130 [GstBus], message=message@entry=0x7f6eb411ac90) at ../subprojects/gstreamer/gst/gstbus.c:359
   #37 0x00007f6ed8bf1396 in gst_element_post_message_default (element=element@entry=0x7f6e6c02aa60 [GstDecodeBin], message=0x7f6eb411ac90) at ../subprojects/gstreamer/gst/gstelement.c:2067
   #38 0x00007f6ed8bccbee in gst_bin_post_message (element=0x7f6e6c02aa60 [GstDecodeBin], msg=0x7f6eb411ac90) at ../subprojects/gstreamer/gst/gstmessage.h:376
   #39 0x00007f6ed8bf4b66 in gst_element_post_message (element=0x7f6e6c02aa60 [GstDecodeBin], message=0x7f6eb411ac90) at ../subprojects/gstreamer/gst/gstelement.c:2110
   #40 0x00007f6ec8f1e00d in gst_decode_bin_handle_message (bin=0x7f6e6c02aa60 [GstDecodeBin], msg=<optimized out>) at ../subprojects/gst-plugins-base/gst/playback/gstdecodebin2.c:5667
   #41 0x00007f6ed8bc9128 in bin_bus_handler (bus=<optimized out>, message=<optimized out>, bin=<optimized out>) at ../subprojects/gstreamer/gst/gstbin.c:3286
   #42 0x00007f6ed8bdbae2 in gst_bus_post (bus=bus@entry=0x7f6eb4139110 [GstBus], message=message@entry=0x7f6eb411ac90) at ../subprojects/gstreamer/gst/gstbus.c:359
   #43 0x00007f6ed8bf1396 in gst_element_post_message_default (element=element@entry=0x7f6e54038c70 [GESDemux], message=0x7f6eb411ac90) at ../subprojects/gstreamer/gst/gstelement.c:2067
   #44 0x00007f6ed8bccbee in gst_bin_post_message (element=0x7f6e54038c70 [GESDemux], msg=0x7f6eb411ac90) at ../subprojects/gstreamer/gst/gstmessage.h:376
   #45 0x00007f6ed8bf4b66 in gst_element_post_message (element=0x7f6e54038c70 [GESDemux], message=0x7f6eb411ac90) at ../subprojects/gstreamer/gst/gstelement.c:2110
   #46 0x00007f6ed8bc9128 in bin_bus_handler (bus=<optimized out>, message=<optimized out>, bin=<optimized out>) at ../subprojects/gstreamer/gst/gstbin.c:3286
   #47 0x00007f6ed8bdbae2 in gst_bus_post (bus=bus@entry=0x7f6eb4139350 [GstBus], message=message@entry=0x7f6eb411ac90) at ../subprojects/gstreamer/gst/gstbus.c:359
   #48 0x00007f6ed8bf1396 in gst_element_post_message_default (element=element@entry=0x7f6e6c01ae50 [GESTimeline], message=0x7f6eb411ac90) at ../subprojects/gstreamer/gst/gstelement.c:2067
   #49 0x00007f6ed8bccbee in gst_bin_post_message (element=0x7f6e6c01ae50 [GESTimeline], msg=0x7f6eb411ac90) at ../subprojects/gstreamer/gst/gstmessage.h:376
   #50 0x00007f6ed8bf4b66 in gst_element_post_message (element=element@entry=0x7f6e6c01ae50 [GESTimeline], message=0x7f6eb411ac90) at ../subprojects/gstreamer/gst/gstelement.c:2110
   #51 0x00007f6ed8cfa221 in ges_timeline_change_state (element=0x7f6e6c01ae50 [GESTimeline], transition=GST_STATE_CHANGE_READY_TO_PAUSED) at ../subprojects/gst-editing-services/ges/ges-timeline.c:450
   #52 0x00007f6ed8bf5d1e in gst_element_change_state (element=element@entry=0x7f6e6c01ae50 [GESTimeline], transition=GST_STATE_CHANGE_READY_TO_PAUSED) at ../subprojects/gstreamer/gst/gstelement.c:3033
   #53 0x00007f6ed8bf6868 in gst_element_continue_state (element=element@entry=0x7f6e6c01ae50 [GESTimeline], ret=ret@entry=GST_STATE_CHANGE_SUCCESS) at ../subprojects/gstreamer/gst/gstelement.c:2741
   #54 0x00007f6ed8bf5d67 in gst_element_change_state (element=element@entry=0x7f6e6c01ae50 [GESTimeline], transition=transition@entry=GST_STATE_CHANGE_NULL_TO_READY) at ../subprojects/gstreamer/gst/gstelement.c:3072
   #55 0x00007f6ed8bf6368 in gst_element_set_state_func (element=0x7f6e6c01ae50 [GESTimeline], state=GST_STATE_PAUSED) at ../subprojects/gstreamer/gst/gstelement.c:2987
   #56 0x00007f6ed8bd2129 in gst_bin_element_set_state (next=GST_STATE_PAUSED, current=GST_STATE_PAUSED, start_time=0, base_time=0, element=0x7f6e6c01ae50 [GESTimeline], bin=0x7f6e54038c70 [GESDemux]) at ../subprojects/gstreamer/gst/gstbin.c:2615
   #57 gst_bin_change_state_func (element=0x7f6e54038c70 [GESDemux], transition=GST_STATE_CHANGE_PAUSED_TO_PAUSED) at ../subprojects/gstreamer/gst/gstbin.c:2957
   #58 0x00007f6ed8bf5d1e in gst_element_change_state (element=element@entry=0x7f6e54038c70 [GESDemux], transition=transition@entry=GST_STATE_CHANGE_PAUSED_TO_PAUSED) at ../subprojects/gstreamer/gst/gstelement.c:3033
   #59 0x00007f6ed8bf6368 in gst_element_set_state_func (element=0x7f6e54038c70 [GESDemux], state=GST_STATE_PAUSED) at ../subprojects/gstreamer/gst/gstelement.c:2987
   #60 0x00007f6ed8bd2129 in gst_bin_element_set_state (next=GST_STATE_PAUSED, current=GST_STATE_READY, start_time=0, base_time=0, element=0x7f6e54038c70 [GESDemux], bin=0x7f6e6c02aa60 [GstDecodeBin]) at ../subprojects/gstreamer/gst/gstbin.c:2615
   #61 gst_bin_change_state_func (element=0x7f6e6c02aa60 [GstDecodeBin], transition=GST_STATE_CHANGE_READY_TO_PAUSED) at ../subprojects/gstreamer/gst/gstbin.c:2957
   #62 0x00007f6ec8f1e84f in gst_decode_bin_change_state (element=0x7f6e6c02aa60 [GstDecodeBin], transition=GST_STATE_CHANGE_READY_TO_PAUSED) at ../subprojects/gst-plugins-base/gst/playback/gstdecodebin2.c:5482
   #63 0x00007f6ed8bf5d1e in gst_element_change_state (element=element@entry=0x7f6e6c02aa60 [GstDecodeBin], transition=GST_STATE_CHANGE_READY_TO_PAUSED) at ../subprojects/gstreamer/gst/gstelement.c:3033
   #64 0x00007f6ed8bf6868 in gst_element_continue_state (element=element@entry=0x7f6e6c02aa60 [GstDecodeBin], ret=ret@entry=GST_STATE_CHANGE_SUCCESS) at ../subprojects/gstreamer/gst/gstelement.c:2741
   #65 0x00007f6ed8bf5d67 in gst_element_change_state (element=element@entry=0x7f6e6c02aa60 [GstDecodeBin], transition=transition@entry=GST_STATE_CHANGE_NULL_TO_READY) at ../subprojects/gstreamer/gst/gstelement.c:3072
   #66 0x00007f6ed8bf6368 in gst_element_set_state_func (element=0x7f6e6c02aa60 [GstDecodeBin], state=GST_STATE_PAUSED) at ../subprojects/gstreamer/gst/gstelement.c:2987
   #67 0x00007f6ed8bf5ae8 in gst_element_sync_state_with_parent (element=0x7f6e6c02aa60 [GstDecodeBin]) at ../subprojects/gstreamer/gst/gstelement.c:2413
   #68 0x00007f6ed89f17a0 in g_slist_foreach (list=<optimized out>, func=0x7f6ed8bf5a50 <gst_element_sync_state_with_parent>, user_data=user_data@entry=0x0) at ../glib/gslist.c:880
   #69 0x00007f6ec8f37d45 in gst_uri_decode_bin_change_state (element=<optimized out>, transition=<optimized out>) at ../subprojects/gst-plugins-base/gst/playback/gsturidecodebin.c:2869
   #70 0x00007f6ed8bf5d1e in gst_element_change_state (element=element@entry=0x7f6eb42fc7a0 [GstURIDecodeBin], transition=transition@entry=GST_STATE_CHANGE_READY_TO_PAUSED) at ../subprojects/gstreamer/gst/gstelement.c:3033
   #71 0x00007f6ed8bf6368 in gst_element_set_state_func (element=0x7f6eb42fc7a0 [GstURIDecodeBin], state=GST_STATE_PAUSED) at ../subprojects/gstreamer/gst/gstelement.c:2987
   #72 0x00007f6ed8bd2129 in gst_bin_element_set_state (next=GST_STATE_PAUSED, current=GST_STATE_READY, start_time=0, base_time=0, element=0x7f6eb42fc7a0 [GstURIDecodeBin], bin=0x1029450 [GstBin]) at ../subprojects/gstreamer/gst/gstbin.c:2615
   #73 gst_bin_change_state_func (element=0x1029450 [GstBin], transition=GST_STATE_CHANGE_READY_TO_PAUSED) at ../subprojects/gstreamer/gst/gstbin.c:2957
   #74 0x00007f6ed8bf5d1e in gst_element_change_state (element=element@entry=0x1029450 [GstBin], transition=transition@entry=GST_STATE_CHANGE_READY_TO_PAUSED) at ../subprojects/gstreamer/gst/gstelement.c:3033
   #75 0x00007f6ed8bf6368 in gst_element_set_state_func (element=0x1029450 [GstBin], state=GST_STATE_PAUSED) at ../subprojects/gstreamer/gst/gstelement.c:2987
   #76 0x00007f6ed8bd2129 in gst_bin_element_set_state (next=GST_STATE_PAUSED, current=GST_STATE_READY, start_time=0, base_time=0, element=0x1029450 [GstBin], bin=0xd705e0 [NleSource]) at ../subprojects/gstreamer/gst/gstbin.c:2615
   #77 gst_bin_change_state_func (element=0xd705e0 [NleSource], transition=GST_STATE_CHANGE_READY_TO_PAUSED) at ../subprojects/gstreamer/gst/gstbin.c:2957
   #78 0x00007f6ec805533f in nle_object_change_state (element=0xd705e0 [NleSource], transition=GST_STATE_CHANGE_READY_TO_PAUSED) at ../subprojects/gst-editing-services/plugins/nle/nleobject.c:748
   #79 0x00007f6ed8bf5d1e in gst_element_change_state (element=element@entry=0xd705e0 [NleSource], transition=transition@entry=GST_STATE_CHANGE_READY_TO_PAUSED) at ../subprojects/gstreamer/gst/gstelement.c:3033
   #80 0x00007f6ed8bf6368 in gst_element_set_state_func (element=0xd705e0 [NleSource], state=GST_STATE_PAUSED) at ../subprojects/gstreamer/gst/gstelement.c:2987
   #81 0x00007f6ed8bd2129 in gst_bin_element_set_state (next=GST_STATE_PAUSED, current=GST_STATE_READY, start_time=0, base_time=0, element=0xd705e0 [NleSource], bin=0x1029110 [GstBin]) at ../subprojects/gstreamer/gst/gstbin.c:2615
   #82 gst_bin_change_state_func (element=0x1029110 [GstBin], transition=GST_STATE_CHANGE_READY_TO_PAUSED) at ../subprojects/gstreamer/gst/gstbin.c:2957
   #83 0x00007f6ed8bf5d1e in gst_element_change_state (element=element@entry=0x1029110 [GstBin], transition=transition@entry=GST_STATE_CHANGE_READY_TO_PAUSED) at ../subprojects/gstreamer/gst/gstelement.c:3033
   #84 0x00007f6ed8bf6368 in gst_element_set_state_func (element=0x1029110 [GstBin], state=GST_STATE_PAUSED) at ../subprojects/gstreamer/gst/gstelement.c:2987
   #85 0x00007f6ed8bf5ae8 in gst_element_sync_state_with_parent (element=0x1029110 [GstBin]) at ../subprojects/gstreamer/gst/gstelement.c:2413
   #86 0x00007f6ec8060356 in _activate_new_stack (toplevel_seek=<optimized out>, comp=0x10261d0 [NleComposition]) at ../subprojects/gst-editing-services/plugins/nle/nlecomposition.c:3117
   #87 update_pipeline (comp=comp@entry=0x10261d0 [NleComposition], currenttime=<optimized out>, seqnum=<optimized out>, update_reason=update_reason@entry=COMP_UPDATE_STACK_INITIALIZE) at ../subprojects/gst-editing-services/plugins/nle/nlecomposition.c:3396
   #88 0x00007f6ec80614f6 in _initialize_stack_func (comp=0x10261d0 [NleComposition], ucompo=0x108c800) at ../subprojects/gst-editing-services/plugins/nle/nlecomposition.c:732
   #89 0x00007f6ed893788a in g_closure_invoke (closure=<optimized out>, return_value=<optimized out>, n_param_values=<optimized out>, param_values=<optimized out>, invocation_hint=<optimized out>) at ../gobject/gclosure.c:810
   #90 0x00007f6ec805aaf6 in _execute_actions (comp=0x10261d0 [NleComposition]) at ../subprojects/gst-editing-services/plugins/nle/nlecomposition.c:412
   #91 0x00007f6ed8c4c1cf in gst_task_func (task=0x7f6e6c01c290 [GstTask]) at ../subprojects/gstreamer/gst/gsttask.c:328
   #92 0x00007f6ed89fc0f4 in g_thread_pool_thread_proxy (data=<optimized out>) at ../glib/gthreadpool.c:354
   #93 0x00007f6ed89fb7f2 in g_thread_proxy (data=0x7f6eb0017800) at ../glib/gthread.c:807
   #94 0x00007f6ed7e14432 in start_thread () at /lib64/libpthread.so.0
   #95 0x00007f6ed86779d3 in clone () at /lib64/libc.so.6
```

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-editing-services/-/merge_requests/167>

4 years agocheck: give nle_tempochange test more time
Henry Wilkes [Tue, 14 Apr 2020 09:22:09 +0000 (10:22 +0100)]
check: give nle_tempochange test more time

These test can take longer than most under valgrind, so give them a
little more time until they timeout.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-editing-services/-/merge_requests/160>

4 years agotimeline: fix adding track when layers contains clips
Henry Wilkes [Mon, 13 Apr 2020 10:40:55 +0000 (11:40 +0100)]
timeline: fix adding track when layers contains clips

Made sure that adding a new track only uses select-tracks-for-object for
core children to determine whether a track elements should be added to the
new track or not, and *not* any other track. In particular, there should
be *no* change in the existing tracks of the timeline when adding another
track. Moreover, a new track should not invoke the creation of track
elements for other tracks.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-editing-services/-/merge_requests/160>

4 years agonleobject: stop using media-duration-factor
Henry Wilkes [Wed, 8 Apr 2020 16:11:14 +0000 (17:11 +0100)]
nleobject: stop using media-duration-factor

The property had been deprecated and is unused.

This property is not needed. Any internal time effect that an nleoperation
wraps is itself responsible for converting seek/segment timestamps.
Previously, the ghostpads were performing a rate conversion after the
rate element had already done so, essentially doubling their effect on
seeks and segment times. This was always unnecessary, but went unnoticed
by the tempochange test because it was using an identity element rather
than an actual rate-changing element.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-editing-services/-/merge_requests/160>

4 years agonleoperation: stop setting next_base_time
Henry Wilkes [Wed, 8 Apr 2020 16:08:41 +0000 (17:08 +0100)]
nleoperation: stop setting next_base_time

This property was unused.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-editing-services/-/merge_requests/160>

4 years agonlecomposition: Fix seeking with stop
Thibault Saunier [Tue, 21 Apr 2020 20:22:31 +0000 (16:22 -0400)]
nlecomposition: Fix seeking with stop

And add some tests

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-editing-services/-/merge_requests/166>

4 years agolaunch: Add support for testfiles
Thibault Saunier [Fri, 24 Apr 2020 21:15:16 +0000 (17:15 -0400)]
launch: Add support for testfiles

Making it simpler to define a test in a single files, including the
configuration etc..

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-editing-services/-/merge_requests/166>

4 years agotrack: Do not commit ourselves automatically when changing state from wrong thread
Thibault Saunier [Fri, 24 Apr 2020 20:46:50 +0000 (16:46 -0400)]
track: Do not commit ourselves automatically when changing state from wrong thread

The user is responsible to commit the timeline from the right thread
in that case and in the case of gesdemux, the loaded timeline is filling
gaps automatically when the project is set loaded.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-editing-services/-/merge_requests/166>

4 years agomacos: fix python's configure checks
Andoni Morales Alastruey [Sat, 18 Apr 2020 14:22:25 +0000 (16:22 +0200)]
macos: fix python's configure checks

4 years agoges: Fix interlaced stream playback
Thibault Saunier [Fri, 17 Apr 2020 16:35:26 +0000 (12:35 -0400)]
ges: Fix interlaced stream playback

Negotiation was failling as `videoflip` was not allowing not
progressive interlacing.

Also avoid adding a deinterlace element when it is useless.

4 years agoframepositioner: Fix some source repositionning rounding issues
Thibault Saunier [Fri, 17 Apr 2020 00:27:30 +0000 (20:27 -0400)]
framepositioner: Fix some source repositionning rounding issues

Avoid loosing (too much) precision when rescaling back and forth by
storing values in gdoubles.

Handle the fact that position values can be negative

Also fix debug category static variable
as it clashes with the instance variable name in a few methods.

4 years agotimeline: Fix wrong usage of scale_int
Thibault Saunier [Thu, 16 Apr 2020 16:53:00 +0000 (12:53 -0400)]
timeline: Fix wrong usage of scale_int

We are multiplying the framerate by GST_SECOND and thus have no
guarantee that it won't overflow.

4 years agoges: Place imagefreeze at right place
Thibault Saunier [Sat, 11 Apr 2020 15:40:06 +0000 (11:40 -0400)]
ges: Place imagefreeze at right place

Negotiation fails when having the imagefreeze after videorate and
frame positioning won't happen after seeks if we do not put it
before the postioner

4 years agoasset: Avoid dereferencing NULL pointer
Thibault Saunier [Thu, 9 Apr 2020 15:24:44 +0000 (11:24 -0400)]
asset: Avoid dereferencing NULL pointer

CID 1461286

4 years agobasebin: Do not set stream_group if upstream didn't provide it
Thibault Saunier [Thu, 9 Apr 2020 15:20:34 +0000 (11:20 -0400)]
basebin: Do not set stream_group if upstream didn't provide it

CID: 1461278

4 years agoframepositionner: Fix wrong old size check condition
Thibault Saunier [Thu, 9 Apr 2020 15:17:59 +0000 (11:17 -0400)]
framepositionner: Fix wrong old size check condition

CID: 1461277

4 years agovalidate: Avoid dereferencing NULL pointer
Thibault Saunier [Thu, 9 Apr 2020 15:16:34 +0000 (11:16 -0400)]
validate: Avoid dereferencing NULL pointer

CID: 1461266

4 years agotimeline: Ensure setting framerate in timeline_get_framerate
Thibault Saunier [Thu, 9 Apr 2020 15:10:43 +0000 (11:10 -0400)]
timeline: Ensure setting framerate in timeline_get_framerate

CID: 1461250, 1461288

4 years agotests: Check that linking pads works
Thibault Saunier [Thu, 9 Apr 2020 15:07:04 +0000 (11:07 -0400)]
tests: Check that linking pads works

CID: 1456061

4 years agostructured-interface: Properly check that setting keyframe works
Thibault Saunier [Thu, 9 Apr 2020 15:02:26 +0000 (11:02 -0400)]
structured-interface: Properly check that setting keyframe works

Fixes CID: 1455490

4 years agogesdemux: Check result of g_stat
Thibault Saunier [Thu, 9 Apr 2020 14:59:40 +0000 (10:59 -0400)]
gesdemux: Check result of g_stat

CID: 1455489, 1455521

4 years agotest: tempochange: Plug leak
Thibault Saunier [Thu, 9 Apr 2020 14:54:26 +0000 (10:54 -0400)]
test: tempochange: Plug leak

CID: 1455448

4 years agoges: Cast to signed int to compare agasint 0
Thibault Saunier [Thu, 9 Apr 2020 14:42:03 +0000 (10:42 -0400)]
ges: Cast to signed int to compare agasint 0

The check made sense but we were not casting to be able to check
signess of subtraction result.

CID: 1444923

4 years agotimeline: Do not compare unsigned with 0
Thibault Saunier [Thu, 9 Apr 2020 14:37:20 +0000 (10:37 -0400)]
timeline: Do not compare unsigned with 0

Layer priorities are always positive the check was making no
sense in any case.

Fixes CID: 1444922, 1461284

4 years agoges: Always check return value of `ges_container_add`
Thibault Saunier [Thu, 9 Apr 2020 14:31:36 +0000 (10:31 -0400)]
ges: Always check return value of `ges_container_add`

Making coverity happy

CIDs: 1461460, 1461461, 1461462, 1461463, 1461464, 1461465, 1461466, 1461468,

4 years agoges: Fix sending EOS on testclip when using timeoverlay
Thibault Saunier [Thu, 9 Apr 2020 14:00:43 +0000 (10:00 -0400)]
ges: Fix sending EOS on testclip when using timeoverlay

Basically when using timeoverlay we where waiting for input-selector
to receive EOS on its active on the output-selector streaming thread
but... EOS was being sent from that same thread waiting for input-selector
to unblock to send EOS on its other pad.

In our specific use case we want EOS to be sent only on the active pad.

Fixes: https://gitlab.freedesktop.org/gstreamer/gst-editing-services/-/issues/103

4 years agoges: Update documentation
Thibault Saunier [Thu, 9 Apr 2020 13:29:17 +0000 (09:29 -0400)]
ges: Update documentation

And start generating TrackElement children property with a stupid
simple script

4 years agoges: Add the foreground color child property
Thibault Saunier [Thu, 9 Apr 2020 13:24:12 +0000 (09:24 -0400)]
ges: Add the foreground color child property

4 years agoges: Fix reloading UriClipAsset synchronously
Thibault Saunier [Tue, 7 Apr 2020 14:53:15 +0000 (10:53 -0400)]
ges: Fix reloading UriClipAsset synchronously

And add tests for that

4 years agoges: Rework the way we ensure core elements are not wrongly moved between clips
Thibault Saunier [Tue, 7 Apr 2020 14:47:07 +0000 (10:47 -0400)]
ges: Rework the way we ensure core elements are not wrongly moved between clips

Instead of focusing on the instances of the clips and their children,
we relax the check to allow moving track element clip between clips
that share a common asset. This makes it as correct conceptually but
more flexible, and the code becomes simpler.

4 years agogroup: tidied timeline membership in copy-paste
Henry Wilkes [Thu, 2 Apr 2020 10:58:18 +0000 (11:58 +0100)]
group: tidied timeline membership in copy-paste

Previously, the GESContainer ->paste method and GESGroup ->paste methods
were unnecessarily setting the timeline of groups, even though this is
handled by the GESGroup ->child_added method. This could result in the
group being added multiple times.

4 years agotimeline-tree: fix overlap check
Henry Wilkes [Wed, 1 Apr 2020 20:34:48 +0000 (21:34 +0100)]
timeline-tree: fix overlap check

Previously, the code was not able to detect that an element overlaps on
its end, nor could it detect that an element overlaps two elements that
already overlap.

4 years agoclip: tidy grouping
Henry Wilkes [Mon, 6 Apr 2020 11:44:30 +0000 (12:44 +0100)]
clip: tidy grouping

Make the grouping of clips cleaner by checking that the clips share the
same asset.

4 years agoclip: secure adding clip to layer
Henry Wilkes [Mon, 6 Apr 2020 11:42:03 +0000 (12:42 +0100)]
clip: secure adding clip to layer

Add more checks when adding a clip to a layer, or moving a clip to a new
layer. Also, mark the "layer" property as explicit-notify.

4 years agouri-clip: match children by track
Henry Wilkes [Mon, 6 Apr 2020 11:28:13 +0000 (12:28 +0100)]
uri-clip: match children by track

When the asset of a uri clip is reset, its core children are removed and
replaced by the new core children. When replacing, the `set_asset`
method attempts to copy children properties from the previous children
to the new children. However, the children were matched by track-type
only. This would not function as intended when a URI contains multiple
audio or video streams. Instead, we now match children by the tracks
themselves. This should work better, provided the user's
select-tracks-for-object is well behaved.

Also, fix a memory problem in `set_mute` for when a child is not in a
track.

4 years agotimeline-element: only copy read-write properties
Henry Wilkes [Mon, 6 Apr 2020 11:26:11 +0000 (12:26 +0100)]
timeline-element: only copy read-write properties

Only copy the properties that can be both read and written, and are not
construct only. Similarly for child properties when a track-element is
deep copied.

4 years agotimeline: return sunk element on pasting
Henry Wilkes [Mon, 6 Apr 2020 11:17:43 +0000 (12:17 +0100)]
timeline: return sunk element on pasting

Technically, an element can still be floating on the return from
`->paste` (e.g. a clip not in a layer). Since the return of the `_paste`
methods are (return full) a non-floating object is probably expected in
all cases.

4 years agoauto-transition: select track directly
Henry Wilkes [Mon, 6 Apr 2020 11:16:11 +0000 (12:16 +0100)]
auto-transition: select track directly

By-pass the select-tracks-for-object signal for auto-transitions since
their track element must land in the same track as the elements it is
the auto-transition for.

4 years agotimeline: re-handle clip children track selection
Henry Wilkes [Mon, 6 Apr 2020 11:09:54 +0000 (12:09 +0100)]
timeline: re-handle clip children track selection

The way a clip's track elements are added to tracks was re-handled. This
doesn't affect the normal usage of a simple audio-video timeline, where
the tracks are added before any clips, but usage for multi-track
timelines has improved. The main changes are:

+ We can now handle a track being selected for more than one track,
  including a full copy of their children properties and bindings.
  (Previously broken.)
+ When a clip is split, we copy the new elements directly into the same
  track, avoiding select-tracks-for-object.
+ When a clip is grouped or ungrouped, we avoid moving the elements to
  or from tracks.
+ Added API to allow users to copy the core elements of a clip directly
  into a track, complementing select-tracks-for-object.
+ Enforced the rule that a clip can only contain one core child in a
  track, and all the non-core children must be added to tracks that
  already contains a core child. This extends the previous condition
  that two sources from the same clip should not be added to the same
  track.
+ Made ges_track_add_element check that the newly added track element
  does not break the configuration rules of the timeline.
+ When adding a track to a timeline, we only use
  select-tracks-for-object to check whether track elements should be
  added to the new track, not existing ones.
+ When removing a track from a timeline, we empty it of all the track
  elements that are controlled by a clip. Thus, we ensure that a clip
  only contains elements that are in the tracks of the same timeline, or
  no track. Similarly, when removing a clip from a timeline.
+ We can now avoid unsupported timeline configurations when a layer is
  added to a timeline, and already contains clips.
+ We can now avoid unsupported timeline configurations when a track is
  added to a timeline, and the timeline already contains clips.

Fixes https://gitlab.freedesktop.org/gstreamer/gst-editing-services/-/issues/84

4 years agotimeline: stop connecting to track-element-added
Henry Wilkes [Thu, 26 Mar 2020 09:21:42 +0000 (09:21 +0000)]
timeline: stop connecting to track-element-added

This was used to connect to the track element's notify::start signal in
order to update the duration of the timeline (it is not clear why the
notify::duration signal was not also connected to for the same reason).
However, this is already covered by the timeline_tree_move method, which
is always called to update the start of a track element, even if it is not
part of a clip (and similarly for timeline_tree_trim, which is called
when the duration is set).

4 years agoclip: allow arbitrary max-duration when no core children
Henry Wilkes [Wed, 25 Mar 2020 19:35:11 +0000 (19:35 +0000)]
clip: allow arbitrary max-duration when no core children

Before the max-duration could be set arbitrarily when the clip was empty,
to indicate what the max-duration would be once the core children were
created. Now, we can also do this whilst the clip only contains non-core
children.

4 years agotrack-element: change owner to creator
Henry Wilkes [Wed, 25 Mar 2020 18:49:16 +0000 (18:49 +0000)]
track-element: change owner to creator

Rename the private "owners" to "creators" to avoid confusing this with
the owner of the track element's memory.

Also made the ungroup method for GESClip symmetric by making all the
children of the resulting clips share their creators, which allows them
to be added to any of the other ungrouped clips. Once the clips are
grouped back together, the tracks loose these extra creators.

4 years agocontainer: change ownership when adding
Henry Wilkes [Mon, 6 Apr 2020 11:21:54 +0000 (12:21 +0100)]
container: change ownership when adding

Make sure we sink the child on adding, and keep it alive until the end
in case the method fails.

Also, since the child mappings hold a ref to the child, they should give
them up in their free method. This way, the ref will be given up on
disposing, even if ges_container_remove fails.

Also, reverse setting of the start of the container if adding fails.

4 years agoges: Fix build with GCC 10
Nirbheek Chauhan [Mon, 6 Apr 2020 17:36:29 +0000 (23:06 +0530)]
ges: Fix build with GCC 10

gcc-10 defaults to -fno-common, which exposes a symbol conflict, so
use `static` correctly. Also we don't use `parent_extractable_iface`
in `ges-uri-clip.c`.
See https://gcc.gnu.org/bugzilla/show_bug.cgi?id=85678

4 years agoges: Fix trimming clip inside deeply nested groups
Thibault Saunier [Tue, 31 Mar 2020 14:25:49 +0000 (11:25 -0300)]
ges: Fix trimming clip inside deeply nested groups

This broke in 6b7c658b6a551a5b9170987ba44592d1d819e1ae

4 years agouri-clip: Remove dead code
Thibault Saunier [Wed, 25 Mar 2020 01:47:01 +0000 (22:47 -0300)]
uri-clip: Remove dead code

GES_TESTING_ASSETS_DIRECTORY is prehistoric and since then
new mechanism for asset relocation have been added, it makes
no sense to keep that unused code path

4 years agouri-clip: Remove ->create_track_element implementation
Thibault Saunier [Wed, 25 Mar 2020 01:44:07 +0000 (22:44 -0300)]
uri-clip: Remove ->create_track_element implementation

It is dead code

4 years agoges: Deprecate GESImageSource and GESMultiFileSource
Thibault Saunier [Wed, 25 Mar 2020 01:35:35 +0000 (22:35 -0300)]
ges: Deprecate GESImageSource and GESMultiFileSource

Refactoring GESVideoSource so that #GESUriVideoSource can handle
still image in a simple way

MultiFileSource has been replaced with the new `imagesequencesrc`
element, this was totally broken anyway as `multifilesrc` can not seek
properly.

4 years agotrack-element: Create nleobject on GESExtractable::set_asset
Thibault Saunier [Wed, 25 Mar 2020 01:30:38 +0000 (22:30 -0300)]
track-element: Create nleobject on GESExtractable::set_asset

This means that we have all the information about the asset
when constructing the underlying GstElements.

This also allows to cleanup some code all around

4 years agotimeline:element: Refactor the way we 'copy'
Thibault Saunier [Wed, 25 Mar 2020 01:25:47 +0000 (22:25 -0300)]
timeline:element: Refactor the way we 'copy'

Simplifying the implementation and making sure assets are set asap

4 years agoges: Use assets to instantiate track elements/group
Thibault Saunier [Wed, 25 Mar 2020 01:23:16 +0000 (22:23 -0300)]
ges: Use assets to instantiate track elements/group

And deprecate all GESTrackElement constructors, but the GESEffect one.
Those should **never** be created by users and should become internal
in the future.

Stop having docstring for the constructors that were internal.

4 years agotests: Cleanup test files handling
Thibault Saunier [Wed, 18 Mar 2020 19:24:08 +0000 (16:24 -0300)]
tests: Cleanup test files handling

4 years agoformatter: Serialize source properties
Thibault Saunier [Fri, 13 Mar 2020 18:03:17 +0000 (15:03 -0300)]
formatter: Serialize source properties

This way we ensure that the TrackElement 'active' property is
properly serialized

4 years agoges: Add a way to set layer activeness by track
Thibault Saunier [Fri, 6 Mar 2020 21:56:52 +0000 (18:56 -0300)]
ges: Add a way to set layer activeness by track

a.k.a muting layers.

Adding unit tests and making sure serialization works properly

4 years agoelement: Add API safe guard against invalid position in edit()
Thibault Saunier [Tue, 24 Mar 2020 00:21:10 +0000 (21:21 -0300)]
element: Add API safe guard against invalid position in edit()

4 years agovalidate: Refactor actions implementation
Thibault Saunier [Tue, 24 Mar 2020 00:11:45 +0000 (21:11 -0300)]
validate: Refactor actions implementation

Making them simpler to read and avoiding leaks

4 years agostructured-interface: Fix adding clip to layer error reporting
Thibault Saunier [Mon, 23 Mar 2020 18:14:13 +0000 (15:14 -0300)]
structured-interface: Fix adding clip to layer error reporting

4 years agoges: Add a SourceClipAsset class
Thibault Saunier [Tue, 17 Mar 2020 14:53:47 +0000 (11:53 -0300)]
ges: Add a SourceClipAsset class

Cleaning up the way we use the default framerate for natural
frame rate.

4 years agolaunch: Add a way to disable validate at runtime
Thibault Saunier [Tue, 10 Mar 2020 19:10:12 +0000 (16:10 -0300)]
launch: Add a way to disable validate at runtime

Also avoid to add useless bin in our sinks

4 years agoges: Plug some leaks
Thibault Saunier [Mon, 9 Mar 2020 18:38:58 +0000 (15:38 -0300)]
ges: Plug some leaks

4 years agovalidate: Add support to seek in frames
Thibault Saunier [Fri, 28 Feb 2020 14:56:22 +0000 (11:56 -0300)]
validate: Add support to seek in frames

4 years agoges: support test clips assets natural size/framerate
Thibault Saunier [Fri, 28 Feb 2020 14:47:25 +0000 (11:47 -0300)]
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.

4 years agoges: Add APIs to have a sens of frame numbers
Thibault Saunier [Fri, 21 Feb 2020 12:17:11 +0000 (09:17 -0300)]
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.

4 years agoutils: fix argument sanitization
Henry Wilkes [Tue, 29 Oct 2019 16:52:52 +0000 (16:52 +0000)]
utils: fix argument sanitization

_sanitize_argument is supposed to wrap arguments in '"' quote marks such
that they can be parsed and copied into a GstStructure string. This
purpose is now supported more directly, which fixes some bugs, e.g.:
  arguments                before                  fix
+title my=title          +title my="title"       +title "my=title"
+title abc n=my=name     +title abc n="my="name" +title abc n="my=name"
+title my"title          +title "my"title"       +title "my\"title"
+title my\title          +title "my\title"       +title "my\\title"

4 years agolaunch: Fix memory management issue with the rendering format
Thibault Saunier [Fri, 28 Feb 2020 14:52:38 +0000 (11:52 -0300)]
launch: Fix memory management issue with the rendering format

4 years agovalidate: Rename edit-container to edit
Thibault Saunier [Tue, 25 Feb 2020 20:42:47 +0000 (17:42 -0300)]
validate: Rename edit-container to edit

Keeping the old version for backward compat

4 years agoges: Add a timeoverlay to video test sources
Thibault Saunier [Fri, 21 Feb 2020 20:17:10 +0000 (17:17 -0300)]
ges: Add a timeoverlay to video test sources

This is often very useful to have a timeoverlay inside test sources.
We do not want to use it as an effect as segments are not the sames
in GES when it comes to nleoperations.

4 years agoelement: Handle using own property as child property
Thibault Saunier [Tue, 25 Feb 2020 21:39:47 +0000 (18:39 -0300)]
element: Handle using own property as child property

Avoiding ref cycles

4 years agoges: Ensure GESClips assets are always ClipAssets
Thibault Saunier [Fri, 21 Feb 2020 20:16:01 +0000 (17:16 -0300)]
ges: Ensure GESClips assets are always ClipAssets