chromeos / cros-codecs

BSD 3-Clause "New" or "Revised" License
30 stars 11 forks source link

decoder/stateless: backends should check the number of available output buffers, if needed. #85

Open Gnurou opened 4 months ago

Gnurou commented 4 months ago

Revealed by PR #83.

The stateless decoders check the number of available output buffers before submitting a picture to the backend. This is needed for VAAPI, but not for V4L2 stateless where we on the contrary need an input buffer to proceed.

This means that backends should validate that they have the resources required to perform their operation. This could probably be done as part of new_picture (which should be extended to all codecs), which could reserve the resources required to process a given pictures. Codecs like VP9 or AV1 that can process several frames per unit of input would call new_picture as many times as necessary, return if any call was failing, and then process the pictures sequentially.