pub struct MultichannelConfig {
pub order: MultichannelConfigOrder,
pub channel_count: u8,
pub extra: Vec<u8>,
}Expand description
Decoded body of an Enhanced RTMP v2
AudioPacketType.MultichannelConfig message
(enhanced-rtmp-v2.pdf §“ExAudioTagBody”). The body sits in
AudioTag::body verbatim on parse; callers can lift it into this
strongly-typed view via MultichannelConfig::parse and round-trip
back through MultichannelConfig::encode / [AudioTag::with_multichannel_config].
Per spec the body length depends on audio_channel_order:
Unspecified(0): 2 bytes (order,channel_count).Native(1): 6 bytes (order,channel_count, UI32 flags).Custom(2):2 + channel_countbytes (mapping is a UI8 per channel).
Any UI8 audio_channel_order value that is not one of those three
surfaces as MultichannelConfigOrder::Reserved — the parser does
not invent a layout, and the build path will encode just the
(order, channel_count) prefix, leaving any trailing bytes to the
caller via MultichannelConfig::extra.
Fields§
§order: MultichannelConfigOrderThe full discriminator union from the spec table. See
MultichannelConfigOrder for the shape per variant.
channel_count: u8Number of channels in the multichannel stream. UI8 on the wire, so values 0..=255 are representable.
extra: Vec<u8>Trailing bytes preserved verbatim when [order] is
MultichannelConfigOrder::Reserved (forward-compat with
future spec additions). Empty for the three recognised orders.
Implementations§
Source§impl MultichannelConfig
impl MultichannelConfig
Sourcepub fn parse(body: &[u8]) -> Result<MultichannelConfig>
pub fn parse(body: &[u8]) -> Result<MultichannelConfig>
Parse the body bytes of an AudioPacketType.MultichannelConfig
audio message (the bytes that sit in AudioTag::body after a
successful parse_audio call). Returns Err(Error::Other) on
truncation; an unrecognised audioChannelOrder does NOT trigger
an error — it is preserved as MultichannelConfigOrder::Reserved
and any trailing bytes flow through MultichannelConfig::extra.
Trait Implementations§
Source§impl Clone for MultichannelConfig
impl Clone for MultichannelConfig
Source§fn clone(&self) -> MultichannelConfig
fn clone(&self) -> MultichannelConfig
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for MultichannelConfig
impl Debug for MultichannelConfig
impl Eq for MultichannelConfig
Source§impl PartialEq for MultichannelConfig
impl PartialEq for MultichannelConfig
Source§fn eq(&self, other: &MultichannelConfig) -> bool
fn eq(&self, other: &MultichannelConfig) -> bool
self and other values to be equal, and is used by ==.