#[non_exhaustive]pub enum ConvertError {
NullFrame,
UnsupportedPixelFormat(UnsupportedPixelFormat),
InvalidPlaneLayout(InvalidPlaneLayout),
BufferAcquireFailed(BufferAcquireFailed),
}Expand description
Errors from av_frame_to_video_frame.
Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
NullFrame
av_frame was null.
UnsupportedPixelFormat(UnsupportedPixelFormat)
The frame’s pixel format isn’t in the closed CPU-format set this crate supports for safe per-plane access.
InvalidPlaneLayout(InvalidPlaneLayout)
A plane reported linesize <= 0 or otherwise inconsistent layout.
BufferAcquireFailed(BufferAcquireFailed)
Failed to acquire an AVBufferRef for a plane (out of memory, or
the frame’s data[i] pointer doesn’t lie inside any of buf[]).
Implementations§
Source§impl ConvertError
impl ConvertError
Sourcepub const fn is_null_frame(&self) -> bool
pub const fn is_null_frame(&self) -> bool
Returns true if this value is of type NullFrame. Returns false otherwise
Sourcepub const fn is_unsupported_pixel_format(&self) -> bool
pub const fn is_unsupported_pixel_format(&self) -> bool
Returns true if this value is of type UnsupportedPixelFormat. Returns false otherwise
Sourcepub const fn is_invalid_plane_layout(&self) -> bool
pub const fn is_invalid_plane_layout(&self) -> bool
Returns true if this value is of type InvalidPlaneLayout. Returns false otherwise
Sourcepub const fn is_buffer_acquire_failed(&self) -> bool
pub const fn is_buffer_acquire_failed(&self) -> bool
Returns true if this value is of type BufferAcquireFailed. Returns false otherwise
Source§impl ConvertError
impl ConvertError
Sourcepub fn unwrap_null_frame(self)
pub fn unwrap_null_frame(self)
Unwraps this value to the ConvertError::NullFrame variant.
Panics if this value is of any other type.
Sourcepub fn unwrap_null_frame_ref(&self)
pub fn unwrap_null_frame_ref(&self)
Unwraps this reference to the ConvertError::NullFrame variant.
Panics if this value is of any other type.
Sourcepub fn unwrap_null_frame_mut(&mut self)
pub fn unwrap_null_frame_mut(&mut self)
Unwraps this mutable reference to the ConvertError::NullFrame variant.
Panics if this value is of any other type.
Sourcepub fn unwrap_unsupported_pixel_format(self) -> UnsupportedPixelFormat
pub fn unwrap_unsupported_pixel_format(self) -> UnsupportedPixelFormat
Unwraps this value to the ConvertError::UnsupportedPixelFormat variant.
Panics if this value is of any other type.
Sourcepub fn unwrap_unsupported_pixel_format_ref(&self) -> &UnsupportedPixelFormat
pub fn unwrap_unsupported_pixel_format_ref(&self) -> &UnsupportedPixelFormat
Unwraps this reference to the ConvertError::UnsupportedPixelFormat variant.
Panics if this value is of any other type.
Sourcepub fn unwrap_unsupported_pixel_format_mut(
&mut self,
) -> &mut UnsupportedPixelFormat
pub fn unwrap_unsupported_pixel_format_mut( &mut self, ) -> &mut UnsupportedPixelFormat
Unwraps this mutable reference to the ConvertError::UnsupportedPixelFormat variant.
Panics if this value is of any other type.
Sourcepub fn unwrap_invalid_plane_layout(self) -> InvalidPlaneLayout
pub fn unwrap_invalid_plane_layout(self) -> InvalidPlaneLayout
Unwraps this value to the ConvertError::InvalidPlaneLayout variant.
Panics if this value is of any other type.
Sourcepub fn unwrap_invalid_plane_layout_ref(&self) -> &InvalidPlaneLayout
pub fn unwrap_invalid_plane_layout_ref(&self) -> &InvalidPlaneLayout
Unwraps this reference to the ConvertError::InvalidPlaneLayout variant.
Panics if this value is of any other type.
Sourcepub fn unwrap_invalid_plane_layout_mut(&mut self) -> &mut InvalidPlaneLayout
pub fn unwrap_invalid_plane_layout_mut(&mut self) -> &mut InvalidPlaneLayout
Unwraps this mutable reference to the ConvertError::InvalidPlaneLayout variant.
Panics if this value is of any other type.
Sourcepub fn unwrap_buffer_acquire_failed(self) -> BufferAcquireFailed
pub fn unwrap_buffer_acquire_failed(self) -> BufferAcquireFailed
Unwraps this value to the ConvertError::BufferAcquireFailed variant.
Panics if this value is of any other type.
Sourcepub fn unwrap_buffer_acquire_failed_ref(&self) -> &BufferAcquireFailed
pub fn unwrap_buffer_acquire_failed_ref(&self) -> &BufferAcquireFailed
Unwraps this reference to the ConvertError::BufferAcquireFailed variant.
Panics if this value is of any other type.
Sourcepub fn unwrap_buffer_acquire_failed_mut(&mut self) -> &mut BufferAcquireFailed
pub fn unwrap_buffer_acquire_failed_mut(&mut self) -> &mut BufferAcquireFailed
Unwraps this mutable reference to the ConvertError::BufferAcquireFailed variant.
Panics if this value is of any other type.
Source§impl ConvertError
impl ConvertError
Sourcepub fn try_unwrap_null_frame(self) -> Result<(), TryUnwrapError<Self>>
pub fn try_unwrap_null_frame(self) -> Result<(), TryUnwrapError<Self>>
Attempts to unwrap this value to the ConvertError::NullFrame variant.
Returns a [TryUnwrapError] with the original value if this value is of any other type.
Sourcepub fn try_unwrap_null_frame_ref(&self) -> Result<(), TryUnwrapError<&Self>>
pub fn try_unwrap_null_frame_ref(&self) -> Result<(), TryUnwrapError<&Self>>
Attempts to unwrap this reference to the ConvertError::NullFrame variant.
Returns a [TryUnwrapError] with the original value if this value is of any other type.
Sourcepub fn try_unwrap_null_frame_mut(
&mut self,
) -> Result<(), TryUnwrapError<&mut Self>>
pub fn try_unwrap_null_frame_mut( &mut self, ) -> Result<(), TryUnwrapError<&mut Self>>
Attempts to unwrap this mutable reference to the ConvertError::NullFrame variant.
Returns a [TryUnwrapError] with the original value if this value is of any other type.
Sourcepub fn try_unwrap_unsupported_pixel_format(
self,
) -> Result<UnsupportedPixelFormat, TryUnwrapError<Self>>
pub fn try_unwrap_unsupported_pixel_format( self, ) -> Result<UnsupportedPixelFormat, TryUnwrapError<Self>>
Attempts to unwrap this value to the ConvertError::UnsupportedPixelFormat variant.
Returns a [TryUnwrapError] with the original value if this value is of any other type.
Sourcepub fn try_unwrap_unsupported_pixel_format_ref(
&self,
) -> Result<&UnsupportedPixelFormat, TryUnwrapError<&Self>>
pub fn try_unwrap_unsupported_pixel_format_ref( &self, ) -> Result<&UnsupportedPixelFormat, TryUnwrapError<&Self>>
Attempts to unwrap this reference to the ConvertError::UnsupportedPixelFormat variant.
Returns a [TryUnwrapError] with the original value if this value is of any other type.
Sourcepub fn try_unwrap_unsupported_pixel_format_mut(
&mut self,
) -> Result<&mut UnsupportedPixelFormat, TryUnwrapError<&mut Self>>
pub fn try_unwrap_unsupported_pixel_format_mut( &mut self, ) -> Result<&mut UnsupportedPixelFormat, TryUnwrapError<&mut Self>>
Attempts to unwrap this mutable reference to the ConvertError::UnsupportedPixelFormat variant.
Returns a [TryUnwrapError] with the original value if this value is of any other type.
Sourcepub fn try_unwrap_invalid_plane_layout(
self,
) -> Result<InvalidPlaneLayout, TryUnwrapError<Self>>
pub fn try_unwrap_invalid_plane_layout( self, ) -> Result<InvalidPlaneLayout, TryUnwrapError<Self>>
Attempts to unwrap this value to the ConvertError::InvalidPlaneLayout variant.
Returns a [TryUnwrapError] with the original value if this value is of any other type.
Sourcepub fn try_unwrap_invalid_plane_layout_ref(
&self,
) -> Result<&InvalidPlaneLayout, TryUnwrapError<&Self>>
pub fn try_unwrap_invalid_plane_layout_ref( &self, ) -> Result<&InvalidPlaneLayout, TryUnwrapError<&Self>>
Attempts to unwrap this reference to the ConvertError::InvalidPlaneLayout variant.
Returns a [TryUnwrapError] with the original value if this value is of any other type.
Sourcepub fn try_unwrap_invalid_plane_layout_mut(
&mut self,
) -> Result<&mut InvalidPlaneLayout, TryUnwrapError<&mut Self>>
pub fn try_unwrap_invalid_plane_layout_mut( &mut self, ) -> Result<&mut InvalidPlaneLayout, TryUnwrapError<&mut Self>>
Attempts to unwrap this mutable reference to the ConvertError::InvalidPlaneLayout variant.
Returns a [TryUnwrapError] with the original value if this value is of any other type.
Sourcepub fn try_unwrap_buffer_acquire_failed(
self,
) -> Result<BufferAcquireFailed, TryUnwrapError<Self>>
pub fn try_unwrap_buffer_acquire_failed( self, ) -> Result<BufferAcquireFailed, TryUnwrapError<Self>>
Attempts to unwrap this value to the ConvertError::BufferAcquireFailed variant.
Returns a [TryUnwrapError] with the original value if this value is of any other type.
Sourcepub fn try_unwrap_buffer_acquire_failed_ref(
&self,
) -> Result<&BufferAcquireFailed, TryUnwrapError<&Self>>
pub fn try_unwrap_buffer_acquire_failed_ref( &self, ) -> Result<&BufferAcquireFailed, TryUnwrapError<&Self>>
Attempts to unwrap this reference to the ConvertError::BufferAcquireFailed variant.
Returns a [TryUnwrapError] with the original value if this value is of any other type.
Sourcepub fn try_unwrap_buffer_acquire_failed_mut(
&mut self,
) -> Result<&mut BufferAcquireFailed, TryUnwrapError<&mut Self>>
pub fn try_unwrap_buffer_acquire_failed_mut( &mut self, ) -> Result<&mut BufferAcquireFailed, TryUnwrapError<&mut Self>>
Attempts to unwrap this mutable reference to the ConvertError::BufferAcquireFailed variant.
Returns a [TryUnwrapError] with the original value if this value is of any other type.
Trait Implementations§
Source§impl Clone for ConvertError
impl Clone for ConvertError
Source§fn clone(&self) -> ConvertError
fn clone(&self) -> ConvertError
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for ConvertError
impl Debug for ConvertError
Source§impl Display for ConvertError
impl Display for ConvertError
Source§impl Error for ConvertError
impl Error for ConvertError
1.30.0 · Source§fn source(&self) -> Option<&(dyn Error + 'static)>
fn source(&self) -> Option<&(dyn Error + 'static)>
1.0.0 · Source§fn description(&self) -> &str
fn description(&self) -> &str
use the Display impl or to_string()