pub struct DecoderSplit { /* private fields */ }Expand description
Implementations§
Source§impl DecoderSplit
impl DecoderSplit
Sourcepub fn new(
reader: &Reader,
reader_stream_index: usize,
resize: Option<Resize>,
hwaccel_device_type: Option<HardwareAccelerationDeviceType>,
) -> Result<Self, Error>
pub fn new( reader: &Reader, reader_stream_index: usize, resize: Option<Resize>, hwaccel_device_type: Option<HardwareAccelerationDeviceType>, ) -> Result<Self, Error>
Create a new DecoderSplit.
§Arguments
reader-Readerto initialize decoder from.resize- Optional resize strategy to apply to frames.
Sourcepub fn time_base(&self) -> AvRational
pub fn time_base(&self) -> AvRational
Get decoder time base.
Sourcepub fn decode(&mut self, packet: Packet) -> Result<Option<(Time, Frame)>, Error>
pub fn decode(&mut self, packet: Packet) -> Result<Option<(Time, Frame)>, Error>
Decode a Packet.
Feeds the packet to the decoder and returns a frame if there is one available. The caller should keep feeding packets until the decoder returns a frame.
§Panics
Panics if in draining mode.
§Return value
A tuple of the Frame and timestamp (relative to the stream) and the frame itself if the
decoder has a frame available, None if not.
Sourcepub fn decode_raw(&mut self, packet: Packet) -> Result<Option<RawFrame>, Error>
pub fn decode_raw(&mut self, packet: Packet) -> Result<Option<RawFrame>, Error>
Decode a Packet.
Feeds the packet to the decoder and returns a frame if there is one available. The caller should keep feeding packets until the decoder returns a frame.
§Panics
Panics if in draining mode.
§Return value
The decoded raw frame as RawFrame if the decoder has a frame available, None if not.
Sourcepub fn drain(&mut self) -> Result<Option<(Time, Frame)>, Error>
pub fn drain(&mut self) -> Result<Option<(Time, Frame)>, Error>
Drain one frame from the decoder.
After calling drain once the decoder is in draining mode and the caller may not use normal decode anymore or it will panic.
§Return value
A tuple of the Frame and timestamp (relative to the stream) and the frame itself if the
decoder has a frame available, None if not.