Frame

Struct Frame 

Source
pub struct Frame<'a, D: FrameDescriptorSpec = FrameDescriptor> {
    pub source: Option<String>,
    pub pts: Option<i64>,
    pub dts: Option<i64>,
    pub duration: Option<i64>,
    pub time_base: Option<Rational64>,
    pub metadata: Option<Variant>,
    /* private fields */
}

Fields§

§source: Option<String>§pts: Option<i64>§dts: Option<i64>§duration: Option<i64>§time_base: Option<Rational64>§metadata: Option<Variant>

Implementations§

Source§

impl Frame<'_>

Source

pub fn convert_audio_to(&self, dst: &mut Frame<'_>) -> Result<()>

Source§

impl Frame<'_, AudioFrameDescriptor>

Source

pub fn convert_to(&self, dst: &mut AudioFrame<'_>) -> Result<()>

Source§

impl Frame<'_>

Source

pub fn audio_creator() -> AudioFrameCreator

Source

pub fn audio_descriptor(&self) -> Option<&AudioFrameDescriptor>

Source

pub fn is_audio(&self) -> bool

Source

pub fn truncate(&mut self, samples: u32) -> Result<()>

Source§

impl Frame<'_, AudioFrameDescriptor>

Source

pub fn new( format: SampleFormat, channels: u8, samples: u32, sample_rate: u32, ) -> Result<Self>

Source

pub fn new_with_descriptor(desc: AudioFrameDescriptor) -> Result<Self>

Source

pub fn from_buffer<'a, T>( format: SampleFormat, channels: u8, samples: u32, sample_rate: u32, buffer: T, ) -> Result<AudioFrame<'a>>
where T: Into<Cow<'a, [u8]>>,

Source

pub fn from_buffer_with_descriptor<'a, T>( desc: AudioFrameDescriptor, buffer: T, ) -> Result<AudioFrame<'a>>
where T: Into<Cow<'a, [u8]>>,

Source

pub fn new_empty( format: SampleFormat, channels: u8, samples: u32, sample_rate: u32, ) -> Result<Self>

Source

pub fn new_empty_with_descriptor(desc: AudioFrameDescriptor) -> Result<Self>

Source

pub fn truncate(&mut self, samples: u32) -> Result<()>

Source§

impl Frame<'_>

Source

pub fn convert_video_to(&self, dst: &mut Frame<'_>) -> Result<()>

Source§

impl Frame<'_, VideoFrameDescriptor>

Source

pub fn convert_to(&self, dst: &mut VideoFrame<'_>) -> Result<()>

Source§

impl Frame<'_>

Source

pub fn video_creator() -> VideoFrameCreator

Source

pub fn video_descriptor(&self) -> Option<&VideoFrameDescriptor>

Source

pub fn is_video(&self) -> bool

Source

pub fn attach_video_shared_buffer( &mut self, format: PixelFormat, width: u32, height: u32, buffer: Arc<Buffer>, buffer_planes: &[(usize, u32)], ) -> Result<()>

Source

pub fn attach_video_shared_buffer_with_descriptor( &mut self, desc: VideoFrameDescriptor, buffer: Arc<Buffer>, buffer_planes: &[(usize, u32)], ) -> Result<()>

Source§

impl Frame<'_, VideoFrameDescriptor>

Source

pub fn new(format: PixelFormat, width: u32, height: u32) -> Result<Self>

Source

pub fn new_with_descriptor(desc: VideoFrameDescriptor) -> Result<Self>

Source

pub fn from_buffer<'a, T>( format: PixelFormat, width: u32, height: u32, buffer: T, ) -> Result<VideoFrame<'a>>
where T: Into<Cow<'a, [u8]>>,

Source

pub fn from_buffer_with_descriptor<'a, T>( desc: VideoFrameDescriptor, buffer: T, ) -> Result<VideoFrame<'a>>
where T: Into<Cow<'a, [u8]>>,

Source

pub fn from_aligned_buffer<'a, T>( format: PixelFormat, width: u32, height: u32, stride: u32, buffer: T, ) -> Result<VideoFrame<'a>>
where T: Into<Cow<'a, [u8]>>,

Source

pub fn from_aligned_buffer_with_descriptor<'a, T>( desc: VideoFrameDescriptor, stride: NonZeroU32, buffer: T, ) -> Result<VideoFrame<'a>>
where T: Into<Cow<'a, [u8]>>,

Source

pub fn from_packed_buffer<'a, T>( format: PixelFormat, width: u32, height: u32, stride: u32, buffer: T, ) -> Result<VideoFrame<'a>>
where T: Into<Cow<'a, [u8]>>,

Source

pub fn from_packed_buffer_with_descriptor<'a, T>( desc: VideoFrameDescriptor, stride: NonZeroU32, buffer: T, ) -> Result<VideoFrame<'a>>
where T: Into<Cow<'a, [u8]>>,

Source

pub fn from_buffers<'a>( format: PixelFormat, width: u32, height: u32, buffers: &[(&'a [u8], u32)], ) -> Result<VideoFrame<'a>>

Source

pub fn from_buffers_with_descriptor<'a>( desc: VideoFrameDescriptor, buffers: &[(&'a [u8], u32)], ) -> Result<VideoFrame<'a>>

Source

pub fn from_shared_buffer( format: PixelFormat, width: u32, height: u32, buffer: Arc<Buffer>, planes: &[(usize, u32)], ) -> Result<VideoFrame<'static>>

Source

pub fn from_shared_buffer_with_descriptor( desc: VideoFrameDescriptor, buffer: Arc<Buffer>, planes: &[(usize, u32)], ) -> Result<VideoFrame<'static>>

Source

pub fn new_empty( format: PixelFormat, width: u32, height: u32, ) -> Result<VideoFrame<'static>>

Source

pub fn new_empty_with_descriptor( desc: VideoFrameDescriptor, ) -> Result<VideoFrame<'static>>

Source

pub fn attach_shared_buffer( &mut self, format: PixelFormat, width: u32, height: u32, buffer: Arc<Buffer>, buffer_planes: &[(usize, u32)], ) -> Result<()>

Source

pub fn attach_shared_buffer_with_descriptor( &mut self, desc: VideoFrameDescriptor, buffer: Arc<Buffer>, buffer_planes: &[(usize, u32)], ) -> Result<()>

Source§

impl Frame<'_>

Source

pub fn scale_to( &self, dst: &mut Frame<'_>, scale_filter: ScaleFilter, ) -> Result<()>

Source§

impl Frame<'_, VideoFrameDescriptor>

Source

pub fn scale_to( &self, dst: &mut VideoFrame<'_>, scale_filter: ScaleFilter, ) -> Result<()>

Source§

impl<D: FrameDescriptorSpec> Frame<'_, D>

Source

pub fn data(&self) -> Option<&Variant>

Source

pub fn data_mut(&mut self) -> Option<&mut Variant>

Source§

impl Frame<'_>

Source§

impl Frame<'_, DataFrameDescriptor>

Source

pub fn new(format: DataFormat) -> DataFrame<'static>

Source

pub fn new_with_descriptor(desc: DataFrameDescriptor) -> DataFrame<'static>

Source§

impl Frame<'_, FrameDescriptor>

Source

pub fn new_with_generic_descriptor<D>(desc: D) -> Result<Frame<'static>>

Source

pub fn media_type(&self) -> MediaType

Source

pub fn convert_to(&self, dst: &mut Frame<'_>) -> Result<()>

Source§

impl<D: FrameDescriptorSpec> Frame<'_, D>

Source

pub fn descriptor(&self) -> &D

Source

pub fn into_owned(self) -> Frame<'static, D>

Source

pub fn map(&self) -> Result<MappedGuard<'_>>

Source

pub fn map_mut(&mut self) -> Result<MappedGuard<'_>>

Trait Implementations§

Source§

impl<'a, D: Clone + FrameDescriptorSpec> Clone for Frame<'a, D>

Source§

fn clone(&self) -> Frame<'a, D>

Returns a duplicate of the value. Read more
1.0.0§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl FrameSpec<FrameDescriptor> for Frame<'_, FrameDescriptor>

Source§

impl<'a> From<Frame<'a, AudioFrameDescriptor>> for Frame<'a>

Source§

fn from(frame: AudioFrame<'a>) -> Self

Converts to this type from the input type.
Source§

impl<'a> From<Frame<'a, DataFrameDescriptor>> for Frame<'a>

Source§

fn from(frame: DataFrame<'a>) -> Self

Converts to this type from the input type.
Source§

impl<'a> From<Frame<'a, VideoFrameDescriptor>> for Frame<'a>

Source§

fn from(frame: VideoFrame<'a>) -> Self

Converts to this type from the input type.
Source§

impl<D: FrameDescriptorSpec> SharedFrameInner for Frame<'_, D>

Source§

impl<'a> TryFrom<Frame<'a>> for AudioFrame<'a>

Source§

type Error = Error

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

fn try_from(frame: Frame<'a>) -> Result<Self>

Performs the conversion.
Source§

impl<'a> TryFrom<Frame<'a>> for DataFrame<'a>

Source§

type Error = Error

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

fn try_from(frame: Frame<'a>) -> Result<Self>

Performs the conversion.
Source§

impl<'a> TryFrom<Frame<'a>> for VideoFrame<'a>

Source§

type Error = Error

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

fn try_from(frame: Frame<'a>) -> Result<Self>

Performs the conversion.

Auto Trait Implementations§

§

impl<'a, D> Freeze for Frame<'a, D>
where D: Freeze,

§

impl<'a, D> RefUnwindSafe for Frame<'a, D>
where D: RefUnwindSafe,

§

impl<'a, D> Send for Frame<'a, D>

§

impl<'a, D> Sync for Frame<'a, D>

§

impl<'a, D> Unpin for Frame<'a, D>
where D: Unpin,

§

impl<'a, D> UnwindSafe for Frame<'a, D>
where D: UnwindSafe,

Blanket Implementations§

§

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

§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
§

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

§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
§

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

§

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

Mutably borrows from an owned value. Read more
§

impl<T> CloneToUninit for T
where T: Clone,

§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
§

impl<T> From<T> for T

§

fn from(t: T) -> T

Returns the argument unchanged.

§

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

§

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> IntoEither for T

Source§

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 more
Source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
where F: FnOnce(&Self) -> bool,

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
Source§

impl<T> Pointable for T

Source§

const ALIGN: usize

The alignment of pointer.
Source§

type Init = T

The type for initializers.
Source§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
Source§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
Source§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
Source§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
§

impl<T> ToOwned for T
where T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
§

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

§

type Error = Infallible

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

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

Performs the conversion.
§

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

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

Performs the conversion.