pub struct Vp9Packet {Show 25 fields
pub i: bool,
pub p: bool,
pub l: bool,
pub f: bool,
pub b: bool,
pub e: bool,
pub v: bool,
pub z: bool,
pub picture_id: u16,
pub picture_id_15_bits: bool,
pub tid: u8,
pub u: bool,
pub sid: u8,
pub d: bool,
pub pdiff: Vec<u8>,
pub tl0picidx: u8,
pub ns: u8,
pub y: bool,
pub g: bool,
pub ng: u8,
pub width: Vec<u16>,
pub height: Vec<u16>,
pub pgtid: Vec<u8>,
pub pgu: Vec<bool>,
pub pgpdiff: Vec<Vec<u8>>,
}Expand description
Vp9Packet represents the VP9 header that is stored in the payload of an RTP Packet
Every field describes the packet last given to Depacketizer::depacketize: a field the
packet did not carry reads 0 / false / empty. In particular the scalability structure
fields are those of a packet with V=1 only; a consumer that needs the stream’s current
structure keeps Vp9Packet::scalability_structure of the last packet that had one.
Fields§
§i: boolpicture ID is present
p: boolinter-picture predicted frame.
l: boollayer indices present
f: boolflexible mode. Read as false when I is 0, whatever the bit says (RFC 9628 section
4.2: F is ignored without a picture ID).
b: boolstart of frame. beginning of new vp9 frame
e: boolend of frame
v: boolscalability structure (SS) present
z: boolNot a reference frame for upper spatial layers
picture_id: u16Recommended headers 7 or 15 bits, picture ID.
picture_id_15_bits: boolWhether the picture ID was sent in 15 bits (M=1) rather than 7. The width can change
during a session; reference indices are computed modulo the width in use (RFC 9628
section 4.2).
tid: u8Conditionally recommended headers Temporal layer ID
u: boolSwitching up point
sid: u8Spatial layer ID
d: boolInter-layer dependency used
pdiff: Vec<u8>Conditionally required headers Reference index (F=1)
tl0picidx: u8Temporal layer zero index (F=0)
ns: u8Scalability structure headers N_S + 1 indicates the number of spatial layers present in the VP9 stream
y: boolEach spatial layer’s frame resolution present
g: boolPG description present flag.
ng: u8N_G indicates the number of pictures in a Picture Group (PG)
width: Vec<u16>Frame width for each spatial layer.
height: Vec<u16>Frame height for each spatial layer.
pgtid: Vec<u8>Temporal layer ID of pictures in a Picture Group
pgu: Vec<bool>Switching up point of pictures in a Picture Group
pgpdiff: Vec<Vec<u8>>Reference indices of pictures in a Picture Group
Implementations§
Source§impl Vp9Packet
impl Vp9Packet
Sourcepub fn scalability_structure(&self) -> Option<Vp9ScalabilityStructure>
pub fn scalability_structure(&self) -> Option<Vp9ScalabilityStructure>
The scalability structure this packet carried (V=1), if any.
Sourcepub fn referenced_picture_id(&self, reference_diff: u8) -> u16
pub fn referenced_picture_id(&self, reference_diff: u8) -> u16
The picture ID of the picture reference_diff pictures back (a P_DIFF of this
packet), computed modulo the width this packet’s picture ID was sent in (RFC 9628
section 4.2).
Trait Implementations§
Source§impl Depacketizer for Vp9Packet
impl Depacketizer for Vp9Packet
Source§fn depacketize(&mut self, packet: &Bytes) -> Result<Bytes>
fn depacketize(&mut self, packet: &Bytes) -> Result<Bytes>
depacketize parses the passed byte slice and stores the result in the Vp9Packet this method is called upon
Source§fn is_partition_head(&self, payload: &Bytes) -> bool
fn is_partition_head(&self, payload: &Bytes) -> bool
is_partition_head checks whether if this is a head of the VP9 partition
A picture starts at a packet with B=1 whose frame does not depend on a lower spatial
layer of the same picture: with D=1 the frame it depends on comes first, so a run of
packets that begins there has lost it.
Source§fn is_key_frame_start(&self, payload: &Bytes) -> bool
fn is_key_frame_start(&self, payload: &Bytes) -> bool
The first packet of a picture (is_partition_head:
B=1, not dependent on a lower spatial layer) of the base spatial layer whose P bit
is clear (RFC 9628 section 4.2: “P: Inter-picture predicted frame. When set to zero,
the frame does not utilize inter-picture prediction”). An upper spatial layer’s frame
with P=0 (a layer synchronization frame) is not one: the picture’s lower layers and
the other layers’ earlier pictures are still needed.
Source§fn is_partition_tail(&self, marker: bool, _payload: &Bytes) -> bool
fn is_partition_tail(&self, marker: bool, _payload: &Bytes) -> bool
Source§fn has_key_frames(&self) -> bool
fn has_key_frames(&self) -> bool
false, the default, is a format whose
frames stand alone (audio) or one this depacketizer cannot speak for.