#include "avcodec.h"
#include "internal.h"
#include "libavutil/avassert.h"
+#include "libavutil/mem.h"
#include "libavutil/opt.h"
#include <float.h> /* FLT_MIN, FLT_MAX */
+#include <string.h>
#include "options_table.h"
return NULL;
}
+static AVClassCategory get_category(void *ptr)
+{
+ AVCodecContext* avctx = ptr;
+ 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,
.log_level_offset_offset = offsetof(AVCodecContext, log_level_offset),
.child_next = codec_child_next,
.child_class_next = codec_child_class_next,
+ .category = AV_CLASS_CATEGORY_ENCODER,
+ .get_category = get_category,
};
#if FF_API_ALLOC_CONTEXT