1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
use super::VideoCodec;
/// Error produced while configuring or driving a video backend.
#[derive(Debug, thiserror::Error)]
pub enum VideoError {
/// Decoder options were internally inconsistent.
#[error("invalid decoder option: {0}")]
InvalidOption(&'static str),
/// Input did not contain a valid Annex-B NAL unit sequence.
#[error("invalid Annex-B access unit: {0}")]
InvalidAnnexB(&'static str),
/// A NAL unit cannot be represented by the target framing format.
#[error("NAL unit is too large: {0} bytes")]
NalUnitTooLarge(usize),
/// Codec configuration did not match the submitted stream.
#[error("decoder is configured for {configured}, but received {received}")]
CodecMismatch {
/// Active decoder codec.
configured: VideoCodec,
/// Submitted access-unit codec.
received: VideoCodec,
},
/// The current platform does not provide the requested decoder.
#[error("{codec} is not supported by the {backend} backend")]
UnsupportedCodec {
/// Requested codec.
codec: VideoCodec,
/// Backend identifier.
backend: &'static str,
},
/// The codec exists on this platform, but no hardware decoder is advertised.
#[error("no hardware {codec} decoder is available through {backend}")]
HardwareDecoderUnavailable {
/// Requested codec.
codec: VideoCodec,
/// Backend identifier.
backend: &'static str,
},
/// A native platform call returned an error status.
#[error("{api} failed with platform status {status}")]
Platform {
/// Native API that failed.
api: &'static str,
/// Native status code.
status: i32,
},
/// A backend operation failed with a platform-specific diagnostic.
#[error("{backend} {operation} failed: {message}")]
Backend {
/// Decoder backend identifier.
backend: &'static str,
/// Operation that failed.
operation: &'static str,
/// Native library diagnostic.
message: String,
},
}