Commit graph

1897 commits

Author SHA1 Message Date
Sebastian Dröge bc1ec4ec5f inputselector: Use the same waiting function for EOS and non-EOS waiting 2014-12-24 13:46:28 +01:00
Sebastian Dröge a1c183417f inputselector: Wake up all waitings pads directly if we forward the EOS event
Otherwise they might wait a bit longer unnecessarily.

Also do some minor cleanup.
2014-12-24 13:44:09 +01:00
Song Bing 11e4b744f5 inputselector: Block when receiving an EOS event on a deactivated pad
... and only unblock when either a) the pad becomes active and the event
should be forwarded or b) the active pad went EOS itself.

Otherwise it can happen that we switch from a longer track that is not EOS yet
to a shorter track that already is EOS, but the shorter track won't have any
possibility to send its EOS event downstream anymore.

https://bugzilla.gnome.org/show_bug.cgi?id=740949
2014-12-24 13:33:12 +01:00
Sebastian Dröge 12a905929f inputselector: Keep a ref of the currently active sinkpad around
Otherwise we can't be sure that the pointer points to a still existing
pad instance after releasing the lock.
2014-12-23 12:54:50 +01:00
Song Bing 3137043c3a inputselector: Get the active sinkpad again after taking the lock when handling events
It might have changed in the meantime.

https://bugzilla.gnome.org/show_bug.cgi?id=741893
2014-12-23 12:53:58 +01:00
Tim-Philipp Müller ed15125086 typefind: minor cosmetic change
No nee to abbrev variab nam here, nicer to read if full.
2014-12-10 11:17:25 +00:00
Tim-Philipp Müller 691bd8bd87 typefind: use GST_BUFFER_OFFSET_NONE for buffer offset 2014-12-10 11:16:09 +00:00
Edward Hervey f1c2cd60c3 typefind: Propagate input buffer offset
The initial buffers might have non-default offsets, make sure they get
propagated if present.
2014-12-01 10:47:01 +01:00
Sebastian Dröge 154eefecc9 Don't compare booleans for equality to TRUE and FALSE
TRUE is 1, but every other non-zero value is also considered true. Comparing
for equality with TRUE would only consider 1 but not the others.

Also normalize booleans in a few places.
2014-12-01 09:51:37 +01:00
Tim-Philipp Müller f2e4c25588 plugins: fix build on windows
gstelements_private.c: In function 'gst_writev_buffers':
gstelements_private.c:236:51: error: 'EWOULDBLOCK' undeclared
2014-11-30 23:56:06 +00:00
Tim-Philipp Müller 5b50f39015 filesink: use writev() in ::render() to write out memories without merging them 2014-11-30 14:40:46 +00:00
Tim-Philipp Müller 5a4fb5c314 filesink: implement ::render_list() function that uses writev() 2014-11-30 14:40:46 +00:00
Tim-Philipp Müller ad3e12b006 fdsink: use writev() in ::render() to write out memories without merging them 2014-11-30 14:40:46 +00:00
Tim-Philipp Müller dc73245edd fdsink: implement ::render_list() using writev()
Write out multiple buffers possibly containing multiple
memories with one writev() call, without merging the
buffer memories first, like ::render() does currently.
2014-11-30 14:40:46 +00:00
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