Set the target state of the newly added uridecodebins to somthing else that
PAUSED so that we keep their state in sync with the playsink state.
Fixes#585268
uridecodebin expects the passed connection-speed value in kbps, so we
need to divide the value stored in bps by 1000. Also, lower the upper
limit on the properties to the value that we can actually store in our
internal guint (which is plenty high enough)
When we are probing for streams, we want to set the queue size in such a way
that we can scan a maximum amount of data without consuming too much memory.
Therefore, remove the time limit on the queue and only stop scanning after 2MB
of data.
See #584104.
Recognise PGS subpicture streams and connect them to the SPU pad
in playsink. Unfortunately this fails badly with negotiation errors
if the SPU is not recent enough to support the stream. I'm not sure
how to add format negotiation in yet.
When using an audio sink without a "volume" property, volume control
would only work for the first song. For the next song, we'd try to
re-use the existing audio chain, but inadvertently set chain->volume
to NULL instead of to the existing volume element.
playbin2 inadvertently used autoaudiosink and autovideosink up to now,
since it would overwrite the sinks configured via the "audio-sink"
and "video-sink" properties with the stream-specific group sinks when
configuring the outputs. Those are usually NULL however, so that would
overwrite the configured sinks with NULL which makes playbin2 then
default to the auto sinks. Fix this by keeping a reference to each
configured sink in playbin2 and setting up the right sinks depending
on whether there is a stream-specific sink or not.
Fixes#584020.
Use two flags to remember volume/mute changes at times when we don't have the
audiochain yet (e.g. construction). Only set values when they were actualy
changed. This makes pulseaudio's stream restore functional.
Add a queue2 after the raw output pads of certain sources such as those for uris
like cdda://
No tuning of the queue is done yet as the defaults seem to work fine for me.
Fixes#582528
Keep track of the autoplugged custom sinks and configure them in the playsink
element when we have collected all streams.
Also make sure that we only select one custom sink.
When unreffing the internal sink, we don't need to change the state to NULL.
Make playsink go async to the PAUSED state instead of relying on uridecodebin
for async behaviour in playbin. This solves some problems (mainly with DVD)
where the pipeline would go to PLAYING before preroll completed, failing to
select the audiosink clock.
Fixes#581727
The 2s limit is way too small for a lot of files (which have an interleave
in time of between 3 and 5s). Instead, leave it to the initial 5s value
and reduce the other limits (allowing us to stay memory-efficient).
First check the pad caps if they are raw before setting the raw_decoding_mode to
TRUE. Fixes playback of transport streams and other streams that require large
queues.
Fixes#579734
Clear the target of our ghostpads before we remove the pad from the element.
This to make sure that the internal pad is not left linked to whatever pad we
were ghosted to. This should only be a problem when we leak the ghostpads.
Also release our subpicture pads.
Fixes#577288.
Raw decoding mode removes almost all buffering in video and audio queues
when a source providing already decoded video/audio is detected, on the
possibly bogus assumption that such a source should provide sufficient
internal queueing. Fixes playback on some DVDs, and improves it
on all.
When reusing playbin with visualisations, reset the async property on the video
sink because some sinks might dynamically recreate their sinks.
Fixes#576188
When we have the textpad configured, enable and disable the subtitles by setting
the silent flag on the overlay element instead of trying to remove elements.
See #576187
Link after doing the state change and unlink before shutting down. Makes the
window for causing races in toggling the visualisations smaller.
See #576187.
Remove the group GCond that we used for waiting for groups to finish because we
use pad blocking on the selectors and counters instead for waiting for the
groups to complete.
remove the obsolete about_to_finish variable set while emiting the
about-to-finish signal and fix some old comments.
We don't need to take the playbin lock when querying the uridecodebin.
When we make a group connected to a demuxer, keep an extra dynamic refcount for
the group which is only decremented when no_more_pads or a multiqueue overrun is
detected. This way we avoid a race between exposing the group while more dynamic
refs are added from new pads.
Fixes#575588.
Sync the state of the newly added chains to the state of the parent sink element
to avoid lost async-start messages. Fixes cdda:// async-done message storm.
When streams are not selected in the selector, return NOT_LINKED so that
upstream elements can skip decoding. Only do this for audio and video pads
because for text streams the overhead is smaller and they could come from
external files.
Set the custom sink async=FALSE to not make it participate in preroll because we
are dealing with sparse streams.
Try to set sync=TRUE on the custom text sink.
Release the shutdown lock when we wait for other groups to complete or else we
have a deadlock when the other group completes and tries to grab the shutdown
lock.
Fixes#575550.
Add property to playbin2 to configure a custom sink that receives the raw
subtitle buffers instead of using a textoverlay.
Improve the property finding code to make it more usable.
Use property find code to find async properties in custom sinks that are bins.
Improve text overlay code to gracefully handle missing elements.
Disconnect the notify::caps signal in our callback (it'll be re-added
if we're not, in fact, finished getting complete caps). Ensures that
caps changes mid-stream (e.g. from an mp3 that changes from
stereo->mono mid-file) don't cause us to try to add a new pad.
Make it possible to request a flushing pad from the playsink. We can eventually
use these flushing pads to quickly terminate the dataflow when we are shutting
down.
Release the group lock while we perform the state changes on the uridecodebins
because that might trigger callbacks that we need to handle with the group lock
taken. Avoids a possible deadly embrace in some id3/flac files.
Fixes#567396.
Rather than only checking for volume property on the audio sink
directly, recursively look for it on sinks within it (if it's a bin).
Allows use of sink-as-volume-control where the application has supplied
an audio-sink bin that includes a real audio sink internally.
Don't keep extra references to volume and mute elements; we don't need
to do so.
Ensure we unref pads that we have references to, and release request
pads.