Commit graph

1521 commits

Author SHA1 Message Date
Vincent Penquerc'h
661588b150 dcodebin2: fix lock/unlock mismatch on multiqueue overrun 2015-01-20 15:09:13 +00:00
Sebastian Dröge
2228d9f22b decodebin: Fix compilation 2015-01-17 14:51:48 +01:00
Branislav Katreniak
d16df7f70d decodebin: do call set_queue_size in no_more_pads_cb
Consider pipeline: gst-launch-1.0 playbin uri=http://example.com/a.ogg
Consider 128kbit audio stream.

As soon as uridecodebin detects the bitrate, it configures its input
queue2 max-size to 32000 bytes.
The 2MB buffer in multiqueue is nearly 2 orders of magnitude bigger.
This non-deterministically drives queue2 buffer anywhere from
100% to 0% until multiqueue is filled.

This patch sets multiqueue size to 5 buffers early in no_more_pads_cb.

Partly reverts commit db771185ed.

https://bugzilla.gnome.org/show_bug.cgi?id=740689
2015-01-16 20:58:40 +01:00
Vincent Penquerc'h
6ab711f3f1 decodebin: free old groups when switching groups
Old groups are freed with one switch's delay when switching groups.
They're freed in a scratch thread to avoid delaying the switch.
2015-01-16 15:55:10 +00:00
Thiago Santos
a5ed7afb4c decodebin: disable pad link checks as it has already been done
Decodebin has already added the element to the bin and should only
select caps compatible pads. It should disable the pad link checks
to avoid doing those again.

https://bugzilla.gnome.org/show_bug.cgi?id=742885
2015-01-14 10:33:52 -03:00
Sebastian Dröge
6521870077 Revert "decodebin: Only emit the drain signal for the main decode chain, not any subchains"
This reverts commit a391dfe17f.

It breaks gapless playback: https://bugzilla.gnome.org/show_bug.cgi?id=740045
2014-12-15 09:46:13 +01:00
Thibault Saunier
b9cbfcdeb4 playbin: Do not mix up stream type when getting stream combiner element
We were always returning the video stream combiner whatever stream type
combiner was wanted.
2014-12-11 13:47:58 +01:00
Thiago Santos
7e801a5f26 playbin2: always unref the combiner sinkpad when removing the srcpad
Create a function to do the pad cleanup of the GstSourceCombine struct
and use it to not forget to also cleanup the sink pad and fix a memory
leak.

https://bugzilla.gnome.org/show_bug.cgi?id=741198
2014-12-10 13:36:37 -03:00
Edward Hervey
6a2f017bfa playbin: Only check sinks which are in >= GST_STATE_READY
Otherwise we endup with bogus caps intersection (from the pad template
caps and not from what the actual hardware/device supports)

https://bugzilla.gnome.org/show_bug.cgi?id=738131
2014-12-05 07:58:44 +01:00
Sebastian Dröge
90eb93c2ef 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.
2014-12-01 09:51:12 +01:00
Thibault Saunier
35f6259b24 decodebin: Analyze source pad before setting to PAUSED for 'simple demuxers'
Before we were setting them to PAUSED and (much) later connecting to
their source pad caps notify signal.

There was a race where that demuxer was pushing a caps and later a buffer
on its source pad when we were not even connected to its source pad caps notify
signal leading to decodebin missing the information and not keeping on
building the pipeline on CAPS event thus the demuxer was posting an ERROR
(not linked) message on the bus. This need to be done for 'simple
demuxers' because those have one ALWAYS source pad, not like usual demuxers
that have several dynamic source pads.

A "simple demuxer" is a demuxer that has one and only one ALWAYS source
pad.

https://bugzilla.gnome.org/show_bug.cgi?id=740693
2014-11-26 19:38:48 +01:00
Mathieu Duponchelle
68edf0ebd6 decodebin2: Take STREAM_LOCK before sending sticky events.
There was a race where:

1) we would put the element to PAUSED
2) It would get data sent to it from upstream
3) It would thus send caps
3) caps_notify_cb would continue autoplugging
4) caps would flow downstream, the last pad would get exposed
5) we were still not done sending the sticky events

Taking the stream lock on the new element's sinkpad and only
releasing it when sticky events have all been sent prevents
the caps from reaching the source pad of the element before
we're all set.

https://bugzilla.gnome.org/show_bug.cgi?id=740694
2014-11-26 19:38:48 +01:00
Andrei Sarakeev
e5c6f59140 playsink: Reset mute property of the sink to playsink's value when setting up the audio chain
Otherwise the following can happen:
1. set mute=true
2. play media1 (Ok)
3. play media without audio (audiochain removed)
4. play media2 (audiochain created, mute=*false*)

https://bugzilla.gnome.org/show_bug.cgi?id=740675
2014-11-25 10:23:50 +01:00
Tim-Philipp Müller
9c5d53c7e3 docs: fix some gtk-doc warnings
Deprecated entities found in documentation for xyz:Long_description
.
2014-11-15 23:13:42 +00:00
Andreas Frisch
bae96c85ee subtitleoverlay: return available factory CAPS instead of ANY on CAPS query
https://bugzilla.gnome.org/show_bug.cgi?id=739536
2014-11-03 08:20:13 +01:00
Sebastian Dröge
8b8b8ae2e8 Revert "decodebin: fix the autoplugging of parser elements"
This reverts commit 2b0d392741.

This breaks cases where an actual second parser is required after the parser,
e.g. to do timestamp corrections.

See https://bugzilla.gnome.org/show_bug.cgi?id=738416
2014-10-26 11:04:47 +01:00
Sebastian Dröge
2da56de19f Revert "decodebin: Fix locking"
This reverts commit aa94d5dc9a.
2014-10-26 11:04:38 +01:00
Sebastian Dröge
aa94d5dc9a decodebin: Fix locking
The chain mutex needs to be locked when looking at chain->elements. Move code
around a bit to require only one lock() and unlock().
2014-10-21 13:32:19 +02:00
Sreerenj Balachandran
2b0d392741 decodebin: fix the autoplugging of parser elements
If there are two parser elements available for the same media format,
then decodebin is autoplugging an extra capsfilter and parser irrespective
of caps and rank. So restrict the decodebin from autoplugging multiple parser
elements back to back in adjacent positions with in a single DecodeChain
for the same media format.

https://bugzilla.gnome.org/show_bug.cgi?id=738416
2014-10-21 13:32:19 +02:00
Sreerenj Balachandran
a24db77217 decodebin: optimize the code a bit by avoiding unnecessary string comparisons
https://bugzilla.gnome.org/show_bug.cgi?id=738416
2014-10-21 11:05:53 +02:00
Sreerenj Balachandran
f60da86ae2 decodebin: Fix typo in comment
https://bugzilla.gnome.org/show_bug.cgi?id=738416
2014-10-21 11:05:53 +02:00
Heinrich Fink
4497b73806 playsink: Use correct property enum value for video-filter property installation 2014-10-10 12:14:57 +03:00
Andrei Sarakeev
a391dfe17f decodebin: Only emit the drain signal for the main decode chain, not any subchains
https://bugzilla.gnome.org/show_bug.cgi?id=738064
2014-10-07 14:48:54 +03:00
Sebastian Dröge
72eb84a900 decodebin: Free factories array when delaying autoplugging due to non-final caps 2014-10-06 10:15:13 +03:00
Aurélien Zanelli
796fd16550 decodebin: unref decode pad after usage
https://bugzilla.gnome.org/show_bug.cgi?id=737757
2014-10-06 09:53:39 +03:00
Andres Gomez
09872442f8 uridecodebin: Removed setting "iradio-mode" property in the source element
The "iradio-mode" property used to have a default FALSE value in HTTP
source elements but now it should default to TRUE or just do not exist
as a property so it is not really needed to set it any more in
uridecodebin.

Apart from that this code could've never worked as uridecodebin looks for a
string-typed iradio-mode property, but it's a boolean in all sources.

Fixes https://bugzilla.gnome.org/show_bug.cgi?id=725383
2014-10-02 09:50:48 +03:00
Andrei Sarakeev
2133a98eb1 playbin: Don't leak input-selector sinkpads
https://bugzilla.gnome.org/show_bug.cgi?id=736861
2014-09-18 12:52:02 +03:00
Sebastian Dröge
52e97f59ba playsink: Add audio/videoconvert in front of the audio/video-filters
audioresample and videoscale is something the application will have to do if
required, but we can at least help here by adding the
audioconvert/videoconvert elements.

https://bugzilla.gnome.org/show_bug.cgi?id=735748
2014-09-16 21:42:46 +03:00
Thiago Santos
3657929e1f decodebin: protect buffering message handling
Use the object lock to avoid concurrent processing which leads
to small disasters (assertions or crashes)
2014-09-11 17:16:18 -03:00
George Kiagiadakis
a2122f04ec playbin: filter out buffering messages when switching uri
When switching URI from about-to-finish, playbin starts decoding the new
URI and the queue2 inside uridecodebin starts emitting buffering messages
immediately. However, the queue(s) inside playsink still have buffers to
play and the pipeline doesn't need to pause for buffering, so we should
not send those buffering messages up to the application, otherwise there
is an audible glitch caused by pausing the pipeline for a very short time.

https://bugzilla.gnome.org/show_bug.cgi?id=727255
2014-09-05 12:44:27 -03:00
Sebastian Dröge
5cbefaa9a2 decodebin: Also include the raw caps in the error message, not just the human readable description 2014-09-02 15:37:38 +03:00
Sebastian Dröge
56899b596e decodebin: Include codec description for missing plugins in the error message
If we had plugins and an error occurred we only include the error message
caused by this, otherwise we will include the codec description as generated
from the caps.

This allows to detect which exact codec was missing instead of getting a
generic "no suitable decoders found" error message.
2014-09-02 13:00:48 +03:00
Sebastian Dröge
2434af3d31 playsinkconvertbin: setcaps() always returns TRUE and the return value is unused
Change it to a void return value. The caps are forwarded afterwards via
gst_pad_event_default() and not inside this function.

CID 1226477
2014-08-28 17:13:05 +03:00
Sebastian Dröge
a5cf0a4572 decodebin: Include information from the error messages of tried but failed elements in the missing plugin errors 2014-08-25 21:01:16 +03:00
Sebastian Dröge
22a138b716 decodebin: Initialize local variables for every retry 2014-08-25 21:01:16 +03:00
Sebastian Dröge
21e9f84486 decodebin: Remove error case that resulted in two error messages
We already send one in gst_decode_bin_expose() for this case. Only
if we're unable to typefind the caps another error message is needed.
2014-08-25 21:01:16 +03:00
Thiago Santos
98ed3ddc8f playsinkconvertbin: only intersect with the filter at the end
Otherwise we might change some capsfeatures from ANY to the specific
value from the filter and do not filter those out in case the
sink doesn't support them

https://bugzilla.gnome.org/show_bug.cgi?id=734822
2014-08-15 18:24:36 -03:00
Thiago Santos
14d79a3a47 decodebin: handle group switching for deadend group
Gracefully handle switching groups that all pads are deadend.

This can happen when quickly switching programs on mpegts as the
output is unaligned it can happen that not enough data was accumulated at
parsers to generate any buffers, causing the stream to receive EOS before
any data can be decoded.

To handle this scenario, the _expose function now also gets if there is
any next group to be exposed along with the list of endpads. If there are
no endpads and there is another group to expose it will switch to this next
group and then retry exposing the streams.

Also, the requirement to only switch from the chain that has the endpad had
to be modified to care for when the drainpad is NULL

https://bugzilla.gnome.org/show_bug.cgi?id=733169
2014-08-13 18:51:37 +03:00
Thiago Santos
9c09c8ae17 decodebin: consider all deadend pads as drained
Otherwise when switching out a group with a deadend pad it will block
as it would be waiting for EOS on a deadend that already got one

https://bugzilla.gnome.org/show_bug.cgi?id=733169
2014-08-13 18:51:37 +03:00
Sebastian Dröge
d280bba126 playsinkconvertbin: Make sure to intersect raw caps with our converter caps
Otherwise we end up allowing video/x-raw with arbitrary caps features that are
not handled by our converters.

https://bugzilla.gnome.org/show_bug.cgi?id=734683
2014-08-13 14:28:05 +03:00
Sebastian Dröge
59fb749ef6 decodebin: Remove buffering special casing for adaptive streaming demuxers
They output smaller buffers now and we should be able to handle the buffering
limits like in every other situation now.
2014-08-11 10:57:43 +02:00
Sebastian Dröge
a0a9fd004b playbin: Keep a reference to the playsink sinkpads
Otherwise playsink might get shut down without us noticing
that our pad references are gone now.

Probably fixes https://bugzilla.gnome.org/show_bug.cgi?id=733165
2014-08-01 15:00:46 +02:00
Mohammed Sameer
b34e0ba91c streamsynchronizer: don't unset DISCONT flag
Unsetting DISCONT flag means we need to copy the buffer. This copy operation
mandates that all GstMemory should be copy-able which is not always the case

https://bugzilla.gnome.org/show_bug.cgi?id=727409
2014-08-01 14:23:07 +02:00
Thiago Santos
cf50b45ff6 decodebin: add missing 'time' word to debug message
It prints the buffers, bytes and time limits, but 'time' was missing
from the string.
2014-07-29 15:55:27 -03:00
Sebastian Dröge
362e9a547b playbin: Pass through NO_PREROLL state change returns
Fixes playback of live pipelines.
2014-07-28 16:57:00 +02:00
Sebastian Dröge
f3f55e1758 uridecodebin: Pass through NO_PREROLL state change returns
Fixes playback of live pipelines.
2014-07-28 16:57:00 +02:00
Tim-Philipp Müller
1ed192abb0 playbin: fix 'attempt to unlock mutex that was not locked' in error code path
Fixes playbin unit test with latest GLib.
2014-07-26 14:52:01 +01:00
Sebastian Dröge
f173fa15b1 decodebin: Don't unref caps for which we don't own a reference... get one first
https://bugzilla.gnome.org/show_bug.cgi?id=733615
2014-07-23 19:51:36 +02:00
Sebastian Dröge
73646bd04f playbin: Go asynchronously from READY to PAUSED
We now add all our elements to uridecodebin *after*
GstBin::change_state(READY->PAUSED), so we need to post async-start
and async-done messages ourselves if we want to work async.

https://bugzilla.gnome.org/show_bug.cgi?id=733495
2014-07-23 12:46:48 +02:00
Sebastian Dröge
5c038192e2 uridecodebin: Go asynchronously from READY to PAUSED
We now add all our elements to uridecodebin *after*
GstBin::change_state(READY->PAUSED), so we need to post async-start
and async-done messages ourselves if we want to work async.

https://bugzilla.gnome.org/show_bug.cgi?id=733495
2014-07-23 12:46:48 +02:00