timeline: re-handle clip children track selection
authorHenry Wilkes <hwilkes@igalia.com>
Mon, 6 Apr 2020 11:09:54 +0000 (12:09 +0100)
committerHenry Wilkes <hwilkes@igalia.com>
Wed, 8 Apr 2020 13:35:28 +0000 (14:35 +0100)
commit269c2d1dc0effce16418247ac8b2ff6f99cc36c1
tree1d3fe221126f750e81126a363f6c17d7a2909048
parentf7a1bdb289c04e3fc89c71fd74525f8bac9f990c
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
ges/ges-clip.c
ges/ges-clip.h
ges/ges-internal.h
ges/ges-layer.c
ges/ges-timeline-element.c
ges/ges-timeline.c
ges/ges-track-element.c
ges/ges-track.c
tests/check/ges/basic.c
tests/check/ges/clip.c
tests/check/ges/test-utils.h