#[non_exhaustive]pub struct LayerIdentity {
pub layer_id: u16,
pub view_id: Option<u16>,
pub access_unit: Option<u64>,
}Expand description
Which layer / view a decoded VideoFrame
belongs to.
#[non_exhaustive]: build it with new and the
with_* builders, read the public fields directly. Default is
the base layer with no view and no access-unit index.
Fields (Non-exhaustive)§
This struct is marked as non-exhaustive
Struct { .. } syntax; cannot be matched against without a wildcard ..; and struct update syntax will not work.layer_id: u16The codec’s layer identifier for the frame (H.265 / H.266
nuh_layer_id, AV1 spatial_id, …). 0 is the base layer.
view_id: Option<u16>The view the frame belongs to, for multi-view content (the
codec’s view identifier, e.g. H.265 Annex F ViewId). None
when the stream is not multi-view or the decoder does not
know the mapping.
access_unit: Option<u64>Running index of the access unit (the set of pictures across
all layers that share one presentation instant) the frame comes
from, when the decoder counts them. Lets a consumer regroup the
per-layer frames of one instant without relying on equal pts
values. None when not tracked.
Implementations§
Source§impl LayerIdentity
impl LayerIdentity
Sourcepub const fn new(layer_id: u16) -> Self
pub const fn new(layer_id: u16) -> Self
Identity for layer_id, with no view and no access-unit index.
Sourcepub const fn base() -> Self
pub const fn base() -> Self
The base layer (layer_id == 0), no view, no access unit —
identical to Default.
Sourcepub const fn with_view_id(self, view_id: u16) -> Self
pub const fn with_view_id(self, view_id: u16) -> Self
Builder: set the view identifier.
Sourcepub const fn with_access_unit(self, index: u64) -> Self
pub const fn with_access_unit(self, index: u64) -> Self
Builder: set the access-unit index.
Sourcepub const fn is_base_layer(&self) -> bool
pub const fn is_base_layer(&self) -> bool
true for the base layer (layer_id == 0).
Sourcepub fn to_bytes(&self) -> [u8; 13]
pub fn to_bytes(&self) -> [u8; 13]
Fixed-size wire form used by the VideoFrame
side-channel record: one flags byte (bit 0 = view_id
present, bit 1 = access_unit present), then layer_id as
two little-endian bytes, view_id as two (zero when absent)
and access_unit as eight (zero when absent).