pub struct StreamProducer { /* private fields */ }Expand description
The interface for transporting media data from one node to another.
A producer is essentially a GStreamer appsink whose output
is sent to a set of consumers, who are essentially appsrc wrappers
Implementations§
source§impl StreamProducer
impl StreamProducer
sourcepub fn configure_consumer(consumer: &AppSrc)
pub fn configure_consumer(consumer: &AppSrc)
Configure a consumer appsrc for later use in a StreamProducer
This is automatically called when calling add_consumer().
sourcepub fn add_consumer(
&self,
consumer: &AppSrc,
) -> Result<ConsumptionLink, AddConsumerError>
pub fn add_consumer( &self, consumer: &AppSrc, ) -> Result<ConsumptionLink, AddConsumerError>
Add an appsrc to dispatch data to.
Dropping the returned ConsumptionLink will automatically disconnect the consumer from the producer.
sourcepub fn remove_consumer(&self, consumer: &AppSrc)
pub fn remove_consumer(&self, consumer: &AppSrc)
Remove a consumer appsrc by id
sourcepub fn set_forward_events(
&self,
events_to_forward: impl IntoIterator<Item = EventType>,
)
pub fn set_forward_events( &self, events_to_forward: impl IntoIterator<Item = EventType>, )
configure event types the appsink should forward to all its consumers (default: Eos).
sourcepub fn set_forward_preroll(&self, forward_preroll: bool)
pub fn set_forward_preroll(&self, forward_preroll: bool)
configure whether the preroll sample should be forwarded (default: true)
sourcepub fn last_sample(&self) -> Option<Sample>
pub fn last_sample(&self) -> Option<Sample>
The last sample produced by this producer.
Trait Implementations§
source§impl Clone for StreamProducer
impl Clone for StreamProducer
source§fn clone(&self) -> StreamProducer
fn clone(&self) -> StreamProducer
Returns a copy of the value. Read more
1.6.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moresource§impl Debug for StreamProducer
impl Debug for StreamProducer
source§impl<'a> From<&'a AppSink> for StreamProducer
impl<'a> From<&'a AppSink> for StreamProducer
source§impl PartialEq for StreamProducer
impl PartialEq for StreamProducer
impl Eq for StreamProducer
Auto Trait Implementations§
impl Freeze for StreamProducer
impl RefUnwindSafe for StreamProducer
impl Send for StreamProducer
impl Sync for StreamProducer
impl Unpin for StreamProducer
impl UnwindSafe for StreamProducer
Blanket Implementations§
source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
source§unsafe fn clone_to_uninit(&self, dst: *mut T)
unsafe fn clone_to_uninit(&self, dst: *mut T)
🔬This is a nightly-only experimental API. (
clone_to_uninit)source§impl<T> IntoEither for T
impl<T> IntoEither for T
source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moresource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more