pub struct CodecNegotiation { /* private fields */ }
Expand description
Selects a codec and a set of capabilities for that codec, based on a preferential list of partially-defined codec capabilities, using each codec’s support to find best compatable matching capability. Currently supports SBC and AAC codec capabilities.
Implementations§
Source§impl CodecNegotiation
impl CodecNegotiation
Sourcepub fn build(
codecs: Vec<ServiceCapability>,
direction: EndpointType,
) -> Result<Self>
pub fn build( codecs: Vec<ServiceCapability>, direction: EndpointType, ) -> Result<Self>
Make a new codec negotiation set using codecs
as an ordered list “ideal” capabilities.
Capabilities earlier in the list are preferred if compatible when selecting.
When selecting endpoints, ones of direction
are chosen over ones other directions.
Returns an error if any of the capabilities provided can’t be negotiated, or aren’t codecs.
Sourcepub fn select(
&self,
endpoints: &[StreamEndpoint],
) -> Option<(Vec<ServiceCapability>, StreamEndpointId)>
pub fn select( &self, endpoints: &[StreamEndpoint], ) -> Option<(Vec<ServiceCapability>, StreamEndpointId)>
Given a set of endpoints, return the endpoint id, and the ServiceCapabilities we should request when configuring that endpoint for streaming, based on our preferences for codecs and delay reporting. Returns None if none of the endpoints can be supported by the supported codecs.
Sourcepub fn select_codec(
&self,
endpoints: &[StreamEndpoint],
) -> Option<(ServiceCapability, StreamEndpointId)>
pub fn select_codec( &self, endpoints: &[StreamEndpoint], ) -> Option<(ServiceCapability, StreamEndpointId)>
Given a set of endpoints, return the endpoint id, and a ServiceCapability representing the selected compatible codec parameters for that endpoint, based on our preferences. Returns None if none of the endpoints can be supported by the preferred codecs.
Sourcepub fn set_direction(&mut self, direction: EndpointType)
pub fn set_direction(&mut self, direction: EndpointType)
Change the preferred direction. Calls to select
after this call will prefer to match
endpoints that are of direction
Trait Implementations§
Source§impl Clone for CodecNegotiation
impl Clone for CodecNegotiation
Source§fn clone(&self) -> CodecNegotiation
fn clone(&self) -> CodecNegotiation
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read moreAuto Trait Implementations§
impl Freeze for CodecNegotiation
impl RefUnwindSafe for CodecNegotiation
impl Send for CodecNegotiation
impl Sync for CodecNegotiation
impl Unpin for CodecNegotiation
impl UnwindSafe for CodecNegotiation
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§unsafe fn clone_to_uninit(&self, dst: *mut T)
unsafe fn clone_to_uninit(&self, dst: *mut T)
clone_to_uninit
)