Skip to main content

VideoDecodeError

Enum VideoDecodeError 

Source
#[non_exhaustive]
pub enum VideoDecodeError { Decode(Error), Convert(ConvertError), PostCommitNeverResynced(PostCommitNeverResynced), }
Expand description

Error type for [FfmpegVideoStreamDecoder] — faults and the send-side refusal.

Every arm here is something that went wrong or something the push face declined. The drain’s needs input and ended are Received states out of receive_frame; they used to arrive as Decode(Ffmpeg(Other { errno: EAGAIN })) and Decode(Ffmpeg(Eof)), which is to say they had no name at this tier at all. Self::PostCommitNeverResynced is the deliberate exception on the end-of-stream road: it is not “the stream ended”, it is “the stream ended and the tail was lost”, which is a fault.

Open fault taxonomy, so it is #[non_exhaustive]. New ways to fail are discovered — a backend, a ceiling, a corruption a codec learns to report — and a consumer that meets one it has never heard of should take its generic-fault path. That is exactly what the wildcard arm this attribute forces is for. The two status vocabularies opposite it, Sent and Received, are exhaustive for the mirror-image reason: their arms are the substrate’s fixed state set, and there the wildcard would be dead weight hiding a state a consumer forgot.

Variants (Non-exhaustive)§

This enum is marked as non-exhaustive
Non-exhaustive enums could have additional variants added in future. Therefore, when matching against variants of non-exhaustive enums, an extra wildcard arm must be added to account for any future variants.
§

Decode(Error)

The wrapped decoder (HW or SW) reported an error.

§

Convert(ConvertError)

Frame conversion from FFmpeg’s native types to mediadecode’s types failed.

§

PostCommitNeverResynced(PostCommitNeverResynced)

A post-commit HW->SW fallback degraded the stream but the software decoder reached EOF without ever producing a frame.

Implementations§

Source§

impl VideoDecodeError

Source

pub const fn is_decode(&self) -> bool

Returns true if this value is of type Decode. Returns false otherwise

Source

pub const fn is_convert(&self) -> bool

Returns true if this value is of type Convert. Returns false otherwise

Source

pub const fn is_post_commit_never_resynced(&self) -> bool

Returns true if this value is of type PostCommitNeverResynced. Returns false otherwise

Source§

impl VideoDecodeError

Source

pub fn unwrap_decode(self) -> Error

Unwraps this value to the VideoDecodeError::Decode variant. Panics if this value is of any other type.

Source

pub fn unwrap_decode_ref(&self) -> &Error

Unwraps this reference to the VideoDecodeError::Decode variant. Panics if this value is of any other type.

Source

pub fn unwrap_decode_mut(&mut self) -> &mut Error

Unwraps this mutable reference to the VideoDecodeError::Decode variant. Panics if this value is of any other type.

Source

pub fn unwrap_convert(self) -> ConvertError

Unwraps this value to the VideoDecodeError::Convert variant. Panics if this value is of any other type.

Source

pub fn unwrap_convert_ref(&self) -> &ConvertError

Unwraps this reference to the VideoDecodeError::Convert variant. Panics if this value is of any other type.

Source

pub fn unwrap_convert_mut(&mut self) -> &mut ConvertError

Unwraps this mutable reference to the VideoDecodeError::Convert variant. Panics if this value is of any other type.

Source

pub fn unwrap_post_commit_never_resynced(self) -> PostCommitNeverResynced

Unwraps this value to the VideoDecodeError::PostCommitNeverResynced variant. Panics if this value is of any other type.

Source

pub fn unwrap_post_commit_never_resynced_ref(&self) -> &PostCommitNeverResynced

Unwraps this reference to the VideoDecodeError::PostCommitNeverResynced variant. Panics if this value is of any other type.

Source

pub fn unwrap_post_commit_never_resynced_mut( &mut self, ) -> &mut PostCommitNeverResynced

Unwraps this mutable reference to the VideoDecodeError::PostCommitNeverResynced variant. Panics if this value is of any other type.

Source§

impl VideoDecodeError

Source

pub fn try_unwrap_decode(self) -> Result<Error, TryUnwrapError<Self>>

Attempts to unwrap this value to the VideoDecodeError::Decode variant. Returns a [TryUnwrapError] with the original value if this value is of any other type.

Source

pub fn try_unwrap_decode_ref(&self) -> Result<&Error, TryUnwrapError<&Self>>

Attempts to unwrap this reference to the VideoDecodeError::Decode variant. Returns a [TryUnwrapError] with the original value if this value is of any other type.

Source

pub fn try_unwrap_decode_mut( &mut self, ) -> Result<&mut Error, TryUnwrapError<&mut Self>>

Attempts to unwrap this mutable reference to the VideoDecodeError::Decode variant. Returns a [TryUnwrapError] with the original value if this value is of any other type.

Source

pub fn try_unwrap_convert(self) -> Result<ConvertError, TryUnwrapError<Self>>

Attempts to unwrap this value to the VideoDecodeError::Convert variant. Returns a [TryUnwrapError] with the original value if this value is of any other type.

Source

pub fn try_unwrap_convert_ref( &self, ) -> Result<&ConvertError, TryUnwrapError<&Self>>

Attempts to unwrap this reference to the VideoDecodeError::Convert variant. Returns a [TryUnwrapError] with the original value if this value is of any other type.

Source

pub fn try_unwrap_convert_mut( &mut self, ) -> Result<&mut ConvertError, TryUnwrapError<&mut Self>>

Attempts to unwrap this mutable reference to the VideoDecodeError::Convert variant. Returns a [TryUnwrapError] with the original value if this value is of any other type.

Source

pub fn try_unwrap_post_commit_never_resynced( self, ) -> Result<PostCommitNeverResynced, TryUnwrapError<Self>>

Attempts to unwrap this value to the VideoDecodeError::PostCommitNeverResynced variant. Returns a [TryUnwrapError] with the original value if this value is of any other type.

Source

pub fn try_unwrap_post_commit_never_resynced_ref( &self, ) -> Result<&PostCommitNeverResynced, TryUnwrapError<&Self>>

Attempts to unwrap this reference to the VideoDecodeError::PostCommitNeverResynced variant. Returns a [TryUnwrapError] with the original value if this value is of any other type.

Source

pub fn try_unwrap_post_commit_never_resynced_mut( &mut self, ) -> Result<&mut PostCommitNeverResynced, TryUnwrapError<&mut Self>>

Attempts to unwrap this mutable reference to the VideoDecodeError::PostCommitNeverResynced variant. Returns a [TryUnwrapError] with the original value if this value is of any other type.

Trait Implementations§

Source§

impl Debug for VideoDecodeError

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Display for VideoDecodeError

Source§

fn fmt(&self, __formatter: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Error for VideoDecodeError

Source§

fn source(&self) -> Option<&(dyn Error + 'static)>

Returns the lower-level source of this error, if any. Read more
1.0.0 · Source§

fn description(&self) -> &str

👎Deprecated since 1.42.0:

use the Display impl or to_string()

1.0.0 · Source§

fn cause(&self) -> Option<&dyn Error>

👎Deprecated since 1.33.0:

replaced by Error::source, which can support downcasting

Source§

fn provide<'a>(&'a self, request: &mut Request<'a>)

🔬This is a nightly-only experimental API. (error_generic_member_access)
Provides type-based access to context intended for error reports. Read more
Source§

impl From<ConvertError> for VideoDecodeError

Source§

fn from(source: ConvertError) -> Self

Converts to this type from the input type.
Source§

impl From<Error> for VideoDecodeError

Source§

fn from(source: Error) -> Self

Converts to this type from the input type.

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<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
where ST: ?Sized, DT: ?Sized,

Source§

impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
where ST: ?Sized, DT: ?Sized,

Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T> Instrument for T

Source§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
Source§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
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> Read<Exclusive, BecauseExclusive> for T
where T: ?Sized,

Source§

impl<T> ToSmolStr for T
where T: Display + ?Sized,

Source§

impl<T> ToString for T
where T: Display + ?Sized,

Source§

fn to_string(&self) -> String

Converts the given value to a String. Read more
Source§

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

Source§

type Error = !

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

impl<T> WithSubscriber for T

Source§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more