ac_ffmpeg::codec::audio::frame

Struct AudioFrameMut

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

An audio frame with mutable data.

Implementations§

Source§

impl AudioFrameMut

Source

pub fn silence( channel_layout: &ChannelLayoutRef, sample_format: SampleFormat, sample_rate: u32, samples: usize, ) -> Self

Create an audio frame containing silence. The time base of the frame will be in microseconds.

Source

pub fn sample_format(&self) -> SampleFormat

Get frame sample format.

Source

pub fn sample_rate(&self) -> u32

Get frame sample rate.

Source

pub fn samples(&self) -> usize

Get number of samples (per channel) in this frame.

Source

pub fn planes(&self) -> Planes<'_>

Get sample data planes for this frame.

Source

pub fn planes_mut(&mut self) -> PlanesMut<'_>

Get mutable sample data planes for this frame.

Source

pub fn channel_layout(&self) -> &ChannelLayoutRef

Get channel layout.

Source

pub fn time_base(&self) -> TimeBase

Get frame time base.

Source

pub fn with_time_base(self, time_base: TimeBase) -> Self

Set frame time base. (This will rescale the current timestamp into a given time base.)

Source

pub fn pts(&self) -> Timestamp

Get presentation timestamp.

Source

pub fn with_pts(self, pts: Timestamp) -> Self

Set presentation timestamp.

Source

pub fn freeze(self) -> AudioFrame

Make the frame immutable.

Trait Implementations§

Source§

impl Drop for AudioFrameMut

Source§

fn drop(&mut self)

Executes the destructor for this type. Read more
Source§

impl<'a> From<&'a AudioFrameMut> for Planes<'a>

Source§

fn from(frame: &'a AudioFrameMut) -> Self

Converts to this type from the input type.
Source§

impl<'a> From<&'a mut AudioFrameMut> for PlanesMut<'a>

Source§

fn from(frame: &'a mut AudioFrameMut) -> Self

Converts to this type from the input type.
Source§

impl Send for AudioFrameMut

Source§

impl Sync for AudioFrameMut

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 = 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.