mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer-rs.git
synced 2024-11-22 09:31:06 +00:00
utils: streamproducer: Add new ConsumptionLink::disconnected()
constructor
This allows constructing a new consumption link from an `appsrc` without having it connected from the very beginning. Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer-rs/-/merge_requests/1189>
This commit is contained in:
parent
dd284a80ea
commit
0a6ed3c717
1 changed files with 11 additions and 0 deletions
|
@ -53,6 +53,17 @@ pub struct ConsumptionLink {
|
|||
}
|
||||
|
||||
impl ConsumptionLink {
|
||||
/// Create a new disconnected `ConsumptionLink`.
|
||||
pub fn disconnected(consumer: gst_app::AppSrc) -> ConsumptionLink {
|
||||
ConsumptionLink {
|
||||
consumer,
|
||||
producer: None,
|
||||
dropped: Arc::new(atomic::AtomicU64::new(0)),
|
||||
pushed: Arc::new(atomic::AtomicU64::new(0)),
|
||||
discard: Arc::new(atomic::AtomicBool::new(false)),
|
||||
}
|
||||
}
|
||||
|
||||
/// Replace the producer by a new one, keeping the existing consumer.
|
||||
pub fn change_producer(
|
||||
&mut self,
|
||||
|
|
Loading…
Reference in a new issue