pub struct PesFrame {
pub track: usize,
pub pts: i64,
pub keyframe: bool,
pub data: Vec<u8>,
}Expand description
One frame of elementary stream data.
Fields§
§track: usizeTrack index (0-based, matches stream info track order).
pts: i64Presentation timestamp in nanoseconds.
keyframe: boolTrue if this is a keyframe (IDR for video).
data: Vec<u8>Raw elementary stream data (NAL units, audio samples, etc).
Implementations§
Source§impl PesFrame
impl PesFrame
Sourcepub fn serialize(&self, w: &mut dyn Write) -> Result<()>
pub fn serialize(&self, w: &mut dyn Write) -> Result<()>
Serialize to bytes: track(1) | pts(8) | keyframe(1) | len(4) | data
Sourcepub fn deserialize(r: &mut dyn Read) -> Result<Option<Self>>
pub fn deserialize(r: &mut dyn Read) -> Result<Option<Self>>
Deserialize from bytes. Returns None at EOF.
Sourcepub fn from_codec_frame(track: usize, frame: Frame) -> Self
pub fn from_codec_frame(track: usize, frame: Frame) -> Self
Create from a codec::Frame with a track index.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for PesFrame
impl RefUnwindSafe for PesFrame
impl Send for PesFrame
impl Sync for PesFrame
impl Unpin for PesFrame
impl UnsafeUnpin for PesFrame
impl UnwindSafe for PesFrame
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