pub struct PacketInfo { /* private fields */ }Expand description
Read-only metadata extracted from a single demuxed packet.
PacketInfo contains scalar values copied out of an AVPacket together with
stream-type flags looked up at read time, so it has no lifetime ties to the
scanner. It is cheap to clone and store.
§Defensive fields
stream_index and size are clamped to non-negative values before storage.
FFmpeg’s internal asserts guarantee valid ranges in practice, so the clamping
is purely defensive and not expected to trigger.
Implementations§
Source§impl PacketInfo
impl PacketInfo
Sourcepub fn stream_index(&self) -> usize
pub fn stream_index(&self) -> usize
The index of the stream this packet belongs to.
Sourcepub fn pts(&self) -> Option<i64>
pub fn pts(&self) -> Option<i64>
Presentation timestamp in stream time-base units, if available.
Sourcepub fn dts(&self) -> Option<i64>
pub fn dts(&self) -> Option<i64>
Decompression timestamp in stream time-base units, if available.
Sourcepub fn is_keyframe(&self) -> bool
pub fn is_keyframe(&self) -> bool
Whether this packet contains a keyframe.
Sourcepub fn is_corrupt(&self) -> bool
pub fn is_corrupt(&self) -> bool
Whether this packet is flagged as corrupt.
Sourcepub fn data(&self) -> Option<&[u8]>
pub fn data(&self) -> Option<&[u8]>
The packet payload, when capture was enabled via
PacketScanner::set_capture_data (None otherwise). Useful for
content-level comparisons, e.g. verifying NAL layout of demuxed
samples.
Trait Implementations§
Source§impl Clone for PacketInfo
impl Clone for PacketInfo
Source§fn clone(&self) -> PacketInfo
fn clone(&self) -> PacketInfo
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more