pub struct ColorInfo {
pub color_config: Option<ColorConfig>,
pub hdr_cll: Option<HdrCll>,
pub hdr_mdcv: Option<HdrMdcv>,
}Expand description
Strongly-typed view of the "colorInfo" HDR metadata object carried in a
VideoPacketType.Metadata video message (Enhanced RTMP §“Metadata Frame”).
Each of the three sub-objects (colorConfig, hdrCll, hdrMdcv) is
Option: None means the property was absent from the wire object,
Some(..) (possibly all-None inside) means it was present. This
distinction matters because the spec’s “reset to the original color state”
signal is an empty object {} — distinct from omitting colorInfo
altogether (which sends Undefined, surfaced as ColorInfo::is_reset).
Lift it from a parsed metadata VideoTag with
VideoTag::color_info, and rebuild an outgoing tag with
VideoTag::color_info_tag.
Fields§
§color_config: Option<ColorConfig>§hdr_cll: Option<HdrCll>§hdr_mdcv: Option<HdrMdcv>Implementations§
Source§impl ColorInfo
impl ColorInfo
Sourcepub fn from_amf0(value: &Amf0Value) -> Result<ColorInfo>
pub fn from_amf0(value: &Amf0Value) -> Result<ColorInfo>
Decode a colorInfo value (the AMF value half of the
["colorInfo", value] pair) from an already-decoded Amf0Value.
- An
Amf0Value::Object/Amf0Value::EcmaArrayis walked for the three sub-objects. Amf0Value::Undefined(the spec’s RECOMMENDED reset signal) or an empty object decode to the all-Nonereset state.- Any other AMF type is rejected with
Error::Other.
Sourcepub fn is_reset(&self) -> bool
pub fn is_reset(&self) -> bool
True when this is the reset signal — no sub-object present. Encodes as
Undefined per the spec’s RECOMMENDED reset approach (see
ColorInfo::to_amf0).
Sourcepub fn to_amf0(&self) -> Amf0Value
pub fn to_amf0(&self) -> Amf0Value
Encode to the AMF value half of the ["colorInfo", value] pair.
The reset state (ColorInfo::is_reset) encodes as
Amf0Value::Undefined — the spec’s RECOMMENDED reset form. A
present-but-empty sub-object encodes as an empty {} object so the
presence bit round-trips.