pub struct DataPacket<E, D> { /* private fields */ }Expand description
A timed opaque-data packet — timecode, KLV, timed ID3.
Data tracks are real packet streams: they run along the file’s
timeline and carry a payload per timestamp. They are never
reordered, so — like SubtitlePacket and for the same reason —
there is no DTS seat; a data packet’s presentation time is its
decode time.
Clone and Debug derive directly — see VideoPacket’s docs
for why the per-parameter bound this produces is already precise.
Implementations§
Source§impl<E, D> DataPacket<E, D>
impl<E, D> DataPacket<E, D>
Sourcepub const fn new(data: D, extra: E) -> Self
pub const fn new(data: D, extra: E) -> Self
Constructs a DataPacket from data and extra. Timestamps
default to None and flags to empty.
Sourcepub const fn flags(&self) -> PacketFlags
pub const fn flags(&self) -> PacketFlags
Returns the packet flags.
Sourcepub fn extra_mut(&mut self) -> &mut E
pub fn extra_mut(&mut self) -> &mut E
Returns a mutable reference to the backend-specific extras.
Sourcepub fn into_parts(self) -> (D, E)
pub fn into_parts(self) -> (D, E)
Consumes the packet and returns (buffer, extras).
Sourcepub const fn with_duration(self, v: Option<Timestamp>) -> Self
pub const fn with_duration(self, v: Option<Timestamp>) -> Self
Sets the duration (consuming builder).
Sourcepub const fn with_flags(self, v: PacketFlags) -> Self
pub const fn with_flags(self, v: PacketFlags) -> Self
Sets the flags (consuming builder).
Sourcepub const fn set_duration(&mut self, v: Option<Timestamp>) -> &mut Self
pub const fn set_duration(&mut self, v: Option<Timestamp>) -> &mut Self
Sets the duration in place.
Sourcepub const fn set_flags(&mut self, v: PacketFlags) -> &mut Self
pub const fn set_flags(&mut self, v: PacketFlags) -> &mut Self
Sets the flags in place.