#[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
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
impl ConsumerOptions
Sourcepub fn new(producer_id: ProducerId, rtp_capabilities: RtpCapabilities) -> Self
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
impl Clone for ConsumerOptions
Source§fn clone(&self) -> ConsumerOptions
fn clone(&self) -> ConsumerOptions
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read more