pub struct AudioFrame {
pub(crate) data: Vec<u8>,
pub(crate) pts: u64,
pub(crate) channels: u8,
pub(crate) pool: Option<Arc<BufferPool>>,
}Expand description
One encoded frame as the capture delivers it: the two-byte header and RED framing
followed by the Opus packet, or the raw packet on a capture that omits the header, with
the pts it starts at and the channels its Opus carries.
Owns its buffer; when the frame is dropped, a pooled buffer is recycled back to the
capture thread (see the Drop impl), keeping the steady-state emit path
allocation-free, so a consumer that must keep the bytes copies them out.
Fields§
§data: Vec<u8>§pts: u64§channels: u8Channels the frame’s Opus carries: the capture’s own, or 2 for its stereo companion.
pool: Option<Arc<BufferPool>>Set when the buffer came from a capture’s BufferPool; recycled to it on drop.
Implementations§
Trait Implementations§
Source§impl Debug for AudioFrame
impl Debug for AudioFrame
Source§impl Drop for AudioFrame
impl Drop for AudioFrame
Auto Trait Implementations§
impl Freeze for AudioFrame
impl RefUnwindSafe for AudioFrame
impl Send for AudioFrame
impl Sync for AudioFrame
impl Unpin for AudioFrame
impl UnsafeUnpin for AudioFrame
impl UnwindSafe for AudioFrame
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