pub struct Packet { /* private fields */ }
Expand description
Packet with immutable data.
Implementations§
source§impl Packet
impl Packet
sourcepub fn stream_index(&self) -> usize
pub fn stream_index(&self) -> usize
Get stream index.
sourcepub fn with_stream_index(self, index: usize) -> Packet
pub fn with_stream_index(self, index: usize) -> Packet
Set stream index.
sourcepub fn with_time_base(self, time_base: TimeBase) -> Self
pub fn with_time_base(self, time_base: TimeBase) -> Self
Set packet time base. (This will rescale the current timestamps into a given time base.)
sourcepub fn with_raw_pts(self, pts: i64) -> Self
pub fn with_raw_pts(self, pts: i64) -> Self
Set packet presentation timestamp without time base.
sourcepub fn with_raw_dts(self, dts: i64) -> Self
pub fn with_raw_dts(self, dts: i64) -> Self
Set packet decoding timestamp without time base.
sourcepub fn duration(&self) -> Option<Duration>
pub fn duration(&self) -> Option<Duration>
Get packet duration.
The method returns None
if the duration is lower or equal to zero.
sourcepub fn with_duration(self, duration: Duration) -> Self
pub fn with_duration(self, duration: Duration) -> Self
Set packet duration.
sourcepub fn raw_duration(&self) -> i64
pub fn raw_duration(&self) -> i64
Get packet duration in time base units.
sourcepub fn with_raw_duration(self, duration: i64) -> Self
pub fn with_raw_duration(self, duration: i64) -> Self
Set packet duration in time base units.
sourcepub fn try_into_mut(self) -> Result<PacketMut, Self>
pub fn try_into_mut(self) -> Result<PacketMut, Self>
Try to make this packet mutable.
The method returns PacketMut
if the packet can be made mutable
without copying the data, otherwise it returns Packet
.