pub struct MediaFormat {
media_kind: MediaKind,
codec: MediaCodec,
payload_type: PayloadType,
clock_rate: u32,
channels: Option<u16>,
settings: Vec<CodecSetting>,
rtcp_feedback: Vec<RtcpFeedback>,
}Expand description
Negotiated codec format for a concrete media stream.
Unlike a capability, a format has a fixed payload_type that matches the
actual value expected in the RTP packets on the wire.
Fields§
§media_kind: MediaKind§codec: MediaCodec§payload_type: PayloadType§clock_rate: u32§channels: Option<u16>§settings: Vec<CodecSetting>§rtcp_feedback: Vec<RtcpFeedback>Implementations§
Source§impl MediaFormat
impl MediaFormat
pub fn new( media_kind: MediaKind, codec: impl Into<MediaCodec>, payload_type: PayloadType, clock_rate: u32, ) -> Self
pub fn with_channels(self, channels: u16) -> Self
pub fn with_setting(self, setting: CodecSetting) -> Self
pub fn with_parameter( self, name: impl Into<String>, value: impl Into<String>, ) -> Self
pub fn with_rtcp_feedback(self, feedback: RtcpFeedback) -> Self
pub fn media_kind(&self) -> MediaKind
pub fn codec(&self) -> &MediaCodec
pub fn codec_name(&self) -> &str
pub fn payload_type_id(&self) -> PayloadType
pub fn payload_type(&self) -> u8
pub fn clock_rate(&self) -> u32
pub fn channels(&self) -> Option<u16>
pub fn settings(&self) -> impl Iterator<Item = &CodecSetting>
pub fn parameters(&self) -> impl Iterator<Item = (String, String)> + '_
pub fn rtcp_feedback(&self) -> impl Iterator<Item = &RtcpFeedback>
pub fn rtx_associated_payload_type_id(&self) -> Option<PayloadType>
pub fn rtx_associated_payload_type(&self) -> Option<u8>
Trait Implementations§
Source§impl Clone for MediaFormat
impl Clone for MediaFormat
Source§fn clone(&self) -> MediaFormat
fn clone(&self) -> MediaFormat
Returns a duplicate of the value. Read more
1.0.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 MediaFormat
impl Debug for MediaFormat
Source§impl PartialEq for MediaFormat
impl PartialEq for MediaFormat
impl Eq for MediaFormat
impl StructuralPartialEq for MediaFormat
Auto Trait Implementations§
impl Freeze for MediaFormat
impl RefUnwindSafe for MediaFormat
impl Send for MediaFormat
impl Sync for MediaFormat
impl Unpin for MediaFormat
impl UnsafeUnpin for MediaFormat
impl UnwindSafe for MediaFormat
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