Skip to main content

AVAudioFifo

Struct AVAudioFifo 

Source
pub struct AVAudioFifo { /* private fields */ }
Expand description

Context for an Audio FIFO Buffer.

  • Operates at the sample level rather than the byte level.
  • Supports multiple channels with either planar or packed sample format.
  • Automatic reallocation when writing to a full buffer.

Implementations§

Source§

impl AVAudioFifo

Source

pub fn as_ptr(&self) -> *const AVAudioFifo

Source

pub fn as_mut_ptr(&mut self) -> *mut AVAudioFifo

Source

pub unsafe fn set_ptr(&mut self, ptr: NonNull<AVAudioFifo>)

§Safety

This function should only be called when the pointer is valid and the data it’s pointing to can be dropped.

Source

pub unsafe fn from_raw(raw: NonNull<AVAudioFifo>) -> Self

§Safety

This function should only be called when the pointer is valid and the data it’s pointing to can be dropped.

Source

pub fn into_raw(self) -> NonNull<AVAudioFifo>

Source§

impl AVAudioFifo

Source

pub fn new(sample_fmt: AVSampleFormat, channels: i32, nb_samples: i32) -> Self

Allocate an AVAudioFifo.

Source

pub fn realloc(&mut self, nb_samples: i32)

Reallocate an AVAudioFifo.

Source

pub unsafe fn write( &mut self, data: *const *mut u8, nb_samples: i32, ) -> Result<()>

Write data to an AVAudioFifo.

The AVAudioFifo will be reallocated automatically if the available space is less than nb_samples.

§Safety

Function is safe when the data points to valid samples.

Source

pub unsafe fn peek( &mut self, data: *const *mut u8, nb_samples: i32, ) -> Result<i32>

Peek data from an AVAudioFifo.

§Safety

Function is safe when the data points to valid sample buffer.

Source

pub unsafe fn peek_at( &mut self, data: *const *mut u8, nb_samples: i32, offset: i32, ) -> Result<i32>

Peek data from an AVAudioFifo.

§Safety

Function is safe when the data points to valid sample buffer.

Source

pub unsafe fn read( &mut self, data: *const *mut u8, nb_samples: i32, ) -> Result<i32>

Read data from an AVAudioFifo.

This function returns actually read size if success.

§Safety

Function is safe when the data points to valid array such as AVFrame::data.

Source

pub fn drain(&mut self, nb_samples: i32)

Drain data from an AVAudioFifo.

Removes the data without reading it.

Source

pub fn reset(&mut self)

Reset the AVAudioFifo buffer.

This empties all data in the buffer.

Source

pub fn size(&self) -> i32

Get the current number of samples in the AVAudioFifo available for reading.

Source

pub fn space(&self) -> i32

Get the current number of samples in the AVAudioFifo available for writing.

Trait Implementations§

Source§

impl Deref for AVAudioFifo

Source§

type Target = AVAudioFifo

The resulting type after dereferencing.
Source§

fn deref(&self) -> &Self::Target

Dereferences the value.
Source§

impl Drop for AVAudioFifo

Source§

fn drop(&mut self)

Executes the destructor for this type. Read more
Source§

fn pin_drop(self: Pin<&mut Self>)

🔬This is a nightly-only experimental API. (pin_ergonomics)
Execute the destructor for this type, but different to Drop::drop, it requires self to be pinned. Read more
Source§

impl Send for AVAudioFifo

Source§

impl UnsafeDerefMut for AVAudioFifo

Source§

unsafe fn deref_mut(&mut self) -> &mut Self::Target

Mutably dereferences the value, unsafely. Read more

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<P, T> Receiver for P
where P: Deref<Target = T> + ?Sized, T: ?Sized,

Source§

type Target = T

🔬This is a nightly-only experimental API. (arbitrary_self_types)
The target type on which the method may be called.
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.