Skip to content

GitLab

  • Menu
Projects Groups Snippets
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
    • Contribute to GitLab
  • Sign in / Register
  • gst-editing-services gst-editing-services
  • Project information
    • Project information
    • Activity
    • Labels
    • Members
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributors
    • Graph
    • Compare
  • Issues 74
    • Issues 74
    • List
    • Boards
    • Service Desk
    • Milestones
  • Merge requests 9
    • Merge requests 9
  • CI/CD
    • CI/CD
    • Pipelines
    • Jobs
    • Schedules
  • Deployments
    • Deployments
    • Environments
    • Releases
  • Monitor
    • Monitor
    • Incidents
  • Packages & Registries
    • Packages & Registries
    • Container Registry
  • Analytics
    • Analytics
    • Value stream
    • CI/CD
    • Repository
  • Snippets
    • Snippets
  • Activity
  • Graph
  • Create a new issue
  • Jobs
  • Commits
  • Issue Boards
Collapse sidebar
  • GStreamer
  • gst-editing-servicesgst-editing-services
  • Issues
  • #87

Closed
Open
Created Feb 24, 2020 by Henry Wilkes@hwilkesContributor

group: incorrect `timeline` of children

Currently, you can add clips from different timelines to the same GESGroup. This can lead to a difference in the timeline of a group and its children:

>>> timeline = GES.Timeline.new()
>>> alt_timeline = GES.Timeline.new()
>>> layer = timeline.append_layer()
>>> alt_layer = alt_timeline.append_layer()
>>> asset = GES.Asset.request(GES.TestClip, None) 
>>> clip = layer.add_asset(asset, 0, 0, 10, GES.TrackType.AUDIO)
>>> alt_clip = alt_layer.add_asset(asset, 30, 0, 10, GES.TrackType.AUDIO)
>>> group = GES.Group.new()
>>> group.add(clip)
True
>>> group.add(alt_clip)
True
>>> group.timeline is clip.timeline
True
>>> group.timeline is alt_clip.timeline
False

This can obviously lead to problems. Similarly, when a group contains a clip, and neither have a timeline, then we can get a critical failure when we add the clip to a timeline because the timeline is not tracking the clip's parent: the group.

>>> timeline = GES.Timeline.new()
>>> layer = timeline.append_layer()
>>> clip = GES.TestClip.new()
>>> group = GES.Group.new()
>>> group.add(clip)
True
>>> clip.set_duration(20)
True
>>> layer.add_clip(clip)
**
GES:ERROR:ges-timeline-tree.c:205:timeline_tree_track_element: assertion failed: (parent)
Bail out! GES:ERROR:ges-timeline-tree.c:205:timeline_tree_track_element: assertion failed: (parent)
Aborted (core dumped)

I propose that you can only add to a group elements that have a timeline set. If it is the first element, we set the group's timeline to the same value. Otherwise, it must match the timeline of the group. And if, and only if, the group is empty, it will have a NULL timeline. To keep this consistent, when a clip is removed from its layer, and its timeline, we should automatically remove it from the group.

Assignee
Assign to
Time tracking