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<'_, AudioFrameDescriptor>
impl Frame<'_, AudioFrameDescriptor>
pub fn convert_to(&self, dst: &mut AudioFrame<'_>) -> Result<()>
Source§impl Frame<'_>
impl Frame<'_>
pub fn audio_creator() -> AudioFrameCreator
pub fn audio_descriptor(&self) -> Option<&AudioFrameDescriptor>
pub fn is_audio(&self) -> bool
pub fn truncate(&mut self, samples: u32) -> Result<()>
Source§impl Frame<'_, AudioFrameDescriptor>
impl Frame<'_, AudioFrameDescriptor>
pub fn new( format: SampleFormat, channels: u8, samples: u32, sample_rate: u32, ) -> Result<Self>
pub fn new_with_descriptor(desc: AudioFrameDescriptor) -> Result<Self>
pub fn from_buffer<'a, T>( format: SampleFormat, channels: u8, samples: u32, sample_rate: u32, buffer: T, ) -> Result<AudioFrame<'a>>
pub fn from_buffer_with_descriptor<'a, T>( desc: AudioFrameDescriptor, buffer: T, ) -> Result<AudioFrame<'a>>
pub fn new_empty( format: SampleFormat, channels: u8, samples: u32, sample_rate: u32, ) -> Result<Self>
pub fn new_empty_with_descriptor(desc: AudioFrameDescriptor) -> Result<Self>
pub fn truncate(&mut self, samples: u32) -> Result<()>
Source§impl Frame<'_, VideoFrameDescriptor>
impl Frame<'_, VideoFrameDescriptor>
pub fn convert_to(&self, dst: &mut VideoFrame<'_>) -> Result<()>
Source§impl Frame<'_>
impl Frame<'_>
pub fn video_creator() -> VideoFrameCreator
pub fn video_descriptor(&self) -> Option<&VideoFrameDescriptor>
pub fn is_video(&self) -> bool
Source§impl Frame<'_, VideoFrameDescriptor>
impl Frame<'_, VideoFrameDescriptor>
pub fn new(format: PixelFormat, width: u32, height: u32) -> Result<Self>
pub fn new_with_descriptor(desc: VideoFrameDescriptor) -> Result<Self>
pub fn from_buffer<'a, T>( format: PixelFormat, width: u32, height: u32, buffer: T, ) -> Result<VideoFrame<'a>>
pub fn from_buffer_with_descriptor<'a, T>( desc: VideoFrameDescriptor, buffer: T, ) -> Result<VideoFrame<'a>>
pub fn from_aligned_buffer<'a, T>( format: PixelFormat, width: u32, height: u32, stride: u32, buffer: T, ) -> Result<VideoFrame<'a>>
pub fn from_aligned_buffer_with_descriptor<'a, T>( desc: VideoFrameDescriptor, stride: NonZeroU32, buffer: T, ) -> Result<VideoFrame<'a>>
pub fn from_packed_buffer<'a, T>( format: PixelFormat, width: u32, height: u32, stride: u32, buffer: T, ) -> Result<VideoFrame<'a>>
pub fn from_packed_buffer_with_descriptor<'a, T>( desc: VideoFrameDescriptor, stride: NonZeroU32, buffer: T, ) -> Result<VideoFrame<'a>>
pub fn from_buffers<'a>( format: PixelFormat, width: u32, height: u32, buffers: &[(&'a [u8], u32)], ) -> Result<VideoFrame<'a>>
pub fn from_buffers_with_descriptor<'a>( desc: VideoFrameDescriptor, buffers: &[(&'a [u8], u32)], ) -> Result<VideoFrame<'a>>
pub fn new_empty( format: PixelFormat, width: u32, height: u32, ) -> Result<VideoFrame<'static>>
pub fn new_empty_with_descriptor( desc: VideoFrameDescriptor, ) -> Result<VideoFrame<'static>>
Source§impl Frame<'_, VideoFrameDescriptor>
impl Frame<'_, VideoFrameDescriptor>
pub fn scale_to( &self, dst: &mut VideoFrame<'_>, scale_filter: ScaleFilter, ) -> Result<()>
Source§impl<D: FrameDescriptorSpec> Frame<'_, D>
impl<D: FrameDescriptorSpec> Frame<'_, D>
Source§impl Frame<'_>
impl Frame<'_>
pub fn data_creator() -> DataFrameCreator
pub fn data_descriptor(&self) -> Option<&DataFrameDescriptor>
pub fn is_data(&self) -> bool
Source§impl Frame<'_, DataFrameDescriptor>
impl Frame<'_, DataFrameDescriptor>
pub fn new(format: DataFormat) -> DataFrame<'static>
pub fn new_with_descriptor(desc: DataFrameDescriptor) -> DataFrame<'static>
Source§impl Frame<'_, FrameDescriptor>
impl Frame<'_, FrameDescriptor>
pub fn new_with_generic_descriptor<D>(desc: D) -> Result<Frame<'static>>
pub fn media_type(&self) -> MediaType
pub fn convert_to(&self, dst: &mut Frame<'_>) -> Result<()>
Source§impl<D: FrameDescriptorSpec> Frame<'_, D>
impl<D: FrameDescriptorSpec> Frame<'_, D>
pub fn descriptor(&self) -> &D
pub fn into_owned(self) -> Frame<'static, D>
pub fn map(&self) -> Result<MappedGuard<'_>>
pub fn map_mut(&mut self) -> Result<MappedGuard<'_>>
Trait Implementations§
Source§impl FrameSpec<FrameDescriptor> for Frame<'_, FrameDescriptor>
impl FrameSpec<FrameDescriptor> for Frame<'_, FrameDescriptor>
fn new_with_descriptor(desc: FrameDescriptor) -> Result<Frame<'static>>
fn media_type(&self) -> MediaType
Source§impl<'a> From<Frame<'a, AudioFrameDescriptor>> for Frame<'a>
impl<'a> From<Frame<'a, AudioFrameDescriptor>> for Frame<'a>
Source§fn from(frame: AudioFrame<'a>) -> Self
fn from(frame: AudioFrame<'a>) -> Self
Converts to this type from the input type.
Source§impl<'a> From<Frame<'a, VideoFrameDescriptor>> for Frame<'a>
impl<'a> From<Frame<'a, VideoFrameDescriptor>> for Frame<'a>
Source§fn from(frame: VideoFrame<'a>) -> Self
fn from(frame: VideoFrame<'a>) -> Self
Converts to this type from the input type.
type Descriptor = D
Source§impl<'a> TryFrom<Frame<'a>> for AudioFrame<'a>
impl<'a> TryFrom<Frame<'a>> for AudioFrame<'a>
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> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
§unsafe fn clone_to_uninit(&self, dest: *mut u8)
unsafe fn clone_to_uninit(&self, dest: *mut u8)
🔬This is a nightly-only experimental API. (
clone_to_uninit)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