pub struct AudioBuffer<T> { /* private fields */ }
Expand description

A structure containing the result of an audio buffer map operation, which is executed with from_buffer_readable(). For non-interleaved (planar) buffers, the beginning of each channel in the buffer has its own pointer in the planes array. For interleaved buffers, the planes array only contains one item, which is the pointer to the beginning of the buffer, and n_planes equals 1.

The different channels in planes are always in the GStreamer channel order.

Implementations§

source§

impl<T> AudioBuffer<T>

source

pub fn info(&self) -> &AudioInfo

source

pub fn into_buffer(self) -> Buffer

source

pub fn format(&self) -> AudioFormat

source

pub fn format_info(&self) -> AudioFormatInfo

source

pub fn channels(&self) -> u32

source

pub fn rate(&self) -> u32

source

pub fn layout(&self) -> AudioLayout

source

pub fn width(&self) -> u32

source

pub fn depth(&self) -> u32

source

pub fn sample_stride(&self) -> u32

source

pub fn bps(&self) -> u32

source

pub fn bpf(&self) -> u32

source

pub fn n_samples(&self) -> usize

source

pub fn n_planes(&self) -> u32

source

pub fn plane_size(&self) -> usize

source

pub fn buffer(&self) -> &BufferRef

source

pub fn plane_data(&self, plane: u32) -> Result<&[u8], BoolError>

source

pub fn planes_data(&self) -> SmallVec<[&[u8]; 8]>

source

pub fn as_audio_buffer_ref(&self) -> AudioBufferRef<&BufferRef>

source

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

source§

impl AudioBuffer<Readable>

source

pub fn from_buffer_readable( buffer: Buffer, info: &AudioInfo ) -> Result<Self, Buffer>

source

pub fn buffer_owned(&self) -> Buffer

source§

impl AudioBuffer<Writable>

source

pub fn from_buffer_writable( buffer: Buffer, info: &AudioInfo ) -> Result<Self, Buffer>

source

pub fn plane_data_mut(&mut self, plane: u32) -> Result<&mut [u8], BoolError>

source

pub fn planes_data_mut(&mut self) -> SmallVec<[&mut [u8]; 8]>

source

pub fn as_mut_audio_buffer_ref(&mut self) -> AudioBufferRef<&mut BufferRef>

source

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

Trait Implementations§

source§

impl<T> Debug for AudioBuffer<T>

source§

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

Formats the value using the given formatter. Read more
source§

impl<T> Drop for AudioBuffer<T>

source§

fn drop(&mut self)

Executes the destructor for this type. Read more
source§

impl<T> Send for AudioBuffer<T>

source§

impl<T> Sync for AudioBuffer<T>

Auto Trait Implementations§

§

impl<T> RefUnwindSafe for AudioBuffer<T>
where T: RefUnwindSafe,

§

impl<T> Unpin for AudioBuffer<T>
where T: Unpin,

§

impl<T> UnwindSafe for AudioBuffer<T>
where T: UnwindSafe,

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>,

§

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>,

§

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.