Commit graph

1791 commits

Author SHA1 Message Date
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