[FFmpeg-cvslog] lavc: seperate encoder/decoder class category
Michael Niedermayer
git at videolan.org
Tue Jun 19 17:26:02 CEST 2012
ffmpeg | branch: master | Michael Niedermayer <michaelni at gmx.at> | Sun Jun 3 22:40:37 2012 +0200| [6fb7d03d742787fa74606e48d74ca317ec95acd3] | committer: Michael Niedermayer
lavc: seperate encoder/decoder class category
Signed-off-by: Michael Niedermayer <michaelni at gmx.at>
> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=6fb7d03d742787fa74606e48d74ca317ec95acd3
---
libavcodec/options.c | 7 +++++++
1 file changed, 7 insertions(+)
diff --git a/libavcodec/options.c b/libavcodec/options.c
index ed51146..c8f770a 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
More information about the ffmpeg-cvslog
mailing list