[−][src]Enum mediasoup::producer::Producer
A producer represents an audio or video source being injected into a mediasoup router. It's created on top of a transport that defines how the media packets are carried.
Variants (Non-exhaustive)
Regular(RegularProducer)
Producer created on transport other than
DirectTransport
.
Direct(DirectProducer)
Producer created on DirectTransport
.
Implementations
impl Producer
[src]
pub fn id(&self) -> ProducerId
[src]
Producer identifier.
pub fn kind(&self) -> MediaKind
[src]
Media kind.
pub fn rtp_parameters(&self) -> &RtpParameters
[src]
Producer RTP parameters.
Notes on usage
Check the RTP Parameters and Capabilities section for more details (TypeScript-oriented, but concepts apply here as well).
pub fn type(&self) -> ProducerType
[src]
Producer type.
pub fn paused(&self) -> bool
[src]
Whether the Producer is paused.
pub fn score(&self) -> Vec<ProducerScore>
[src]
The score of each RTP stream being received, representing their transmission quality.
pub fn app_data(&self) -> &AppData
[src]
Custom application data.
pub fn closed(&self) -> bool
[src]
Whether the producer is closed.
pub async fn get_stats(&self) -> Result<Vec<ProducerStat>, RequestError>
[src]
Returns current RTC statistics of the producer.
Check the RTC Statistics section for more details (TypeScript-oriented, but concepts apply here as well).
pub async fn pause(&self) -> Result<(), RequestError>
[src]
Pauses the producer (no RTP is sent to its associated consumers). Calls
Consumer::on_producer_pause
callback on
all its associated consumers.
pub async fn resume(&self) -> Result<(), RequestError>
[src]
Resumes the producer (no RTP is sent to its associated consumers). Calls
Consumer::on_producer_resume
callback on
all its associated consumers.
pub async fn enable_trace_event(
&self,
types: Vec<ProducerTraceEventType>
) -> Result<(), RequestError>
[src]
&self,
types: Vec<ProducerTraceEventType>
) -> Result<(), RequestError>
Instructs the procuer to emit "trace" events. For monitoring purposes. Use with caution.
pub fn on_score<F: Fn(&Vec<ProducerScore>) + Send + Sync + 'static>(
&self,
callback: F
) -> HandlerId
[src]
&self,
callback: F
) -> HandlerId
Callback is called when the producer score changes.
pub fn on_video_orientation_change<F: Fn(ProducerVideoOrientation) + Send + Sync + 'static>(
&self,
callback: F
) -> HandlerId
[src]
&self,
callback: F
) -> HandlerId
Callback is called when the video orientation changes. This is just possible if the
urn:3gpp:video-orientation
RTP extension has been negotiated in the producer RTP
parameters.
pub fn on_pause<F: Fn() + Send + Sync + 'static>(
&self,
callback: F
) -> HandlerId
[src]
&self,
callback: F
) -> HandlerId
Callback is called when the producer is paused.
pub fn on_resume<F: Fn() + Send + Sync + 'static>(
&self,
callback: F
) -> HandlerId
[src]
&self,
callback: F
) -> HandlerId
Callback is called when the producer is resumed.
pub fn on_trace<F: Fn(&ProducerTraceEventData) + Send + Sync + 'static>(
&self,
callback: F
) -> HandlerId
[src]
&self,
callback: F
) -> HandlerId
See Producer::enable_trace_event
method.
pub fn on_transport_close<F: FnOnce() + Send + 'static>(
&self,
callback: F
) -> HandlerId
[src]
&self,
callback: F
) -> HandlerId
Callback is called when the transport this producer belongs to is closed for whatever
reason. The producer itself is also closed. A on_producer_close
callback is called on all
its associated consumers.
pub fn on_close<F: FnOnce() + Send + 'static>(&self, callback: F) -> HandlerId
[src]
Callback is called when the producer is closed for whatever reason.
pub fn downgrade(&self) -> WeakProducer
[src]
Downgrade Producer
to WeakProducer
instance.
Trait Implementations
impl Clone for Producer
[src]
impl From<DirectProducer> for Producer
[src]
pub fn from(producer: DirectProducer) -> Self
[src]
impl From<RegularProducer> for Producer
[src]
pub fn from(producer: RegularProducer) -> Self
[src]
Auto Trait Implementations
impl !RefUnwindSafe for Producer
[src]
impl Send for Producer
[src]
impl Sync for Producer
[src]
impl Unpin for Producer
[src]
impl !UnwindSafe for Producer
[src]
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
pub fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T> ToOwned for T where
T: Clone,
[src]
T: Clone,
type Owned = T
The resulting type after obtaining ownership.
pub fn to_owned(&self) -> T
[src]
pub fn clone_into(&self, target: &mut T)
[src]
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
pub fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,
type Error = <U as TryFrom<T>>::Error
The type returned in the event of a conversion error.
pub fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>
[src]
impl<V, T> VZip<V> for T where
V: MultiLane<T>,
V: MultiLane<T>,