Skip to main content

SdpMediaSection

Struct SdpMediaSection 

Source
pub struct SdpMediaSection { /* private fields */ }
Expand description

One m= section of an SDP offer, whatever its port or media type.

Sections that contribute nothing to a codec string are retained all the same: a port-0 section is the offer’s held or declined stream and is exactly what a reader needs when a call has no audio. is_negotiable separates the two.

Implementations§

Source§

impl SdpMediaSection

Source

pub fn media_type(&self) -> &SdpMediaType

The media type from the m= line.

Source

pub fn port(&self) -> u16

The transport port; 0 means the peer declined or held this stream.

Source

pub fn proto(&self) -> &str

The transport protocol from the m= line, verbatim.

Source

pub fn formats(&self) -> &str

The m= format list, verbatim — the only content a non-RTP section carries.

Source

pub fn direction(&self) -> SdpDirection

The direction the peer wrote, defaulting to the session’s.

Sofia forces a port-0 section to inactive regardless, so on a held section this is what was offered, not what the switch acted on.

Source

pub fn entries(&self) -> &[SdpCodecEntry]

Codec entries in m= format-list order.

Source

pub fn unmapped(&self) -> &[UnmappedPayload]

Payload types this section named that could not be resolved to a codec.

Source

pub fn non_codec_payloads(&self) -> &[NonCodecPayload]

Payloads the switch negotiates outside the codec string, in format-list order.

Not deduplicated. See NonCodecPayload for what the switch itself retains.

Source

pub fn is_negotiable(&self) -> bool

Whether this section feeds the codec string and the top-level views.

Trait Implementations§

Source§

impl Clone for SdpMediaSection

Source§

fn clone(&self) -> Self

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

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

Performs copy-assignment from source. Read more
Source§

impl Debug for SdpMediaSection

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, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. 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 = !

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

fn try_from(value: U) -> Result<T, !>

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.