Commit graph

1981 commits

Author SHA1 Message Date
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
Vincent Penquerc'h
a8ca56b42d gstbuffer: factor three flags-to-string loops 2014-06-04 12:30:36 +01:00
Wim Taymans
f446280740 downloadbuffer: fix uninitialized variable 2014-06-03 22:19:33 +02:00
Wim Taymans
45c61db152 downloadbuffer: improve start/stop in buffering query
The start and stop should represent the currently downloading region.
The estimated-total should represent the remaining time to download
the currently downloading region. This makes it a lot more useful
for applications because they can then use those values to update
the fill region and use the estimated time to delay playback.
Update the docs with this clarification.
2014-06-03 22:17:17 +02:00
Vincent Penquerc'h
557bb0de16 identity: add static and const where appropriate 2014-06-03 15:36:15 +01:00
Vincent Penquerc'h
1e063bc6e6 identity: fix potential buffer overflow
Coverity 1037155
2014-06-03 15:36:11 +01:00
Wim Taymans
8cbc35a93d downloadbuffer: reset read and write positions
Reset the read and write positions right after we open the file or flush
it. We are also in the buffering state with 0 percent buffered when we
start.
2014-06-03 14:49:44 +02:00
Sebastian Dröge
a91b51c9b7 typefind: Keep still meaningfull pending events on FLUSH_STOP
Only EOS and segment should be deleted in that case.

https://bugzilla.gnome.org/show_bug.cgi?id=709868
2014-05-31 17:35:52 +02:00
Thiago Santos
01c9ae2630 multiqueue: post buffering message when queues flush
The buffering status goes back to 0, so inform the application about it

https://bugzilla.gnome.org/show_bug.cgi?id=726423
2014-05-29 16:51:41 -03:00
Tim-Philipp Müller
f28a4cc671 elements: don't depend on libgio just for g_io_error_from_errno()
https://bugzilla.gnome.org/show_bug.cgi?id=729949
2014-05-13 20:06:48 +01:00
Tim-Philipp Müller
fa94322349 sparsefile: keep it private as helper API for downloadbuffer
There's no expectation that any other element or applications
might want to use this helper API any time soon, so keep it
private for the time being. There were open questions regarding
portability and binding-friendliness too.

This also removes the gio dependency of -base again.

https://bugzilla.gnome.org/show_bug.cgi?id=729951
https://bugzilla.gnome.org/show_bug.cgi?id=729949
2014-05-13 20:05:55 +01:00
Nicolas Dufresne
6ff2b59ff5 downloadbuffer: Fix 32bit build
format '%lli' expects argument of type 'long long int', but argument 8 has type 'gsize'
2014-05-08 14:48:00 -04:00
Wim Taymans
3d69028797 downloadbuffer: small cleanups 2014-05-08 16:55:15 +02:00
Wim Taymans
451d0e3b0d downloadbuffer: update docs 2014-05-08 16:54:57 +02:00
Wim Taymans
45855e2795 Add new downloadbuffer element
See https://bugzilla.gnome.org/show_bug.cgi?id=680183
2014-05-08 15:53:45 +02:00
Wim Taymans
35a1822d7a pads: update docs for request pads
We would like to encourage the use of gst_element_request_pad()
2014-05-08 09:13:04 +02:00
Руслан Ижбулатов
45c0831835 filesrc: g_memmove() is deprecated
https://bugzilla.gnome.org/show_bug.cgi?id=712811
2014-05-04 14:49:36 +01:00
Thiago Santos
0a3bc6be1f multiqueue: avoid signaling overrun on the first segment
When the first segment has position != 0 and position > max-size-time
it will immediatelly cause the multiqueue to signal overrun.

This can happen easily with adaptive streams when switching bitrates
and starting a new group. The segment for this new group will have
a position that is much greater than 0 and will lead to this issue.
This is particularly harmful when the adaptive stream uses mpegts
that doesn't emit no-more-pads and it might happen that only one
of the stream pads was added when the multiqueue overruns and gets
the group ready for exposing. So the user will only get audio or
video.

The solution is to fallback to the sink segment while the source pad
has no segment.

https://bugzilla.gnome.org/show_bug.cgi?id=729124
2014-04-28 17:08:57 -03:00
Srimanta Panda
e3e1b0eac7 funnel: Check if the last pad was set
If no data is coming but only EOS is sent from all of the sinkpad, it is not
forwarding the EOS.

https://bugzilla.gnome.org/show_bug.cgi?id=727945
2014-04-28 02:03:28 -04:00
Tim-Philipp Müller
6eb6d9ec38 docs: remove outdated and pointless 'Last reviewed' lines from docs
They are very confusing for people, and more often than not
also just not very accurate. Seeing 'last reviewed: 2005' in
your docs is not very confidence-inspiring. Let's just remove
those comments.
2014-04-26 21:21:51 +01:00
Srimanta Panda
094fdfee7e funnel: Handle end of stream event on sink pad
Handle end of stream events on sink pad. Check all the sink pad
has received eos before forwarding to source pad.

Fixes : https://bugzilla.gnome.org/show_bug.cgi?id=727945
2014-04-17 19:14:34 -04:00
Vincent Penquerc'h
f3dd7937a2 queue2: fix event/preroll deadlock differently
The qlock is released between popping a buffer from the queue
and pushing it. When this buffer causes the sink to wait in
preroll, this lets a query see that the queue is empty, and
push the query then wait for it to be serviced. However, this
will not be done till after peroll, and this will thus block.
If upstream was waiting on buffering to reach 100% before
switching to PLAYING, a deadlock would ensue.

This had been fixed recently by failing queries when the
queue2 was buffering, but this happens to break some other
case (playbin on a local http server and matroska), while
this patch works for both.

See https://bugzilla.gnome.org/show_bug.cgi?id=728345
2014-04-16 15:17:04 +01:00
Jan Schmidt
a89789366f input-selector: Hold pad object lock when changing tags
Avoid spurious crashes when tags are retrieved just as
new ones arrive.
2014-04-11 22:39:36 +10:00
Sebastian Dröge
eba6f7d972 multiqueue: Wake up the queues if limits are changing in a way that would unblock the queue 2014-04-09 15:57:35 +02:00
Tim-Philipp Müller
d5c2439f08 queue2: use g_strerror() instead of strerror()
Need UTF-8 encoding.
2014-04-07 17:49:14 +01:00
Vincent Penquerc'h
fe7925373d queue2: warn if we can't remove our temporary file
It's not fatal though, so do not error out.

Coverity 1037121
2014-04-07 17:35:15 +01:00
Tim-Philipp Müller
9c821554fc filesrc: no need for a translated message for impossible error cases
The message is too technical anyway, the default message works
just fine here as well.
2014-04-07 15:38:17 +01:00
Vincent Penquerc'h
1a08e22845 filesrc: catch failure to seek back to zero after seek test
This should never happen theoretically, but since a transient
failure would get us to silently read wrong data, it's worth
erroring out. And it silence this:

Coverity 206034
2014-04-07 15:24:26 +01:00
Thiago Santos
e06f9667b0 inputselector: fix build with debug cached buffers enabled
gstinputselector.c:818:5: error: format not a string literal
and no format arguments [-Werror=format-security]
2014-04-03 18:17:03 -03:00
Vincent Penquerc'h
a6decb91ac queue2: fix event/preroll deadlock
The qlock is released between popping a buffer from the queue
and pushing it. When this buffer causes the sink to wait in
preroll, this lets a query see that the queue is empty, and
push the query then wait for it to be serviced. However, this
will not be done till after peroll, and this will thus block.
If upstream was waiting on buffering to reach 100% before
switching to PLAYING, a deadlock would ensue.

We fix it by refusing the query when buffering, as per Wim's
recommendation on IRC.
2014-03-24 12:00:50 +01:00
Sebastian Dröge
7d7511a4b3 queue2: Update buffering status and maybe post buffering message right when enabling buffering 2014-03-19 09:48:45 +01:00
Sebastian Dröge
f53f4ddca4 multiqueue: Update buffering status and maybe post buffering message right when enabling buffering 2014-03-19 09:48:45 +01:00
Tim-Philipp Müller
a6cd61b86a docs: fix multiqueue docs for new template names foo_%d -> foo_%u
https://bugzilla.gnome.org/show_bug.cgi?id=726358
2014-03-14 18:40:31 +00:00
Stefan Sauer
6d20be1702 tee: use store_sticky events add add more logging
Use the pad as object for logging to get more context. Use
gst_pad_store_sticky_event() instead of sending the event. This avoids a warning
as here the pad is not yet linked and we actually don't want to send anyway.
2014-03-11 21:50:35 +01:00
Thiago Santos
0362d98d94 queue2: if buffering is disabled while buffering, post 100% message
Avoids stall waiting for buffering to reach 100%
2014-03-10 10:10:24 -03:00
Thiago Santos
dc8f0932fe queue2: remove unused variable
buffering_iteration was never used
2014-03-10 10:10:24 -03:00
Thiago Santos
3ed2507ebc queue: queue2: preserve last flow result when pushing events
Avoids mistakenly returning _OK when downstream is still
_NOT_LINKED on subsequent received pad pushes

https://bugzilla.gnome.org/show_bug.cgi?id=725917
2014-03-10 10:10:20 -03:00
Thiago Santos
0e2f63654b multiqueue: if buffering is disabled while buffering, post 100% message
Avoids stall waiting for buffering to reach 100%
2014-03-10 09:49:05 -03:00
Thiago Santos
b6470a7b3f multiqueue: do not reset last push result when pushing events
Use the last result as a default when pushing a item from a single queue,
otherwise the status gets reset to _OK when pushing events.

This causes problems when mistakenly activating a not-linked stream
that is being ignored upstream as it is not being used (adaptive
scenarios), it will make the multiqueue post a buffering message
on a pad that won't receive buffers

https://bugzilla.gnome.org/show_bug.cgi?id=725917
2014-03-10 09:48:58 -03:00
Tim-Philipp Müller
3c966d060d fakesink, identity, fakesrc: fix debug printing if TAG_MEMORY buffer flag
The IN_CAPS flag does not exist any more.
2014-03-06 20:40:46 +00:00
Sebastian Dröge
5737f4f367 multiqueue: If we only have a single pad, don't consider all pads not linked and grow the queue indefinitely 2014-02-20 15:35:11 +01:00
Wim Taymans
252aa44887 queue2: don't truncate the temp file on shutdown
We want to keep the downloaded file untruncated so that we can use it
again later.

Fixes: https://bugzilla.gnome.org/show_bug.cgi?id=724373
2014-02-18 15:46:32 +01:00
Wim Taymans
6fa8edd6b0 queue2: Fix merging of ranges
Make a method to get the seeking threshold. If data is further away from
this threshold we want to perform a seek upstream.
When the current downloaded range can merge with the next range,
actually include the data of the next range into the current range
instead of discarding it. Also decide if we seek to the write position
of the merged range or continue reading.
2014-02-18 14:29:01 +01:00
Thiago Santos
8ee77efbed outputselector: respect the 'negotiation-mode' property
If the segment event is allowed to be pushed to all pads it
will lead to an assertion of 'sticky event misordering:
segment received before caps' in case the pad-negotiation-mode
is set to 'active' or 'none'.

This patch fixes this by making all sticky events follow the
property like the caps event to prevent misordering warnings.

When a new pad is activated the current sticky events on the
sinkpad are forwarded to it in the proper order.

https://bugzilla.gnome.org/show_bug.cgi?id=723266
2014-01-30 17:06:00 -03:00
Thiago Santos
00da86036b capsfilter: do not forget to push pending events
Push pending events before buffers if caps is already
set
2014-01-29 14:59:43 -03:00
Arnaud Vrac
a93615aea1 multiqueue: do not reduce single queue below current level
When the single queue size was just bumped by 1 to allow more buffers to
be added, the buffers limit could be reduced to the current level when
setting the max-size-buffers property. This would result in a stall
since the queue would not grow anymore at this point.

Prevent this by not reducing a single queue size below the current
number of buffers + 1.

https://bugzilla.gnome.org/show_bug.cgi?id=712597
2014-01-27 19:57:35 +01:00
Sebastian Dröge
454ee04a22 multiqueue: Break the loop immediately if we found an empty queue
No need to continue looking at all the others
2014-01-24 09:28:05 +01:00
Per x Johansson
4f928547a8 multiqueue: Allow growing a queue if all other queues are not linked
In the case where one singlequeue is full and all other are not linked, the
growing of the full queue does not work correctly. The result depends on if
the full queue is last in the queue list or not.

https://bugzilla.gnome.org/show_bug.cgi?id=722891
2014-01-24 09:27:28 +01:00
Sebastian Dröge
210b0629fc capsfilter: Only set caps on the srcpad if it's activated in push mode
https://bugzilla.gnome.org/show_bug.cgi?id=722289
2014-01-16 18:16:35 +01:00
Thiago Santos
1d87a5244c inputselector: removing duplicate field position
It is already stored inside the GstSegment struct and
was only duplicating information. Also removed some
weird positon if/else that would possibly change the
segment that was going to be pushed downstream
2014-01-15 19:28:01 -03:00
Thiago Santos
139c96c129 multiqueue: prevent buffering forever with playbin
When prerolling/buffering, multiqueue has its buffers limit set
to 0, this means it can take an infinite amount of buffers.

When prerolling/buffering finishes, its limit is set back to 5, but
only if the current level is lower than 5. It should (almost) never be
and this will cause prerolling/buffering to need to wait to reach the
hard bytes and time limits, which are much higher.

This can lead to a very long startup time. This patch fixes this
by setting the single queues to the max(current, new_value) instead
of simply ignoring the new value and letting it as infinite(0)

https://bugzilla.gnome.org/show_bug.cgi?id=712597
2014-01-15 09:51:35 -03:00
Sebastian Dröge
24a3102b21 tee: Make sure to give pads the name that was requested
Also check for uniqueness and make sure we create a new
pad index properly if some were requested with names but
the new one is not.
2014-01-14 16:45:53 +01:00
Sebastian Dröge
c343ebd454 multiqueue: Allow growing a queue if all other queues are not linked
See https://bugzilla.gnome.org/show_bug.cgi?id=719893
2014-01-08 09:54:01 +01:00
Wim Taymans
c80ea6895d filesrc: don't try to seek to -1 offset
The offset can be -1 when we are configured in TIME format. Instead of
failing the seek and erroring, do what and offset of -1 is supposed to
do and simply read from the current offset.
2014-01-07 16:18:37 +01:00
YanpingZhang
1de533735b multiqueue: Fix hanging if shut down while handling a serialized query
https://bugzilla.gnome.org/show_bug.cgi?id=721253
2014-01-03 11:15:33 +01:00
Sebastian Dröge
34f8b4d6f3 tee: Remove dyn lock
It was used for pad-alloc in 0.10 but currently is completely unused
and not necessary. All pad access is protected by the tee object lock
and keeping another reference to the current pad.
2014-01-02 11:13:27 +01:00
Sebastian Dröge
e80fd39947 tee: Keep another ref to our one and only srcpad around while pushing
A pad probe on that pad might otherwise just release the pad, drop
the last reference and cause great misery.

https://bugzilla.gnome.org/show_bug.cgi?id=721300
2014-01-02 11:09:59 +01:00
Edward Hervey
af6fd4f5bb queue: Remove unneeded checks
item is guaranteed to be non-null.

COVERITY CID 1037152
COVERITY CID 1037153
2013-12-30 16:51:01 +01:00
Sebastian Dröge
0199cd5dbf funnel: Setting the PROXY_CAPS flag on the srcpad does not make much sense
funnel outputs whatever one of the upstreams currently outputs, a caps
query to a random upstream does not give the right answer here.
2013-12-20 14:30:22 +01:00
Sebastian Dröge
5937199726 funnel: Proxy CAPS and ALLOCATION queries 2013-12-20 11:38:18 +01:00
Thiago Santos
1f71f191be multiqueue: post 100% buffering if single queue is not linked
This makes buffering stop in case a stream switch happens. This is
important for adaptive streams that can disable not-linked streams
to avoid consuming the network bandwidth.

https://bugzilla.gnome.org/show_bug.cgi?id=719575
2013-12-20 01:10:47 -03:00
Wim Taymans
e5a73cc2ff queue: don't ignore event return value
Pass the event return value upstream.
Remove strange goto construct.
2013-12-11 14:52:25 +01:00
Sebastian Rasmussen
53ae1b2c9c docs: Fix typos in function/object descriptions
Fixes https://bugzilla.gnome.org/show_bug.cgi?id=720029
2013-12-07 17:11:12 +00:00
Olivier Crête
a90ce304c8 multiqueue: Wake up on reconfigure event
After patch bda406c4, the state of the singlequeue was set to OK, but nothing
would then wake up the thread, as the other wakeup functions only look at
singlequeues that are marked as having received as not-linked.

https://bugzilla.gnome.org/show_bug.cgi?id=708200
2013-12-03 12:40:11 -05:00
Sebastian Rasmussen
49950e57ad docs: add missing docs, fixing doc errors
* add many missing declarations to sections
 * GstController has been removed, update docs
 * skip GstIndex when generating documentation
 * rephrase so gtkdoc doesn't imagine return value
 * add missing argument description for gst_context_new()
 * document GstOutputSelectorPadNegotiationMode and move to header-file

https://bugzilla.gnome.org/show_bug.cgi?id=719614
2013-12-03 00:11:59 +00:00
Thiago Santos
5bb45ffbfc inputselector: handle gap events
Use gap events to advance the selector's pad position.

This is relevant to keep sync_streams mode working when one of the
streams doesn't have data all the time.
2013-11-29 15:03:44 -03:00
Edward Hervey
74a1970101 queue: Don't use gst_buffer_get_size() when possible
Makes qst_queue_locked_dequeue 20% faster
2013-11-11 13:28:14 +01:00
Wim Taymans
058533ff9f valve: proxy caps and allocation
Proxy the caps queries on the srcpad as well.
Proxy the allocation query on the sinkpad.
2013-11-06 10:15:59 +01:00
Sebastian Rasmussen
1479aba1cf tests/filesrc: Set location in wrong state
Also remove incorrect comment about code possibly not being reachable
that is now exercised by the filesrc unit test.

https://bugzilla.gnome.org/show_bug.cgi?id=709831
2013-10-13 12:18:57 -04:00
Sebastian Dröge
02a4830096 Revert "Potential GstContext regression"
This reverts commit e658379534.

This test commit should've never been pushed. Oops.
2013-09-24 12:47:52 +02:00
Alex Ashley
e658379534 Potential GstContext regression
Since the refactoring of GstContext (commits
qc9fa2771b508e9aaeecc700e66e958190476f,
a7f5dc8b8a,
690326f906dc82e41ea58b81cdb2e3e88b754,
d367dc1b0d4ecb37f4d27267e03d7bf0c6c06a6, and
82d158aed3f2e8545e1e7d35085085ff58f18) I am no longer able to get
a shared context for an element that is used twice in a pipeline.

I used the documentation and eglglessink as my reference for
implementing the GstContext logic.

As the code was tied to a hardware decoder, I have ported the
GstContext code to fakesink to show the problem. Using the old
API a single ExampleMgr instance is created, but using the new
API each element is creating its own instance.
2013-09-24 12:28:55 +02:00
Sebastian Dröge
b25b9ad6bd queue2: Only update current level if we already downloaded a range
Otherwise queue->level is NULL and dereferencing that is not a good
idea in general.

https://bugzilla.gnome.org/show_bug.cgi?id=707648
2013-09-10 10:15:03 +02:00
Gustavo Noronha Silva
4cb596ddd6 Update the buffering state before stalling for more data
In some cases the wait for more data was happening without updating
the buffering state, meaning the API user would not be able to notice
it should pause the pipeline and update UI to indicate that is the
case, the video would likely stutter instead.

https://bugzilla.gnome.org/show_bug.cgi?id=707648
2013-09-09 14:15:09 +02:00
Sebastian Dröge
631421b8af typefind: Add missing break after handling the GAP event
Thanks to Edward Hervey for noticing.
2013-09-04 14:42:38 +02:00
Matej Knopp
7f657358a8 multiqueue: Don't reduce single queue visible size below its current level
If the multiqueue has automatically grown chances are good that
we will cause the pipeline to starve if the maximum level is reduced
below that automatically grown size.

https://bugzilla.gnome.org/show_bug.cgi?id=707156
2013-09-04 10:52:13 +02:00
Sebastian Dröge
8ba5fb0b28 outputselector: Don't adjust segment->start to the current time when switching pads
This does not make any sense at all and breaks timestamp->running_time
calculations in unpredictable ways.

https://bugzilla.gnome.org/show_bug.cgi?id=707130
2013-09-02 13:55:08 +02:00
Mathieu Duponchelle
76b5278f7c capsfilter: Delete link directly in pending_events.
When removing a segment event.

https://bugzilla.gnome.org/show_bug.cgi?id=707088
2013-08-30 14:56:17 -04:00
Alessandro Decina
a2bc789de6 filesink: please gcc (avoid a warn_unused_result warning) 2013-08-27 09:31:22 +02:00
Alessandro Decina
924acf5e92 filesink: flush (discard data) on FLUSH_STOP
Reset the write position to 0 and truncate the file on FLUSH_STOP.
2013-08-27 08:00:09 +02:00
Sebastian Dröge
14f817d723 queue: Properly unlock the sinkpad streaming thread when deactivating the pad
https://bugzilla.gnome.org/show_bug.cgi?id=705835
2013-08-20 10:16:41 +02:00
Sebastian Dröge
52f2345516 queue2: Properly unlock the sinkpad streaming thread when deactivating the pad
https://bugzilla.gnome.org/show_bug.cgi?id=706360
2013-08-20 10:16:05 +02:00
Sebastian Dröge
b40599f6db multiqueue: Clean up after the streaming thread has stopped
https://bugzilla.gnome.org/show_bug.cgi?id=705835
2013-08-19 16:38:50 +02:00
Sebastian Dröge
d7c3be226c queue2: Clean up after the streaming thread has stopped
https://bugzilla.gnome.org/show_bug.cgi?id=705835
2013-08-19 16:38:40 +02:00
Sebastian Dröge
ec1dd125c7 queue: Clean up after the streaming thread has stopped
https://bugzilla.gnome.org/show_bug.cgi?id=705835
2013-08-19 16:38:16 +02:00
Tim-Philipp Müller
6b4bef214b queue2: don't crash on EOS if queue is empty
Fixes spurious crash in test_simple_shutdown_while_running
unit test.
2013-08-16 16:53:29 +01:00
Tim-Philipp Müller
c02081ca30 queue2: don't change global buffering state from within query handler
When a buffering query is handled it uses the get_buffering_percent()
function to get some statitics. Unfortunately this function also
calculates whether the queue should be buffering and adapts the
global queue2 state in case of state transitions from/to buffering
(including whether a buffering message was posted on the bus!).

This means that there is a race which can cause buffering messages
to never posted if the global state changes happen as a result of aa
query instead of resulting from bytes flowing in/out.

Spotted by Sjoerd Simons.

Change to only query state in get_buffering_percent() and update
state only in update_buffering().

https://bugzilla.gnome.org/show_bug.cgi?id=705332
2013-08-16 16:53:03 +01:00
Wim Taymans
d7a98f9802 queue2: update buffering when changing capacity
When the capacity of the queue changes, make sure we post an updated buffering
message because we might suddenly have completed the buffering stage.
2013-08-16 12:57:17 +02:00
Sjoerd Simons
0b06804735 queue2: Fix backwards seeks into undowloaded ranges
When in download buffering mode queue2 didn't check if a range offset is
in a undownloaded range before the currently in-progress range. Causing
seeks to an earlier offset to, well, take a while.
2013-07-31 09:50:47 +02:00
Sjoerd Simons
7f8fb3861e queue2: Forward the schedule query upstream
When asked about the scheduling flags first check with upstream and
simply add the _SEEKABLE flag when using a temporary file as storage.

This enables the forwarding of _SEQUENTIAL and _BANDWIDTH_LIMITED from
sources if needed.

https://bugzilla.gnome.org/show_bug.cgi?id=704927
2013-07-29 15:07:44 +02:00
Sebastian Dröge
4aef70fed1 typefind: Only advance offset by the number of bytes we actually read
There might be a short read at EOS.
2013-07-29 11:05:09 +02:00
Arnaud Vrac
9bc26c5f25 input-selector: Fix missing pad activation notification
A new active pad might not be notified in some cases, which results
in the current track number not being set in playbin.

The active-pad notification is only sent in the chain and sink_event
functions, and only when the buffer or event that triggered the active
pad selection is from the newly activated pad. So in the other case
the notification will never be sent.

https://bugzilla.gnome.org/show_bug.cgi?id=704691
2013-07-23 08:59:07 +02:00
Sebastian Dröge
eaf333248a inputselector: Don't push new stream-start events on stream change unless they all have group ids
https://bugzilla.gnome.org/show_bug.cgi?id=704408
2013-07-22 15:30:10 +02:00
Sebastian Dröge
d9f3d3560e typefind: Use new group-id in stream-start event 2013-07-22 15:30:10 +02:00
Sebastian Dröge
0dc232e114 multiqueue: only block serialized query when it's safe
We must be certain that we don't cause a deadlock when blocking the serialized
queries. One such deadlock can happen when we are buffering and downstream is
blocked in preroll and a serialized query arrives. Downstream will not unblock
(and allow our query to execute) until we complete buffering and buffering will
not complete until we can answer the query..

https://bugzilla.gnome.org/show_bug.cgi?id=702840
2013-07-16 11:36:50 +02:00
Sebastian Dröge
717ad20912 inputselector: Deactivate and remove pad without the inputselector lock
Otherwise we might get deadlocks caused by lock order inversion:
During the chain function the stream lock is first locked and then the
inputselector lock. During pad release we first locked the inputselector
lock and then deactivating the pad would lock the stream lock.

There's no reason why the inputselector lock should be required while
deactivating and removing the pad, it's only needed before.

https://bugzilla.gnome.org/show_bug.cgi?id=704002
2013-07-12 10:08:26 +02:00
Sebastian Dröge
c8cfaff1ff inputselector: Keep previous active sinkpad around until we're done with it
Otherwise we'll send a new segment event downstream for each buffer.
2013-07-10 14:30:31 +02:00
Olivier Crête
bbb26f8756 funnel: Re-push all sticky events when buffers come from a different pad
Don't special case segment/caps, just push all sticky events when they are
received on the currently active pad or when the active pad changes.
2013-07-01 20:45:42 -04:00
Olivier Crête
176e16aa5f funnel: Use default pad function for upstream event/queries
The default functions in 1.x already do the right thing
2013-07-01 20:21:10 -04:00
Wim Taymans
2f78e96299 queue2: only block serialized query when it's safe
We must be certain that we don't cause a deadlock when blocking the serialized
queries. One such deadlock can happen when we are buffering and downstream is
blocked in preroll and a serialized query arrives. Downstream will not unblock
(and allow our query to execute) until we complete buffering and buffering will
not complete until we can answer the query..

Fixes https://bugzilla.gnome.org/show_bug.cgi?id=702840
2013-06-24 23:29:16 +02:00
Sebastian Dröge
2f8e572887 queue: Don't hold the queue mutex while doing serialized queries downstream
https://bugzilla.gnome.org/show_bug.cgi?id=702520
2013-06-19 10:53:21 +02:00
Brendan Long
f0a3d8bb09 input-selector: send notify::active signal for input-selector pads.
https://bugzilla.gnome.org/show_bug.cgi?id=701319
2013-06-06 17:16:47 +02:00
Brendan Long
76f0e18f92 input-selector: return FALSE for "active" property if selector is NULL
https://bugzilla.gnome.org/show_bug.cgi?id=701323
2013-06-04 17:46:25 +02:00
Sebastian Dröge
ab6a1085ee (multi)queue: Don't access query items during flushing 2013-05-27 16:38:18 +02:00