pub struct Packet {
pub stream_id: u32,
pub pts: i64,
pub dts: i64,
pub duration: u64,
pub is_keyframe: bool,
pub is_discard: bool,
pub payload: Bytes,
}Expand description
Elementary compressed packet passed between demuxers, decoders, encoders, and muxers.
payload uses Bytes so clones are reference-counted (cheap) instead of full
bitstream copies on hot paths.
Fields§
§stream_id: u32Stream / track ID this packet belongs to.
pts: i64Presentation timestamp unit count (may be negative after edit-list remap).
dts: i64Decode timestamp unit count (may be negative after edit-list remap).
duration: u64Duration of the packet in timestamp units.
is_keyframe: boolWhether this packet represents a keyframe / random access point.
is_discard: boolOutside the active edit window (decode dependency / padding). Decoders may skip.
payload: BytesCompressed bitstream payload bytes.
Trait Implementations§
impl Eq for Packet
impl StructuralPartialEq for Packet
Auto Trait Implementations§
impl !Freeze for Packet
impl RefUnwindSafe for Packet
impl Send for Packet
impl Sync for Packet
impl Unpin for Packet
impl UnsafeUnpin for Packet
impl UnwindSafe for Packet
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more