Skip to main content

ClientCapabilities

Struct ClientCapabilities 

Source
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

Source

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.

Source

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

Source

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.

Source

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.

Source

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).

Source

pub fn deliveries(&self) -> Vec<Delivery>

ClientCapabilities::delivery, with the default (range reads only) filled in when it is empty.

Trait Implementations§

Source§

impl Clone for ClientCapabilities

Source§

fn clone(&self) -> Self

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for ClientCapabilities

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Default for ClientCapabilities

Source§

fn default() -> Self

Returns the “default value” for a type. Read more
Source§

impl<'de> Deserialize<'de> for ClientCapabilities

Source§

fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>
where __D: Deserializer<'de>,

Deserialize this value from the given Serde deserializer. Read more
Source§

impl Eq for ClientCapabilities

Source§

impl PartialEq for ClientCapabilities

Source§

fn eq(&self, other: &Self) -> bool

Equality operator ==. Read more
1.0.0 (const: unstable) · Source§

fn ne(&self, other: &Rhs) -> bool

Inequality operator !=. Read more
Source§

impl Serialize for ClientCapabilities

Source§

fn serialize<__S>(&self, __serializer: __S) -> Result<__S::Ok, __S::Error>
where __S: Serializer,

Serialize this value into the given Serde serializer. Read more
Source§

impl StructuralPartialEq for ClientCapabilities

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> DeserializeOwned for T
where T: for<'de> Deserialize<'de>,

Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = !

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, !>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.