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.
Trait Implementations§
impl Send for PacketMut
impl Sync for PacketMut
Auto Trait Implementations§
impl Freeze for PacketMut
impl RefUnwindSafe for PacketMut
impl Unpin for PacketMut
impl UnwindSafe for PacketMut
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