pub struct StreamSources<F> { /* private fields */ }Expand description
Opens one crate::video_stream::VideoStream per cursor and keeps decoding forward while
requests stay within the sequential gap, seeking otherwise.
A cursor its reads say is finished is closed, at most a set number of video streams stay open, and one decoded still serves every cursor of its source. A closed cursor reopens with a seek.
Implementations§
Source§impl<F> StreamSources<F>
impl<F> StreamSources<F>
Sourcepub fn with_reads(self, reads: CursorReads) -> Self
pub fn with_reads(self, reads: CursorReads) -> Self
Closes a cursor once reads say it reads nothing more (SourceFrames::release_finished).
A cursor reads does not know is never closed this way.
Sourcepub fn with_session_limit(self, limit: usize) -> Self
pub fn with_session_limit(self, limit: usize) -> Self
Before opening a video stream while limit are open, closes the one read longest ago that
the current output frame does not read.
Sourcepub fn open_streams(&self) -> usize
pub fn open_streams(&self) -> usize
Video streams open now.
Sourcepub const fn dropped_layers(&self) -> &BTreeMap<SourceId, DroppedLayer>
pub const fn dropped_layers(&self) -> &BTreeMap<SourceId, DroppedLayer>
What the pictures of each source opened so far go without, one entry per source.
Sourcepub fn with_surface_import(self, import: Arc<dyn SurfaceImport>) -> Self
pub fn with_surface_import(self, import: Arc<dyn SurfaceImport>) -> Self
Prepares the decoder surfaces the streams produce with import; without it a surface
frame fails its source.
Trait Implementations§
Source§impl<F> SourceFrames for StreamSources<F>
impl<F> SourceFrames for StreamSources<F>
Source§fn frame(
&mut self,
need: &FrameNeed,
index: u64,
cancel: &CancelToken,
) -> Result<Option<SourceFrame>, String>
fn frame( &mut self, need: &FrameNeed, index: u64, cancel: &CancelToken, ) -> Result<Option<SourceFrame>, String>
need of output frame index shows: the frame presented at its media
time; None for an audio source, which audio clips name but nothing draws. Read moreSource§fn following(
&mut self,
need: &FrameNeed,
index: u64,
cancel: &CancelToken,
) -> Result<Option<SourceFrame>, String>
fn following( &mut self, need: &FrameNeed, index: u64, cancel: &CancelToken, ) -> Result<Option<SourceFrame>, String>
Self::frame just answered for need, asked for a need that
follows (FrameNeed::following). None when that frame is its source’s last, which is
also what the default answers: the clip then holds its frame. Read moreSource§fn release_finished(&mut self, time: MediaTime)
fn release_finished(&mut self, time: MediaTime)
time read; called before the frame at time
is decoded.Source§fn held_bytes(&self) -> u64
fn held_bytes(&self) -> u64
Auto Trait Implementations§
impl<F> !RefUnwindSafe for StreamSources<F>
impl<F> !Sync for StreamSources<F>
impl<F> !UnwindSafe for StreamSources<F>
impl<F> Forget for StreamSources<F>
impl<F> Freeze for StreamSources<F>where
F: Freeze,
*const u8 is !null: Freeze,
PhantomData<((SourceId, ClipId, Option<NodeId>), Cursor)>: Freeze,
PhantomData<((SourceId, ClipId, Option<NodeId>), Vec<TimeRange>)>: Freeze,
PhantomData<(SourceId, Weak<DecodedVideoFrame>)>: Freeze,
PhantomData<(SourceId, ())>: Freeze,
*const LeafNode<SourceId, DroppedLayer> is !null: Freeze,
PhantomData<(Owned, LeafOrInternal)>: Freeze,
PhantomData<Box<(SourceId, DroppedLayer)>>: Freeze,
*const ArcInner<dyn SurfaceImport> is !null: Freeze,
PhantomData<ArcInner<dyn SurfaceImport>>: Freeze,
impl<F> Move for StreamSources<F>
impl<F> Send for StreamSources<F>where
F: Send,
RawTable<((SourceId, ClipId, Option<NodeId>), Cursor)>: Send,
RawTable<((SourceId, ClipId, Option<NodeId>), Vec<TimeRange>)>: Send,
RawTable<(SourceId, Weak<DecodedVideoFrame>)>: Send,
RawTable<(SourceId, ())>: Send,
NodeRef<Owned, SourceId, DroppedLayer, LeafOrInternal>: Send,
BoxRaw<(SourceId, DroppedLayer)>: Send,
Arc<dyn SurfaceImport>: Send,
impl<F> Unpin for StreamSources<F>where
F: Unpin,
*const u8 is !null: Unpin,
Box<VideoStream>: Unpin,
Arc<DecodedVideoFrame>: Unpin,
*const u8: Unpin,
Align8<*mut ()>: Unpin,
&'static Vtable: Unpin,
Arc<dyn SurfaceLease>: Unpin,
*const ArcInner<DecodedVideoFrame> is !null: Unpin,
*const LeafNode<SourceId, DroppedLayer> is !null: Unpin,
Box<(SourceId, DroppedLayer)>: Unpin,
Arc<dyn SurfaceImport>: Unpin,
impl<F> UnsafeUnpin for StreamSources<F>where
F: UnsafeUnpin,
*const u8 is !null: UnsafeUnpin,
PhantomData<((SourceId, ClipId, Option<NodeId>), Cursor)>: UnsafeUnpin,
PhantomData<((SourceId, ClipId, Option<NodeId>), Vec<TimeRange>)>: UnsafeUnpin,
PhantomData<(SourceId, Weak<DecodedVideoFrame>)>: UnsafeUnpin,
PhantomData<(SourceId, ())>: UnsafeUnpin,
*const LeafNode<SourceId, DroppedLayer> is !null: UnsafeUnpin,
PhantomData<(Owned, LeafOrInternal)>: UnsafeUnpin,
PhantomData<Box<(SourceId, DroppedLayer)>>: UnsafeUnpin,
*const ArcInner<dyn SurfaceImport> is !null: UnsafeUnpin,
PhantomData<ArcInner<dyn SurfaceImport>>: 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