pub struct DemuxInput { /* private fields */ }Expand description
Implementations§
Source§impl DemuxInput
impl DemuxInput
Sourcepub fn interrupt_when(&self, check: impl Fn() -> bool + Send + Sync + 'static)
pub fn interrupt_when(&self, check: impl Fn() -> bool + Send + Sync + 'static)
Makes blocking I/O on this input stop with AVERROR_EXIT once check returns true.
Sourcepub fn best_stream(
&self,
media_type: AVMediaType,
) -> Result<Option<usize>, RsmpegError>
pub fn best_stream( &self, media_type: AVMediaType, ) -> Result<Option<usize>, RsmpegError>
The AVStream index of the best decodable stream of media_type, never an attached
picture such as cover art.
None when no stream of the type can be decoded; the input’s other streams still may.
§Errors
Any other av_find_best_stream failure.
Sourcepub fn read_packet(&mut self) -> Result<Option<AVPacket>, RsmpegError>
pub fn read_packet(&mut self) -> Result<Option<AVPacket>, RsmpegError>
The next packet in file order, or None at the end of the file.
§Errors
The FFmpeg read failure, or AVERROR_EXIT when interrupted.
Sourcepub fn seek(
&mut self,
stream_index: i32,
timestamp: i64,
flags: i32,
) -> Result<(), RsmpegError>
pub fn seek( &mut self, stream_index: i32, timestamp: i64, flags: i32, ) -> Result<(), RsmpegError>
Seeks to the key frame at timestamp (stream_index -1 for AV_TIME_BASE units).
§Errors
The FFmpeg seek failure, or AVERROR_EXIT when interrupted.
Sourcepub fn discard_all_but(&mut self, index: usize)
pub fn discard_all_but(&mut self, index: usize)
Has the demuxer discard every stream but index (mov then skips their bytes entirely).
Sourcepub fn keep_only(&mut self, kept: &[usize])
pub fn keep_only(&mut self, kept: &[usize])
Self::discard_all_but for several streams.
Methods from Deref<Target = AVFormatContextInput>§
pub fn as_ptr(&self) -> *const AVFormatContext
Sourcepub fn find_best_stream(
&self,
media_type: i32,
) -> Result<Option<(usize, AVCodecRef<'static>)>, RsmpegError>
pub fn find_best_stream( &self, media_type: i32, ) -> Result<Option<(usize, AVCodecRef<'static>)>, RsmpegError>
Return the stream index and stream decoder if there is any “best” stream. “best” means the most likely what the user wants.
Sourcepub fn streams(&'stream self) -> &'stream [AVStreamRef<'stream>]
pub fn streams(&'stream self) -> &'stream [AVStreamRef<'stream>]
Return slice of AVStreamRef.
Sourcepub fn iformat(&'stream self) -> AVInputFormatRef<'stream>
pub fn iformat(&'stream self) -> AVInputFormatRef<'stream>
Get AVInputFormatRef in the AVFormatContextInput.
Sourcepub fn metadata(&'stream self) -> Option<AVDictionaryRef<'stream>>
pub fn metadata(&'stream self) -> Option<AVDictionaryRef<'stream>>
Get metadata of the ffi::AVFormatContext in crate::avutil::AVDictionary.
demuxing: set by libavformat in avformat_open_input()
muxing: may be set by the caller before avformat_write_header()