mirror of
https://gitlab.freedesktop.org/gstreamer/gst-plugins-rs.git
synced 2024-05-19 00:38:20 +00:00
bd2ff494c7
fallbackswitch now supports multiple sink pads, and on a timeout of the active pad, it will automatically switch to the next lowest priority pad that has data available. fallbackswitch sink pads follow the `sink_%u` template and have `priority` as a pad property. Co-authored-by: Vivia Nikolaidou <vivia.nikolaidou@ltnglobal.com>
38 lines
1.3 KiB
Rust
38 lines
1.3 KiB
Rust
// Copyright (C) 2020 Sebastian Dröge <sebastian@centricular.com>
|
|
// Copyright (C) 2021 Jan Schmidt <jan@centricular.com>
|
|
// Copyright (C) 2020 Mathieu Duponchelle <mathieu@centricular.com>
|
|
// Copyright (C) 2022 Vivia Nikolaidou <vivia.nikolaidou@ltnglobal.com>
|
|
//
|
|
// This Source Code Form is subject to the terms of the Mozilla Public License, v2.0.
|
|
// If a copy of the MPL was not distributed with this file, You can obtain one at
|
|
// <https://mozilla.org/MPL/2.0/>.
|
|
//
|
|
// SPDX-License-Identifier: MPL-2.0
|
|
|
|
use gst::glib;
|
|
use gst::prelude::*;
|
|
|
|
mod imp;
|
|
|
|
// The public Rust wrapper type for our element
|
|
glib::wrapper! {
|
|
pub struct FallbackSwitch(ObjectSubclass<imp::FallbackSwitch>) @extends gst::Element, gst::Object, @implements gst::ChildProxy;
|
|
}
|
|
|
|
// The public Rust wrapper type for our sink pad
|
|
glib::wrapper! {
|
|
pub struct FallbackSwitchSinkPad(ObjectSubclass<imp::FallbackSwitchSinkPad>) @extends gst::Pad, gst::Object;
|
|
}
|
|
|
|
// Registers the type for our element, and then registers in GStreamer under
|
|
// the name "fallbackswitch" for being able to instantiate it via e.g.
|
|
// gst::ElementFactory::make().
|
|
pub fn register(plugin: &gst::Plugin) -> Result<(), glib::BoolError> {
|
|
gst::Element::register(
|
|
Some(plugin),
|
|
"fallbackswitch",
|
|
gst::Rank::None,
|
|
FallbackSwitch::static_type(),
|
|
)
|
|
}
|