pub struct Capabilities {
pub video: bool,
pub audio_settings: bool,
pub subtitle_switching: bool,
pub audio_track_switching: bool,
pub seeks_transcoded_in_place: bool,
}Expand description
What an engine can do, so callers adapt without naming engines.
If a caller ever branches on which engine it holds, this struct is missing something — add it here rather than sniffing. Engine identity leaking into callers is the coupling DR-238 came from.
Fields§
§video: boolThe engine renders pictures, not only sound.
audio_settings: boolAudio settings (EQ, normalisation, gapless) are honoured.
subtitle_switching: boolSubtitle tracks can be selected without re-opening.
audio_track_switching: boolAudio tracks can be selected without re-opening.
seeks_transcoded_in_place: boolA server-side transcode can be seeked without re-opening the stream.
True for hls.js, which seeks within the VOD playlist it is handed and lets the server catch up. False for mpv, whose HLS demuxer cannot make the server transcode from a new offset.
Declared by the engine rather than inferred by the caller. The previous
design decided this from is_hls and use_html5 in a command handler —
on behalf of engines it did not own — which is how “who renders” came to
mean “how do I seek” and why a transcoded seek silently did nothing the
moment native video changed the renderer (DR-238).
Re-negotiating a stream needs the repository, which sits above the engine, so the engine states the capability and the caller acts on it.
Implementations§
Source§impl Capabilities
impl Capabilities
Sourcepub fn mpv() -> Self
pub fn mpv() -> Self
mpv.
Cannot seek a server-side transcode in place: its HLS demuxer will not make the server produce segments from a new offset, so the stream has to be re-opened.
Sourcepub fn exoplayer() -> Self
pub fn exoplayer() -> Self
ExoPlayer.
Can seek a transcode in place. It is a full HLS client, so like hls.js it seeks within the VOD playlist it was handed and lets the server catch up. Grouping it with mpv as “a native engine” gets this exactly backwards — being native is not the property that matters here, speaking HLS is, and that is the whole reason this is declared per engine rather than inferred from a category.
Trait Implementations§
Source§impl Clone for Capabilities
impl Clone for Capabilities
Source§fn clone(&self) -> Capabilities
fn clone(&self) -> Capabilities
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 Capabilities
impl Debug for Capabilities
Source§impl PartialEq for Capabilities
impl PartialEq for Capabilities
Source§fn eq(&self, other: &Capabilities) -> bool
fn eq(&self, other: &Capabilities) -> bool
self and other values to be equal, and is used by ==.impl Copy for Capabilities
impl Eq for Capabilities
impl StructuralPartialEq for Capabilities
Auto Trait Implementations§
impl Freeze for Capabilities
impl RefUnwindSafe for Capabilities
impl Send for Capabilities
impl Sync for Capabilities
impl Unpin for Capabilities
impl UnsafeUnpin for Capabilities
impl UnwindSafe for Capabilities
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key and return true if they are equal.