Skip to main content

VideoStream

Struct VideoStream 

Source
pub struct VideoStream { /* private fields */ }
Expand description

A video track decoded frame-exactly.

Implementations§

Source§

impl VideoStream

Source

pub fn open( reader: Box<dyn ContainerReader>, index: usize, backends: Arc<dyn VideoBackends>, options: StreamOptions, ) -> Result<Self, DecodeError>

Opens track index of reader with a session from backends.

§Errors

DecodeError::Unsupported for a track that is not video or that no allowed session reads.

Source

pub fn open_file( path: &Path, backends: Arc<dyn VideoBackends>, options: StreamOptions, ) -> Result<Self, DecodeError>

Opens the default video track of the file at path.

§Errors

DecodeError::Unsupported for a container this layer does not read, a file without video, or a track no allowed session reads; read failures.

Source

pub const fn track(&self) -> &TrackInfo

The track decoded.

Source

pub const fn dropped_layer(&self) -> Option<&DroppedLayer>

What the track declares that its pictures go without: the alpha of a track that has one.

Source

pub fn lookahead_bytes(&self) -> u64

Bytes of the frame decoded ahead and kept for the next Self::next.

Source

pub const fn presentation_slack(&self) -> MediaTime

How far after a time a frame may be stored and still be the one shown at it.

Source

pub fn on_hardware(&self) -> bool

Whether the session open now runs on hardware.

Source

pub const fn recovery(&self) -> &Recovery

Damage recorded so far.

Source

pub fn next( &mut self, cancel: &CancelToken, ) -> Result<Option<StreamFrame>, DecodeError>

The next frame in presentation order; None at the end.

§Errors

Cancellation, a spent work budget, damage beyond the policy, or a decoder failure no replacement session survives.

Source

pub fn peek_pts( &mut self, cancel: &CancelToken, ) -> Result<Option<MediaTime>, DecodeError>

When the frame Self::next returns is presented; None at the end. The frame is decoded now and kept.

§Errors

As Self::next.

Source

pub fn seek( &mut self, time: MediaTime, cancel: &CancelToken, ) -> Result<StreamFrame, DecodeError>

The frame shown at time: the last at or before time plus the slack, the first for an earlier time and the last for a later one. The frame after it becomes the lookahead.

§Errors

DecodeError::OutOfRange for a stream without frames; otherwise as Self::next.

Trait Implementations§

Source§

impl Debug for VideoStream

Source§

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

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

impl Decoder for VideoStream

The CPU-frame decoder contract, for consumers and conformance tests that take alpha2_media::Decoder. A surface frame is refused as unsupported here.

Source§

fn streams(&self) -> &[StreamInfo]

Returns deterministic stream metadata and stream selection.
Source§

fn flush(&mut self) -> Result<(), DecodeError>

Flushes queued packets and frames without changing stream selection. Read more
Source§

fn seek( &mut self, request: DecodeRequest, cancel: &CancelToken, ) -> Result<DecodeResult, DecodeError>

Seeks and returns what is presented at the request’s time. Read more
Source§

fn decode_next( &mut self, cancel: &CancelToken, ) -> Result<DecodeEvent, DecodeError>

Advances packet draining by one observable event. Read more

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> Downcast<T> for T

Source§

fn downcast(&self) -> &T

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> IntoEither for T

Source§

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 more
Source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
where F: FnOnce(&Self) -> bool,

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
Source§

impl<T> Pointable for T

Source§

const ALIGN: usize

The alignment of pointer.
Source§

type Init = T

The type for initializers.
Source§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
Source§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
Source§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
Source§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
Source§

impl<T> Read<Exclusive, BecauseExclusive> for T
where T: ?Sized,

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.
Source§

impl<T> Upcast<T> for T

Source§

fn upcast(&self) -> Option<&T>

Source§

impl<T> WasmNotSend for T
where T: Send,