Commit graph

257 commits

Author SHA1 Message Date
Alexandru Băluț
c750345c75 timeline: Better handle loading inconsistent timelines
Auto transition when having 3 overlapping clips in a same point in the
timeline is not supported as we can't handle it in a nice way. Before we
to avoid creating 2 overlapping transitions (which is plain broken in
NLE) were completely disabling `auto-transition` and removing all
auto-transitions in the timeline but this is pretty weird for the end
user. This commit changes and now makes sure 2 transitions are not
created in the same place.

Also cleanup previous test case.
2019-01-28 21:32:58 -03:00
Corentin Noël
e7f63b03f8 timeline: fix two issues in the documentation 2019-01-21 14:15:14 +01: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
acc294bf5a ges: Check the thread from which our API is used
And add some missing API guards
2018-11-03 08:27:58 -03: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
Thibault Saunier
11b24922a1 timeline: Add a method to move layers around
summary_:
This way the timeline can handle all priorities for the user
making the API simpler to use.

API:
  + ges_timeline_move_layer

reviewers_: Mathieu_Du
Differential Revision: https://phabricator.freedesktop.org/D232
2018-03-31 11:28:09 -03:00
Thibault Saunier
bd142e285d clip: Make sure to create transition after a clip is splitted
In the (now tested) scenario where we have a transition on the right
side of a clip we are splitting, auto transitions can't be created
because we resize the clip after adding the new one, meaning that
there are 3 elements in the "transition zone", we need to force
auto transition creation after the splitting.

Fixes https://gitlab.gnome.org/GNOME/pitivi/issues/2142
2018-03-18 11:31:17 -03:00
Harish Fulara
e944739ca5 Added paste functionality to GESTimeline class
https://bugzilla.gnome.org/show_bug.cgi?id=793820
2018-03-02 08:10:50 -03:00
Thibault Saunier
f3dbcd2753 timeline: Do not snap object within the moving context
Reviewed-by: Alex Băluț <<alexandru.balut@gmail.com>>
Differential Revision: https://phabricator.freedesktop.org/D1873
2017-11-07 10:18:45 -03:00
Thibault Saunier
4db3800f98 Revert "timeline: Return FALSE when commiting an empty timeline"
This commit means that we do not get ASYNC_DONE anymore when commiting
an empty timeline, which means that we need to special case that.

This actually broke some code and does not bring in much.

Fixes https://phabricator.freedesktop.org/T7802
Fixes https://phabricator.freedesktop.org/T7797

This reverts commit e570d1e080.

Thanks @stefanzzz for investigating!
2017-08-29 22:27:42 -03:00
Thibault Saunier
959a3c70b0 timeline: Add from first element with wanted start to the move context
We need to iterate over the previous element from trackelement_iter
to find the first element that is at the moving point. Several
elements can have the same start as the one initiating the move,
and we need to take all of them into account.

Fixes https://phabricator.freedesktop.org/T7819
2017-08-18 23:52:35 -03:00
Thibault Saunier
487d9df367 timeline: Remove trackelements initating move from the moving context
They are handled specially when moving the context and having them
part of the context can lead to weird behaviours.

Fixes https://phabricator.freedesktop.org/T7693
2017-07-27 16:32:31 -04: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
Thibault Saunier
a125b8d73b ges: Minor GESTimeline documentation fix 2017-03-10 19:34:21 -03:00
Thibault Saunier
35256b47ff docs: Port all docstring to gtk-doc markdown 2017-03-08 18:13:48 -03:00
Thibault Saunier
e570d1e080 timeline: Return FALSE when commiting an empty timeline
Meaning that ASYNC_DONE/COMMITED is always emited when TRUE is returned
2017-03-06 12:19:16 -03:00
Sebastian Dröge
58e8277a78 ges-timeline: Document intentional case-fall-through
CID 1364754
2017-02-28 15:36:46 +02:00
Thibault Saunier
a563578b0a timeline: Cleanup the moved_clip list before rolling back
Otherwise we might end up using an already freed pointer

Differential Revision: https://phabricator.freedesktop.org/D1640
2017-02-04 18:52:57 -03:00
Sebastian Dröge
f536db2b71 ges-timeline: Properly calculate absolute diff of two unsigned integers
CID 1394491.
2016-11-23 18:42:27 +02:00
Alexandru Băluț
3ed09c370a ges: Fix documentation and debug comments
Reviewed-by: Thibault Saunier <thibault.saunier@collabora.com>
Differential Revision: https://phabricator.freedesktop.org/D1393
2016-11-09 18:35:15 -03:00
Mathieu Duponchelle
73cf36fa25 timeline: reimplement snap_to_position a bit more appropriately.
It could yet be made be simpler, but it would require
touching the rest of the timeline editing code.

Fixes https://phabricator.freedesktop.org/T7587

Reviewed-by: Thibault Saunier <thibault.saunier@collabora.com>
Differential Revision: https://phabricator.freedesktop.org/D657
2016-11-09 18:35:12 -03:00
Sebastian Dröge
748d466ac9 ges-timeline: Fix typo in debug messages 2016-11-09 11:48:09 +02:00
Thibault Saunier
1b5c3cb865 timeline: Avoid creating extra transition when rippling clips
In some cases when rippling clip we could get the algo lost because
a transition existed between two clips (for example at the end of c1
and at the begining of c2) but while rippling it would have required
a transition at the end of c2 and beginning of c1, and we were properly
not destroying the old one (as the two clips were in the moving context)
but we were still creating the other transition in the end...

Reviewed-by: Alex Băluț <alexandru.balut@gmail.com>
Differential Revision: https://phabricator.freedesktop.org/D1362
2016-11-04 15:56:36 -03:00
Thibault Saunier
a2ae8762af timeline: Make sure transitions between rippled clips are never deleted
Reviewed-by: Alex Băluț <alexandru.balut@gmail.com>
Differential Revision: https://phabricator.freedesktop.org/D1361
2016-11-04 15:56:34 -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
cd76231f64 timeline: Properly compute the end of groups when checking snapping
Computation was not taking into account the fact that the start of
the element being moved could be at the middle of a group and not
necessarily at the start!

Fixes T7544

Reviewed-by: Alex Băluț <alexandru.balut@gmail.com>
Differential Revision: https://phabricator.freedesktop.org/D1282
2016-09-26 13:33:19 -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
Alexandru Băluț
a63c754222 timeline: Make get_groups public
Had to separate timeline_emit_group_added from timeline_add_group
to avoid emitting group-added when the project is being loaded.

Reviewed-by: Thibault Saunier <thibault.saunier@collabora.com>
Differential Revision: https://phabricator.freedesktop.org/D1302
2016-09-13 16:47:24 -03:00
Alexandru Băluț
760909bc9e timeline: Fix documentation
Reviewed-by: Thibault Saunier <thibault.saunier@collabora.com>
Differential Revision: https://phabricator.freedesktop.org/D1300
2016-09-13 16:45:27 -03:00
Edward Hervey
53fb174443 ges-timeline: Demote some debugging statements
locking should be in a lower level to avoid too many messages
2016-08-14 17:44:36 +02:00
Thibault Saunier
8162811bce timeline: Keep transitions when moving the moving context between layers
Differential Revision: https://phabricator.freedesktop.org/D1225
2016-07-29 15:57:05 -04:00
Thibault Saunier
fff6a73735 timeline: Ripple from start of clips and not the end.
Fixes https://phabricator.freedesktop.org/T7503
2016-07-28 19:37:25 -04:00
Thibault Saunier
6762b05c19 timeline: Emit snap-ended on commit if needed
Commiting the timeline means that the current operations on the clips are over,
so we should concider snapping as done at that point

Fixes T7499
2016-07-24 08:42:30 -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
Thibault Saunier
8718b01595 ges: Remove timeline_emit_group_removed which slipped in the API by mistake
This is formally an API break but I am sure no one ever used that and
we should make sure the method is removed as soon as possible because
it has no reason to be exposed.
2016-05-06 18:27:56 -03:00
Tim-Philipp Müller
e40c8fcb30 ges: fix misc g-i annotations 2016-04-30 18:38:33 +01:00
Aurélien Zanelli
a8636244b5 timeline: rename "track-element" to "track_element" in select-tracks-for-object documentation
because "track-element" is not a valid identifier for a parameter and
will cause generated binding using GIR to be invalid. For instance in
Vala.

https://bugzilla.gnome.org/show_bug.cgi?id=765853
2016-04-30 16:35:16 +01:00
Thibault Saunier
7d34e33ac4 title: Do not concider inpoints
It does not make sense for titles
Handle element with no inpoint handling in the timeline

Fixes https://phabricator.freedesktop.org/T7319
2016-04-22 16:15:33 -03:00
Fabian Orccon
6a97b50b4b group-added and group-removed signals added
Differential Revision: https://phabricator.freedesktop.org/D619
2016-02-23 20:40:21 +01:00
Thibault Saunier
799c11b58c timeline: Avoid possible crash disposing the timeline 2016-01-19 11:22:57 +01:00
Thibault Saunier
0c46363f74 timeline: Fix infinite loop on dispose
Reviewed-by: Thibault Saunier <thibault.saunier@collabora.com>
Differential Revision: https://phabricator.freedesktop.org/D628
2016-01-17 09:23:37 +01:00
Sebastian Dröge
4997c455f4 ges: Fix various g-i warnings 2015-12-26 09:43:23 +01:00
Thibault Saunier
822e0a7b09 ges: Avoid emitting 'child-added/removed' when signal emission stops addition
In the GESTimeline, TrackElement addition to a clip might get cancelled
(and thus the element gets removed), we need to make sure users do not
get wrong signals.

Also document the fact that user should connect to container::child-added
with g_signal_connect_after.
2015-09-24 13:27:16 +02:00
Justin Kim
fe2165cad3 timeline: don't leak pad in private structure
https://bugzilla.gnome.org/show_bug.cgi?id=754867
2015-09-11 13:09:40 +02:00
Thibault Saunier
d5663a46dc timeline: Remove transitions that can no fit into an auto transition
When activating auto transition mode
2015-07-16 11:23:20 +02:00
Thibault Saunier
d23e43ae1a timeline: Disable movement that lead to 2 transition at a position
We should never let 3 objects to overlap at a same position, for that
we introduce a "rollback" feature and whenever such an editing happens,
we rollback object position to whatever it was before the move.
2015-07-03 14:06:54 +02:00
Thibault Saunier
87b790a9da timeline: Never create transitions between rippled objects
In case of groups, we can have track elements that do not belong
directly to the moved_trackelements but will be moved as others. Never
create transition to all object that have a start > moving group start.
2015-07-03 11:20:54 +02:00