pub struct CodecPacket {
pub pts: u64,
pub dts: u64,
pub duration: u32,
pub time_base: (u32, u32),
pub data: Vec<u8>,
pub flags: PacketFlags,
pub stream_index: u32,
}Expand description
A single codec-level packet (compressed frame data + timestamps).
Timestamps are stored as unsigned integers in time-base units. The time base is carried in the packet itself so that consumers do not need out-of-band information to interpret the timestamps.
Fields§
§pts: u64Presentation timestamp — when this frame should be displayed.
dts: u64Decode timestamp — when this frame must be decoded.
duration: u32Frame duration in time-base units.
time_base: (u32, u32)Time base as (numerator, denominator).
Seconds = pts * numerator / denominator.
data: Vec<u8>Compressed frame payload.
flags: PacketFlagsBoolean flags.
stream_index: u32Index of the stream this packet belongs to.
Implementations§
Source§impl CodecPacket
impl CodecPacket
Trait Implementations§
Source§impl Clone for CodecPacket
impl Clone for CodecPacket
Source§fn clone(&self) -> CodecPacket
fn clone(&self) -> CodecPacket
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreAuto Trait Implementations§
impl Freeze for CodecPacket
impl RefUnwindSafe for CodecPacket
impl Send for CodecPacket
impl Sync for CodecPacket
impl Unpin for CodecPacket
impl UnsafeUnpin for CodecPacket
impl UnwindSafe for CodecPacket
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more