From 7ca0931fe1782fed54e508850c12bee7ee0a432a Mon Sep 17 00:00:00 2001 From: Andreas Rheinhardt Date: Mon, 7 Jun 2021 16:13:33 +0200 Subject: avformat/rawdec: Deduplicate AVClasses based upon ff_rawvideo_options The child_class_next API relied on different (de)muxers to use different AVClasses; yet this API has been replaced by child_class_iterate. Signed-off-by: Andreas Rheinhardt --- libavformat/rawdec.c | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) (limited to 'libavformat/rawdec.c') diff --git a/libavformat/rawdec.c b/libavformat/rawdec.c index aa6eba4f39..cf5da8c21e 100644 --- a/libavformat/rawdec.c +++ b/libavformat/rawdec.c @@ -118,12 +118,20 @@ int ff_raw_data_read_header(AVFormatContext *s) #define OFFSET(x) offsetof(FFRawVideoDemuxerContext, x) #define DEC AV_OPT_FLAG_DECODING_PARAM -const AVOption ff_rawvideo_options[] = { +static const AVOption rawvideo_options[] = { { "framerate", "", OFFSET(framerate), AV_OPT_TYPE_VIDEO_RATE, {.str = "25"}, 0, INT_MAX, DEC}, { "raw_packet_size", "", OFFSET(raw_packet_size), AV_OPT_TYPE_INT, {.i64 = RAW_PACKET_SIZE }, 1, INT_MAX, DEC}, { NULL }, }; #undef OFFSET + +const AVClass ff_rawvideo_demuxer_class = { + .class_name = "generic raw video demuxer", + .item_name = av_default_item_name, + .option = rawvideo_options, + .version = LIBAVUTIL_VERSION_INT, +}; + #define OFFSET(x) offsetof(FFRawDemuxerContext, x) static const AVOption raw_options[] = { { "raw_packet_size", "", OFFSET(raw_packet_size), AV_OPT_TYPE_INT, {.i64 = RAW_PACKET_SIZE }, 1, INT_MAX, DEC}, -- cgit v1.2.3