mirror of
https://gitlab.freedesktop.org/gstreamer/gst-plugins-rs.git
synced 2024-05-20 01:08:06 +00:00
e905299eba
This new plugin exposes two elements, intersink and intersrc. These act as wormholes for data in the same process and can be used to forward data from one pipeline to another. The implementation makes use of gstreamer-utils' StreamProducer, and supports dynamically adding and removing consumers, before and after producers, and changing producer names while PLAYING, both on the sink and the src. This initial implementation comes with a small demo, and a few tests. Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-rs/-/merge_requests/1257>
35 lines
838 B
Rust
35 lines
838 B
Rust
// SPDX-License-Identifier: MPL-2.0
|
|
|
|
use glib::prelude::*;
|
|
use gst::glib;
|
|
|
|
mod imp;
|
|
|
|
/**
|
|
* SECTION:element-intersrc
|
|
*
|
|
* #intersrc is an element that can be used to consume data from an #intersink.
|
|
*
|
|
* You can access the underlying appsrc element through the static name
|
|
* "appsrc".
|
|
*
|
|
* #intersrc should not reside in the same pipeline as the #intersink
|
|
* that it consumes from, here is an example of how to use those elements
|
|
* in separate pipelines:
|
|
*
|
|
* {{ generic/inter/examples/basic.rs }}
|
|
*/
|
|
|
|
glib::wrapper! {
|
|
pub struct InterSrc(ObjectSubclass<imp::InterSrc>) @extends gst::Bin, gst::Element, gst::Object;
|
|
}
|
|
|
|
pub fn register(plugin: &gst::Plugin) -> Result<(), glib::BoolError> {
|
|
gst::Element::register(
|
|
Some(plugin),
|
|
"intersrc",
|
|
gst::Rank::None,
|
|
InterSrc::static_type(),
|
|
)
|
|
}
|