pub struct ClientCapabilities {
pub video: BTreeSet<VideoCodec>,
pub audio: BTreeSet<AudioCodec>,
pub containers: BTreeSet<Container>,
pub subtitles: BTreeSet<SubtitleFormat>,
pub delivery: Vec<Delivery>,
pub max_video: Option<VideoLimits>,
pub max_audio_channels: Option<u32>,
pub max_bitrate: Option<u64>,
pub hardware_video: Option<BTreeSet<VideoCodec>>,
pub video_codecs: Option<BTreeSet<String>>,
}Expand description
What a client can play. Belongs to the endpoint, not to a session: two profiles on one device have the same decoders. A client builds it from what it actually has (the Linux client from the GStreamer registry), not from a fixed list.
Every field is required on the wire: an empty set or null
says “none”, and a client that leaves a field out is refused.
Fields§
§video: BTreeSet<VideoCodec>§audio: BTreeSet<AudioCodec>§containers: BTreeSet<Container>§subtitles: BTreeSet<SubtitleFormat>§delivery: Vec<Delivery>How it takes media in, preferred first. Empty means range reads only.
max_video: Option<VideoLimits>§max_audio_channels: Option<u32>§max_bitrate: Option<u64>Bits per second, from the client’s settings. None: no limit.
hardware_video: Option<BTreeSet<VideoCodec>>The video codecs of ClientCapabilities::video it decodes in
hardware (PGPU-06): a conversion goes to a codec the GPU encodes
only if the device decodes it in hardware, so AV1 is not sent to a
device that would decode it in software, draining its battery.
None: it does not say, and every codec it plays counts. Unlike
the fields above it may be left out, and is None then.
video_codecs: Option<BTreeSet<String>>The RFC 6381 codec strings it plays (hvc1.2.4.L153.B0,
dvh1.08.06; CodecString), as its player answers for each:
a video is copied only where one of them covers the source’s own
string (its profile, tier and level, its Dolby Vision profile).
One the server does not read is passed over. None: it does not
say, and ClientCapabilities::video and max_video alone
decide. It may be left out, and is None then.
Implementations§
Source§impl ClientCapabilities
impl ClientCapabilities
Sourcepub fn with_display(
&self,
display: Option<&DisplayCapabilities>,
) -> ClientCapabilities
pub fn with_display( &self, display: Option<&DisplayCapabilities>, ) -> ClientCapabilities
These capabilities with display’s HDR formats and bit depth in
place of ClientCapabilities::max_video’s; unchanged without a
display.
Sourcepub fn plays_codec_string(&self, source: &CodecString) -> Option<bool>
pub fn plays_codec_string(&self, source: &CodecString) -> Option<bool>
Whether it plays a video whose own codec string is source, by
ClientCapabilities::video_codecs: some string listed there
covers it. None when it lists none (it
does not say), and nothing is known of it here.
Sourcepub fn decodes_in_hardware(&self, codec: VideoCodec) -> bool
pub fn decodes_in_hardware(&self, codec: VideoCodec) -> bool
Whether it decodes codec in hardware, as it says; every codec it
plays when it does not say (PGPU-06).
Sourcepub fn deliveries(&self) -> Vec<Delivery>
pub fn deliveries(&self) -> Vec<Delivery>
ClientCapabilities::delivery, with the default (range reads
only) filled in when it is empty.