aboutsummaryrefslogtreecommitdiffstats
path: root/libavcodec/utils.c
diff options
context:
space:
mode:
authorAndreas Rheinhardt <andreas.rheinhardt@outlook.com>2025-03-10 16:40:39 +0100
committerAndreas Rheinhardt <andreas.rheinhardt@outlook.com>2025-03-13 02:16:27 +0100
commit47d7c6cd15716127b867125e6ae088043f5e7b31 (patch)
tree77be83263309f240225500a668a9e2811846396d /libavcodec/utils.c
parent3e19e5062c42c6edc901b36fb68ef89c0cb93d9d (diff)
downloadffmpeg-47d7c6cd15716127b867125e6ae088043f5e7b31.tar.gz
avcodec/codec_internal: Add dedicated is_decoder flag to FFCodec
Allows to simplify av_codec_is_decoder() and av_codec_is_encoder(). Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
Diffstat (limited to 'libavcodec/utils.c')
-rw-r--r--libavcodec/utils.c8
1 files changed, 2 insertions, 6 deletions
diff --git a/libavcodec/utils.c b/libavcodec/utils.c
index 0aa5a6f55e..90867ed6b1 100644
--- a/libavcodec/utils.c
+++ b/libavcodec/utils.c
@@ -79,17 +79,13 @@ void av_fast_padded_mallocz(void *ptr, unsigned int *size, size_t min_size)
int av_codec_is_encoder(const AVCodec *avcodec)
{
const FFCodec *const codec = ffcodec(avcodec);
- return codec && (codec->cb_type == FF_CODEC_CB_TYPE_ENCODE ||
- codec->cb_type == FF_CODEC_CB_TYPE_ENCODE_SUB ||
- codec->cb_type == FF_CODEC_CB_TYPE_RECEIVE_PACKET);
+ return codec && !codec->is_decoder;
}
int av_codec_is_decoder(const AVCodec *avcodec)
{
const FFCodec *const codec = ffcodec(avcodec);
- return codec && (codec->cb_type == FF_CODEC_CB_TYPE_DECODE ||
- codec->cb_type == FF_CODEC_CB_TYPE_DECODE_SUB ||
- codec->cb_type == FF_CODEC_CB_TYPE_RECEIVE_FRAME);
+ return codec && codec->is_decoder;
}
int ff_set_dimensions(AVCodecContext *s, int width, int height)