pub struct TrackCodec {
pub payload_type_map: Arc<RwLock<HashMap<u8, CodecType>>>,
/* private fields */
}Fields§
§payload_type_map: Arc<RwLock<HashMap<u8, CodecType>>>Implementations§
Source§impl TrackCodec
impl TrackCodec
pub fn new() -> Self
pub fn set_payload_type(&mut self, pt: u8, codec: CodecType)
Sourcepub fn get_codec_for_pt(&self, pt: u8) -> Option<CodecType>
pub fn get_codec_for_pt(&self, pt: u8) -> Option<CodecType>
Look up the codec for a given RTP payload type, consulting the negotiated map first and falling back to the static payload type registry.
pub fn is_audio(payload_type: u8) -> bool
pub fn decode( &mut self, payload_type: u8, payload: &[u8], target_sample_rate: u32, ) -> (u32, u16, PcmBuf)
pub fn resample(&mut self, pcm: PcmBuf, in_rate: u32, out_rate: u32) -> PcmBuf
pub fn encode(&mut self, payload_type: u8, frame: AudioFrame) -> (u8, Vec<u8>)
Trait Implementations§
Auto Trait Implementations§
impl Freeze for TrackCodec
impl RefUnwindSafe for TrackCodec
impl Send for TrackCodec
impl Sync for TrackCodec
impl Unpin for TrackCodec
impl UnsafeUnpin for TrackCodec
impl UnwindSafe for TrackCodec
Blanket Implementations§
Source§impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
Source§impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
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
impl<T> CloneAny for T
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
impl<S, T> Duplex<S> for Twhere
T: FromSample<S> + ToSample<S>,
Source§impl<S> FromSample<S> for S
impl<S> FromSample<S> for S
fn from_sample_(s: S) -> S
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more