pub struct PacketMut { /* private fields */ }
Expand description
Packet with mutable data.
Implementations§
source§impl PacketMut
impl PacketMut
sourcepub fn new(size: usize) -> Self
pub fn new(size: usize) -> Self
Create a new packet of a given size. The time base of the packet will be in microseconds.
sourcepub fn stream_index(&self) -> usize
pub fn stream_index(&self) -> usize
Get stream index.
sourcepub fn with_stream_index(self, index: usize) -> Self
pub fn with_stream_index(self, index: usize) -> Self
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 with_key_flag(self, key: bool) -> Self
pub fn with_key_flag(self, key: bool) -> Self
Set or unset the key flag.