mirror of
https://gitlab.freedesktop.org/gstreamer/gst-plugins-rs.git
synced 2025-02-16 21:05:15 +00:00
fallbacksrc: Create an identity sync=true
if the new clocksync
element can't be found
This commit is contained in:
parent
2e13e4ce73
commit
392bfc0b1e
1 changed files with 15 additions and 2 deletions
|
@ -599,7 +599,14 @@ impl FallbackSrc {
|
||||||
gst::ElementFactory::make("imagefreeze", Some("fallback_imagefreeze"))
|
gst::ElementFactory::make("imagefreeze", Some("fallback_imagefreeze"))
|
||||||
.expect("No imagefreeze found");
|
.expect("No imagefreeze found");
|
||||||
let clocksync = gst::ElementFactory::make("clocksync", Some("fallback_clocksync"))
|
let clocksync = gst::ElementFactory::make("clocksync", Some("fallback_clocksync"))
|
||||||
.expect("No clocksync found");
|
.or_else(|_| -> Result<_, glib::BoolError> {
|
||||||
|
let identity =
|
||||||
|
gst::ElementFactory::make("identity", Some("fallback_clocksync"))?;
|
||||||
|
identity.set_property("sync", &true).unwrap();
|
||||||
|
Ok(identity)
|
||||||
|
})
|
||||||
|
.expect("No clocksync or identity found");
|
||||||
|
|
||||||
input
|
input
|
||||||
.add_many(&[
|
.add_many(&[
|
||||||
&filesrc,
|
&filesrc,
|
||||||
|
@ -753,7 +760,13 @@ impl FallbackSrc {
|
||||||
|
|
||||||
let switch =
|
let switch =
|
||||||
gst::ElementFactory::make("fallbackswitch", None).expect("No fallbackswitch found");
|
gst::ElementFactory::make("fallbackswitch", None).expect("No fallbackswitch found");
|
||||||
let clocksync = gst::ElementFactory::make("clocksync", None).expect("No clocksync found");
|
let clocksync = gst::ElementFactory::make("clocksync", None)
|
||||||
|
.or_else(|_| -> Result<_, glib::BoolError> {
|
||||||
|
let identity = gst::ElementFactory::make("identity", None)?;
|
||||||
|
identity.set_property("sync", &true).unwrap();
|
||||||
|
Ok(identity)
|
||||||
|
})
|
||||||
|
.expect("No clocksync or identity found");
|
||||||
|
|
||||||
element
|
element
|
||||||
.add_many(&[&fallback_input, &switch, &clocksync])
|
.add_many(&[&fallback_input, &switch, &clocksync])
|
||||||
|
|
Loading…
Reference in a new issue