mediasoup::consumer

Struct ConsumerOptions

Source
#[non_exhaustive]
pub struct ConsumerOptions { pub producer_id: ProducerId, pub rtp_capabilities: RtpCapabilities, pub paused: bool, pub mid: Option<String>, pub preferred_layers: Option<ConsumerLayers>, pub enable_rtx: Option<bool>, pub ignore_dtx: bool, pub pipe: bool, pub app_data: AppData, }
Expand description

Consumer options.

Fields (Non-exhaustive)§

This struct is marked as non-exhaustive
Non-exhaustive structs could have additional fields added in future. Therefore, non-exhaustive structs cannot be constructed in external crates using the traditional Struct { .. } syntax; cannot be matched against without a wildcard ..; and struct update syntax will not work.
§producer_id: ProducerId

The id of the Producer to consume.

§rtp_capabilities: RtpCapabilities

RTP capabilities of the consuming endpoint.

§paused: bool

Whether the Consumer must start in paused mode. Default false.

When creating a video Consumer, it’s recommended to set paused to true, then transmit the Consumer parameters to the consuming endpoint and, once the consuming endpoint has created its local side Consumer, unpause the server side Consumer using the resume() method. This is an optimization to make it possible for the consuming endpoint to render the video as far as possible. If the server side Consumer was created with paused: false, mediasoup will immediately request a key frame to the remote Producer and such a key frame may reach the consuming endpoint even before it’s ready to consume it, generating “black” video until the device requests a keyframe by itself.

§mid: Option<String>

The MID for the Consumer. If not specified, a sequentially growing number will be assigned.

§preferred_layers: Option<ConsumerLayers>

Preferred spatial and temporal layer for simulcast or SVC media sources. If None, the highest ones are selected.

§enable_rtx: Option<bool>

Whether this Consumer should enable RTP retransmissions, storing sent RTP and processing the incoming RTCP NACK from the remote Consumer. If not set it’s true by default for video codecs and false for audio codecs. If set to true, NACK will be enabled if both endpoints (mediasoup and the remote Consumer) support NACK for this codec. When it comes to audio codecs, just OPUS supports NACK.

§ignore_dtx: bool

Whether this Consumer should ignore DTX packets (only valid for Opus codec). If set, DTX packets are not forwarded to the remote Consumer.

§pipe: bool

Whether this Consumer should consume all RTP streams generated by the Producer.

§app_data: AppData

Custom application data.

Implementations§

Source§

impl ConsumerOptions

Source

pub fn new(producer_id: ProducerId, rtp_capabilities: RtpCapabilities) -> Self

Create consumer options with given producer ID and RTP capabilities.

Trait Implementations§

Source§

impl Clone for ConsumerOptions

Source§

fn clone(&self) -> ConsumerOptions

Returns a copy of the value. Read more
1.0.0 · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for ConsumerOptions

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dst: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dst. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.