pub struct EncodedVideoPacket { /* private fields */ }Expand description
One owned Annex-B video access unit with microsecond presentation timing.
Implementations§
Source§impl EncodedVideoPacket
impl EncodedVideoPacket
Sourcepub fn new(
bitstream: Vec<u8>,
presentation_timestamp_micros: u64,
keyframe: bool,
) -> Result<Self>
pub fn new( bitstream: Vec<u8>, presentation_timestamp_micros: u64, keyframe: bool, ) -> Result<Self>
Construct a non-empty encoded access unit.
§Errors
Returns an error when bitstream is empty. The muxer validates Annex-B
framing when the packet is written.
Sourcepub fn new_with_timestamps(
bitstream: Vec<u8>,
presentation_timestamp_micros: u64,
decode_timestamp_micros: u64,
keyframe: bool,
) -> Result<Self>
pub fn new_with_timestamps( bitstream: Vec<u8>, presentation_timestamp_micros: u64, decode_timestamp_micros: u64, keyframe: bool, ) -> Result<Self>
Construct an access unit with distinct presentation and decode timing.
Packets are written in decode order. Presentation timestamps may reorder; decode timestamps must increase when packets enter a muxer.
§Errors
Returns an error when bitstream is empty.
Sourcepub const fn presentation_timestamp_micros(&self) -> u64
pub const fn presentation_timestamp_micros(&self) -> u64
Return the presentation timestamp in microseconds.
Sourcepub const fn decode_timestamp_micros(&self) -> u64
pub const fn decode_timestamp_micros(&self) -> u64
Return the decode timestamp in microseconds.
Sourcepub const fn is_keyframe(&self) -> bool
pub const fn is_keyframe(&self) -> bool
Return whether this packet is a random-access point.
Sourcepub fn into_bitstream(self) -> Vec<u8> ⓘ
pub fn into_bitstream(self) -> Vec<u8> ⓘ
Consume the packet and return its encoded bytes.
Trait Implementations§
Source§impl Clone for EncodedVideoPacket
impl Clone for EncodedVideoPacket
Source§impl Debug for EncodedVideoPacket
impl Debug for EncodedVideoPacket
impl Eq for EncodedVideoPacket
Source§impl PartialEq for EncodedVideoPacket
impl PartialEq for EncodedVideoPacket
impl StructuralPartialEq for EncodedVideoPacket
Auto Trait Implementations§
impl Forget for EncodedVideoPacket
impl Freeze for EncodedVideoPacket
impl Move for EncodedVideoPacket
impl RefUnwindSafe for EncodedVideoPacket
impl Send for EncodedVideoPacket
impl Sync for EncodedVideoPacket
impl Unpin for EncodedVideoPacket
impl UnsafeUnpin for EncodedVideoPacket
impl UnwindSafe for EncodedVideoPacket
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