Commit graph

1883 commits

Author SHA1 Message Date
Tim-Philipp Müller 66bdae5f33 plugins: add helper function for writing buffers out with writev() 2014-11-30 14:40:46 +00:00
Thiago Santos 8d835ec400 queue2: percentage is relative to high-percent
When comparing percentage values, compare with 0-100 scale as it
has already been made relative to 0-high_percent, otherwise we mark
the queue as not buffering and report a 50% to the user. This leads to
a buffering stall as the user assumes the queue is still buffering but
it thinks it isn't.

https://bugzilla.gnome.org/show_bug.cgi?id=736969
2014-11-23 05:51:12 -03:00
Thiago Santos 5a759011a0 multiqueue: percentage is an absolute value
multiqueue's queues stored percent value is the percentage from 0
to 100 (max-size-*) and should be compared with the requested limit
(high_percentage) set by the user and not with 100% to check if
buffering should stop. Otherwise we are only stopping buffering when the
queue gets completely full.
2014-11-23 05:51:12 -03:00
Sebastian Dröge 9606e04895 capsfilter: Add an optional delayed caps change mode
In this mode we accept previously set filter caps until
upstream renegotiates to something that is compatible
to the current filter caps.

This allows dynamic caps changes in the pipeline even
if there is a queue between any conversion element
and the capsfilter. Without this we would get not-negotiated
errors if timing is bad.

https://bugzilla.gnome.org/show_bug.cgi?id=739002
2014-11-03 08:09:21 +01:00
Stefan Sauer 9a66e3169f identity: include the actual delta in the message
Including the actual delta in the message makes it easy to see, if the new
buffer is behind or ahead and how much.
2014-10-20 16:39:38 +02:00
Andrei Sarakeev ee93c807e1 multiqueue: Wake up any waiting streams if the current one goes EOS
Otherwise we might have unlinked streams waiting.

https://bugzilla.gnome.org/show_bug.cgi?id=738198
2014-10-20 12:31:42 +02:00
Aleix Conchillo Flaqué 41fa9ad9f2 multiqueue: don't lock multiqueue when pushing serialized queries
If we are pushing a serialized query into a queue and the queue is
filled, we will end in a deadlock. We need to release the lock before
pushing and acquire it again afterward.

https://bugzilla.gnome.org/show_bug.cgi?id=737794
2014-10-09 11:49:49 +03:00
Tim-Philipp Müller 64a0abb0f4 inputselector: fix compilation 2014-10-03 14:04:58 +01:00
Stefan Sauer e3dc7366bd input-selector: extract some common code into helpers 2014-10-03 14:44:48 +02:00
Stefan Sauer 8285002693 input-selector: small code cleanups
Rename TIMESTAMP -> PTS. Move a var down to the scope where it is used. Use
g_queue_free_full().
2014-10-03 14:22:01 +02:00
Stefan Sauer d8bee3c769 inputselector: fix printf format
The padcount is uint. Also add comments to the instance vars.
2014-10-03 13:47:42 +02:00
Luis de Bethencourt ecaac57bbf fakesrc: mark the pattern property as unused
Revert the previous commit which removes the pattern property of fakesrc because
doing so will break ABI. Bringing the property back but marking it as unused
in the property string.

https://bugzilla.gnome.org/show_bug.cgi?id=737683
2014-10-03 10:36:40 +01:00
Luis de Bethencourt 9b34972ba1 fakesrc: removing unused pattern option
Eventhough the "pattern" property of fakesrc can be set, it is never used. The
only pattern supported is the default 0x00 -> 0xff, and if a pattern is set by
the user it is ignored. Removing the unused property and variable.

https://bugzilla.gnome.org/show_bug.cgi?id=737683
2014-10-02 13:45:34 +01:00
Sebastian Dröge 917e4cd985 queue: Add missing break in switch 2014-10-02 14:55:22 +03:00
Sebastian Dröge 594e2f0668 queue: update segment position on GAP events to calculate levels properly
https://bugzilla.gnome.org/show_bug.cgi?id=737498
2014-10-02 11:00:32 +03:00
Sebastian Dröge 03376a2086 queue2: update segment position on GAP events to calculate levels properly
https://bugzilla.gnome.org/show_bug.cgi?id=737498
2014-10-02 10:58:24 +03:00
Matej Knopp b5bf41a771 multiqueue: update segment position on GAP events to calculate levels properly
https://bugzilla.gnome.org/show_bug.cgi?id=737498
2014-10-02 10:56:03 +03:00
Sebastian Dröge 798cafa7fc capsfilter: Push pending events before a buffer also if upstream never configured caps but we have srcpad caps already
Otherwise we never send pending events downstream that arrive after we
configured caps on the srcpad.

https://bugzilla.gnome.org/show_bug.cgi?id=737735
2014-10-02 10:13:28 +03:00
Stefan Sauer d5518edf12 fixme: bump leftover 0.11 fixme comments 2014-09-25 21:27:03 +02:00
Thibault Saunier d1181ed98a capsfilter: Remove EOS event from pending_event list on FLUSH_STOP
https://bugzilla.gnome.org/show_bug.cgi?id=709868
2014-09-24 10:57:14 +03:00
Thibault Saunier 97a6bb377b queue: Do not forget to release the QUEUE_LOCK in the out_flow_error path
Avoiding deadlocks!
2014-09-23 14:45:43 +02:00
Thibault Saunier 38657bff51 queue: Do not hold GST_QUEUE_LOCK while posting ERROR messages
This might create deadlocks and we need to avoid holding element
specific lock while posting messages

For example a deadlock will happen if while posting the message,
someone connected on the bus (sync) tries to DOT the pipeline.

https://bugzilla.gnome.org/show_bug.cgi?id=737102
2014-09-22 16:13:44 +02:00
Thiago Santos ecf479e3d1 queue2: do not post buffering messages holding the lock
It might cause deadlocks to post messages while holding the queue2
lock. To avoid this a new boolean flag is set whenever a new
buffering percent is found. The message is posted after the lock
is released.

To make sure the buffering messages are posted in the right order, messages
are posted holding another lock. This prevents 2 threads trying to post
messages at the same time.

https://bugzilla.gnome.org/show_bug.cgi?id=736969
2014-09-19 20:35:29 -03:00
Tim-Philipp Müller 3c4567f591 filesrc: remove FIXME
https://bugzilla.gnome.org/show_bug.cgi?id=735878
2014-09-18 18:57:05 +01:00
Ognyan Tonchev cf04dc0486 typefindelement: do not leak sticky events in flush_stop
https://bugzilla.gnome.org/show_bug.cgi?id=736813
2014-09-17 17:39:10 +01:00
Thiago Santos 3f83ca9c43 multiqueue: do not post messages holding the lock
It might cause deadlocks to post messages while holding the multiqueue
lock. To avoid this a new boolean flag is set whenever a new buffering percent
is found. The message is posted after the lock can be released.

To make sure the buffering messages are posted in the right order, messages
are posted holding another lock. This prevents 2 threads trying to post
messages at the same time.

https://bugzilla.gnome.org/show_bug.cgi?id=736295
2014-09-16 16:56:53 -03:00
Tim-Philipp Müller 49c6f923de coreelements: mark properties with MUTABLE_PLAYING 2014-09-14 16:08:07 +01:00
Rémi Lefèvre 9b2231669f valve: fix typo in description
https://bugzilla.gnome.org/show_bug.cgi?id=736455
2014-09-11 11:09:41 +01:00
Ravi Kiran K N 63a943aa82 output-selector: Send all events to active src pad and EOS to all src pads
Fixes tests/icles/output-selector-test

https://bugzilla.gnome.org/show_bug.cgi?id=729811
2014-09-02 12:33:56 +03:00
Sebastian Dröge ed15b30930 concat: Allow seeking on the currently playing stream
This is consistent with the stream time reporting.
2014-08-27 11:01:53 +03:00
Tim-Philipp Müller 93d8679b00 queue: fix race when flush-stop event comes in whilst shutting down
Don't re-start the queue push task on the source pad when a
flush-stop event comes in and we're in the process of shutting
down, otherwise that task will never be stopped again.

When the element is set to READY state, the pads get de-activated.
The source pad gets deactivated before the queue's own activate_mode
function on the source pads gets called (which will stop the thread),
so checking whether the pad is active before re-starting the task on
receiving flush-stop should be fine. The problem would happen when the
flush-stop handler was called just after the queue's activate mode
function had stopped the task.

Spotted and debugged by Linus Svensson <linux.svensson@axis.com>

https://bugzilla.gnome.org/show_bug.cgi?id=734688
2014-08-23 11:43:20 +01:00
Thiago Santos 3001f3b433 inputselector: always proxy caps query
Otherwise it would only be proxied for the active pad which can lead
upstream to use an incompatible caps for the downstream element.

Even if a reconfigure event is sent upstream when the pad is activated, this
will save the caps reconfiguration if it is already using an acceptable caps.
2014-08-14 19:16:43 -03:00
Thibault Saunier 78e2264544 multiqueue: Not post BUFFERING message if one of the singlequeue doesn't need it
Imagine the following 'pipeline'

                --------------
            p1/| 'fullqueue'  |--- 'laggy' downstream
  ---------  / |              |
-| demuxer |   | multiqueue   |
  ---------  \ |              |
            p2\| 'emptyqueue' |--- 'fast' downstream
                --------------

In the case downstream of one single queue (fullqueue) has (a lot of) latency
(for example for reverse playback with video), we can end up having the other
SingleQueue (emptyqueue) emptied, before that fullqueue gets
unblocked. In the meantime, the demuxer tries to push on fullqueue, and
is blocking there.

In that case the current code will post a BUFFERING message on the bus when
emptyqueue gets emptied, that leads to the application setting the pipeline state to
PAUSED. So now we end up in a situation where 'laggy downstream' is
prerolled and will not unblock anymore because the pipeline is set to
PAUSED, the fullequeue does not have a chance to be emptied and
the emptyqueue can not get filled anymore so no more BUFERRING message
will be posted and the pipeline is stucked in PAUSED for the eternity.

Making sure that we do not try to "buffer" if one of the single queue
does not need buffering, prevents this situtation from happening though it lets the
oportunity for buffering in all other cases.

That implements a new logic where we need all singlequeue to need
buffering for the multiqueue to actually state buffering is needed,
taking the maximum buffering of the single queue as the reference point.

https://bugzilla.gnome.org/show_bug.cgi?id=734412
2014-08-13 18:25:12 +03:00
Sebastian Dröge 3032a369a7 multiqueue: Only handle flow returns < EOS as errors, not e.g. flushing 2014-08-13 13:01:23 +03:00
Sebastian Dröge ee662efdd1 queue2: Post errors if we receive EOS after downstream reported an error
There will be no further data flow that would allow us to propagate the
error upstream, causing nobody at all to post an error message.
2014-08-13 12:20:51 +03:00
Sebastian Dröge 6a261b1fc2 queue: Post errors when receiving EOS after downstream returned an error
There might be no further data flow that would allow us to propagate the
error upstream, causing nobody to post an error at all.
2014-08-13 12:18:37 +03:00
Sebastian Dröge afcc93254b multiqueue: Post errors ourselves if they are received after EOS
After EOS there will be no further buffer which could propagate the
error upstream, so nothing is going to post an error message and
the pipeline just idles around.
2014-08-13 12:10:39 +03:00
Sebastian Dröge 9861003939 concat: Add documentation and integrate into documentation build 2014-08-12 15:39:09 +03:00
Sebastian Dröge c938561a2b concat: Add new element that concatenates multiple streams
https://bugzilla.gnome.org/show_bug.cgi?id=734470
2014-08-12 15:38:56 +03:00
Thiago Santos 463ccd96eb multiqueue: avoid using infinite buffers limit if finite is requested
If the current max-buffers limit it infinite and a finite value is
requested, switch to the MAX (requested, current-value) to set some
limit but not below what we know that we've needed so far.

https://bugzilla.gnome.org/show_bug.cgi?id=733637

https://bugzilla.gnome.org/show_bug.cgi?id=733837
2014-07-29 15:26:51 -03:00
Tim-Philipp Müller 64cc548c16 typefindelement: remove prototype for function that no longer exists 2014-07-25 11:45:56 +01:00
Srimanta Panda 6d05df01b0 funnel: Fix for racy EOS event handling
When eos events are forwarded simultaneouly from two sinkpads on
funnel, it doesnot forward the eos to sourcepad. The reason is
sticky events are stored after the event callbacks are returned.
Therefore while one is about to store the sticky events on the its
sinkpad, other sinkpad starts checking for the eos events on all other
sinkpads and assumes eos is not present yet.

https://bugzilla.gnome.org/show_bug.cgi?id=732851
2014-07-21 09:33:54 +02:00
Tim-Philipp Müller a2ca5007bd elements: improve buffer flags to string utility function
Avoid relocations and refactor so that we don't calculate
the fixed and known at compile time maximum string size
every time. Also skip the mini object flags which we are
not going to print anyway.
2014-07-19 18:56:53 +01:00
Edward Hervey f1abac1109 typefindelement: Propagate input buffer PTS and DTS
The initial buffers (that were used for timestamping) might have PTS
and DTS set. In order to forward those properly, get the initial
PTS/DTS from the adapter and set them on the reconstructed output
buffer.

https://bugzilla.gnome.org/show_bug.cgi?id=733291
2014-07-17 09:45:54 +02:00
Sebastian Dröge 7f9c0d06dd docs: There is no decodebin2 anymore, don't pretend otherwise 2014-07-08 11:18:05 +02:00
Thiago Santos 7446cea73d fdsrc: fix error setting when uri is invalid
Elements should always set the GError
2014-07-07 16:14:55 -03:00
Sebastian Dröge b5936efc98 identity: Proxy the accept-caps query
We always work in passthrough mode so there's no point in doing
something more clever in basetransform. Also the basetransform
code leads to problems with incomplete caps and downstream
elements that use GST_PAD_FLAG_ACCEPT_INTERSECT.

https://bugzilla.gnome.org/show_bug.cgi?id=732559
2014-07-01 19:19:43 +02:00
Tim-Philipp Müller 8f7e581106 elements: fix copyright and remove gtk-doc chunk
Trivial as it may be, this code was mostly copied from
somewhere else. The gtk-doc chunk is not needed, since
it's not public API.
2014-06-25 11:43:04 +01:00
Olivier Crête f53a8a85a7 filesrc: Ignore seek error on non-seekable files
This make it works with FIFOs.

https://bugzilla.gnome.org/show_bug.cgi?id=731176
2014-06-23 16:32:17 -04:00
Srimanta Panda 5b3ee70ea9 Fix funnel EOS handling and wrong unittest
When no data is coming from sinkpads and eos events
arrived at one of the sinkpad, funnel forwards the EOS
event to downstream. It forwards the EOS because lastsink pad
is NULL. Also the unit testcase of the funnel is not checking
the correct behavior as it should. The unit test case should
fail if one of the sink pad has already EOS present on it and
we are trying to push one more EOS.

https://bugzilla.gnome.org/show_bug.cgi?id=731716
2014-06-19 10:19:15 -04:00