Commit graph

73 commits

Author SHA1 Message Date
Thibault Saunier
4432efcfad track-element: Avoid dereferencing NULL pointer
We set TrackElement track type very early when creating effects
so it now uses that information to find TrackElement in clips
by track type.

Reviewed-by: Alex Băluț <alexandru.balut@gmail.com>
Differential Revision: https://phabricator.freedesktop.org/D1370
2016-10-11 19:25:51 +02:00
Thibault Saunier
2854c91ebc clip: Make top effect priority inside the clip priority range
And simplify the way we start computing children priority
making min_priority already relative to the clip itself.

Differential Revision: https://phabricator.freedesktop.org/D1275
2016-09-26 13:32:52 -03:00
Thibault Saunier
be75994cb9 clip: Reimplement look_child and iterate over children if needed
Otherwise in the case where children reimplement lookup_child to
handle some property renaming lookup fails.
2016-07-28 17:13:31 -04:00
Thibault Saunier
346f887553 ges: Don't remove track elements from clips when removing from layer
And reuse the same previously created element when adding the clip
back to a layer, avoiding losing all setting done on clip children
in that situation

This is a behaviour change but previous behaviour was actually totally
unexpected and people working around that weird behaviour will moste
probably not care about that change

Differential Revision: https://phabricator.freedesktop.org/D1094
2016-06-20 14:49:17 -04: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
Sjors Gielen
84f7f04a64 Handle changing playback rate
Before this patch, NLE and GES did not support NleOperations (respectively
GESEffects) that changed the speed/tempo/rate at which the source plays. For
example, the 'pitch' element can make audio play faster or slower. In GES 1.5.90
and before, an NleOperation containing the pitch element to change the rate (or
tempo) would cause a pipeline state change to PAUSED after that stack; that has
been fixed in 1.5.91 (see #755012 [0]). But even then, in 1.5.91 and later,
NleComposition would send segment events to its NleSources assuming that one
source second is equal to one pipeline second. The resulting early EOS event
(in the case of a source rate higher than 1.0) would cause it to switch stacks
too early, causing confusion in the timeline and spectacularly messed up
output.

This patch fixes that by searching for rate-changing elements in
GESTrackElements such as GESEffects. If such rate-changing elements are found,
their final effect on the playing rate is stored in the corresponding NleObject
as the 'media duration factor', named like this because the 'media duration',
or source duration, of an NleObject can be computed by multiplying the duration
with the media duration factor of that object and its parents (this is called
the 'recursive media duration factor'). For example, a 4-second NleSource with
an NleOperation with a media duration factor of 2.0 will have an 8-second media
duration, which means that for playing 4 seconds in the pipeline, the seek
event sent to it must span 8 seconds of media. (So, the 'duration' of an
NleObject or GES object always refers to its duration in the timeline, not the
media duration.)

To summarize:

* Rate-changing elements are registered in the GESEffectClass (pitch::tempo and
  pitch::rate are registered by default);
* GESTimelineElement is responsible for detecting rate-changing elements and
  computing the media_duration_factor;
* GESTrackElement is responsible for storing the media_duration_factor in
  NleObject;
* NleComposition is responsible for the recursive_media_duration_factor;
* The latter property finally fixes media time computations in NleObject.

NLE and GES tests are included.

[0] https://bugzilla.gnome.org/show_bug.cgi?id=755012

Differential Revision: https://phabricator.freedesktop.org/D276
2016-02-26 19:54:40 +01:00
Thibault Saunier
c4fd9cd2b1 Fix and test priority of TrackElement after splitting
And make sure we properly handle transitions in that case
2016-02-09 12:38:29 +01:00
Thibault Saunier
2fae9ee50d group: Make deep copying actually copy deep
Allowing pasting groups paste exactly what had been copied

And not the new version of the contained objects

This technically breaks the C API but this is a new API and I believe
and hope nobody is using it right now.

Reviewed-by: Thibault Saunier <thibault.saunier@collabora.com>
Differential Revision: https://phabricator.freedesktop.org/D616
2016-01-17 09:23:35 +01:00
Thibault Saunier
5885f58c14 element: Implement a paste method
Allowing user to copy paste clips very easily
2015-07-03 14:06:54 +02:00
Thibault Saunier
8b821511ad clip: Use container priority offset when setting children prios
Instead of trying to compute it ourself which might lead to wrong
behaviour when moving between layer.

+ Make sure that when we reset clip children priority (to make space
  for effects,) we update the container knowledge of priority offsets
2015-07-01 11:38:53 +02:00
Thibault Saunier
f7dbdd27ba clip: Fix track element priority computation
We were computing the priority offset taking the global MIN_NLE_PRIO
(which is a constant == 2 to make space for the mixing elements) instead
of the layer 'track element' relative priority, leading to very big
offsets on layer with a prio > 0. In the end it leaded to effects having
the same priority as the sources which leads to an undefined behaviour
in NLE.
2015-07-01 10:19:07 +02:00
Thibault Saunier
73e4e3bb0a group: Disconnect from old layer notify::priority when a clip is moved to a NULL layer
This means we need to properly track the layer a clip was in. We now
keep track of the various signal IDs in a dedicated structure and
keep a ref on the layer an object is in.

http://phabricator.freedesktop.org/T88
2015-06-05 22:52:43 +02:00
Thibault Saunier
c70a654dd6 ges: Handle trimming auto transitions
Meaning trimming neighbors.

+ And add a test
2015-06-01 10:24:11 +02: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
Thibault Saunier
03c87dbbc7 clip: Fix the ges_clip_set_position function
And enhance the new test

https://bugzilla.gnome.org/show_bug.cgi?id=731248
2014-06-09 16:10:41 +02:00
Thibault Saunier
bb4cf62b62 clip: Rename top_effect_index to top_effect_index
Keeping the old method to not break the API but removing it from the
documentation as users should use the new method (which is the exact
same with a better naming)

https://bugzilla.gnome.org/show_bug.cgi?id=731248
2014-06-09 16:10:41 +02:00
Thibault Saunier
2db5368b9d tests: Check ges_clip_set_position behaviour
+ Minor fix to handle properly the feature when clip is not in any layer

https://bugzilla.gnome.org/show_bug.cgi?id=731248
2014-06-09 16:10:41 +02:00
Thibault Saunier
1fed9555cf ges:clip: Add a method to look for a list of TrackElement-s
+ Add unit tests to check it works properly.

API:
  + ges_clip_find_track_elements
2014-05-19 12:21:52 +02:00
Thibault Saunier
ff1446c2b2 ges: Rename remaning tlobj to clip
https://bugzilla.gnome.org/show_bug.cgi?id=729382
2014-05-02 16:58:42 +02: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
b774783af8 ges: Remove versionning infos now that we start on the 1.X API serie
They are now meaningless, all the current symbols are the basic
ones for the 1.X serie.
2013-12-27 10:14:19 +01:00
Mathieu Duponchelle
219154eacb track-element: add start to the position to which we wish we split the bindings.
The bindings split is relative to the beginning of the clip.
2013-10-30 12:09:52 -03:00
Thibault Saunier
0e35a68aa6 clip: Fix the find_track_element method
What we want is to be able to find a TrackElement by its type, and
possibly specify a Track where to look into.
2013-10-29 17:31:06 -03:00
Thibault Saunier
ca562ba8a0 clip: Return the newly created TrackElement when adding an asset
This is a minor API change
2013-09-28 18:09:49 +02:00
MathieuDuponchelle
1c389d6af3 clip: split_bindings at position * + inpoint* 2013-09-28 02:44:06 +02:00
Thibault Saunier
c4c26f8748 ges: Handle trimming in groups
This was broken, clips where moving all around, make it behave properly.
2013-09-07 12:55:58 -04:00
Mathieu Duponchelle
c527067953 ges-clip: when a child, is removed, disconnect from its notifies. 2013-08-28 14:03:14 -04:00
Thibault Saunier
ef8c4b4b6b clip: Remove the ges_clip_fill_track method
Its was only use by the old custom source which is dead now.

API:
    Remove ges_clip_fill_track

https://bugzilla.gnome.org/show_bug.cgi?id=706855
2013-08-27 15:33:45 -04:00
Mathieu Duponchelle
cd8955c56f trackelement: split bindings correctly. 2013-08-22 18:36:40 -04:00
Thibault Saunier
c1451cf48c clip: Fix the spliting method
We should make sure that the newly created trackelement are inside
a container when adding them to as this is needed for GESUriClip-s.

Also do not try to set a child property on the TrackElement itself.

https://bugzilla.gnome.org/show_bug.cgi?id=703152
2013-07-24 21:30:23 -04:00
Mathieu Duponchelle
2723ef561e container/group/clip: Allow creating an empty group.
This is a legitimate use case.
2013-07-11 23:47:36 +02:00
Mathieu Duponchelle
96204ac1d2 container: Add a 'recursive' argument to the get_children method
API:
  - ges_container_get_children (GESContainer *container);
  + ges_container_get_children (GESContainer *container, gboolean recurse);
2013-07-10 23:25:12 -04:00
Thibault Saunier
a933d9540d ges: Implement a GESGroup class, subclass of GESContainer
The GESGroup class is used to group various GESContainer
together, it can contain either GESClips or GESGroup or both.
2013-07-09 16:47:00 -04:00
Thibault Saunier
2b9606437c clip: Emit the notify::layer signal only when actually needed
That means:
  - only when we do change layer
  - At the end of moving between two layers
2013-07-09 22:13:42 +02:00
Thibault Saunier
89e2a69d37 clip: Avoid list corruption when grouping objects
We are currently iterating over a list that is modified in the same
method, we have to get a copy of the list, and iterate over the copy.
2013-07-09 22:13:42 +02:00
Thibault Saunier
12eebdabda clip: Add an internal method to easily get the priority of the layer the clip is in 2013-07-09 22:13:42 +02:00
Thibault Saunier
30eb9e4474 container: Remove the get_priority_range vmethod
We now let full control to subclasses so we do not need it anymore.
2013-07-09 22:13:42 +02:00
Thibault Saunier
9e15e13983 container: Let full control of children priorities to subclasses
For that we make the children_control_mode a protected filed, directly usable by
subclasses, removing the method to set it.

And we let the subclass set and get the priority offsets to the container class.
2013-07-09 22:13:42 +02:00
Thibault Saunier
534bf481ed clip: Handle child priority offsets when setting priority 2013-07-09 22:13:41 +02:00
Thibault Saunier
7412de6f6c ges: Avoid leaking the timeline when grouping containers 2013-07-09 22:13:41 +02:00
Thibault Saunier
8bc88a2ba8 container: Let subclasses decide when height change should be computed
API:
   - GESContainer.compute_height vmethod
   + _ges_container_set_height
2013-07-09 22:13:41 +02:00
Thibault Saunier
663f9884ef ges: Move ges_clip_edit to GESContainer
This exact same method will be needed in GESGroup, so we should have the method
in the common parent class.

API:
    - ges_clip_edit
    + ges_container_edit
    + GESContainer->edit vmethod
2013-07-09 22:13:41 +02:00
Thibault Saunier
fe043e0231 clip: Never try to set the start after the end of an element when trimming 2013-07-09 22:13:40 +02:00
Thibault Saunier
ab98f370c8 ges: Move GESTimelineElemt vmethod implementation from container to clip
This is where they belong to has they are specific to that
implementation of the baseclass
2013-07-09 22:13:40 +02:00
Thibault Saunier
29bfe9c0fe ges: Misc documentation fixes 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
ef4efa505f clip: Avoid corruption of our list of children while ungrouping 2013-05-09 19:12:43 -04:00
Thibault Saunier
b2b96c743d Rename GESTimelineLayer to GESLayer 2013-04-23 20:22:31 -03:00
Thibault Saunier
10c25fef13 clip: Rework the splitting method
+ Avoid setting clip duration of our parent ourself

Now each and every TrackElement inside a clip have the same
start/inpoint/duration
2013-04-19 19:05:43 -03:00
Thibault Saunier
cdd00ed207 ges-clip: Remove the unlocked TrackElement APIs
Remove APIs:
  ges_track_element_set_locked
  ges_track_element_is_locked

Those APIs where really not nice to use and were causing more issues
than solving them. If 2 time related properties of TimelineElement must
be different, then those element can *not* have the same parent.

Plus, with the new ges_container_group () API, we will recreate 1
GESClip containing the proper GESTimelineElements if it is the thing
to do.
2013-04-15 00:18:05 -03:00