pub struct TrackSampleProvider<S> { /* private fields */ }Expand description
A SampleProvider that reads a video track’s compressed bytes from a
ByteSource on demand, holding only track’s index (and whatever S
itself caches) rather than every sample’s bytes.
Built from a container-neutral Track index, so it works over MP4 and
WebM alike.
S::read_at’s future must resolve the first time it is polled: this
provider is used from ExactFrameReader::get,
which is synchronous, so Self::read polls the read once and reports
ErrorKind::Unsupported rather than blocking if the source does not
finish immediately. MemorySource and a
CachingByteSource wrapping one both
satisfy this; a source that genuinely waits on I/O (a network fetch, for
example) needs its own asynchronous reader rather than this provider.
S must be Send so the provider - and a reader built over it - can be
moved to a decode thread, matching SampleProvider’s own requirement.