Imagine some broken media where no SPS or no vpx frames can be parsed at all.
The current design will exit normally, even though no output was produced and nothing useful was done. The decoder will forever be in the DecodingState::AwaitingStreamInfo state.
If by any means we detect EOS (be it at the virtio level, or in cros-codecs itself when executing tests or ccdec) and the decoder is still in that state, we should error out so as to make the user aware that the media is malformed and or corrupt.
How exactly that is to be done is something to be discussed. My initial idea is to add something along the lines of:
Imagine some broken media where no SPS or no vpx frames can be parsed at all.
The current design will exit normally, even though no output was produced and nothing useful was done. The decoder will forever be in the
DecodingState::AwaitingStreamInfo
state.If by any means we detect EOS (be it at the virtio level, or in cros-codecs itself when executing tests or ccdec) and the decoder is still in that state, we should error out so as to make the user aware that the media is malformed and or corrupt.
How exactly that is to be done is something to be discussed. My initial idea is to add something along the lines of:
To the VideoDecoder trait.
Users can then query the state at EOS to manually assert that the decoder is indeed in
DecodingState::Decoding
and proceed accordingly.If for any reason we do not want to copy and or expose T to clients, then another option is:
In which the decoders would convert from AwaitingFormat(T) to AwaitingFormat(())
@Gnurou any other ideas?