pub struct StreamSelection {
pub url: String,
pub transport: Transport,
pub playback_kind: PlaybackKind,
pub rendition: Option<Rendition>,
pub available: Vec<QualityOption>,
pub media_source_id: Option<String>,
pub play_session_id: Option<String>,
pub needs_transcoding: bool,
}Expand description
Everything a player backend needs to open a stream, and everything the UI needs to describe it.
Replaces the bare String URL that get_video_stream_url used to return.
TRACES: UR-079 | DR-225, DR-227, DR-228
Fields§
§url: StringThe URL (or loopback URL) to open.
transport: TransportHow to fetch it. Replaces the .m3u8 substring check.
playback_kind: PlaybackKindWhat the server is doing to the source to produce it.
rendition: Option<Rendition>The negotiated rendition; None when direct-playing the source as-is.
available: Vec<QualityOption>What this media source can offer, for the quality picker (DR-227).
media_source_id: Option<String>The media source this selection is for, so a later re-open (quality change, audio-track switch, transcoded seek) targets the same one.
play_session_id: Option<String>The transcode identity the server keyed this job by, when there is one.
needs_transcoding: boolWhether the server is spending encoder time on this stream.
Derived from playback_kind rather than left for
the frontend to compute: “which kinds count as transcoding” is a domain
rule, and a direct stream is a remux that must not be counted. The
queue’s long-standing needs_transcoding flag and the seek strategy both
read this, so there is one answer rather than three.
TRACES: UR-079 | DR-225, DR-228
Implementations§
Source§impl StreamSelection
impl StreamSelection
Sourcepub fn local_file(url: impl Into<String>) -> Self
pub fn local_file(url: impl Into<String>) -> Self
A selection for a file already on disk.
A downloaded file is a direct play by definition — the bytes are the source’s — and offering a quality ladder over it would be a lie, since nothing about a local file can be re-negotiated.
TRACES: UR-071, UR-079 | DR-225
Sourcepub fn for_queued_item(
url: impl Into<String>,
transport: Option<Transport>,
needs_transcoding: bool,
) -> Self
pub fn for_queued_item( url: impl Into<String>, transport: Option<Transport>, needs_transcoding: bool, ) -> Self
A selection for an item already sitting in the queue.
The queue predates StreamSelection: its items carry a URL, an optional
transport and the older needs_transcoding flag. This rebuilds a
selection from those without re-negotiating with the server, so the
controller can hand an engine an OpenRequest for an item it already
holds.
The transport falls back rather than being sniffed from the URL — the
substring check is exactly what DR-230 removed. needs_transcoding is an
exact stand-in because every transcode this app requests is HLS (DR-140).
TRACES: UR-079, UR-081 | DR-225, DR-245
Trait Implementations§
Source§impl Clone for StreamSelection
impl Clone for StreamSelection
Source§fn clone(&self) -> StreamSelection
fn clone(&self) -> StreamSelection
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 StreamSelection
impl Debug for StreamSelection
Source§impl<'de> Deserialize<'de> for StreamSelection
impl<'de> Deserialize<'de> for StreamSelection
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Source§impl NamedType for StreamSelection
impl NamedType for StreamSelection
fn sid() -> SpectaID
Source§fn named_data_type(
type_map: &mut TypeCollection,
generics: &[DataType],
) -> NamedDataType
fn named_data_type( type_map: &mut TypeCollection, generics: &[DataType], ) -> NamedDataType
Source§fn definition_named_data_type(type_map: &mut TypeCollection) -> NamedDataType
fn definition_named_data_type(type_map: &mut TypeCollection) -> NamedDataType
Source§impl PartialEq for StreamSelection
impl PartialEq for StreamSelection
Source§fn eq(&self, other: &StreamSelection) -> bool
fn eq(&self, other: &StreamSelection) -> bool
self and other values to be equal, and is used by ==.Source§impl Serialize for StreamSelection
impl Serialize for StreamSelection
Source§impl Type for StreamSelection
impl Type for StreamSelection
Source§fn inline(type_map: &mut TypeCollection, generics: Generics<'_>) -> DataType
fn inline(type_map: &mut TypeCollection, generics: Generics<'_>) -> DataType
Source§fn reference(type_map: &mut TypeCollection, generics: &[DataType]) -> Reference
fn reference(type_map: &mut TypeCollection, generics: &[DataType]) -> Reference
definition will be put into the type map.impl Eq for StreamSelection
impl Flatten for StreamSelection
impl StructuralPartialEq for StreamSelection
Auto Trait Implementations§
impl Freeze for StreamSelection
impl RefUnwindSafe for StreamSelection
impl Send for StreamSelection
impl Sync for StreamSelection
impl Unpin for StreamSelection
impl UnsafeUnpin for StreamSelection
impl UnwindSafe for StreamSelection
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<'de, D, R> CommandArg<'de, R> for Dwhere
D: Deserialize<'de>,
R: Runtime,
impl<'de, D, R> CommandArg<'de, R> for Dwhere
D: Deserialize<'de>,
R: Runtime,
§fn from_command(command: CommandItem<'de, R>) -> Result<D, InvokeError>
fn from_command(command: CommandItem<'de, R>) -> Result<D, InvokeError>
§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.§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<T> FunctionArg for Twhere
T: Type,
impl<T> FunctionArg for Twhere
T: Type,
§fn to_datatype(type_map: &mut TypeCollection) -> Option<DataType>
fn to_datatype(type_map: &mut TypeCollection) -> Option<DataType>
DataType]. Read more