Commit graph

22 commits

Author SHA1 Message Date
Henry Wilkes
f0f7e05cef check: give nle_tempochange test more time
These test can take longer than most under valgrind, so give them a
little more time until they timeout.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-editing-services/-/merge_requests/160>
2020-04-29 12:32:52 +00:00
Henry Wilkes
dc9dbddbae nleobject: stop using media-duration-factor
The property had been deprecated and is unused.

This property is not needed. Any internal time effect that an nleoperation
wraps is itself responsible for converting seek/segment timestamps.
Previously, the ghostpads were performing a rate conversion after the
rate element had already done so, essentially doubling their effect on
seeks and segment times. This was always unnecessary, but went unnoticed
by the tempochange test because it was using an identity element rather
than an actual rate-changing element.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-editing-services/-/merge_requests/160>
2020-04-29 12:32:52 +00:00
Thibault Saunier
a8a33622d9 tests: Check that linking pads works
CID: 1456061
2020-04-10 11:12:12 -04:00
Thibault Saunier
eac22d333a tests:nle: Unref the bus before unrefing the pipeline
Aiming at fixing a rare race condition where we get:

    ../subprojects/gstreamer/libs/gst/check/gstcheck.c:1258:F:nlecomposition:test_seek_on_nested:0: nested_src0_0x1a1a310 is not destroyed, 1 refcounts left!

The idea is that there might have a remaining GstMessage
with the nested_src as `message.src` on the bus that has
yet to be processed in some conditions leading to a reference
still existing when unrefing the pipeline.
2019-08-12 17:40:33 -04:00
Thibault Saunier
b3bac67f58 nle: Check seeking on deeply nested composition 2019-07-05 18:30:41 -04:00
Thibault Saunier
e903f15380 nlecomposition: Shutdown children when setting state to NULL
Otherwise if we shutdown a composition whith an nested composition
(inside a source in the test) and leak it, we end up with the nested
composition task still running (in READY) which is bad.

Add a test for that which leaks the pipeline on purpose.
2019-07-05 18:01:51 -04:00
Thibault Saunier
3d11893fd7 nle: Add a seeking test for nested composition 2019-07-05 17:54:40 -04:00
Thibault Saunier
c596f80c63 nlecomposition: Get overall pipeline position by recursing up
And handle NLEComposition inside NLEComposition

Fixes https://gitlab.freedesktop.org/gstreamer/gst-editing-services/issues/39
2019-01-29 00:06:32 +00:00
Seungha Yang
78b38f26a7 tests: init/deinit per test case
... in order to verify init/deinit pair.
2019-01-28 17:35:04 +09:00
Seungha Yang
61c2eb6735 tests: nle: Fix various leak
Don't leak GError and GstPad object
2019-01-18 20:32:02 +00:00
Seungha Yang
a157c9fa10 tests: nle: Fix GList leak 2019-01-18 20:32:02 +00:00
Thibault Saunier
e6a270c80c tests: Minor assertion enahncements 2018-07-21 12:03:02 -04:00
Guillaume Desmottes
53c5bc069c introduce ges_deinit()
GstDiscoverer objects were leaked by tests making the leaks detector
unusable.
Introduce ges_deinit(), similiar to gst_deinit(), doing some cleanup
before exiting the process.

https://bugzilla.gnome.org/show_bug.cgi?id=776805
2017-02-06 09:49:20 -03:00
Thibault Saunier
b6b640d046 test:nle: Soften check on refcount
The composition might already have taken a new ref processing the
source.
2016-12-01 15:52:37 -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
55f0601211 nle: Port tests to the "commit" action signals
Now that nle_object_commit symbol is hidden, we can't use it
in the tests.
2015-06-25 11:03:12 +02:00
Mathieu Duponchelle
506662e2dc nleobject: It is wrong to update object->stop in set_property.
Summary: It must only be done when the object is commited.
We can do that in constructed though, as the changes will
anyway be commited when the object is added to a composition.

Also update the tests, as we set properties spearately then
check the stop, we can commit the source at its creation without
removing meaning from the tests.

Reviewers: thiblahute

Differential Revision: http://phabricator.freedesktop.org/D84
2015-04-09 15:40:32 +02:00
Mathieu Duponchelle
1bfe0b7ef3 Cleanly handle removing the last object in a composition
The strategy here is to seek at the new end of the composition. And in
GES we always add a 1ns long gap at the end of the tracks so that all
track have the exact same duration, and we have black frames when the
timeline is empty
2015-02-03 12:03:33 +01:00
Thibault Saunier
d3d1f85373 tests: Use audiomixer as an audio mixing element
Adder is the past!
2014-11-10 16:22:40 +01:00
Thibault Saunier
57eef236b5 tests: Use the new gst_check_objects_destroyed_on_unref function 2014-10-31 11:58:12 +01:00
Thibault Saunier
95223fd46b Start taking advantage of the fact that NLE is in the same three as GES! 2014-10-31 11:58:12 +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