Commit graph

40 commits

Author SHA1 Message Date
Henry Wilkes
e57c345f72 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.
2020-04-08 14:35:28 +01:00
Henry Wilkes
269c2d1dc0 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
2020-04-08 14:35:28 +01:00
Thibault Saunier
f9f30c4ced ges: Add a way to set layer activeness by track
a.k.a muting layers.

Adding unit tests and making sure serialization works properly
2020-03-25 15:40:25 -03:00
Henry Wilkes
1332ed674a layer: fix ownership when failing to add clip
If a clip is already part of a layer, then adding it to another layer
should fail. Previously, in this case, `ges_layer_add_clip` was adding a
reference to the clip instead, without subsequently giving up ownership.
This meant that the clip would be left with an unowned reference.
This has now been corrected by also calling `unref` after the
`ref_sink`.

Note that, since `clip` is already part of `current_layer`, it should
already be non-floating, so the `ref_sink`-`unref` should do nothing
overall. But we keep both to make the ownership (transfer floating/none)
explicit.
2020-03-05 17:04:51 -03:00
Henry Wilkes
8ad9952cdb docs: update GESTimeline and GESLayer 2020-03-05 16:59:37 -03:00
Niels De Graef
35d140ad92 Don't pass default GLib marshallers for signals
By passing NULL to `g_signal_new` instead of a marshaller, GLib will
actually internally optimize the signal (if the marshaller is available
in GLib itself) by also setting the valist marshaller. This makes the
signal emission a bit more performant than the regular marshalling,
which still needs to box into `GValue` and call libffi in case of a
generic marshaller.

Note that for custom marshallers, one would use
`g_signal_set_va_marshaller()` with the valist marshaller instead.
2019-10-24 15:19:09 +02:00
Thibault Saunier
99c44bdb34 ges: Add support for EffectClip assets 2019-08-28 13:51:02 +00: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
b8c0894f34 docs: Minor documentation fixes 2019-05-23 18:54:42 -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
b4bdf51935 layer: factor out a method to remove an object without signaling it 2019-03-15 23:51:55 +00:00
Yeongjin Jeong
099934c35f layer: Fix asset leak 2019-01-29 16:17:00 +09: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
Tim-Philipp Müller
a7347ca8f7 WIP: ges: fix API export/import and 'inconsistent linkage' on MSVC
Export GES library API in headers when we're building the
library itself, otherwise import the API from the headers.

This fixes linker warnings on Windows when building with MSVC.

Fix up some missing config.h includes when building the lib which
is needed to get the export api define from config.h

Fixes https://gitlab.freedesktop.org/gstreamer/gst-editing-services/issues/42
2018-12-15 00:14:51 +00:00
Thibault Saunier
13b8c8554d Update for g_type_class_add_private() deprecation in recent GLib 2018-09-05 22:57:27 -03: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
Harish Fulara
503300a0df ges: Fix ges_layer_get_clips_in_interval(start, end) refcount handling
The documentation states that it returns a (transfer full) list
of GESClip but it was returning a (transfer container) list. Make
sure to actually make it (transfer full).

https://bugzilla.gnome.org/show_bug.cgi?id=793874
2018-02-27 09:56:43 -03:00
Ashish Kumar
23e9044b4e GESAsset, GESLayer: add some function guards
https://bugzilla.gnome.org/show_bug.cgi?id=789521
2017-11-21 14:13:53 +01:00
Sebastian Dröge
be67574245 ges: Correctly handling floating references
If we ref_sink() a parameter, it must be marked as (transfer floating)
and it also has to be handled consistently between error and normal cases.

See https://bugzilla.gnome.org/show_bug.cgi?id=782499

https://bugzilla.gnome.org/show_bug.cgi?id=782652
2017-05-20 16:53:57 +02:00
Corentin Noël
1a4c4d3ac0 Tiny fixes in the documentation
https://bugzilla.gnome.org/show_bug.cgi?id=780854
2017-04-02 21:25:38 -03:00
suhas2go
6dc0cd0dec layer: Add ability to get clips in a given interval
Reviewed-by: Alex Băluț <<alexandru.balut@gmail.com>>
Reviewed-by: Thibault Saunier <thibault.saunier@collabora.com>
Differential Revision: https://phabricator.freedesktop.org/D1689
2017-03-28 11:29:37 -03:00
Thibault Saunier
35256b47ff docs: Port all docstring to gtk-doc markdown 2017-03-08 18:13:48 -03:00
Thibault Saunier
e31b8627ef timeline: Destroy transition if a neighbor is not being moved to a layer
And make sure that we move the transition to the right layer, not trying
to figure it out.

Differential Revision: https://phabricator.freedesktop.org/D1360
2016-11-04 15:56:31 -03:00
Thibault Saunier
f79c73789f layer: Handle operation priorities
All operations should have higher priorites and sources should be
on top of those. We now first set the operations priorities in
a first pass and then stack sources on top of those.

Differential Revision: https://phabricator.freedesktop.org/D1279
2016-09-26 13:32:57 -03:00
Thibault Saunier
564bd8d473 layer: Make sure to resync priorities on commit
In case effects have been added priorites might become wrong,
but until the timeline is not commited, it does not matter.

Make sure all priorities are correct before commiting compositions

Differential Revision: https://phabricator.freedesktop.org/D1277
2016-09-26 13:32:55 -03:00
Thibault Saunier
3daf8bd788 Finally move clip priority handling to GESLayer.
Fix all tests as we now have 1 priority inside the layer
dedicated to transitions (basically no source clip will
ever have a priority of 0 inside a layer).

Differential Revision: https://phabricator.freedesktop.org/D1276
2016-09-26 13:32:53 -03:00
Aurélien Zanelli
813c4b4fb7 ges: add some g-i annotations according to documentation
Mainly (transfer xxx) and (nullable). Also fix some typo.

https://bugzilla.gnome.org/show_bug.cgi?id=766459
2016-05-14 20:36:07 -03:00
Thibault Saunier
3ba6dec976 timeline: Minor documentation addition 2015-05-19 18:19:10 +02:00
Mathieu Duponchelle
54190d9dd8 layer: call timeline_element_set_timeline in layer_set_timeline.
Summary:
Otherwise if there was still a reference to the layer when it
is removed from the timeline, it fails when the last reference
is released, because timeline_element_set_timeline calls
timeline_remove_element, which tries to remove the element from
an already disposed hashtable.

Reviewers: thiblahute

Differential Revision: http://phabricator.freedesktop.org/D82
2015-04-08 23:35:01 +02:00
Thibault Saunier
0bb313030b layer: Remove child from children list before emitting "child-removed" 2015-01-28 11:39:58 +01:00
Thibault Saunier
11f9c6e108 Cleanup import of GNL and rename gnl to nle for Non Linear Engine
Conflicts:
	ges/ges-track-element.c
	gnl/Makefile.am
	gnl/common

Conflicts:
	ges/ges-internal.h
	ges/ges-track.c
	ges/ges-utils.c
	ges/nle/.gitignore
	ges/nle/gnlmarshal.list
	ges/nle/nle.h
	ges/nle/nlecomposition.c
	ges/nle/nlecomposition.h
	ges/nle/nleghostpad.c
	ges/nle/nleghostpad.h
	ges/nle/nleobject.c
	ges/nle/nleoperation.c
	ges/nle/nleoperation.h
	ges/nle/nlesource.c
	ges/nle/nlesource.h
	ges/nle/nletypes.h
	ges/nle/nleurisource.c
	ges/nle/nleurisource.h
	gnl/Makefile.am
	gnl/gnl.c
	gnl/gnl.h
	gnl/gnl/gnl.h
	gnl/gnl/gnlcomposition.c
	gnl/gnl/gnlcomposition.h
	gnl/gnl/gnlghostpad.c
	gnl/gnl/gnlghostpad.h
	gnl/gnl/gnlmarshal.list
	gnl/gnl/gnlobject.c
	gnl/gnl/gnloperation.c
	gnl/gnl/gnloperation.h
	gnl/gnl/gnlsource.c
	gnl/gnl/gnlsource.h
	gnl/gnl/gnltypes.h
	gnl/gnl/gnlurisource.c
	gnl/gnl/gnlurisource.h
	gnl/gnlcomposition.c
	gnl/gnlcomposition.h
	gnl/gnlghostpad.c
	gnl/gnlghostpad.h
	gnl/gnlmarshal.list
	gnl/gnlobject.c
	gnl/gnlobject.h
	gnl/gnloperation.c
	gnl/gnloperation.h
	gnl/gnlsource.c
	gnl/gnlsource.h
	gnl/gnltypes.h
	gnl/gnlurisource.c
	gnl/gnlurisource.h
	gnl/tests/check/gnl/common.c
	gnl/tests/check/gnl/common.h
	gnl/tests/check/gnl/complex.c
	gnl/tests/check/gnl/gnlcomposition.c
	gnl/tests/check/gnl/gnloperation.c
	gnl/tests/check/gnl/gnlsource.c
	gnl/tests/check/gnl/seek.c
	gnl/tests/check/gnl/simple.c
	tests/check/gnl/common.c
	tests/check/gnl/common.h
	tests/check/gnl/complex.c
	tests/check/gnl/gnlcomposition.c
	tests/check/gnl/gnloperation.c
	tests/check/gnl/gnlsource.c
	tests/check/gnl/seek.c
	tests/check/gnl/simple.c
	tests/check/nle/common.c
	tests/check/nle/common.h
	tests/check/nle/complex.c
	tests/check/nle/nlecomposition.c
	tests/check/nle/nleoperation.c
	tests/check/nle/nlesource.c
	tests/check/nle/seek.c
	tests/check/nle/simple.c
2014-10-31 11:58:12 +01:00
Christoph Reiter
a66e674649 Include class related section documentation in the gir file.
g-ir-scanner includes section docs as class/interface docs if the section name is equal to the lowercase type name.
Since all the documentation is in section blocks, rename them to match the type names.

https://bugzilla.gnome.org/show_bug.cgi?id=727776
2014-04-07 22:13:25 +02:00
Thibault Saunier
04071e7214 layer: Set clip start to the duration of the layer if == TIME_NONE
In the provided start of a clip is GST_CLOCK_TIME_NONE in
ges_layer_add_asset, it means that we want the clip to be
added at the end of the layer
2013-11-22 17:50:27 -03:00
Thibault Saunier
4c411761fd layer: Add an API to get the total duration of the layer
API:
    ges_layer_get_duration
2013-11-22 17:50:27 -03:00
Simon Corsin
bc4186d9c8 ges-layer.c: notify priority changes. 2013-06-23 18:37:41 -04:00
Thibault Saunier
b87c800743 meta-container: Add a VOLUME default meta to layers 2013-06-23 18:28:53 -04:00
Thibault Saunier
55b7628382 ges: Make space in the GESTracks to be able to add mixing elements later
And update the tests
2013-06-23 18:28:52 -04:00
Thibault Saunier
700a56f88c layer: Fix some mix up in variable names 2013-06-23 17:39:05 -04:00
Thibault Saunier
439f9b4cc0 layer: Simplify a bit how we handle priorities 2013-06-23 17:39:05 -04:00
Thibault Saunier
b2b96c743d Rename GESTimelineLayer to GESLayer 2013-04-23 20:22:31 -03:00
Renamed from ges/ges-timeline-layer.c (Browse further)