Trait cros_codecs::decoder::DecoderFormatNegotiator
source · pub trait DecoderFormatNegotiator<'a, M> {
// Required methods
fn stream_info(&self) -> &StreamInfo;
fn surface_pool(&mut self) -> &mut dyn SurfacePool<M>;
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 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 Methods§
sourcefn stream_info(&self) -> &StreamInfo
fn stream_info(&self) -> &StreamInfo
Returns the current decoding parameters, as extracted from the stream.
sourcefn surface_pool(&mut self) -> &mut dyn SurfacePool<M>
fn surface_pool(&mut self) -> &mut dyn SurfacePool<M>
Returns the surface pool in use for the decoder, set up for the new format.