mirror of
https://gitlab.freedesktop.org/gstreamer/gst-plugins-rs.git
synced 2024-11-26 13:31:00 +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"))
|
||||
.expect("No imagefreeze found");
|
||||
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
|
||||
.add_many(&[
|
||||
&filesrc,
|
||||
|
@ -753,7 +760,13 @@ impl FallbackSrc {
|
|||
|
||||
let switch =
|
||||
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
|
||||
.add_many(&[&fallback_input, &switch, &clocksync])
|
||||
|
|
Loading…
Reference in a new issue