From 85d982f1e2c3efb8d5622caea162cede3f6c0e21 Mon Sep 17 00:00:00 2001 From: Anton Khirnov Date: Wed, 14 Sep 2011 14:03:55 +0200 Subject: rawdec: refactor private option for raw video demuxers pixel_format/video_size only apply to 'rawvideo' (==uncompressed) demuxer and make no sense for the other raw (== containerless) demuxers. Keep only the framerate option for those. Also use unique classes for all raw video demuxers --- libavformat/rawdec.h | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) (limited to 'libavformat/rawdec.h') diff --git a/libavformat/rawdec.h b/libavformat/rawdec.h index 73bfb4abc4..136f6c2d48 100644 --- a/libavformat/rawdec.h +++ b/libavformat/rawdec.h @@ -24,6 +24,7 @@ #include "avformat.h" #include "libavutil/log.h" +#include "libavutil/opt.h" typedef struct RawAudioDemuxerContext { AVClass *class; @@ -38,7 +39,7 @@ typedef struct FFRawVideoDemuxerContext { char *framerate; /**< String describing framerate, set by a private option. */ } FFRawVideoDemuxerContext; -extern const AVClass ff_rawvideo_demuxer_class; +extern const AVOption ff_rawvideo_options[]; int ff_raw_read_header(AVFormatContext *s, AVFormatParameters *ap); @@ -48,7 +49,16 @@ int ff_raw_audio_read_header(AVFormatContext *s, AVFormatParameters *ap); int ff_raw_video_read_header(AVFormatContext *s, AVFormatParameters *ap); +#define FF_RAWVIDEO_DEMUXER_CLASS(name)\ +static const AVClass name ## _demuxer_class = {\ + .class_name = #name " demuxer",\ + .item_name = av_default_item_name,\ + .option = ff_rawvideo_options,\ + .version = LIBAVUTIL_VERSION_INT,\ +}; + #define FF_DEF_RAWVIDEO_DEMUXER(shortname, longname, probe, ext, id)\ +FF_RAWVIDEO_DEMUXER_CLASS(shortname)\ AVInputFormat ff_ ## shortname ## _demuxer = {\ .name = #shortname,\ .long_name = NULL_IF_CONFIG_SMALL(longname),\ @@ -59,7 +69,7 @@ AVInputFormat ff_ ## shortname ## _demuxer = {\ .flags = AVFMT_GENERIC_INDEX,\ .value = id,\ .priv_data_size = sizeof(FFRawVideoDemuxerContext),\ - .priv_class = &ff_rawvideo_demuxer_class,\ + .priv_class = &shortname ## _demuxer_class,\ }; #endif /* AVFORMAT_RAWDEC_H */ -- cgit v1.2.3