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> ...
media_title: Option<Information>
i=<session description>
connection_information: Option<ConnectionInformation>
c=<nettype> <addrtype> <connection-address>
bandwidth: Vec<Bandwidth>
b=<bwtype>:<bandwidth>
encryption_key: Option<EncryptionKey>
§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.
Implementations§
source§impl MediaDescription
impl MediaDescription
sourcepub fn attribute(&self, key: &str) -> Option<Option<&str>>
pub fn attribute(&self, key: &str) -> Option<Option<&str>>
attribute returns the value of an attribute and if it exists
sourcepub fn new_jsep_media_description(
codec_type: String,
_codec_prefs: Vec<&str>
) -> Self
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.
sourcepub fn with_property_attribute(self, key: String) -> Self
pub fn with_property_attribute(self, key: String) -> Self
with_property_attribute adds a property attribute ‘a=key’ to the media description
sourcepub fn with_value_attribute(self, key: String, value: String) -> Self
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
sourcepub fn with_fingerprint(self, algorithm: String, value: String) -> Self
pub fn with_fingerprint(self, algorithm: String, value: String) -> Self
with_fingerprint adds a fingerprint to the media description
sourcepub fn with_ice_credentials(self, username: String, password: String) -> Self
pub fn with_ice_credentials(self, username: String, password: String) -> Self
with_ice_credentials adds ICE credentials to the media description
sourcepub fn with_codec(
self,
payload_type: u8,
name: String,
clockrate: u32,
channels: u16,
fmtp: String
) -> Self
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
sourcepub fn with_media_source(
self,
ssrc: u32,
cname: String,
stream_label: String,
label: String
) -> Self
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
sourcepub fn with_candidate(self, value: String) -> Self
pub fn with_candidate(self, value: String) -> Self
with_candidate adds an ICE candidate to the media description Deprecated: use WithICECandidate instead
pub fn with_extmap(self, e: ExtMap) -> Self
sourcepub fn with_transport_cc_extmap(self) -> Self
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
impl Clone for MediaDescription
source§fn clone(&self) -> MediaDescription
fn clone(&self) -> MediaDescription
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read more