Struct gstreamer_audio::audio_buffer::AudioBuffer
source · 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>
impl<T> AudioBuffer<T>
pub fn info(&self) -> &AudioInfo
pub fn into_buffer(self) -> Buffer
pub fn format(&self) -> AudioFormat
pub fn format_info(&self) -> AudioFormatInfo
pub fn channels(&self) -> u32
pub fn rate(&self) -> u32
pub fn layout(&self) -> AudioLayout
pub fn width(&self) -> u32
pub fn depth(&self) -> u32
pub fn sample_stride(&self) -> u32
pub fn bps(&self) -> u32
pub fn bpf(&self) -> u32
pub fn n_samples(&self) -> usize
pub fn n_planes(&self) -> u32
pub fn plane_size(&self) -> usize
pub fn buffer(&self) -> &BufferRef
pub fn plane_data(&self, plane: u32) -> Result<&[u8], BoolError>
pub fn planes_data(&self) -> SmallVec<[&[u8]; 8]>
pub fn as_audio_buffer_ref(&self) -> AudioBufferRef<&BufferRef>
pub fn as_ptr(&self) -> *const GstAudioBuffer
source§impl AudioBuffer<Readable>
impl AudioBuffer<Readable>
pub fn from_buffer_readable( buffer: Buffer, info: &AudioInfo, ) -> Result<Self, Buffer>
pub fn buffer_owned(&self) -> Buffer
source§impl AudioBuffer<Writable>
impl AudioBuffer<Writable>
pub fn from_buffer_writable( buffer: Buffer, info: &AudioInfo, ) -> Result<Self, Buffer>
pub fn plane_data_mut(&mut self, plane: u32) -> Result<&mut [u8], BoolError>
pub fn planes_data_mut(&mut self) -> SmallVec<[&mut [u8]; 8]>
pub fn as_mut_audio_buffer_ref(&mut self) -> AudioBufferRef<&mut BufferRef>
pub fn as_mut_ptr(&mut self) -> *mut GstAudioBuffer
Trait Implementations§
source§impl<T> Debug for AudioBuffer<T>
impl<T> Debug for AudioBuffer<T>
source§impl<T> Drop for AudioBuffer<T>
impl<T> Drop for AudioBuffer<T>
impl<T> Send for AudioBuffer<T>
impl<T> Sync for AudioBuffer<T>
Auto Trait Implementations§
impl<T> Freeze for AudioBuffer<T>
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> 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
source§impl<T> IntoEither for T
impl<T> IntoEither for T
source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self
into a Left
variant of Either<Self, Self>
if into_left
is true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read moresource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self
into a Left
variant of Either<Self, Self>
if into_left(&self)
returns true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read more