Struct sdp::description::media::MediaDescription

source ·
pub struct MediaDescription {
    pub media_name: MediaName,
    pub media_title: Option<Information>,
    pub connection_information: Option<ConnectionInformation>,
    pub bandwidth: Vec<Bandwidth>,
    pub encryption_key: Option<EncryptionKey>,
    pub attributes: Vec<Attribute>,
}
Expand description

MediaDescription represents a media type. https://tools.ietf.org/html/rfc4566#section-5.14

Fields§

§media_name: MediaName

m=<media> <port>/<number of ports> <proto> <fmt> ...

https://tools.ietf.org/html/rfc4566#section-5.14

§media_title: Option<Information>§connection_information: Option<ConnectionInformation>

c=<nettype> <addrtype> <connection-address>

https://tools.ietf.org/html/rfc4566#section-5.7

§bandwidth: Vec<Bandwidth>§encryption_key: Option<EncryptionKey>

k=<method>

k=<method>:<encryption key>

https://tools.ietf.org/html/rfc4566#section-5.12

§attributes: Vec<Attribute>

Attributes are the primary means for extending SDP. Attributes may be defined to be used as “session-level” attributes, “media-level” attributes, or both.

https://tools.ietf.org/html/rfc4566#section-5.12

Implementations§

source§

impl MediaDescription

source

pub fn attribute(&self, key: &str) -> Option<Option<&str>>

attribute returns the value of an attribute and if it exists

source

pub fn new_jsep_media_description( codec_type: String, _codec_prefs: Vec<&str> ) -> Self

new_jsep_media_description creates a new MediaName with some settings that are required by the JSEP spec.

source

pub fn with_property_attribute(self, key: String) -> Self

with_property_attribute adds a property attribute ‘a=key’ to the media description

source

pub fn with_value_attribute(self, key: String, value: String) -> Self

with_value_attribute adds a value attribute ‘a=key:value’ to the media description

source

pub fn with_fingerprint(self, algorithm: String, value: String) -> Self

with_fingerprint adds a fingerprint to the media description

source

pub fn with_ice_credentials(self, username: String, password: String) -> Self

with_ice_credentials adds ICE credentials to the media description

source

pub fn with_codec( self, payload_type: u8, name: String, clockrate: u32, channels: u16, fmtp: String ) -> Self

with_codec adds codec information to the media description

source

pub fn with_media_source( self, ssrc: u32, cname: String, stream_label: String, label: String ) -> Self

with_media_source adds media source information to the media description

source

pub fn with_candidate(self, value: String) -> Self

with_candidate adds an ICE candidate to the media description Deprecated: use WithICECandidate instead

source

pub fn with_extmap(self, e: ExtMap) -> Self

source

pub fn with_transport_cc_extmap(self) -> Self

with_transport_cc_extmap adds an extmap to the media description

Trait Implementations§

source§

impl Clone for MediaDescription

source§

fn clone(&self) -> MediaDescription

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 MediaDescription

source§

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

Formats the value using the given formatter. Read more
source§

impl Default for MediaDescription

source§

fn default() -> MediaDescription

Returns the “default value” for a type. 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> 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,

§

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>,

§

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>,

§

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.
source§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

source§

fn vzip(self) -> V