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 from_decoders(decoders: Decoders, display: &DisplayCapabilities) -> Self
pub fn from_decoders(decoders: Decoders, display: &DisplayCapabilities) -> Self
What decoders play on display: PCM is always played (every
player outputs it), hardware decoders are only those it plays, no
delivery said is range reads then a progressive stream, and the
screen’s HDR and bit depth are the video limits. No height, frame
rate or bitrate limit: these are the decoders’ limits, and the
screen’s mode goes with each plan (ClientCapabilities::with_display);
the bitrate is the app’s setting.
Sourcepub fn probe(
probe_codec: &dyn CodecProbe,
display: &DisplayCapabilities,
player: Decoders,
) -> Self
pub fn probe( probe_codec: &dyn CodecProbe, display: &DisplayCapabilities, player: Decoders, ) -> Self
The iOS app’s probe, for any platform: player’s fixed lists (its
audio, containers, subtitles, delivery, and the video it plays in
software), plus each codec of its hardware_video (what decodes
in hardware, as the platform says), on display. probe_codec is
asked about each of candidate_codec_strings. The bit depth is
10 where HEVC decodes in hardware (Main 10), else 8, unless
display says its own.
Source§impl ClientCapabilities
impl ClientCapabilities
Sourcepub fn with_display(
&self,
display: Option<&DisplayCapabilities>,
) -> ClientCapabilities
pub fn with_display( &self, display: Option<&DisplayCapabilities>, ) -> ClientCapabilities
The capabilities a plan reads: these, with display’s HDR formats
and bit depth in place of ClientCapabilities::max_video’s, and
its height and frame rate as limits where it says them, never above
Hello’s. With or without a display, a height or frame rate of 0
is read as not said: the limits it gives never hold a 0.
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.