platform/upstream/gst-editing-services.git
4 years agotimeline: Add a simplified version of track selection signal
Thibault Saunier [Wed, 8 Jul 2020 19:47:55 +0000 (15:47 -0400)]
timeline: Add a simplified version of track selection signal

Most user do not need to select several tracks for a single
TrackElement and this signal is not binding friendly so
this is adding a simpler, more user and binding friendly version

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-editing-services/-/merge_requests/198>

4 years agouri-source: Respect user stream selection
Thibault Saunier [Wed, 8 Jul 2020 19:47:12 +0000 (15:47 -0400)]
uri-source: Respect user stream selection

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-editing-services/-/merge_requests/198>

4 years agolaunch: Also print the position when disabling validate
Thibault Saunier [Wed, 8 Jul 2020 12:02:27 +0000 (08:02 -0400)]
launch: Also print the position when disabling validate

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-editing-services/-/merge_requests/198>

4 years agolaunch: Print more useful information to stdout
Thibault Saunier [Wed, 8 Jul 2020 12:01:58 +0000 (08:01 -0400)]
launch: Print more useful information to stdout

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-editing-services/-/merge_requests/198>

4 years agobuild: Add an option to disable examples
Thibault Saunier [Wed, 8 Jul 2020 11:42:38 +0000 (07:42 -0400)]
build: Add an option to disable examples

And make it yield as in other modules

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-editing-services/-/merge_requests/198>

4 years agolauncher: Re activate smart rendering support
Thibault Saunier [Fri, 3 Jul 2020 22:21:22 +0000 (18:21 -0400)]
launcher: Re activate smart rendering support

Trying to get the best encoding profile for smart rendering when
the user didn't specify anything.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-editing-services/-/merge_requests/198>

4 years agoges: Fix smart rendering
Thibault Saunier [Fri, 3 Jul 2020 22:16:13 +0000 (18:16 -0400)]
ges: Fix smart rendering

Smart rendering has been broken since, mostly forever, but some code
was there pretending it was supported... let's try to stop pretending.

We now keep track of the smart rendering state in the timeline, track
and sources to be able to:

 * tell decodebin to stop plugging more (decoding elements) as soon as
   downstream supports the format.

 * avoid plugging converters after the source element when smart
   rendering.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-editing-services/-/merge_requests/198>

4 years agovalidate: Pipe debug output to a file when discovering scenarios
Thibault Saunier [Fri, 3 Jul 2020 22:00:39 +0000 (18:00 -0400)]
validate: Pipe debug output to a file when discovering scenarios

Otherwise `gst-validate-launcher` can get veeery noisy

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-editing-services/-/merge_requests/198>

4 years agonle: Minor debug enhancement
Thibault Saunier [Fri, 3 Jul 2020 21:59:49 +0000 (17:59 -0400)]
nle: Minor debug enhancement

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-editing-services/-/merge_requests/198>

4 years agotests: Mark audio identity as audio
Thibault Saunier [Fri, 3 Jul 2020 21:58:16 +0000 (17:58 -0400)]
tests: Mark audio identity as audio

Otherwise GES fallbacks to video...

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-editing-services/-/merge_requests/198>

4 years agopipeline: stop setting the track caps
Henry Wilkes [Mon, 13 Jan 2020 13:08:24 +0000 (13:08 +0000)]
pipeline: stop setting the track caps

Stop setting the track 'caps' property. The previous code could
overwrite a users own setting of the caps for video and audio caps.
Moreover, the 'caps' property is listed as construct only, and users
will likely expect it to stay the same after a track has been added to a
timeline.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-editing-services/-/merge_requests/198>

4 years agolauncher: Delay setting rendering setting to right before rendering
Thibault Saunier [Fri, 3 Jul 2020 21:41:28 +0000 (17:41 -0400)]
launcher: Delay setting rendering setting to right before rendering

So that user settings have been applied to the timeline taking into
account any `validatetest` arguments

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-editing-services/-/merge_requests/198>

4 years agosource: Refactor the way we plug converter elements
Thibault Saunier [Fri, 3 Jul 2020 21:18:51 +0000 (17:18 -0400)]
source: Refactor the way we plug converter elements

Paving the way to skipping converters when rendering smartly

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-editing-services/-/merge_requests/198>

4 years agopipeline: Do not name urisink as `urisink` as it is useless
Thibault Saunier [Fri, 3 Jul 2020 21:02:45 +0000 (17:02 -0400)]
pipeline: Do not name urisink as `urisink` as it is useless

And actually harmful in case you are debugging several pipelines.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-editing-services/-/merge_requests/198>

4 years agopipeline: Remove urisink from timeline instead of unrefing it
Thibault Saunier [Fri, 3 Jul 2020 21:01:18 +0000 (17:01 -0400)]
pipeline: Remove urisink from timeline instead of unrefing it

Doing what was suggested in the FIXME and avoiding to unref
something it while we do not actually own it ourself.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-editing-services/-/merge_requests/198>

4 years agopipeline: Discard encoding profiles that don't match any track
Thibault Saunier [Fri, 3 Jul 2020 20:52:06 +0000 (16:52 -0400)]
pipeline: Discard encoding profiles that don't match any track

Otherwise we get a 'not linked' error and we should just help
the user as we can here.

If the user adds a new track, he should set a new encoding profile
anyway.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-editing-services/-/merge_requests/198>

4 years agouri*source: Factor out common logic into a GESUriSource private data
Thibault Saunier [Fri, 3 Jul 2020 20:34:21 +0000 (16:34 -0400)]
uri*source: Factor out common logic into a GESUriSource private data

The two classes are *very* close but have different hierarchy so this
introduces a new GESUriSource structure that is used as private
structure by both subclasses and makes most of the logic shared this
way.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-editing-services/-/merge_requests/198>

4 years ago*uri-source: Call free from the object ->finalize not ->dispose
Thibault Saunier [Wed, 24 Jun 2020 15:11:11 +0000 (11:11 -0400)]
*uri-source: Call free from the object ->finalize not ->dispose

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-editing-services/-/merge_requests/198>

4 years agomeson: install bash completion helper for ges-launch-1.0
Tim-Philipp Müller [Sat, 25 Jul 2020 18:16:06 +0000 (19:16 +0100)]
meson: install bash completion helper for ges-launch-1.0

Fixes #77

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-editing-services/-/merge_requests/203>

4 years agomeson: add 'tools' and 'examples' options
Tim-Philipp Müller [Sat, 25 Jul 2020 18:09:30 +0000 (19:09 +0100)]
meson: add 'tools' and 'examples' options

To optionally disable build of those.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-editing-services/-/merge_requests/203>

4 years agoFix retrieving asset metadata on project reload.
AsociTon [Fri, 24 Jul 2020 02:13:05 +0000 (07:43 +0530)]
Fix retrieving asset metadata on project reload.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-editing-services/-/merge_requests/202>

4 years agotests: Add test for ges_clip_get_top_effect_index
yatinmaan1@gmail.com [Tue, 21 Jan 2020 10:32:56 +0000 (16:02 +0530)]
tests: Add test for ges_clip_get_top_effect_index

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-editing-services/-/merge_requests/201>

4 years agotests: clip: fix test_rate_effects_duration_limit
Guillaume Desmottes [Tue, 14 Jul 2020 08:20:32 +0000 (10:20 +0200)]
tests: clip: fix test_rate_effects_duration_limit

Fix this assertion:
g_value_copy: assertion 'g_value_type_compatible (G_VALUE_TYPE (src_value), G_VALUE_TYPE (dest_value))' failed

'tempo' is a float, not a double.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-editing-services/-/merge_requests/199>

4 years agobuild: Add version.h to the headers list
Thibault Saunier [Fri, 10 Jul 2020 12:16:10 +0000 (08:16 -0400)]
build: Add version.h to the headers list

So it is properly installed and the gir contains the required information

Fixes https://gitlab.freedesktop.org/gstreamer/gst-editing-services/-/issues/75

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-editing-services/-/merge_requests/197>

4 years agopitivi-formatter: Also skip the class
Thibault Saunier [Fri, 10 Jul 2020 01:42:50 +0000 (21:42 -0400)]
pitivi-formatter: Also skip the class

4 years agomeson: set release date from .doap file for releases
Tim-Philipp Müller [Wed, 8 Jul 2020 16:33:07 +0000 (17:33 +0100)]
meson: set release date from .doap file for releases

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-editing-services/-/merge_requests/196>

4 years agotitle: Make deprecated symbols visible API
Thibault Saunier [Wed, 8 Jul 2020 14:03:43 +0000 (10:03 -0400)]
title: Make deprecated symbols visible API

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-editing-services/-/merge_requests/195>

4 years agoBack to development
Tim-Philipp Müller [Fri, 3 Jul 2020 01:04:08 +0000 (02:04 +0100)]
Back to development

4 years agoRelease 1.17.2
Tim-Philipp Müller [Thu, 2 Jul 2020 23:35:20 +0000 (00:35 +0100)]
Release 1.17.2

4 years agodocs: fix links
Mathieu Duponchelle [Tue, 23 Jun 2020 14:11:59 +0000 (16:11 +0200)]
docs: fix links

4 years agoplugins_cache: add base classes
Mathieu Duponchelle [Mon, 22 Jun 2020 22:05:13 +0000 (00:05 +0200)]
plugins_cache: add base classes

4 years agomeson: mark plugins cache target as always stale
Mathieu Duponchelle [Mon, 22 Jun 2020 22:04:52 +0000 (00:04 +0200)]
meson: mark plugins cache target as always stale

4 years agodocs: mark more types as plugin API
Mathieu Duponchelle [Sat, 20 Jun 2020 23:42:26 +0000 (01:42 +0200)]
docs: mark more types as plugin API

4 years agodoc: Stop documenting properties from parents
Thibault Saunier [Sat, 20 Jun 2020 02:56:41 +0000 (22:56 -0400)]
doc: Stop documenting properties from parents

4 years agosmart-video-mixer: Don't call gst_ghost_pad_construct() anymore
Sebastian Dröge [Mon, 22 Jun 2020 09:34:20 +0000 (12:34 +0300)]
smart-video-mixer: Don't call gst_ghost_pad_construct() anymore

It's deprecated, unneeded and doesn't do anything anymore.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-editing-services/-/merge_requests/192>

4 years agoBack to development
Tim-Philipp Müller [Fri, 19 Jun 2020 23:28:31 +0000 (00:28 +0100)]
Back to development

4 years agoRelease 1.17.1
Tim-Philipp Müller [Fri, 19 Jun 2020 18:25:56 +0000 (19:25 +0100)]
Release 1.17.1

4 years agoges: Add all missing Since markers from 1.16 onward
Thibault Saunier [Fri, 19 Jun 2020 15:13:24 +0000 (11:13 -0400)]
ges: Add all missing Since markers from 1.16 onward

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-editing-services/-/merge_requests/191>

4 years agoasset: Do not try to update proxies when we are in a proxying loop
Thibault Saunier [Tue, 9 Jun 2020 14:07:13 +0000 (10:07 -0400)]
asset: Do not try to update proxies when we are in a proxying loop

This is a regression introduced in
c12b84788d197c714ec32653e2b751079e377c46, this commit simply brings back
the previous behavior.

Fixes https://gitlab.freedesktop.org/gstreamer/gst-editing-services/-/issues/113

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-editing-services/-/merge_requests/185>

4 years agoges: Refactor the way we plug converters in effects
Thibault Saunier [Tue, 9 Jun 2020 04:03:57 +0000 (00:03 -0400)]
ges: Refactor the way we plug converters in effects

Stopping to do it at the bin description level but properly
plugging them where they are needed and cleanly ghosting the pads
where it makes most sense.

This introduces support for GES to request pads on the most upstream
element in case no static pad can be ghosted.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-editing-services/-/merge_requests/187>

4 years agostructured-interface: Add support for setting effects inpoint
Thibault Saunier [Tue, 9 Jun 2020 20:40:11 +0000 (16:40 -0400)]
structured-interface: Add support for setting effects inpoint

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-editing-services/-/merge_requests/187>

4 years agotrack-element: Make set_has_internal_source return a boolean
Thibault Saunier [Tue, 9 Jun 2020 20:35:44 +0000 (16:35 -0400)]
track-element: Make set_has_internal_source return a boolean

Telling the user if it is legal to have an internal source in that
particular GESTrackElement.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-editing-services/-/merge_requests/187>

4 years agopipeline: doc: Add a note about trying to render before setting rendering settings
Thibault Saunier [Mon, 15 Jun 2020 17:09:39 +0000 (13:09 -0400)]
pipeline: doc: Add a note about trying to render before setting rendering settings

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-editing-services/-/merge_requests/189>

4 years agouri-clip: Add a warning about synchronous uri discovery
Thibault Saunier [Mon, 15 Jun 2020 16:23:26 +0000 (12:23 -0400)]
uri-clip: Add a warning about synchronous uri discovery

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-editing-services/-/merge_requests/189>

4 years agodocs: Update plugins cache
Thibault Saunier [Tue, 9 Jun 2020 19:22:30 +0000 (15:22 -0400)]
docs: Update plugins cache

4 years agodocs: Update plugins cache
Thibault Saunier [Mon, 8 Jun 2020 14:58:43 +0000 (10:58 -0400)]
docs: Update plugins cache

4 years agotests: enforce I420 format
Guillaume Desmottes [Fri, 5 Jun 2020 13:56:00 +0000 (15:56 +0200)]
tests: enforce I420 format

Tests are assuming video is I420 with a specific chroma and colorimetry
but were not actually enforcing it.
Fixes needed as I420 will no longer be the first video format, see
gst-plugins-base!689

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-editing-services/-/merge_requests/184>

4 years agotrack, composition: mark stream id properties as DOC_SHOW_DEFAULT
Mathieu Duponchelle [Thu, 4 Jun 2020 21:14:59 +0000 (23:14 +0200)]
track, composition: mark stream id properties as DOC_SHOW_DEFAULT

and update plugins cache

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-editing-services/-/merge_requests/182>

4 years agodoc: Require hotdoc >= 0.11.0
Thibault Saunier [Wed, 3 Jun 2020 22:30:39 +0000 (18:30 -0400)]
doc: Require hotdoc >= 0.11.0

4 years agodocs: Update gst_plugins_cache.json
Sebastian Dröge [Wed, 27 May 2020 13:03:35 +0000 (16:03 +0300)]
docs: Update gst_plugins_cache.json

4 years agoadd missing Since annotations on new API
Guillaume Desmottes [Wed, 3 Jun 2020 07:57:06 +0000 (09:57 +0200)]
add missing Since annotations on new API

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-editing-services/-/merge_requests/181>

4 years agoformatter: Do not dereference NULL pointer
Thibault Saunier [Wed, 27 May 2020 23:44:29 +0000 (19:44 -0400)]
formatter: Do not dereference NULL pointer

CID 1461701

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-editing-services/-/merge_requests/180>

4 years agoxml-formatter: Add an GST_ERROR when setting control sources fails
Thibault Saunier [Wed, 27 May 2020 23:39:49 +0000 (19:39 -0400)]
xml-formatter: Add an GST_ERROR when setting control sources fails

CID 1463853

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-editing-services/-/merge_requests/180>

4 years agovalidate: Wait for state change to consider commit as done
Thibault Saunier [Tue, 26 May 2020 23:14:53 +0000 (19:14 -0400)]
validate: Wait for state change to consider commit as done

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-editing-services/-/merge_requests/178>

4 years agovalidate: Stop always muting
Thibault Saunier [Tue, 26 May 2020 23:02:58 +0000 (19:02 -0400)]
validate: Stop always muting

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-editing-services/-/merge_requests/178>

4 years agoformatter: Fix saving/loading project with clip speed rate control
Thibault Saunier [Thu, 21 May 2020 21:22:18 +0000 (17:22 -0400)]
formatter: Fix saving/loading project with clip speed rate control

We need to ensure that clips duration is set after time effects are
added and we now need to serialize effects inpoints and max duration.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-editing-services/-/merge_requests/177>

4 years agodocs: add some notes on Time in GES
Henry Wilkes [Thu, 21 May 2020 14:42:23 +0000 (15:42 +0100)]
docs: add some notes on Time in GES

These notes cover time coordinates in GES, time effects, time
translations.

It also goes into why keyframes will not work with non-linear time
effects.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-editing-services/-/merge_requests/177>

4 years agouri-clip: don't assume duration needs to stay the same
Henry Wilkes [Thu, 21 May 2020 10:25:30 +0000 (11:25 +0100)]
uri-clip: don't assume duration needs to stay the same

ges_uri_clip_asset_get_duration does not tell us what the duration in
the timeline needs to be. Especially when we have time effects, or
effects with finite max-durations. So we should no longer expect the
duration to stay the same when replacing assets. Instead, we just check
that the new max-duration would be compatible with the current in-point
(which was not checked before), and the clip would not be totally
overlapped if its duration-limit changes.

This is based on the assumption that each source is replaced one-to-one
in its track. If a source is replaced with nothing in the same track,
this check may be a little too strong (but still mostly weaker than
before). However, problems could occur if track selection does
something unexpected, such as placing the new source in a track not
previously occupied.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-editing-services/-/merge_requests/177>

4 years agoclip: provide an example of using time effects
Henry Wilkes [Wed, 20 May 2020 20:23:03 +0000 (21:23 +0100)]
clip: provide an example of using time effects

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-editing-services/-/merge_requests/177>

4 years agotrack-element: use out-point for updating control bindings
Henry Wilkes [Wed, 20 May 2020 20:20:10 +0000 (21:20 +0100)]
track-element: use out-point for updating control bindings

The out-point, which is an internal time, is used instead of the
duration for determining the control binding value at the end of the
element.

Also, allow the user to switch off the auto-clamping of control sources
if they are not desired. And allow them to clamp specific control sources
individually.

Also, fix a lot of memory leaks related to control sources. In
particular, releasing the extra ref gained by source in
g_object_get (binding, "control-source", &source, NULL);

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-editing-services/-/merge_requests/177>

4 years agoclip: test for layer in group
Henry Wilkes [Fri, 15 May 2020 17:09:50 +0000 (18:09 +0100)]
clip: test for layer in group

Make sure the layer exists before we try to remove the grouped clips
from it.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-editing-services/-/merge_requests/177>

4 years agotimeline-tree: make sure the layer priority refers to an existing layer
Henry Wilkes [Fri, 15 May 2020 13:58:08 +0000 (14:58 +0100)]
timeline-tree: make sure the layer priority refers to an existing layer

If a layer priority sits between the priorities of two layers in the
timeline, i.e. it references a gap in the timeline's layers, then
ges_timeline_append_layer will never fill this gap and create the
desired layer, so the edit in timeline-tree would loop forever. So a
check was added to avoid this.

This would be a usage error, but a user can reasonably end up with a gap
in their layers if they remove a layer from the timeline.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-editing-services/-/merge_requests/177>

4 years agoclip: add method for adding top effects
Henry Wilkes [Fri, 15 May 2020 13:53:49 +0000 (14:53 +0100)]
clip: add method for adding top effects

Unlike ges_container_add, this lets you set the index and will check
that track selection did not fail. This is useful for time effects whose
addition would create an unsupported timeline configuration.

Also can use the clip add error in ges_timeline_add_clip to let the user
know when adding a clip to a layer that its in-point is set larger than
the max-duration of its core children.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-editing-services/-/merge_requests/177>

4 years agotimeline-tree: take time effects into account when trimming
Henry Wilkes [Fri, 15 May 2020 13:47:15 +0000 (14:47 +0100)]
timeline-tree: take time effects into account when trimming

When trimming the start of a clip, we want to set the in-point of its
children such that whatever data was at the timeline time T still
remains at the timeline time T after the trim, where
  T = MAX (prev_start, new_start)

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-editing-services/-/merge_requests/177>

4 years agoclip: use time translation for split
Henry Wilkes [Fri, 15 May 2020 13:41:58 +0000 (14:41 +0100)]
clip: use time translation for split

The new in-point should be the media position corresponding to the media
position. media_duration_factor is no longer needed.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-editing-services/-/merge_requests/177>

4 years agoclip: fix warning when getting duration-limit
Henry Wilkes [Mon, 18 May 2020 16:34:01 +0000 (17:34 +0100)]
clip: fix warning when getting duration-limit

The duration-limit case was missing a 'break;' statement.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-editing-services/-/merge_requests/177>

4 years agoclip: add methods to convert between time coordinates
Henry Wilkes [Tue, 12 May 2020 17:18:09 +0000 (18:18 +0100)]
clip: add methods to convert between time coordinates

Add methods to convert between the timeline time coordinates and the
internal time coordinates of a track element in a clip, taking time
effects into account.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-editing-services/-/merge_requests/177>

4 years agoeffect: Add support for time effects
Henry Wilkes [Fri, 15 May 2020 13:28:09 +0000 (14:28 +0100)]
effect: Add support for time effects

Allow the user to register a child property of a base effect as a time
property. This can be used by GES to correctly calculate the
duration-limit of a clip when it has time effects on it. The existing
ges_effect_class_register_rate_property is now used to automatically
register such time effects for rate effects.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-editing-services/-/merge_requests/177>

4 years agoerrors: added edit errors
Henry Wilkes [Fri, 15 May 2020 13:25:01 +0000 (14:25 +0100)]
errors: added edit errors

Added more errors to GES_ERROR for when edits fail (other than
programming or usage errors). Also promoted some GST messages if they
related to a usage error.

Also added explanation of timeline overlap rules in user docs.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-editing-services/-/merge_requests/177>

4 years agotests: Stop recording gaps in seek_with_stop
Thibault Saunier [Fri, 15 May 2020 16:19:16 +0000 (12:19 -0400)]
tests: Stop recording gaps in seek_with_stop

We have little control over those as they are generated by streamsynchronizer in a not reproducible way

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-editing-services/-/merge_requests/175>

4 years agodocs: Remove reference to deinterlacing props in title and video test source
Thibault Saunier [Fri, 15 May 2020 15:53:10 +0000 (11:53 -0400)]
docs: Remove reference to deinterlacing props in title and video test source

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-editing-services/-/merge_requests/175>

4 years agovalidate: Fix setting ges properties
Thibault Saunier [Fri, 15 May 2020 22:33:46 +0000 (18:33 -0400)]
validate: Fix setting ges properties

And fix typos.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-editing-services/-/merge_requests/175>

4 years agoges: Move TimeOverlayClip out of GESTestClip
Thibault Saunier [Wed, 22 Apr 2020 17:39:21 +0000 (13:39 -0400)]
ges: Move TimeOverlayClip out of GESTestClip

This was complexifying the implementation for very little gain.
Each source type should ideally have its own API.

In that patch we make it so we do not have to subclass anything
but instead use GESAsset to pass information about how the pipeline
should look like.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-editing-services/-/merge_requests/175>

4 years agonlecomposition: Add stack initialization action after setting our state
Thibault Saunier [Thu, 14 May 2020 04:56:40 +0000 (00:56 -0400)]
nlecomposition: Add stack initialization action after setting our state

Otherwise there is a pretty rare race where we get the
_initialize_stack_func executed leading to the stack set up and
the source pushing buffers before the composition source pad is
activated, and a STREAM_ERROR is reported as we end up pushing a
buffer to a flushing pad.

Thanks rr chaos mode for showing that improbable race

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-editing-services/-/merge_requests/175>

4 years agotimeline: No thread checking while disposing
Thibault Saunier [Wed, 13 May 2020 21:11:24 +0000 (17:11 -0400)]
timeline: No thread checking while disposing

While this is not correct, we can't predict from what thread a
GstElement will be disposed as it might still be referenced by
a GstMessage somewhere which is freed by, any thread.

In this specific case we can assume that GES user will already have
let go his timeline reference and we should not avoid assert in that
specific case as it should be safe to let the timeline be destroyed
at that point.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-editing-services/-/merge_requests/175>

4 years agonle: Use G_PARAM_DEPRECATED for media-duration-factor
Thibault Saunier [Sat, 2 May 2020 03:05:44 +0000 (23:05 -0400)]
nle: Use G_PARAM_DEPRECATED for media-duration-factor

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-editing-services/-/merge_requests/175>

4 years agoges: Ensure that assets are added to project before adding clip to timeline
Thibault Saunier [Mon, 18 May 2020 12:49:53 +0000 (08:49 -0400)]
ges: Ensure that assets are added to project before adding clip to timeline

It is the right ordering and in Pitivi we set the project size
when adding the first (relevant) asset, meaning that our code to
reposition clips would kick in (in the unit tests) if we do not respect
that ordering.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-editing-services/-/merge_requests/176>

4 years agotrack-element: Add is_core method to API
Henry Wilkes [Wed, 13 May 2020 11:11:32 +0000 (12:11 +0100)]
track-element: Add is_core method to API

Open up the method to the user, since they may need the information.
Also added more documentation on what a core track element is to a clip
and how they are treated.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-editing-services/-/merge_requests/169>

4 years agoasset: unref requested assets
Henry Wilkes [Fri, 1 May 2020 11:40:58 +0000 (12:40 +0100)]
asset: unref requested assets

Prevent a few memory leaks in the tests.

Also mark ges_project_save as transfer full for the formatter asset.

Also make sure that ges_project_request_sync is transfer full on the
returned asset.

Fixes https://gitlab.freedesktop.org/gstreamer/gst-editing-services/-/issues/104

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-editing-services/-/merge_requests/169>

4 years agoclip: enforce duration-limit
Henry Wilkes [Thu, 30 Apr 2020 11:10:22 +0000 (12:10 +0100)]
clip: enforce duration-limit

Prevent setting of properties or that of children, if the clip would not
be able to set the corresponding duration if the duration-limit would
drop below the currently set duration.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-editing-services/-/merge_requests/169>

4 years agoclip: make sure core child is active for non-core in same track
Henry Wilkes [Thu, 30 Apr 2020 11:01:52 +0000 (12:01 +0100)]
clip: make sure core child is active for non-core in same track

Each active non-core child must have a corresponding active core child
in the same track. Therefore, if we de-activate a core child, we also
need to de-activate all the non-core children in the same track.
Similarly, if we activate a non-core child, we need to activate the
corresponding core child as well.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-editing-services/-/merge_requests/169>

4 years agoclip: be more robust in handling priority
Henry Wilkes [Thu, 30 Apr 2020 10:50:08 +0000 (11:50 +0100)]
clip: be more robust in handling priority

Make less assumptions about the priority of effects and core elements so
that the code would still work if the priority of an element was set
directly. In particular, the index of a top effect will always be its
position in the effect ordering.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-editing-services/-/merge_requests/169>

4 years agocontainer: stop storing priority offset in child mapping
Henry Wilkes [Tue, 28 Apr 2020 16:29:22 +0000 (17:29 +0100)]
container: stop storing priority offset in child mapping

GESGroup no longer uses this, and GESClip can be made simpler without
it.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-editing-services/-/merge_requests/169>

4 years agoclip: preserve auto-transition in split
Henry Wilkes [Mon, 27 Apr 2020 18:11:16 +0000 (19:11 +0100)]
clip: preserve auto-transition in split

When splitting a clip, keep the auto-transition at the end of the clip
alive and move its source to that of the corresponding split track
element.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-editing-services/-/merge_requests/169>

4 years agoclip: change order of split
Henry Wilkes [Tue, 21 Apr 2020 11:55:34 +0000 (12:55 +0100)]
clip: change order of split

We first change the duration of the splitted clip, then we add the new
clip to the layer and assign the tracks for its children. Normally, when
a clip is added to a layer it will have its track elements created, if
needed, and then assigned to their tracks. This will fail if any sources
would fully or triple overlap existing sources in the same track.

However, here we were adding the clip to the layer *and* avoiding the
track assignment process and instead setting the tracks explicitly. In
particular, the order was:

+ add new clip to layer with no tracks assigned
+ shrink the split clip
+ assign the tracks for the new clip

This has been changed to:

+ shrink the split clip
+ add new clip to layer with no tracks assigned
+ assign the tracks for the new clip

Thus, the order of events for any users connecting to object signals
will be close to that of adding another clip to the layer.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-editing-services/-/merge_requests/169>

4 years agotimeline: create auto-transitions during track-element-added
Henry Wilkes [Mon, 27 Apr 2020 15:27:15 +0000 (16:27 +0100)]
timeline: create auto-transitions during track-element-added

Any time a track element is added to a track, we need to check whether
we need to create a new corresponding auto-transition. This simply moves
the code from ges-clip.c to ges-timeline.c, where it is more appropriate.

Moreover, it technically opens the possibility for creating
auto-transitions for track elements in the timeline that have no
corresponding clip.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-editing-services/-/merge_requests/169>

4 years agotimeline-tree: also trim non-core track elements
Henry Wilkes [Mon, 27 Apr 2020 15:05:54 +0000 (16:05 +0100)]
timeline-tree: also trim non-core track elements

Also trim the in-point of non-core children of clips to ensure that
their content will appear in the timeline at the same position.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-editing-services/-/merge_requests/169>

4 years agotimeline: make sure appended layer has lowest priority
Henry Wilkes [Fri, 24 Apr 2020 20:00:18 +0000 (21:00 +0100)]
timeline: make sure appended layer has lowest priority

Make sure that the priority of an appended layer is the lowest (highest
in value) when appending a layer to the timeline. This change is
important when appending a layer to a timeline, which can easily have a
gap in priorities if a layer has been removed.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-editing-services/-/merge_requests/169>

4 years agotests: add tests for new editing behaviour
Henry Wilkes [Thu, 23 Apr 2020 16:34:52 +0000 (17:34 +0100)]
tests: add tests for new editing behaviour

These tests expose some of the new editing behaviour in timeline
tree. In particular, we test:
+ edits for clips within groups within a group
+ that an edit can succeed if a snap allows it to
+ that snapping occurs at a specific point, and that we alternate
  between one call to snapping-started and one call to snapping-ended
  with corresponding values
+ that an edit can fail if a snap causes it to
+ no snapping is released when an edit fails
+ We tests for the expected changes, and otherwise check that the
  configuration of the timeline has remained unchanged
+ The timeline configuration remains the same when an edit fails
+ That each clip overlap has a corresponding auto-transition
+ That particular auto-transitions are created when a new overlap is
  formed
+ That particular auto-transitions are destroyed when an overlap ends
+ That auto-transitions are not replaced when two clips move but
  maintain their overlap
+ That the timeline does not contain any unaccounted for clips

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-editing-services/-/merge_requests/169>

4 years agolayer: don't set timeline when moving clip
Henry Wilkes [Thu, 23 Apr 2020 16:30:17 +0000 (17:30 +0100)]
layer: don't set timeline when moving clip

If a clip is moving we should not unset its timeline when it is removed
from the layer. Logic has been moved to ges_timeline_add_clip and
ges_timeline_remove_clip.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-editing-services/-/merge_requests/169>

4 years agotimeline-tree: freeze auto-transitions whilst editing
Henry Wilkes [Wed, 22 Apr 2020 14:06:32 +0000 (15:06 +0100)]
timeline-tree: freeze auto-transitions whilst editing

Freeze the auto-tranistions so they do not destroy themselves during an
edit. Once complete the auto-transitions can move themselves back into
position, or remove themselves if their sources are no longer
overlapping.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-editing-services/-/merge_requests/169>

4 years agoclip: make auto-transitions less expensive when adding to track
Henry Wilkes [Tue, 21 Apr 2020 14:06:03 +0000 (15:06 +0100)]
clip: make auto-transitions less expensive when adding to track

Only check the overlaps with the actual track element that was just added
to the track. This reduces the tree traversal by one order.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-editing-services/-/merge_requests/169>

4 years agoclip: remove children if failed to add to layer
Henry Wilkes [Tue, 21 Apr 2020 13:05:55 +0000 (14:05 +0100)]
clip: remove children if failed to add to layer

If adding to a layer fails during ges_timeline_add_clip, any new children
that were created during this process should be removed from the clip to
put it back into its previous state.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-editing-services/-/merge_requests/169>

4 years agogroup: let timeline-tree handle layer priority
Henry Wilkes [Tue, 21 Apr 2020 10:36:58 +0000 (11:36 +0100)]
group: let timeline-tree handle layer priority

Since a group can only have its priority set whilst it is part of a
timeline, we can simply let the timeline-tree handle the move, which it
can already do, whilst checking that the move would be legal (not break
the timeline configuration). All the group has to do now if update its
priority value if the priority of any of its children changes. It
doesn't even need to keep track of the layer priority offsets.

Also, added a check to ensure added children belong to the same
timeline.

Also moved the sigids from the GObject data to a g_hash_table, which is
clearer.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-editing-services/-/merge_requests/169>

4 years agotimeline-element: stop using edit vmethods
Henry Wilkes [Mon, 20 Apr 2020 13:56:55 +0000 (14:56 +0100)]
timeline-element: stop using edit vmethods

These were all redirecting to essentially ges_timeline_element_edit
anyway.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-editing-services/-/merge_requests/169>

4 years agotimeline-element: simplify check for being edited
Henry Wilkes [Mon, 20 Apr 2020 12:13:48 +0000 (13:13 +0100)]
timeline-element: simplify check for being edited

It should be sufficient to set the edit flag only on the toplevel, which
allows all of its children to know they are being edited and should not
move in response.

Also, removed some unnecessary setting/checking of this.

Also, supplied the ges_timeline_element_peak_toplevel, which unlike
ges_timeline_element_get_toplevel_parent, does not add a reference to
the toplevel. Some corresponding leaks in auto-transition have been
fixed by using this instead.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-editing-services/-/merge_requests/169>

4 years agotimeline: emit snapping-started with new valid time
Henry Wilkes [Mon, 27 Apr 2020 13:05:38 +0000 (14:05 +0100)]
timeline: emit snapping-started with new valid time

Only emit snapping-ended if we have a valid snap time. Moreover, we
should emit a new snapping-started even if we are snapping at the same
location. This is because a new snap will always correspond to a new edit,
possibly involving different snapping elements, which a user would want
to know about.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-editing-services/-/merge_requests/169>

4 years agotimeline-tree: simplify and fix editing
Henry Wilkes [Mon, 27 Apr 2020 12:58:38 +0000 (13:58 +0100)]
timeline-tree: simplify and fix editing

Editing has been simplified by breaking down each edit into a
combination of three basic single-element edits: MOVE, TRIM_START, and
TRIM_END.

Each edit follows these steps:
+ Determine which elements are to be edited and under which basic mode
+ Determine which track elements will move as a result
+ Snap the edit position to one of the edges of the main edited element,
  (or the edge of one of its descendants, in the case of MOVE), avoiding
  moving elements.
  NOTE: in particular, we can *not* snap to the edge of a neighbouring
  element in a roll edit. This was previously possible, even though the
  neighbour was moving!
+ Determine the edit positions for clips (or track elements with no
  parent) using the snapped value. In addition, we replace any edits of
  a group with an edit of its descendant clips. If any value would be
  out of bounds (e.g. negative start) we do not edit.
  NOTE: this is now done *after* checking the snapping. This allows the
  edit to succeed if snapping would cause it to go from being invalid to
  valid!
+ Determine whether the collection of edits would result in a valid
  timeline-configuration which does not break the rules for sources
  overlapping.
+ If all this succeeds, we emit snapping-started on the timeline.
+ We then perform all the edits. At this point they should all succeed.

The simplification/unification should make it easier to make other
changes.

Fixes https://gitlab.freedesktop.org/gstreamer/gst-editing-services/-/issues/97
Fixes https://gitlab.freedesktop.org/gstreamer/gst-editing-services/-/issues/98

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-editing-services/-/merge_requests/169>

4 years agogroup: fix priority setting
Henry Wilkes [Sat, 18 Apr 2020 15:49:31 +0000 (16:49 +0100)]
group: fix priority setting

Stop moving the group if a child clip is being edited by timeline-tree,
a child group is updating its own priority, or a layer that a clip is in
has changed priority. A group should only move if a descendant moves
layers outside of a timeline-tree edit, or the priority of the group is
set by the user.

Fixes https://gitlab.freedesktop.org/gstreamer/gst-editing-services/-/issues/89

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-editing-services/-/merge_requests/169>

4 years agocontainer: keep start and duration up to date
Henry Wilkes [Sat, 18 Apr 2020 15:34:56 +0000 (16:34 +0100)]
container: keep start and duration up to date

Simplified keeping the start and the duration of a container/group up to
date with the earliest start of the children and the last end of the
children. The previous logic was spread between ges-group and
ges-container, now all the position handling is in ges-container.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-editing-services/-/merge_requests/169>