avcodec/codec_internal: Add FFCodec.decode_sub

This increases type-safety by avoiding conversions from/through void*.
It also avoids the boilerplate "AVSubtitle *sub = data;" line
for subtitle decoders. Its only downside is that it increases
sizeof(FFCodec), yet this can be more than offset lateron.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
This commit is contained in:
Andreas Rheinhardt 2022-03-30 19:52:41 +02:00
parent 1c3c29d07d
commit fb59a42ef9
22 changed files with 76 additions and 87 deletions

View file

@ -80,7 +80,7 @@ int av_codec_is_encoder(const AVCodec *avcodec)
int av_codec_is_decoder(const AVCodec *avcodec)
{
const FFCodec *const codec = ffcodec(avcodec);
return codec && (codec->decode || codec->receive_frame);
return codec && (codec->decode || codec->decode_sub || codec->receive_frame);
}
int ff_set_dimensions(AVCodecContext *s, int width, int height)