Skip to main content

input_from_stream_with_interrupt

Function input_from_stream_with_interrupt 

Source
pub fn input_from_stream_with_interrupt<F>(
    custom_io: StreamIo,
    filename: Option<&str>,
    options: Option<Dictionary<'_>>,
    closure: F,
) -> Result<Input, Error>
where F: FnMut() -> bool + Send + 'static,
Expand description

Like input_from_stream, with an interrupt callback FFmpeg polls to cancel a stalled open or read. closure returns true to abort; a cancelled blocking read then surfaces as Error::Exit. To resume the same context afterward, re-arm the token and either seek (seekable streams) or call context::Input::clear_interrupt (non-seekable streams).

Fails with EINVAL if custom_io is a write context or filename contains an interior NUL byte.