From 146f99cfecb243f55e6e759dc1c754839ae0ade7 Mon Sep 17 00:00:00 2001 From: Michael Niedermayer Date: Wed, 2 Nov 2011 18:39:42 +0100 Subject: [PATCH] h264: add nal_length_size and is_avc to the publically readable fields Signed-off-by: Michael Niedermayer --- libavcodec/h264.c | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) diff --git a/libavcodec/h264.c b/libavcodec/h264.c index 3f6bc7290b..eb8b2f1245 100644 --- a/libavcodec/h264.c +++ b/libavcodec/h264.c @@ -26,6 +26,7 @@ */ #include "libavutil/imgutils.h" +#include "libavutil/opt.h" #include "internal.h" #include "dsputil.h" #include "avcodec.h" @@ -4231,6 +4232,26 @@ static const AVProfile profiles[] = { { FF_PROFILE_UNKNOWN }, }; +static const AVOption h264_options[] = { + {"is_avc", "is avc", offsetof(H264Context, is_avc), FF_OPT_TYPE_INT, {.dbl = 0}, 0, 1, 0}, + {"nal_length_size", "nal_length_size", offsetof(H264Context, nal_length_size), FF_OPT_TYPE_INT, {.dbl = 0}, 0, 4, 0}, + {NULL} +}; + +static const AVClass h264_class = { + "H264 Decoder", + av_default_item_name, + h264_options, + LIBAVUTIL_VERSION_INT, +}; + +static const AVClass h264_vdpau_class = { + "H264 VDPAU Decoder", + av_default_item_name, + h264_options, + LIBAVUTIL_VERSION_INT, +}; + AVCodec ff_h264_decoder = { .name = "h264", .type = AVMEDIA_TYPE_VIDEO, @@ -4246,6 +4267,7 @@ AVCodec ff_h264_decoder = { .init_thread_copy = ONLY_IF_THREADS_ENABLED(decode_init_thread_copy), .update_thread_context = ONLY_IF_THREADS_ENABLED(decode_update_thread_context), .profiles = NULL_IF_CONFIG_SMALL(profiles), + .priv_class = &h264_class, }; #if CONFIG_H264_VDPAU_DECODER @@ -4262,5 +4284,6 @@ AVCodec ff_h264_vdpau_decoder = { .long_name = NULL_IF_CONFIG_SMALL("H.264 / AVC / MPEG-4 AVC / MPEG-4 part 10 (VDPAU acceleration)"), .pix_fmts = (const enum PixelFormat[]){PIX_FMT_VDPAU_H264, PIX_FMT_NONE}, .profiles = NULL_IF_CONFIG_SMALL(profiles), + .priv_class = &h264_vdpau_class, }; #endif