Commit graph

16 commits

Author SHA1 Message Date
Vineeth TM e660f47a1d editing-services: use new gst_element_class_add_static_pad_template()
https://bugzilla.gnome.org/show_bug.cgi?id=763195
2016-03-24 14:52:58 +02:00
Sjors Gielen c247c911a0 nle: Set the NleOperation flags to NLE_OBJECT_OPERATION
Reviewed By: thiblahute

Differential Revision: https://phabricator.freedesktop.org/D770
2016-02-26 21:13:56 +01: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 38c4e415fd nle: Turn composition structural issue into ERROR on the bus
Those error are really critical and we are then enable to keep
working. Just post an ERROR message on the bus and let the
application deal with it.

Reviewed-by: Mathieu Duponchelle <mathieu.duponchelle@opencreed.com>
Differential Revision: https://phabricator.freedesktop.org/D740
2016-02-04 15:23:30 +01:00
Mathieu Duponchelle 199b86684f nlecomposition: use correct type for flush_seqnum. 2016-01-09 05:17:23 +01:00
Mathieu Duponchelle 1c1c9124b1 nleghostpad: use GST_SEGMENT_FORMAT
This isn't 2005 anymore.
2016-01-09 05:17:23 +01:00
Justin Kim 93ce9c5e1d nlecomposition: free closure actions when disposing
Summary:
After invoking GClosure, the item of action list becomes
orphan so it lost a chance to be freed. In addition, even
when disposing, the list of actions has few items so we
have to check the list.

Reviewers: thiblahute

Projects: #gstreamer_editing_services

Reviewed By: thiblahute

Differential Revision: https://phabricator.freedesktop.org/D324
2015-10-02 16:51:56 +02:00
Justin Kim b7c97d8e87 nlecomposition: fix wrong argument order of GClosureNotify
Summary:
_free_action should follow GClosureNotify type.

```
void
(*GClosureNotify) (gpointer data,
                   GClosure *closure);
```

Reviewers: thiblahute

Projects: #gstreamer_editing_services

Reviewed By: thiblahute

Differential Revision: https://phabricator.freedesktop.org/D323
2015-10-02 16:49:31 +02:00
Justin Kim d6b37d0f4d nleoperation: don't leak iterator
Summary: Once an iterator is created, it should be freed after usage.

Reviewers: thiblahute

Projects: #gstreamer_editing_services

Reviewed By: thiblahute

Differential Revision: https://phabricator.freedesktop.org/D318
2015-10-02 16:20:36 +02:00
Justin Kim a854658404 nleoperation: don't leak srcpad
https://bugzilla.gnome.org/show_bug.cgi?id=755860
2015-09-30 12:09:17 +02:00
Justin Kim bd1d03202b nle{composition,object}: remove unused allocation & trivial leakages
nlecomposition allocates unused 'UpdateCompositionData' and it
causes leakages.

https://bugzilla.gnome.org/show_bug.cgi?id=755417
2015-09-24 13:05:55 +02:00
Thibault Saunier c8e9cf962c nle: Avoid unsetting srcpad target after the srcpad is already freed
That leaded to segfaults
2015-09-15 12:17:29 +02:00
Thibault Saunier 69e9acc823 nle: Stop wrongly set operation segment base time
Inside the composition we actually do not need to have any notion
of what the timing outside the compositon as we already tweak the segment
base time outside the composition. This code was only there to work
around https://bugzilla.gnome.org/show_bug.cgi?id=753196

https://bugzilla.gnome.org/show_bug.cgi?id=754893
2015-09-15 12:08:00 +02:00
Justin Kim ff388f1d9b nlecomposition: don't leak internal hashtable
https://bugzilla.gnome.org/show_bug.cgi?id=754867
2015-09-11 13:09:40 +02:00
Justin Kim 937217021e nleobject: don't leak srcpad when disposing
https://bugzilla.gnome.org/show_bug.cgi?id=754867
2015-09-11 13:09:40 +02:00
Thibault Saunier edc5c27ffb Move NLE to a dedicated GstPlugin
Summary: Allowing external user to directly use it

Reviewers: Mathieu_Du

Differential Revision: https://phabricator.freedesktop.org/D231
2015-08-20 13:49:20 +02:00