Trait DecoderFormatNegotiator

Source
pub trait DecoderFormatNegotiator {
    type Descriptor;

    // Required methods
    fn stream_info(&self) -> &StreamInfo;
    fn frame_pool(
        &mut self,
        layer: PoolLayer,
    ) -> Vec<&mut dyn FramePool<Descriptor = Self::Descriptor>>;
    fn try_format(&mut self, format: DecodedFormat) -> Result<()>;
}
Expand description

Trait for objects allowing to negotiate the output format of a decoder.

A decoder always has a valid output format set, but that format can change if the stream requests it. When this happens, the decoder stops accepting new input and a DecoderEvent::FormatChanged event is emitted, carrying a negotiator trait object that allows the client to acknowledge that the format change took place, and (in the future) negotiate its specifics.

When the object is dropped, the decoder can accept and process new input again.

Required Associated Types§

Required Methods§

Source

fn stream_info(&self) -> &StreamInfo

Returns the current decoding parameters, as extracted from the stream.

Source

fn frame_pool( &mut self, layer: PoolLayer, ) -> Vec<&mut dyn FramePool<Descriptor = Self::Descriptor>>

Returns the frame pool in use for the decoder for layer set up for the new format.

Source

fn try_format(&mut self, format: DecodedFormat) -> Result<()>

Attempt to change the pixel format of output frames to format.

Implementors§

Source§

impl<'a, H, FP, D, FH, F> DecoderFormatNegotiator for StatelessDecoderFormatNegotiator<'a, H, FP, D, FH, F>
where H: DecodedHandle, FP: FramePool<Descriptor = H::Descriptor>, D: StatelessVideoDecoder<Handle = H, FramePool = FP> + StatelessVideoDecoder, F: Fn(&mut D, &FH),