Skip to main content

FrameDefect

Enum FrameDefect 

Source
#[non_exhaustive]
pub enum FrameDefect {
Show 70 variants UnknownEnvelopeCodec { fourcc: u32, }, Layout(LayoutDefect), ImageDimension { codec: ImageCodecKind, dimension: ImageAxisKind, length: usize, maximum: usize, }, MetadataMissingTerminator, MetadataInteriorNul, MetadataNullData, NullVideoData, NullAudioData, AudioMisaligned, EmptyAudioHasData, V210Stride, V210Storage, V210Width, P216LayoutMismatch, PlanarAudioMismatch, FrameSyncAudioMismatch, PacketHeaderTruncated, PacketHeaderSize, PacketHeaderUnsupported, PacketCodecMismatch, EmptyCodecPayload, PacketLengthsMismatch, KeyframeConfigurationMissing, AacKeyframeMissing, AacConfigurationMissing, AacRateMismatch, AacChannelsMismatch, PacketLength, PacketLengthOverflow, PacketTruncated, PacketSizeOverflow, PacketPayloadSize, UnknownCompressedVideo, SpeedHqQuality, PreviewVideoDimensions, CompressedVideoSize, SpeedHqTruncated, OpusSampleRate, OpusDuration, AacSampleCount, AacSampleRate, AacChannels, CompressedAudioSize, CompressedBuffer, ScatterBlockCount, EmptyScatterBlock, ScatterSize, ScatterHeader, UnknownCompressedAudio, UnknownScanType { code: u32, }, AudioBufferTooSmall { actual: usize, minimum: usize, }, MetadataNegativeLength { length: i32, }, MetadataTooLarge { length: usize, }, MetadataUnterminated, VideoDataLength { actual: usize, expected: usize, }, AudioDataLength { detail: CompactDiagnostic<AudioLengthDefect>, }, EmptyAudioStride { stride: i32, }, EmptyAudioFormat { sample_rate: i32, channels: i32, }, UnknownAudioFormat { fourcc: u32, }, UnknownPixelFormat { fourcc: u32, }, FrameSyncAudioInput { channels: usize, samples: usize, }, VideoBufferTooSmall { format: PixelFormat, actual: usize, minimum: usize, }, V210BufferTooSmall { actual: usize, minimum: usize, }, InterleavedAudioLength { actual: usize, channels: u32, }, AudioDestinationLength { actual: usize, minimum: usize, }, ColorMetadataWithheld { status: FrameMetadataStatus, }, ConflictingColorMetadata { first: ColorInfo, second: ColorInfo, }, HdrRefused { transfer: TransferFunction, }, ColorMetadata { issue: ColorMetadataDefect, diagnostic: Box<str>, }, EncodingFailed { codec: ImageCodecKind, diagnostic: Box<str>, },
}
Expand description

Typed causes of crate::Error::InvalidFrame.

Shared layout refusals use FrameDefect::Layout and LayoutDefect. Ordinary causes retain their evidence inline without allocating. Boxed diagnostic fields retain caller or SDK text only for the documented exceptions.

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

UnknownEnvelopeCodec

A FourCC does not identify a supported packet-envelope codec.

Fields

§fourcc: u32

The unrecognized FourCC value.

§

Layout(LayoutDefect)

A refusal of the shared media layout or value checks.

§

ImageDimension

A codec cannot encode this dimension.

Fields

§codec: ImageCodecKind

The codec.

§dimension: ImageAxisKind

The dimension.

§length: usize

The actual length.

§maximum: usize

The codec’s maximum.

§

MetadataMissingTerminator

Metadata frame length does not include a trailing NUL terminator.

§

MetadataInteriorNul

Metadata frame contains an interior NUL byte.

§

MetadataNullData

Metadata frame has non-zero length with null data pointer.

§

NullVideoData

Video frame has null data pointer.

§

NullAudioData

Audio frame has null data pointer.

§

AudioMisaligned

Audio data pointer is not aligned for f32.

§

EmptyAudioHasData

Zero-length audio frame has non-null data pointer.

§

V210Stride

V210 stride must be a multiple of four and cover every complete pixel group.

§

V210Storage

V210 storage exceeds the video limit.

§

V210Width

V210 conversion requires a positive width divisible by six.

§

P216LayoutMismatch

P216 frame format and dimensions must match the V210 layout.

§

PlanarAudioMismatch

planar destination rate, channels and samples must match the interleaved source.

§

FrameSyncAudioMismatch

The SDK returned FrameSync audio with dimensions different from the request.

§

PacketHeaderTruncated

Truncated compressed packet header.

§

PacketHeaderSize

Unsupported compressed packet header size.

§

PacketHeaderUnsupported

Cannot send a packet with an unsupported header version or unknown flags.

§

PacketCodecMismatch

Packet codec does not match the frame’s codec.

§

EmptyCodecPayload

Empty codec payload.

§

PacketLengthsMismatch

Packet header lengths do not match the size of the frame.

§

KeyframeConfigurationMissing

Keyframes require codec configuration data.

§

AacKeyframeMissing

AAC packets must carry the keyframe flag.

§

AacConfigurationMissing

AAC packets require their AudioSpecificConfig as codec configuration data.

§

AacRateMismatch

The AAC configuration names a different sample rate than the frame.

§

AacChannelsMismatch

The AAC configuration names a different channel layout than the frame.

§

PacketLength

Invalid compressed packet length.

§

PacketLengthOverflow

Compressed packet length overflow.

§

PacketTruncated

Truncated compressed packet.

§

PacketSizeOverflow

Packet size overflow.

§

PacketPayloadSize

Invalid compressed packet payload size.

§

UnknownCompressedVideo

Unknown compressed video FourCC.

§

SpeedHqQuality

A SpeedHQ frame begins with its quality, a byte below 100.

§

PreviewVideoDimensions

An H.264 or HEVC picture on the preview stream is at most 640 pixels wide and 640 high.

§

CompressedVideoSize

Invalid compressed video size.

§

SpeedHqTruncated

Truncated SpeedHQ frame.

§

OpusSampleRate

Opus is sent at 8000, 12000, 16000, 24000 or 48000 Hz.

§

OpusDuration

An Opus frame holds 2.5, 5, 10, 20, 40 or 60 ms of audio.

§

AacSampleCount

An AAC frame holds 1024 samples per channel.

§

AacSampleRate

AAC is sent at a sample rate its configuration can name, from 7350 to 96000 Hz.

§

AacChannels

AAC is sent with one to six or eight channels.

§

CompressedAudioSize

Invalid compressed audio size.

§

CompressedBuffer

Invalid compressed frame buffer.

§

ScatterBlockCount

Invalid scatter block count.

§

EmptyScatterBlock

Scatter blocks must not be empty.

§

ScatterSize

Scatter frame exceeds the packet size limit.

§

ScatterHeader

The first scatter block must hold the frame’s complete header.

§

UnknownCompressedAudio

Unknown compressed audio FourCC.

§

UnknownScanType

Unknown scan type: 0x{code:08X}.

Fields

§code: u32

The code.

§

AudioBufferTooSmall

Audio buffer has {actual} samples, requires at least {minimum}.

Fields

§actual: usize

The actual.

§minimum: usize

The minimum.

§

MetadataNegativeLength

Metadata frame has negative length: {length}.

Fields

§length: i32

The length.

§

MetadataTooLarge

Metadata exceeds maximum size: {length} bytes > {MAX_METADATA_BYTES} bytes.

Fields

§length: usize

The length.

§

MetadataUnterminated

Frame metadata is missing a NUL terminator within {MAX_METADATA_BYTES} bytes.

§

VideoDataLength

Video data length {actual}, expected {expected} bytes for validated layout.

Fields

§actual: usize

The actual.

§expected: usize

The expected.

§

AudioDataLength

Audio data length {actual}, expected {expected} samples ({channels} channels x {samples} samples) for validated layout.

Fields

§detail: CompactDiagnostic<AudioLengthDefect>

Exact values, boxed only on 32-bit targets.

§

EmptyAudioStride

Zero-length audio frame has non-zero channel_stride_in_bytes: {stride}.

Fields

§stride: i32

The stride.

§

EmptyAudioFormat

Invalid zero-length audio state: sample_rate={sample_rate}, no_channels={channels}.

Fields

§sample_rate: i32

The sample rate.

§channels: i32

The channels.

§

UnknownAudioFormat

Unknown audio format FourCC: 0x{fourcc:08X}.

Fields

§fourcc: u32

The fourcc.

§

UnknownPixelFormat

Unknown pixel format FourCC: 0x{fourcc:08X}.

Fields

§fourcc: u32

The fourcc.

§

FrameSyncAudioInput

FrameSync audio input-format query returned {channels} channels of {samples} samples.

Fields

§channels: usize

The channels.

§samples: usize

The samples.

§

VideoBufferTooSmall

Buffer too small for {format:?}: got {actual} bytes, expected at least {minimum}.

Fields

§format: PixelFormat

The format.

§actual: usize

The actual.

§minimum: usize

The minimum.

§

V210BufferTooSmall

V210 buffer has {actual} words, requires {minimum}.

Fields

§actual: usize

The actual.

§minimum: usize

The minimum.

§

InterleavedAudioLength

interleaved audio has {actual} samples, which is not a multiple of {channels} channels.

Fields

§actual: usize

The actual.

§channels: u32

The channels.

§

AudioDestinationLength

audio destination has {actual} samples, requires {minimum}.

Fields

§actual: usize

The actual.

§minimum: usize

The minimum.

§

ColorMetadataWithheld

The frame’s color description cannot be read because its metadata was withheld ({status:?}); ColorPolicy::Override explicitly supplies its color conversion.

Fields

§status: FrameMetadataStatus

The status.

§

ConflictingColorMetadata

The frame’s metadata holds ndi_color_info elements that differ: {first:?} and {second:?}.

Fields

§first: ColorInfo

The first.

§second: ColorInfo

The second.

§

HdrRefused

The frame’s ndi_color_info gives the {transfer} transfer function; HdrPolicy::CodeValues encodes its code values to a tagged PNG.

Fields

§transfer: TransferFunction

The transfer.

§

ColorMetadata

Malformed color text; the issue is typed and its original diagnostic is boxed.

Fields

§issue: ColorMetadataDefect

The syntax or value refusal.

§diagnostic: Box<str>

Original text, including the bounded peer-text excerpt.

§

EncodingFailed

The encoder’s diagnostic, whose content is supplied by that library.

Fields

§codec: ImageCodecKind

The encoder.

§diagnostic: Box<str>

The library diagnostic.

Trait Implementations§

Source§

impl Clone for FrameDefect

Source§

fn clone(&self) -> Self

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

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

Performs copy-assignment from source. Read more
Source§

impl Debug for FrameDefect

Source§

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

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

impl Display for FrameDefect

Source§

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

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

impl Error for FrameDefect

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 PartialEq for FrameDefect

Source§

fn eq(&self, other: &Self) -> bool

Equality operator ==. Read more
1.0.0 (const: unstable) · Source§

fn ne(&self, other: &Rhs) -> bool

Inequality operator !=. Read more
Source§

impl StructuralPartialEq for FrameDefect

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<T> CloneToUninit for T
where T: Clone,

Source§

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

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

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> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

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

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

Uses borrowed data to replace owned data, usually by cloning. Read more
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, !>

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.