Skip to main content

PlaybackPlan

Enum PlaybackPlan 

Source
pub enum PlaybackPlan {
    Direct {
        container: Container,
        video: Option<VideoCodec>,
        audio: Option<PlannedAudio>,
        subtitle: Option<PlannedSubtitle>,
        source_codec: Option<String>,
    },
    Converted {
        delivery: Delivery,
        container: Container,
        video: Option<ConvertedVideo>,
        audio: Option<ConvertedAudio>,
        subtitle: Option<ConvertedSubtitle>,
        ladder: Vec<Rung>,
        reasons: Vec<String>,
        source_codec: Option<String>,
    },
    Unsupported {
        reasons: Vec<String>,
    },
    Unknown,
}

Variants§

§

Direct

The client plays the file as it is.

Fields

§container: Container
§source_codec: Option<String>

The source video’s RFC 6381 codec string as the plan judged it against ClientCapabilities::video_codecs (hvc1.2.4.L153.B0; dvh1.08.06 for Dolby Vision shown as such): for a client’s log. None where the server did not read it, or there is no video. It may be left out, and is None then.

§

Converted

The server converts the file for this client: copies the streams that fit, encodes the ones that do not, and delivers the result as delivery says. A remux is a plan whose streams are all Copy.

Fields

§delivery: Delivery
§container: Container

The container of the output.

§ladder: Vec<Rung>

The encodes an HLS player switches between as its link changes, highest first: video is the first of them. Empty for one encode, as every plan but Auto quality over HLS is.

§reasons: Vec<String>

Why the file is not played as it is, one per stream that is converted, e.g. “subtitle 0: pgs cannot be shown; burned into the video”. A client can offer to avoid them (subtitles off).

§source_codec: Option<String>

As in Direct.

§

Unsupported

The client cannot play this selection. Each reason names a stream and why, e.g. “audio 0: dts not supported”.

Fields

§reasons: Vec<String>
§

Unknown

A plan kind this build does not know.

Implementations§

Source§

impl PlaybackPlan

The parts of a plan a player reads, by value.

Source

pub fn kind(&self) -> PlanKind

What kind of play it is (PlaybackPlan::summary’s).

Source

pub fn converted_video(&self) -> Option<ConvertedVideo>

A converted plan’s video: copied or encoded; None for any other plan, or no video.

Source

pub fn audio_action(&self) -> Option<AudioAction>

What a converted plan does to the audio; None for any other plan, or no audio.

Source

pub fn subtitle_action(&self) -> Option<SubtitleAction>

What a converted plan does to the subtitle; None for any other plan, or none picked.

Source

pub fn burns_in_subtitle(&self) -> bool

The subtitle is drawn into the video: the player shows none of its own, and turning it off plans again.

Source§

impl PlaybackPlan

Source

pub fn encoded_height(&self) -> Option<u32>

The lines the server encodes the picture to, for a quality picker’s “Auto (720p)”; None where the picture is the file’s own (a direct play, a copied video) or there is none.

Source§

impl PlaybackPlan

Source

pub fn ladder(&self) -> &[Rung]

The encodes an HLS player switches between, highest first; empty for one encode, or a plan that isn’t converted.

Source

pub fn summary(&self) -> PlanSummary

The plan as an info panel shows it. A remux is a converted plan whose streams are all copied, as PlaybackPlan::Converted says, with no encoded rung in its ladder.

Source§

impl PlaybackPlan

Source

pub fn source_codec(&self) -> Option<&str>

Its source_codec: None where it has none, as an unsupported plan has not.

Trait Implementations§

Source§

impl Clone for PlaybackPlan

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 PlaybackPlan

Source§

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

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

impl<'de> Deserialize<'de> for PlaybackPlan

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 PlaybackPlan

Source§

impl PartialEq for PlaybackPlan

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 PlaybackPlan

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 PlaybackPlan

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<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
where ST: ?Sized, DT: ?Sized,

Source§

impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
where ST: ?Sized, DT: ?Sized,

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> Read<Exclusive, BecauseExclusive> for T
where T: ?Sized,

Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
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.