#[non_exhaustive]pub enum ScalabilityMode {
Show 36 variants
L1T1,
L1T2,
L1T3,
L2T1,
L2T2,
L2T3,
L3T1,
L3T2,
L3T3,
L2T1h,
L2T2h,
L2T3h,
L3T1h,
L3T2h,
L3T3h,
S2T1,
S2T2,
S2T3,
S2T1h,
S2T2h,
S2T3h,
S3T1,
S3T2,
S3T3,
S3T1h,
S3T2h,
S3T3h,
L2T2_KEY,
L2T2_KEY_SHIFT,
L2T3_KEY,
L2T3_KEY_SHIFT,
L3T1_KEY,
L3T2_KEY,
L3T2_KEY_SHIFT,
L3T3_KEY,
L3T3_KEY_SHIFT,
}Expand description
A scalability mode: a value of RTCRtpEncodingParameters.scalabilityMode (W3C
webrtc-svc, section 5). The identifiers are case sensitive and limited to the
specification’s table; FromStr accepts exactly those.
The table can grow (section 5.1 says how a mode is added), so the enum is non-exhaustive.
Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
L1T1
"L1T1".
L1T2
"L1T2".
L1T3
"L1T3".
L2T1
"L2T1".
L2T2
"L2T2".
L2T3
"L2T3".
L3T1
"L3T1".
L3T2
"L3T2".
L3T3
"L3T3".
L2T1h
"L2T1h".
L2T2h
"L2T2h".
L2T3h
"L2T3h".
L3T1h
"L3T1h".
L3T2h
"L3T2h".
L3T3h
"L3T3h".
S2T1
"S2T1".
S2T2
"S2T2".
S2T3
"S2T3".
S2T1h
"S2T1h".
S2T2h
"S2T2h".
S2T3h
"S2T3h".
S3T1
"S3T1".
S3T2
"S3T2".
S3T3
"S3T3".
S3T1h
"S3T1h".
S3T2h
"S3T2h".
S3T3h
"S3T3h".
L2T2_KEY
"L2T2_KEY".
L2T2_KEY_SHIFT
"L2T2_KEY_SHIFT".
L2T3_KEY
"L2T3_KEY".
L2T3_KEY_SHIFT
"L2T3_KEY_SHIFT".
L3T1_KEY
"L3T1_KEY".
L3T2_KEY
"L3T2_KEY".
L3T2_KEY_SHIFT
"L3T2_KEY_SHIFT".
L3T3_KEY
"L3T3_KEY".
L3T3_KEY_SHIFT
"L3T3_KEY_SHIFT".
Implementations§
Source§impl ScalabilityMode
impl ScalabilityMode
Sourcepub fn spatial_layers(&self) -> u8
pub fn spatial_layers(&self) -> u8
The number of spatial layers (for an “S” mode, of simulcast encodings).
Sourcepub fn temporal_layers(&self) -> u8
pub fn temporal_layers(&self) -> u8
The number of temporal layers.
Sourcepub fn inter_layer_prediction(&self) -> InterLayerPrediction
pub fn inter_layer_prediction(&self) -> InterLayerPrediction
How the spatial layers depend on each other.
Sourcepub fn resolution_ratio(&self) -> Option<ResolutionRatio>
pub fn resolution_ratio(&self) -> Option<ResolutionRatio>
The ratio between neighbouring spatial layers’ resolutions; None for a mode with one
spatial layer.
Sourcepub fn has_temporal_shift(&self) -> bool
pub fn has_temporal_shift(&self) -> bool
Whether the temporal layers of the spatial layers are shifted against each other (the
_SHIFT modes), so that the frames of one picture are of different temporal layers.
Sourcepub fn is_simulcast(&self) -> bool
pub fn is_simulcast(&self) -> bool
Whether this is an “S” mode: simulcast encodings transported in one RTP stream. The specification allows no more than one active encoding next to an active “S” mode encoding (sections 3.2.1 and 3.2.2).
Sourcepub fn is_single_layer(&self) -> bool
pub fn is_single_layer(&self) -> bool
Whether the mode turns scalable coding off: "L1T1" (section 3.2.2).
Sourcepub fn supported_by(&self, mime_type: &str) -> bool
pub fn supported_by(&self, mime_type: &str) -> bool
Whether a codec can carry the mode, by its MIME type ("video/VP9", compared without
regard to case). Section 5: AV1 and VP9 support every mode of the table; VP8, H.264
and H.265 “only support temporal scalability” and “only permit transport of simulcast
on distinct SSRCs”. For any other codec only "L1T1", which is no scalability.
Sourcepub fn supported_modes(mime_type: &str) -> Vec<ScalabilityMode>
pub fn supported_modes(mime_type: &str) -> Vec<ScalabilityMode>
The modes a codec can carry, in the table’s order: what a capability report lists as
the codec’s scalabilityModes.