gstreamer/ges
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
..
.gitignore all: add/extend more .gitignore 2010-12-15 15:52:03 +01:00
ges-asset.c ges-asset: Don't dereference NULL proxy assets when resolving fails 2015-12-29 18:08:03 +02:00
ges-asset.h asset: Add a way to set asset as "needing reload" 2015-12-10 14:48:08 +01:00
ges-audio-source.c group: Make deep copying actually copy deep 2016-01-17 09:23:35 +01:00
ges-audio-source.h GES: Add GESVideoSource and GESAudioSource base classes 2013-09-03 20:22:32 -04:00
ges-audio-test-source.c Include class related section documentation in the gir file. 2014-04-07 22:13:25 +02:00
ges-audio-test-source.h track-element: Remove constructors for TrackElement from the API 2013-12-27 10:14:19 +01:00
ges-audio-track.c don't leaks caps and converted strings 2015-10-01 11:28:38 +02:00
ges-audio-track.h ges-audio-track: Change contructor prototype. 2013-08-21 08:06:59 -04:00
ges-audio-transition.c ges: Use audiomixer instead of adder by default 2014-10-31 11:58:12 +01:00
ges-audio-transition.h Rename GESTrackAudioTransition to GESAudioTransition 2013-02-15 14:42:07 -03:00
ges-audio-uri-source.c group: Make deep copying actually copy deep 2016-01-17 09:23:35 +01:00
ges-audio-uri-source.h track-element: Remove constructors for TrackElement from the API 2013-12-27 10:14:19 +01:00
ges-auto-transition.c ges: Handle trimming auto transitions 2015-06-01 10:24:11 +02:00
ges-auto-transition.h ges: Hide more symbols of headers that are not installed 2015-06-25 10:28:41 +02:00
ges-base-effect-clip.c Include class related section documentation in the gir file. 2014-04-07 22:13:25 +02:00
ges-base-effect-clip.h Rename GESEffectClip to GESBaseEffectClip 2013-02-15 14:42:04 -03:00
ges-base-effect.c Include class related section documentation in the gir file. 2014-04-07 22:13:25 +02:00
ges-base-effect.h Rename GESTrackOperation to GESOperation 2013-02-15 14:42:06 -03:00
ges-base-transition-clip.c Include class related section documentation in the gir file. 2014-04-07 22:13:25 +02:00
ges-base-transition-clip.h Rename GESTransitionClip to GESBaseTransitionClip 2013-02-15 14:42:04 -03:00
ges-base-xml-formatter.c Implement asset proxying support 2015-12-10 14:48:02 +01:00
ges-base-xml-formatter.h ges: Add padding for API extension where missing 2013-12-27 10:14:19 +01:00
ges-clip-asset.c Include class related section documentation in the gir file. 2014-04-07 22:13:25 +02:00
ges-clip-asset.h Rename GESAssetClip to GESClipAsset 2013-02-15 14:42:07 -03:00
ges-clip.c Handle changing playback rate 2016-02-26 19:54:40 +01:00
ges-clip.h Cleanup import of GNL and rename gnl to nle for Non Linear Engine 2014-10-31 11:58:12 +01:00
ges-command-line-formatter.c ges-launch: Add support for +test-clip 2015-04-07 14:15:36 +02:00
ges-command-line-formatter.h ges: Factor out a GESCommandLineFormatter class 2015-03-20 13:53:42 +01:00
ges-container.c container: Update start if adding a child that as a start < current start 2016-01-17 09:23:39 +01:00
ges-container.h ges: Handle trimming in groups 2013-09-07 12:55:58 -04:00
ges-effect-asset.c effect: Determine the effect type as soon as possible 2016-02-04 15:23:26 +01:00
ges-effect-asset.h ges: Add padding for API extension where missing 2013-12-27 10:14:19 +01:00
ges-effect-clip.c Include class related section documentation in the gir file. 2014-04-07 22:13:25 +02:00
ges-effect-clip.h Rename GESStandardEffectClip to GESEffectClip 2013-02-15 14:42:04 -03:00
ges-effect.c Handle changing playback rate 2016-02-26 19:54:40 +01:00
ges-effect.h Handle changing playback rate 2016-02-26 19:54:40 +01:00
ges-enums.c Fix invalid GEnumValue.value_name entries. 2014-06-09 16:10:41 +02:00
ges-enums.h Rename TIMELINE_MODE_XXX to GES_PIPELINE_MODE_XXX so it corresponds to reality 2014-02-17 12:37:57 +01:00
ges-extractable.c ges: Fix various g-i warnings 2015-12-26 09:43:23 +01:00
ges-extractable.h extractable: Make extractable_set_asset return a boolean 2014-11-10 16:22:39 +01:00
ges-formatter.c ges: Enhance xges format versioning 2015-05-18 21:27:48 +02:00
ges-formatter.h ges: Factor out a GESCommandLineFormatter class 2015-03-20 13:53:42 +01:00
ges-gerror.h gir: fix warnings 2013-11-22 17:50:27 -03:00
ges-group.c group-added and group-removed signals added 2016-02-23 20:40:21 +01:00
ges-group.h group: Disconnect from old layer notify::priority when a clip is moved to a NULL layer 2015-06-05 22:52:43 +02:00
ges-image-source.c Include class related section documentation in the gir file. 2014-04-07 22:13:25 +02:00
ges-image-source.h track-element: Remove constructors for TrackElement from the API 2013-12-27 10:14:19 +01:00
ges-internal.h Handle changing playback rate 2016-02-26 19:54:40 +01:00
ges-layer.c timeline: Minor documentation addition 2015-05-19 18:19:10 +02:00
ges-layer.h Cleanup import of GNL and rename gnl to nle for Non Linear Engine 2014-10-31 11:58:12 +01:00
ges-meta-container.c ges-meta-container: fix ges_meta_container_foreach() 2015-02-27 01:24:30 +00:00
ges-meta-container.h ges: Enhance xges format versioning 2015-05-18 21:27:48 +02:00
ges-multi-file-source.c don't leaks caps and converted strings 2015-10-01 11:28:38 +02:00
ges-multi-file-source.h ges: multifilesrc support 2014-03-19 18:32:48 +01:00
ges-operation-clip.c Include class related section documentation in the gir file. 2014-04-07 22:13:25 +02:00
ges-operation-clip.h Rename GESTimelineOperation to GESOperationClip 2013-02-15 14:42:03 -03:00
ges-operation.c Cleanup import of GNL and rename gnl to nle for Non Linear Engine 2014-10-31 11:58:12 +01:00
ges-operation.h Rename GESTrackOperation to GESOperation 2013-02-15 14:42:06 -03:00
ges-overlay-clip.c Include class related section documentation in the gir file. 2014-04-07 22:13:25 +02:00
ges-overlay-clip.h Rename GESTimelineOverlay to GESOverlayClip 2013-02-15 14:42:03 -03:00
ges-pipeline.c pipeline: don't leak GstPad 2015-09-24 09:42:08 +02:00
ges-pipeline.h ges-pipeline: Rename add_timeline to set_timeline 2014-02-04 14:17:47 +01:00
ges-pitivi-formatter.c pitivi-formatter: don't leak internal hash table 2015-09-24 09:42:08 +02:00
ges-pitivi-formatter.h Update the documentation to use Pitivi instead of PiTiVi 2014-02-27 09:54:41 +01:00
ges-project.c ges: Fix various g-i warnings 2015-12-26 09:43:23 +01:00
ges-project.h ges: Fix various g-i warnings 2015-12-26 09:43:23 +01:00
ges-screenshot.c tests: Fix misc issues 2012-12-29 19:38:12 -03:00
ges-screenshot.h Fix FSF address 2012-11-04 00:25:20 +00:00
ges-smart-adder.c ges: Set restriction caps in the audio source caps filter 2015-11-05 23:49:05 +01:00
ges-smart-adder.h ges: Add padding for API extension where missing 2013-12-27 10:14:19 +01:00
ges-smart-video-mixer.c video-source: Make sure to set framepositionner zorder when creating it 2015-09-02 20:42:50 +02:00
ges-smart-video-mixer.h video-source: Make sure to set framepositionner zorder when creating it 2015-09-02 20:42:50 +02:00
ges-source-clip.c Include class related section documentation in the gir file. 2014-04-07 22:13:25 +02:00
ges-source-clip.h Rename GESTimelineLayer to GESLayer 2013-04-23 20:22:31 -03:00
ges-source.c Cleanup import of GNL and rename gnl to nle for Non Linear Engine 2014-10-31 11:58:12 +01:00
ges-source.h GES: Add GESVideoSource and GESAudioSource base classes 2013-09-03 20:22:32 -04:00
ges-structure-parser.c structure-parser: define GES_STRUCTURE_PARSER macro 2015-09-28 15:57:25 +02:00
ges-structure-parser.h structure-parser: define GES_STRUCTURE_PARSER macro 2015-09-28 15:57:25 +02:00
ges-structured-interface.c structured-interface: introduce TRY_GET_STRING 2015-09-28 16:11:03 +02:00
ges-structured-interface.h ges: command-line-formatter: Properly error out on invalid arguments 2015-03-20 13:53:42 +01:00
ges-test-clip.c Include class related section documentation in the gir file. 2014-04-07 22:13:25 +02:00
ges-test-clip.h Rename GESTimelineTestSource to GESTestSourceClip 2013-02-15 14:42:04 -03:00
ges-text-overlay-clip.c Include class related section documentation in the gir file. 2014-04-07 22:13:25 +02:00
ges-text-overlay-clip.h Rename overlay_text to text_overlay 2013-02-15 14:42:07 -03:00
ges-text-overlay.c text-overlay: added text properties as child-properties 2014-07-23 16:11:31 +02:00
ges-text-overlay.h Rename GESTrackOperation to GESOperation 2013-02-15 14:42:06 -03:00
ges-timeline-element.c Handle changing playback rate 2016-02-26 19:54:40 +01:00
ges-timeline-element.h group: Make deep copying actually copy deep 2016-01-17 09:23:35 +01:00
ges-timeline.c group-added and group-removed signals added 2016-02-23 20:40:21 +01:00
ges-timeline.h group-added and group-removed signals added 2016-02-23 20:40:21 +01:00
ges-title-clip.c title-clip: Return default GESTitleSource value if no child set yet 2016-02-04 15:23:24 +01:00
ges-title-clip.h Rename GESTimelineLayer to GESLayer 2013-04-23 20:22:31 -03:00
ges-title-source.c titlesource: Add properties for text dimensions. 2016-02-04 15:23:30 +01:00
ges-title-source.h title-source: Expose the shaded-background property 2014-11-10 16:22:42 +01:00
ges-track-element-asset.c Include class related section documentation in the gir file. 2014-04-07 22:13:25 +02:00
ges-track-element-asset.h Rename GESAssetTrackElement to GESTrackElementAsset 2013-02-15 14:42:06 -03:00
ges-track-element.c Handle changing playback rate 2016-02-26 19:54:40 +01:00
ges-track-element.h track-element: Add method to remove control binding 2015-07-03 11:20:54 +02:00
ges-track.c track: mixing_operation is handled by its parent 2015-10-02 16:39:31 +02:00
ges-track.h track: [API]: ges_track_update_restriction_caps. 2014-12-05 22:12:11 +01:00
ges-transition-clip.c extractable: Make extractable_set_asset return a boolean 2014-11-10 16:22:39 +01:00
ges-transition-clip.h Rename GESStandardTransitionClip to GESTransitionClip 2013-02-15 14:42:04 -03:00
ges-transition.c Include class related section documentation in the gir file. 2014-04-07 22:13:25 +02:00
ges-transition.h Rename GESTrackTransition to GESTransition 2013-02-15 14:42:06 -03:00
ges-types.h ges: Remove all reference to already dead GESSimpleLayer 2015-03-13 10:02:39 +00:00
ges-uri-asset.c uri-asset: do not reuse a passed GError pointer 2015-10-02 16:08:03 +02:00
ges-uri-asset.h ges: Keep backward compatibility for relocated assets CLI 2014-12-06 10:34:16 +01:00
ges-uri-clip.c uri-clip: Copy sources child properties when resetting asset 2015-12-21 18:12:40 +01:00
ges-uri-clip.h Rename GESTimelineSource to GESSourceClip 2013-02-15 14:42:03 -03:00
ges-utils.c ges: Namespace NLE utils function into GES 2015-09-18 10:01:44 +02:00
ges-utils.h gir: fix warnings 2013-11-22 17:50:27 -03:00
ges-validate.c ges-validate: Fix compiler warning caused by usage of wrong enum type 2015-12-22 09:58:30 +01:00
ges-version.h.in Properly generate versioning #define-s during autogen 2014-03-15 20:01:48 +01:00
ges-video-source.c group: Make deep copying actually copy deep 2016-01-17 09:23:35 +01:00
ges-video-source.h GES: Add GESVideoSource and GESAudioSource base classes 2013-09-03 20:22:32 -04:00
ges-video-test-source.c video-test-source: fix caps leak 2014-10-26 20:31:40 +00:00
ges-video-test-source.h track-element: Remove constructors for TrackElement from the API 2013-12-27 10:14:19 +01:00
ges-video-track.c don't leaks caps and converted strings 2015-10-01 11:28:38 +02:00
ges-video-track.h ges-smart-mixer: first code dump, mainly copy paste from ges-smart-adder. 2013-06-23 18:37:41 -04:00
ges-video-transition.c video-transition: Make compositor background transparent 2015-09-23 21:23:13 +02:00
ges-video-transition.h Rename GESTrackVideoTransition to GESVideoTransition 2013-02-15 14:42:07 -03:00
ges-video-uri-source.c group: Make deep copying actually copy deep 2016-01-17 09:23:35 +01:00
ges-video-uri-source.h track-element: Remove constructors for TrackElement from the API 2013-12-27 10:14:19 +01:00
ges-xml-formatter.c Implement asset proxying support 2015-12-10 14:48:02 +01:00
ges-xml-formatter.h ges: Add padding for API extension where missing 2013-12-27 10:14:19 +01:00
ges.c Move NLE to a dedicated GstPlugin 2015-08-20 13:49:20 +02:00
ges.h ges: Factor out a GESCommandLineFormatter class 2015-03-20 13:53:42 +01:00
gesmarshal.list add object-moved signal to simple timeline layer 2010-09-02 18:08:43 +02:00
gstframepositionner.c ges: track-element: Try to create NleObject as soon as possible 2016-02-04 15:23:21 +01:00
gstframepositionner.h framepositionner: Make use of the new CompositorPad.width/height 2015-07-03 09:41:19 +02:00
Makefile.am g-i: fix init section to avoid compiler warnings 2016-01-19 11:22:11 +01:00
parse.l ges-launch: Add support for +test-clip 2015-04-07 14:15:36 +02:00