Skip to main content

FIFOSampleBuffer

Struct FIFOSampleBuffer 

Source
#[repr(C)]
pub struct FIFOSampleBuffer { pub _base: FIFOSamplePipe, pub buffer: *mut SAMPLETYPE, pub bufferUnaligned: *mut SAMPLETYPE, pub sizeInBytes: uint, pub samplesInBuffer: uint, pub channels: uint, pub bufferPos: uint, }
Expand description

Sample buffer working in FIFO (first-in-first-out) principle. The class takes care of storage size adjustment and data moving during input/output operations.

Notice that in case of stereo audio, one sample is considered to consist of both channel data.

Fields§

§_base: FIFOSamplePipe§buffer: *mut SAMPLETYPE

Sample buffer.

§bufferUnaligned: *mut SAMPLETYPE§sizeInBytes: uint

Sample buffer size in bytes

§samplesInBuffer: uint

How many samples are currently in buffer.

§channels: uint

Channels, 1=mono, 2=stereo.

§bufferPos: uint

Current position pointer to the buffer. This pointer is increased when samples are removed from the pipe so that it’s necessary to actually rewind buffer (move data) only new data when is put to the pipe.

Implementations§

Source§

impl FIFOSampleBuffer

Source

pub unsafe fn ptrEnd(&mut self, slackCapacity: uint) -> *mut SAMPLETYPE

Source

pub unsafe fn setChannels(&mut self, numChannels: c_int)

Source

pub unsafe fn addSilent(&mut self, nSamples: uint)

Source

pub unsafe fn new(numChannels: c_int) -> Self

Trait Implementations§

Source§

impl Debug for FIFOSampleBuffer

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. 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<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = !

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

fn try_from(value: U) -> Result<T, !>

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.