#[non_exhaustive]pub struct AltrefStreamPacket {
pub bytes: Vec<u8>,
pub kind: AltrefPacketKind,
pub source_index: Option<u64>,
}Expand description
One packet emitted by Vp8AltrefStreamEncoder. The stream emits
more packets than source frames (one extra invisible anchor per
lookahead group); source_index ties visible packets back to their
source frame.
Fields (Non-exhaustive)§
This struct is marked as non-exhaustive
Non-exhaustive structs could have additional fields added in future. Therefore, non-exhaustive structs cannot be constructed in external crates using the traditional
Struct { .. } syntax; cannot be matched against without a wildcard ..; and struct update syntax will not work.bytes: Vec<u8>Raw VP8 elementary-stream bytes (one packet = one frame; feed to
crate::state::Vp8DecoderState::decode_frame in emission
order).
kind: AltrefPacketKindWhat the packet carries.
source_index: Option<u64>0-based index of the source frame this packet displays, or
None for an invisible anchor (which displays nothing).
Implementations§
Source§impl AltrefStreamPacket
impl AltrefStreamPacket
Sourcepub fn new(
bytes: Vec<u8>,
kind: AltrefPacketKind,
source_index: Option<u64>,
) -> Self
pub fn new( bytes: Vec<u8>, kind: AltrefPacketKind, source_index: Option<u64>, ) -> Self
Build a AltrefStreamPacket from every field.
Sourcepub fn with_bytes(self, v: Vec<u8>) -> Self
pub fn with_bytes(self, v: Vec<u8>) -> Self
Set bytes.
Sourcepub fn with_kind(self, v: AltrefPacketKind) -> Self
pub fn with_kind(self, v: AltrefPacketKind) -> Self
Set kind.
Sourcepub fn with_source_index(self, v: Option<u64>) -> Self
pub fn with_source_index(self, v: Option<u64>) -> Self
Set source_index.
Source§impl AltrefStreamPacket
impl AltrefStreamPacket
Sourcepub fn is_visible(&self) -> bool
pub fn is_visible(&self) -> bool
Convenience: true iff a player should display this packet’s
decoded picture (mirrors the §9.1 show_frame bit on the wire).
Trait Implementations§
Source§impl Clone for AltrefStreamPacket
impl Clone for AltrefStreamPacket
Auto Trait Implementations§
impl Forget for AltrefStreamPacket
impl Freeze for AltrefStreamPacket
impl Move for AltrefStreamPacket
impl RefUnwindSafe for AltrefStreamPacket
impl Send for AltrefStreamPacketwhere
RawVecInner: Send,
impl Sync for AltrefStreamPacketwhere
RawVecInner: Sync,
impl Unpin for AltrefStreamPacket
impl UnsafeUnpin for AltrefStreamPacket
impl UnwindSafe for AltrefStreamPacketwhere
RawVecInner: UnwindSafe,
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