pub struct VariantStream {
pub id: String,
pub video_codec: Option<StreamCodec>,
pub audio_codec: Option<StreamCodec>,
pub width: Option<u32>,
pub height: Option<u32>,
pub frame_rate: Option<f64>,
pub video_bitrate: u64,
pub audio_bitrate: u64,
pub segment_format: SegmentFormat,
pub language: Option<String>,
pub is_default: bool,
}Expand description
A single variant stream in the adaptive ladder.
Fields§
§id: StringUnique identifier for this variant.
video_codec: Option<StreamCodec>Video codec (if video variant).
audio_codec: Option<StreamCodec>Audio codec (if audio variant or muxed).
width: Option<u32>Width in pixels (video only).
height: Option<u32>Height in pixels (video only).
frame_rate: Option<f64>Frame rate (video only).
video_bitrate: u64Peak video bitrate in bits/s.
audio_bitrate: u64Audio bitrate in bits/s.
segment_format: SegmentFormatSegment format for this variant.
language: Option<String>Language tag (BCP 47) for audio/subtitle variants.
is_default: boolWhether this variant is the default selection.
Implementations§
Source§impl VariantStream
impl VariantStream
Sourcepub fn video(
id: &str,
codec: StreamCodec,
width: u32,
height: u32,
bitrate: u64,
) -> Self
pub fn video( id: &str, codec: StreamCodec, width: u32, height: u32, bitrate: u64, ) -> Self
Create a new video variant.
Sourcepub fn audio(id: &str, codec: StreamCodec, bitrate: u64, language: &str) -> Self
pub fn audio(id: &str, codec: StreamCodec, bitrate: u64, language: &str) -> Self
Create a new audio-only variant.
Sourcepub fn as_default(self) -> Self
pub fn as_default(self) -> Self
Set this variant as the default.
Sourcepub fn with_frame_rate(self, fps: f64) -> Self
pub fn with_frame_rate(self, fps: f64) -> Self
Set the frame rate.
Sourcepub fn total_bandwidth(&self) -> u64
pub fn total_bandwidth(&self) -> u64
Total bandwidth for this variant.
Sourcepub fn combined_codecs(&self) -> String
pub fn combined_codecs(&self) -> String
Build the combined codecs string for manifests.
Sourcepub fn resolution_string(&self) -> Option<String>
pub fn resolution_string(&self) -> Option<String>
Resolution string (e.g. “1920x1080”).
Sourcepub fn validate(&self) -> PackagerResult<()>
pub fn validate(&self) -> PackagerResult<()>
Trait Implementations§
Source§impl Clone for VariantStream
impl Clone for VariantStream
Source§fn clone(&self) -> VariantStream
fn clone(&self) -> VariantStream
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreAuto Trait Implementations§
impl Freeze for VariantStream
impl RefUnwindSafe for VariantStream
impl Send for VariantStream
impl Sync for VariantStream
impl Unpin for VariantStream
impl UnsafeUnpin for VariantStream
impl UnwindSafe for VariantStream
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
Mutably borrows from an owned value. Read more
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more