diff options
author | Michael Niedermayer <michaelni@gmx.at> | 2012-06-03 22:40:37 +0200 |
---|---|---|
committer | Michael Niedermayer <michaelni@gmx.at> | 2012-06-19 17:22:07 +0200 |
commit | 6fb7d03d742787fa74606e48d74ca317ec95acd3 (patch) | |
tree | 433ef20259daad258dc1e09581338a461abd7d10 /libavcodec | |
parent | e69263cd01380b7b20b92588dcac324bf776b59f (diff) | |
download | ffmpeg-6fb7d03d742787fa74606e48d74ca317ec95acd3.tar.gz |
lavc: seperate encoder/decoder class category
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
Diffstat (limited to 'libavcodec')
-rw-r--r-- | libavcodec/options.c | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/libavcodec/options.c b/libavcodec/options.c index ed51146c16..c8f770a7c8 100644 --- a/libavcodec/options.c +++ b/libavcodec/options.c @@ -65,6 +65,12 @@ static const AVClass *codec_child_class_next(const AVClass *prev) return NULL; } +static AVClassCategory get_category(AVCodecContext *avctx) +{ + if(avctx->codec && avctx->codec->decode) return AV_CLASS_CATEGORY_DECODER; + else return AV_CLASS_CATEGORY_ENCODER; +} + static const AVClass av_codec_context_class = { .class_name = "AVCodecContext", .item_name = context_to_name, @@ -74,6 +80,7 @@ static const AVClass av_codec_context_class = { .child_next = codec_child_next, .child_class_next = codec_child_class_next, .category = AV_CLASS_CATEGORY_ENCODER, + .get_category = (void*)get_category, }; #if FF_API_ALLOC_CONTEXT |