Struct symphonia_core::formats::Packet
source · [−]pub struct Packet {
pub ts: u64,
pub dur: u64,
pub trim_start: u32,
pub trim_end: u32,
pub data: Box<[u8]>,
/* private fields */
}Expand description
A Packet contains a discrete amount of encoded data for a single codec bitstream. The exact
amount of data is bounded, but not defined, and is dependant on the container and/or the
encapsulated codec.
Fields
ts: u64The timestamp of the packet. When gapless support is enabled, this timestamp is relative to the end of the encoder delay.
This timestamp is in TimeBase units.
dur: u64The duration of the packet. When gapless support is enabled, the duration does not include the encoder delay or padding.
The duration is in TimeBase units.
trim_start: u32When gapless support is enabled, this is the number of decoded frames that should be trimmed from the start of the packet to remove the encoder delay. Must be 0 in all other cases.
trim_end: u32When gapless support is enabled, this is the number of decoded frames that should be trimmed from the end of the packet to remove the encoder padding. Must be 0 in all other cases.
data: Box<[u8]>The packet buffer.
Implementations
Create a new Packet from a slice.
Create a new Packet from a boxed slice.
Create a new Packet with trimming information from a slice.
Create a new Packet with trimming information from a boxed slice.
Get the timestamp of the packet in TimeBase units.
If gapless support is enabled, then this timestamp is relative to the end of the encoder delay.
Get the duration of the packet in TimeBase units.
If gapless support is enabled, then this is the duration after the encoder delay and padding is trimmed.
Get the duration of the packet in TimeBase units if no decoded frames are trimmed.
If gapless support is disabled, then this is the same as the duration.
Get the number of frames to trim from the start of the decoded packet.
Get the number of frames to trim from the end of the decoded packet.
Get an immutable slice to the packet buffer.
Get a BufStream to read the packet data buffer sequentially.
Trait Implementations
Auto Trait Implementations
impl RefUnwindSafe for Packet
impl UnwindSafe for Packet
Blanket Implementations
Mutably borrows from an owned value. Read more