pub struct ConnectCapabilities {
pub fourcc_list: Vec<String>,
pub video_fourcc_info_map: FourCcInfoMap,
pub audio_fourcc_info_map: FourCcInfoMap,
pub caps_ex: u32,
pub object_encoding: Option<u8>,
}Expand description
Capability block exchanged in the NetConnection connect command.
Owns all four spec entries (fourCcList, videoFourCcInfoMap,
audioFourCcInfoMap, capsEx) plus the long-standing
objectEncoding byte. Encoded into the existing Command Object by
Self::encode_into without touching the surrounding key order, and
parsed back with Self::from_amf0 from either the client’s
Command Object or the server’s _result properties object.
A default-constructed instance is empty — is_empty() is true and
encode_into writes nothing, so a caller composing a legacy AVC /
AAC-only connect command keeps the pre-2023 byte layout exactly.
Fields§
§fourcc_list: Vec<String>fourCcList — Enhanced RTMP v1 strict-array of supported FourCC
strings (e.g. "av01", "hvc1"). The v2 spec deprecates this on
the client side in favour of audio/videoFourCcInfoMap, but
servers are encouraged to keep supporting both for older clients.
video_fourcc_info_map: FourCcInfoMapvideoFourCcInfoMap — v2 per-codec capability bits for video
codecs.
audio_fourcc_info_map: FourCcInfoMapaudioFourCcInfoMap — v2 per-codec capability bits for audio
codecs.
caps_ex: u32capsEx — v2 bag of extended capability bits.
object_encoding: Option<u8>objectEncoding — 0 for AMF0-only, 3 for AMF0+AMF3.
Implementations§
Source§impl ConnectCapabilities
impl ConnectCapabilities
Sourcepub fn supports_caps_ex(&self, mask: u32) -> bool
pub fn supports_caps_ex(&self, mask: u32) -> bool
Test for a specific CapsExMask flag.
Sourcepub fn has_fourcc(&self, key: &str) -> bool
pub fn has_fourcc(&self, key: &str) -> bool
True when fourcc_list includes either the wildcard "*" or
the literal FourCC key.
Sourcepub fn encode_into(&self, pairs: &mut Vec<(String, Amf0Value)>)
pub fn encode_into(&self, pairs: &mut Vec<(String, Amf0Value)>)
Append our capability properties to a command-object pair list.
Each property is only appended when the corresponding field is
non-default, so encoding an empty block adds zero bytes. Caller
keeps any other Command Object properties they want around the
call site — pairs is mutated in place.
Sourcepub fn from_amf0(v: &Amf0Value) -> Self
pub fn from_amf0(v: &Amf0Value) -> Self
Parse any subset of capability properties out of an Object /
ECMA-array. Missing properties stay at their default; malformed
values are silently ignored (the spec’s “fail gracefully” rule —
a forged capsEx = "abc" from a stale peer must not abort the
connect handshake).
Trait Implementations§
Source§impl Clone for ConnectCapabilities
impl Clone for ConnectCapabilities
Source§fn clone(&self) -> ConnectCapabilities
fn clone(&self) -> ConnectCapabilities
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 ConnectCapabilities
impl Debug for ConnectCapabilities
Source§impl Default for ConnectCapabilities
impl Default for ConnectCapabilities
Source§fn default() -> ConnectCapabilities
fn default() -> ConnectCapabilities
impl Eq for ConnectCapabilities
Source§impl PartialEq for ConnectCapabilities
impl PartialEq for ConnectCapabilities
Source§fn eq(&self, other: &ConnectCapabilities) -> bool
fn eq(&self, other: &ConnectCapabilities) -> bool
self and other values to be equal, and is used by ==.