pub enum PacketBufferError {
Refcount {
len: usize,
},
Bounds {
offset: usize,
len: usize,
size: usize,
},
SideDataEntries {
count: i32,
cap: usize,
},
SideDataArray {
count: i32,
},
SideDataPayload {
index: usize,
size: usize,
},
SideDataBytes {
bytes: usize,
cap: usize,
},
UnrepresentableFlags {
raw: i32,
},
SideDataAlloc {
size: usize,
},
}Expand description
Why a packet could not be carried across the boundary — its payload, or the side data that comes with it.
Every arm means the bytes are real and this crate could not carry
them — never that there were none. “No payload” is Ok(None) from
FfmpegBuffer::from_packet, and keeping the two apart is the
whole point of the type: a demuxer that reads a refcount failure as
an empty marker drops a video packet under memory pressure and
carries on as though the file said so. The side-data arms exist for
the same reason one tier along — a packet whose side data cannot be
carried whole is refused, never delivered with some of it.
Variants§
Refcount
av_buffer_ref returned null — out of memory taking a second
reference to a payload that is there.
Bounds
The payload does not lie inside the packet’s own buffer.
AVPacket guarantees it does; a packet that says otherwise is
malformed, and wrapping it would hand out a view over memory the
buffer does not own.
Fields
SideDataEntries
A packet declares more side-data entries than this crate will walk, or a negative count.
The cap bounds the work a crafted packet can demand before it is
refused. It cannot trip on anything FFmpeg’s own packet API
produces: both av_packet_new_side_data and
av_packet_add_side_data replace an entry of the same type, so a
packet carries at most one entry per named type — forty-three in
this build, and the cap tracks that number if it ever grows past
the floor.
SideDataArray
A packet declares side-data entries and carries no array to read them from.
Malformed, and named rather than read as “no side data”: a null array with a positive count is the same silent loss as a truncated copy, reached through the pointer instead of the cap.
SideDataPayload
A side-data entry declares bytes it does not carry.
Fields
SideDataBytes
A packet’s side data is larger than this crate will copy.
Fields
UnrepresentableFlags
A packet carries flag bits the portable vocabulary cannot hold.
mediadecode’s PacketFlags is a u8 bit set, and every packet
flag FFmpeg names today lives in that byte — so this cannot fire
against this build. It exists so that the day one does not, the
packet is refused by name instead of arriving with a bit quietly
missing: the same rule the rest of this boundary keeps.
SideDataAlloc
Out of memory copying a side-data entry.
Trait Implementations§
Source§impl Clone for PacketBufferError
impl Clone for PacketBufferError
Source§fn clone(&self) -> PacketBufferError
fn clone(&self) -> PacketBufferError
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreimpl Copy for PacketBufferError
Source§impl Debug for PacketBufferError
impl Debug for PacketBufferError
Source§impl Display for PacketBufferError
impl Display for PacketBufferError
impl Eq for PacketBufferError
Source§impl Error for PacketBufferError
impl Error for PacketBufferError
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()