pub struct VideoStream { /* private fields */ }Expand description
A video track decoded frame-exactly.
Implementations§
Source§impl VideoStream
impl VideoStream
Sourcepub fn open(
reader: Box<dyn ContainerReader>,
index: usize,
backends: Arc<dyn VideoBackends>,
options: StreamOptions,
) -> Result<Self, DecodeError>
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.
Sourcepub fn open_file(
path: &Path,
backends: Arc<dyn VideoBackends>,
options: StreamOptions,
) -> Result<Self, DecodeError>
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.
Sourcepub const fn dropped_layer(&self) -> Option<&DroppedLayer>
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.
Sourcepub fn lookahead_bytes(&self) -> u64
pub fn lookahead_bytes(&self) -> u64
Bytes of the frame decoded ahead and kept for the next Self::next.
Sourcepub const fn presentation_slack(&self) -> MediaTime
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.
Sourcepub fn on_hardware(&self) -> bool
pub fn on_hardware(&self) -> bool
Whether the session open now runs on hardware.
Sourcepub fn next(
&mut self,
cancel: &CancelToken,
) -> Result<Option<StreamFrame>, DecodeError>
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.
Sourcepub fn peek_pts(
&mut self,
cancel: &CancelToken,
) -> Result<Option<MediaTime>, DecodeError>
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.
Sourcepub fn seek(
&mut self,
time: MediaTime,
cancel: &CancelToken,
) -> Result<StreamFrame, DecodeError>
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
impl Debug for VideoStream
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.
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]
fn streams(&self) -> &[StreamInfo]
Source§fn flush(&mut self) -> Result<(), DecodeError>
fn flush(&mut self) -> Result<(), DecodeError>
Source§fn seek(
&mut self,
request: DecodeRequest,
cancel: &CancelToken,
) -> Result<DecodeResult, DecodeError>
fn seek( &mut self, request: DecodeRequest, cancel: &CancelToken, ) -> Result<DecodeResult, DecodeError>
Source§fn decode_next(
&mut self,
cancel: &CancelToken,
) -> Result<DecodeEvent, DecodeError>
fn decode_next( &mut self, cancel: &CancelToken, ) -> Result<DecodeEvent, DecodeError>
Auto Trait Implementations§
impl !Freeze for VideoStream
impl !RefUnwindSafe for VideoStream
impl !Sync for VideoStream
impl !UnwindSafe for VideoStream
impl Forget for VideoStream
impl Move for VideoStream
impl Send for VideoStreamwhere
BoxRaw<dyn ContainerReader>: Send,
RawVecInner: Send,
Bytes: Send,
Arc<dyn VideoBackends>: Send,
BoxRaw<dyn VideoDecodeBackend>: Send,
BoxRaw<dyn Fn(DecodeDiagnostic) + Sync + Send>: Send,
&'static str: Send,
Arc<dyn SurfaceLease>: Send,
impl Unpin for VideoStreamwhere
Box<dyn ContainerReader>: Unpin,
*const u8 is !null: Unpin,
*const u8: Unpin,
Align8<*mut ()>: Unpin,
&'static Vtable: Unpin,
Arc<dyn VideoBackends>: Unpin,
Box<dyn VideoDecodeBackend>: Unpin,
Box<dyn Fn(DecodeDiagnostic) + Sync + Send>: Unpin,
&'static str: Unpin,
Arc<dyn SurfaceLease>: Unpin,
impl UnsafeUnpin for VideoStreamwhere
*const dyn ContainerReader is !null: UnsafeUnpin,
PhantomData<dyn ContainerReader>: UnsafeUnpin,
*const u8 is !null: UnsafeUnpin,
PhantomData<u8>: UnsafeUnpin,
*const u8: UnsafeUnpin,
Align8<*mut ()>: UnsafeUnpin,
&'static Vtable: UnsafeUnpin,
*const ArcInner<dyn VideoBackends> is !null: UnsafeUnpin,
PhantomData<ArcInner<dyn VideoBackends>>: UnsafeUnpin,
*const dyn VideoDecodeBackend is !null: UnsafeUnpin,
PhantomData<dyn VideoDecodeBackend>: UnsafeUnpin,
*const dyn Fn(DecodeDiagnostic) + Sync + Send is !null: UnsafeUnpin,
PhantomData<dyn Fn(DecodeDiagnostic) + Sync + Send>: UnsafeUnpin,
PhantomData<CorruptPacket>: UnsafeUnpin,
PhantomData<ConcealedAudioGap>: UnsafeUnpin,
PhantomData<DroppedAudioOverlap>: UnsafeUnpin,
PhantomData<VideoRecoveryGap>: UnsafeUnpin,
PhantomData<BackendFrame>: UnsafeUnpin,
PhantomData<Plane>: UnsafeUnpin,
*const ArcInner<dyn SurfaceLease> is !null: UnsafeUnpin,
PhantomData<ArcInner<dyn SurfaceLease>>: UnsafeUnpin,
PhantomData<StreamInfo>: UnsafeUnpin,
&'static str: UnsafeUnpin,
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
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> ⓘ
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> ⓘ
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