pub struct RepacketizerRef<'a> { /* private fields */ }Expand description
Borrowed wrapper around a repacketizer state.
Implementations§
Source§impl<'a> RepacketizerRef<'a>
impl<'a> RepacketizerRef<'a>
Sourcepub unsafe fn from_raw(ptr: *mut OpusRepacketizer) -> Self
pub unsafe fn from_raw(ptr: *mut OpusRepacketizer) -> Self
Wrap an externally-initialized repacketizer without taking ownership.
§Safety
ptrmust point to valid, initialized memory of at leastRepacketizer::size()bytesptrmust be aligned to at leastalign_of::<usize>()(malloc-style alignment)- The memory must remain valid for the lifetime
'a - Caller is responsible for freeing the memory after this wrapper is dropped
Use Repacketizer::init_in_place to initialize the memory before calling this.
Sourcepub fn init_in(buf: &'a mut AlignedBuffer) -> Result<Self>
pub fn init_in(buf: &'a mut AlignedBuffer) -> Result<Self>
Initialize and wrap an externally allocated buffer.
§Errors
Returns Error::BadArg if the buffer is too small.
Methods from Deref<Target = Repacketizer>§
Sourcepub fn push(&mut self, packet: &[u8]) -> Result<()>
pub fn push(&mut self, packet: &[u8]) -> Result<()>
Add a packet to the current state.
The packet data is copied and retained until the next call to Self::reset.
§Errors
Returns an error if the packet is invalid for the current state.
Sourcepub fn frame_count(&self) -> i32
pub fn frame_count(&self) -> i32
Number of frames currently queued.
Trait Implementations§
Source§impl Deref for RepacketizerRef<'_>
impl Deref for RepacketizerRef<'_>
Source§impl DerefMut for RepacketizerRef<'_>
impl DerefMut for RepacketizerRef<'_>
impl Send for RepacketizerRef<'_>
impl Sync for RepacketizerRef<'_>
Auto Trait Implementations§
impl<'a> Freeze for RepacketizerRef<'a>
impl<'a> RefUnwindSafe for RepacketizerRef<'a>
impl<'a> Unpin for RepacketizerRef<'a>
impl<'a> !UnwindSafe for RepacketizerRef<'a>
Blanket Implementations§
§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more