Commit graph

224 commits

Author SHA1 Message Date
Sebastian Dröge
2e13e4ce73 fallbacksrc: Mark internal source property for custom sources as write/construct-only
It's only used during construction of the internal bin after all.
Keeping it readable would cause e.g. creating a pipeline graph trying to
read it, which is not implemented.
2020-06-25 13:47:45 +03:00
François Laignel
e40267e95d event,message,query: update instantiation
See https://gitlab.freedesktop.org/gstreamer/gstreamer-rs/-/merge_requests/532
2020-06-25 11:26:32 +02:00
Sebastian Dröge
fe274ac6e7 fallbacksrc: Use new proxy_pad_chain_function() support when building pads
Less unsafe code.
2020-06-23 10:01:27 +03:00
Sebastian Dröge
9bb3e75fb9 Update to use the new pad builders for safely setting pad functions
Only two uses of unsafely setting the pad functions is left:
- fallbacksrc for overriding the chain function of the proxy pad of a
  ghost pad
- threadshare for overriding the pad functions after creationg, which
  probably needs some fixing at some point
2020-06-22 11:28:19 +03:00
Sebastian Dröge
60321edb8c Update for new_with_XXX/new_from_XXX function renaming 2020-06-16 11:56:48 +03:00
Guillaume Desmottes
e85799b9d6 use new constructor names 2020-06-11 13:07:01 +02:00
Sebastian Dröge
b3138ad041 utils/fallbacksrc: Schedule another timeout after the last buffering activity
If we switch to the fallback stream but the last buffering activity was
less than $timeout ago, we shouldn't restart the source yet but wait a
bit longer. However for that we actually need to schedule another
timeout, which was not happening before.

Fixes https://gitlab.freedesktop.org/gstreamer/gst-plugins-rs/-/issues/116
2020-05-21 11:45:28 +03:00
Sebastian Dröge
621907556d utils/fallbacksrc: Don't error out if we just reached 100% buffering when the timeout triggered
It will take a moment for the fallbackswitch to actually switch to the
main stream. So instead take into account the time since the last
buffering update even when we reached 100%, and don't reset that time
when reaching 100%.
2020-05-20 12:44:28 +03:00
Sebastian Dröge
ba161a146d utils/fallbacksrc: Set use-buffering=true on uridecodebin3 to actually get network buffering 2020-05-20 12:42:42 +03:00
Sebastian Dröge
c91e480f09 utils/fallbacksrc: Block all currently unblocked pads when receiving the stream collection
It might be a second stream collection that we receive at a later time,
and the previous pads would already be unblocked at that point. So block
all currently unblocked pads again and then adjust the offset
according to the new situation.

This fixes playback of various RTMP streams where usually we first get a
stream collection with only one of the two streams, and shortly
afterwards with both streams.
2020-05-20 12:13:25 +03:00
Sebastian Dröge
d50abd74a1 utils/fallbacksrc: Try unblocking pads if a pad was removed
Maybe now all pads we're waiting for were already removed or are ready.
2020-05-20 12:13:25 +03:00
Sebastian Dröge
026bbde403 utils/fallbacksrc: Also handle gap events like buffers for blocking pads 2020-05-20 12:13:25 +03:00
Sebastian Dröge
09c30d73f1 utils/fallbacksrc: Use StreamsSelected message instead of StreamCollection
We don't do any selection ourselves yet so work based on the selection
that uridecodebin does for us.
2020-05-20 12:13:25 +03:00
Sebastian Dröge
ed3ef5f741 utils/fallbacksrc: Add "source" property that allows to directly provide a source element
This works as an alternative to the "uri" property, which would use an
`uridecodebin3` element.

The provided source element can have static audio/video pads or provide
them as sometimes pad while signalling no-more-pads or a stream
collection message once all pads are available.
2020-05-20 07:24:57 +00:00
Sebastian Dröge
d4e9a56e54 fallbackswitch/fallbacksrc: Ignore errors when shutting down the source 2020-05-08 13:56:50 +03:00
Sebastian Dröge
b180517b29 fallbackswitch/fallbackswitch: Don't convert buffer PTS/DTS twice to running time
They were already converted to the running time a few lines above and
updated inside the buffer. Converting another time for the timeout
causes the timeout to happen at the wrong time, usually much later than
it should.
2020-05-08 13:56:50 +03:00
Sebastian Dröge
2019cdb8cb fallbackswitch: Clean up 1.18 aggregator compat code 2020-04-24 14:37:43 +03:00
Sebastian Dröge
a63991e325 fallbackswitch: Add fallbacksource element that automatically retries playback of an URI
This is a wrapper around uridecodebin3 and fallbackswitch that allows to
switch to a still frame on errors and automatically retries the source
in the background on errors until a given retry timeout is reached.
2020-04-24 14:12:01 +03:00
Sebastian Dröge
5a7fcfad7f Fix various new clippy warnings with clippy 1.43 2020-04-24 13:55:01 +03:00
Guillaume Desmottes
bdb0e72cc7 fix LGPL-2.1+ license in Cargo.toml
The proper SPDX name is LGPL-2.1-or-later, see https://spdx.org/licenses/
2020-04-16 13:07:21 +02:00
Sebastian Dröge
ccdb704ca8 fallbackswitch: Update aggregator and aggregator bindings from gstreamer git master 2020-04-08 15:39:35 +03:00
Sebastian Dröge
f6120fcf98 fallbackswitch: Switch from lazy_static to once_cell 2020-04-08 15:39:35 +03:00
Sebastian Dröge
4206b53c09 Mark GMutex mutex guards as #[must_use]
See gstreamer-rs commit b21f5764309f9f65666016a9069e1b938935e6f2
2020-04-08 15:24:07 +03:00
Arun Raghavan
dc3c8fd049 Drop gst-plugin- prefix in plugin directory name 2020-04-05 19:10:47 +00:00