pub struct Sdp {
pub ptr: *mut RawSdp,
}Expand description
An SDP session description.
Fields§
§ptr: *mut RawSdpImplementations§
Source§impl Sdp
impl Sdp
pub unsafe fn new(ptr: *mut RawSdp) -> Option<Self>
Sourcepub fn parse(offer: &CStr) -> Result<Self, SdpParseError>
pub fn parse(offer: &CStr) -> Result<Self, SdpParseError>
Parses an SDP offer string from a client into a structured SDP object.
Sourcepub fn get_payload_type(&self, codec_name: &CStr) -> Option<i32>
pub fn get_payload_type(&self, codec_name: &CStr) -> Option<i32>
Gets the payload type number for a codec in this SDP, or None if the codec isn’t present.
Sourcepub fn get_payload_type_full(
&self,
codec_name: &CStr,
profile: &CStr,
) -> Option<i32>
pub fn get_payload_type_full( &self, codec_name: &CStr, profile: &CStr, ) -> Option<i32>
Gets the payload type number for a codec and provided video profile in this SDP, or None if the codec isn’t present with the provided video profile.
Sourcepub fn add_attribute(&mut self, pt: i32, name: &CStr, contents: &CStr)
pub fn add_attribute(&mut self, pt: i32, name: &CStr, contents: &CStr)
Adds an attribute for the m-line with the given payload type.
Sourcepub fn rewrite_payload_type(&mut self, from: i32, to: i32)
pub fn rewrite_payload_type(&mut self, from: i32, to: i32)
Rewrites any references from one dynamically assigned payload type in this SDP to another dynamically assigned payload type.
Sourcepub fn get_mlines(&self) -> HashMap<MediaType, Vec<&mut RawMLine>>
pub fn get_mlines(&self) -> HashMap<MediaType, Vec<&mut RawMLine>>
Returns a map of all the SDP media lines per SDP media type.
Sourcepub fn to_glibstring(&self) -> GLibString
pub fn to_glibstring(&self) -> GLibString
Writes this SDP into an owned C-style string.
Trait Implementations§
Source§impl<'de> Deserialize<'de> for Sdp
impl<'de> Deserialize<'de> for Sdp
Source§fn deserialize<D>(deserializer: D) -> Result<Self, D::Error>where
D: Deserializer<'de>,
fn deserialize<D>(deserializer: D) -> Result<Self, D::Error>where
D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
impl Send for Sdp
Auto Trait Implementations§
impl Freeze for Sdp
impl RefUnwindSafe for Sdp
impl !Sync for Sdp
impl Unpin for Sdp
impl UnsafeUnpin for Sdp
impl UnwindSafe for Sdp
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