pub struct VideoReader<D> { /* private fields */ }Expand description
Frames of one source in either direction, over a Decoder.
Forward reads continue the decoder after its last frame. Backward reads decode a window of earlier frames forward once from the keyframe before it and hand them out in reverse, so a long backward run decodes each stretch about once.
Implementations§
Source§impl<D: Decoder> VideoReader<D>
impl<D: Decoder> VideoReader<D>
Sourcepub const fn new(decoder: D, source: SourceId, cancel: CancelToken) -> Self
pub const fn new(decoder: D, source: SourceId, cancel: CancelToken) -> Self
A reader of source from decoder, stopping at cancel.
Sourcepub fn frame(
&mut self,
from: FrameFrom,
direction: Direction,
) -> Result<Option<Arc<DecodedVideoFrame>>, DecodeError>
pub fn frame( &mut self, from: FrameFrom, direction: Direction, ) -> Result<Option<Arc<DecodedVideoFrame>>, DecodeError>
The frame a session’s Need::SourceFrame asks for, or None when there is none.
§Errors
The decoder’s failure or cancellation.
Auto Trait Implementations§
impl<D> Forget for VideoReader<D>
impl<D> Freeze for VideoReader<D>where
D: Freeze,
*const u8 is !null: Freeze,
PhantomData<u8>: Freeze,
*const ArcInner<Atomic<bool>> is !null: Freeze,
PhantomData<ArcInner<Atomic<bool>>>: Freeze,
*const LeafNode<MediaTime, Arc<DecodedVideoFrame>> is !null: Freeze,
PhantomData<(Owned, LeafOrInternal)>: Freeze,
PhantomData<Box<(MediaTime, Arc<DecodedVideoFrame>)>>: Freeze,
impl<D> Move for VideoReader<D>
impl<D> RefUnwindSafe for VideoReader<D>where
D: RefUnwindSafe,
Atomic<usize>: RefUnwindSafe,
Atomic<bool>: RefUnwindSafe,
Atomic<*mut ()>: RefUnwindSafe,
impl<D> Send for VideoReader<D>
impl<D> Sync for VideoReader<D>
impl<D> Unpin for VideoReader<D>
impl<D> UnsafeUnpin for VideoReader<D>where
D: UnsafeUnpin,
*const u8 is !null: UnsafeUnpin,
PhantomData<u8>: UnsafeUnpin,
*const ArcInner<Atomic<bool>> is !null: UnsafeUnpin,
PhantomData<ArcInner<Atomic<bool>>>: UnsafeUnpin,
*const LeafNode<MediaTime, Arc<DecodedVideoFrame>> is !null: UnsafeUnpin,
PhantomData<(Owned, LeafOrInternal)>: UnsafeUnpin,
PhantomData<Box<(MediaTime, Arc<DecodedVideoFrame>)>>: UnsafeUnpin,
impl<D> UnwindSafe for VideoReader<D>where
D: UnwindSafe,
RawVecInner: UnwindSafe,
Arc<Atomic<bool>>: UnwindSafe,
BTreeMap<MediaTime, Arc<DecodedVideoFrame>>: UnwindSafe,
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
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> ⓘ
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