avformat/img2: Make AVOptions available to img* demuxers defined in other files

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
pull/88/head
Michael Niedermayer 10 years ago
parent ea7ebadeb7
commit 5303a644f5
  1. 4
      libavformat/img2.h
  2. 8
      libavformat/img2dec.c

@ -24,6 +24,7 @@
#include <stdint.h> #include <stdint.h>
#include "avformat.h" #include "avformat.h"
#include "libavutil/opt.h"
#if HAVE_GLOB #if HAVE_GLOB
#include <glob.h> #include <glob.h>
@ -54,8 +55,9 @@ typedef struct {
int ts_from_file; int ts_from_file;
} VideoDemuxData; } VideoDemuxData;
extern const AVOption ff_img_options[];
int ff_img_read_header(AVFormatContext *s1); int ff_img_read_header(AVFormatContext *s1);
int ff_img_read_packet(AVFormatContext *s1, AVPacket *pkt); int ff_img_read_packet(AVFormatContext *s1, AVPacket *pkt);
#endif #endif

@ -503,7 +503,7 @@ static int img_read_seek(AVFormatContext *s, int stream_index, int64_t timestamp
#define OFFSET(x) offsetof(VideoDemuxData, x) #define OFFSET(x) offsetof(VideoDemuxData, x)
#define DEC AV_OPT_FLAG_DECODING_PARAM #define DEC AV_OPT_FLAG_DECODING_PARAM
static const AVOption options[] = { const AVOption ff_img_options[] = {
{ "framerate", "set the video framerate", OFFSET(framerate), AV_OPT_TYPE_VIDEO_RATE, {.str = "25"}, 0, 0, DEC }, { "framerate", "set the video framerate", OFFSET(framerate), AV_OPT_TYPE_VIDEO_RATE, {.str = "25"}, 0, 0, DEC },
{ "loop", "force loop over input file sequence", OFFSET(loop), AV_OPT_TYPE_INT, {.i64 = 0 }, 0, 1, DEC }, { "loop", "force loop over input file sequence", OFFSET(loop), AV_OPT_TYPE_INT, {.i64 = 0 }, 0, 1, DEC },
@ -528,7 +528,7 @@ static const AVOption options[] = {
static const AVClass img2_class = { static const AVClass img2_class = {
.class_name = "image2 demuxer", .class_name = "image2 demuxer",
.item_name = av_default_item_name, .item_name = av_default_item_name,
.option = options, .option = ff_img_options,
.version = LIBAVUTIL_VERSION_INT, .version = LIBAVUTIL_VERSION_INT,
}; };
AVInputFormat ff_image2_demuxer = { AVInputFormat ff_image2_demuxer = {
@ -548,7 +548,7 @@ AVInputFormat ff_image2_demuxer = {
static const AVClass img2pipe_class = { static const AVClass img2pipe_class = {
.class_name = "image2pipe demuxer", .class_name = "image2pipe demuxer",
.item_name = av_default_item_name, .item_name = av_default_item_name,
.option = options, .option = ff_img_options,
.version = LIBAVUTIL_VERSION_INT, .version = LIBAVUTIL_VERSION_INT,
}; };
AVInputFormat ff_image2pipe_demuxer = { AVInputFormat ff_image2pipe_demuxer = {
@ -681,7 +681,7 @@ static int webp_probe(AVProbeData *p)
static const AVClass imgname ## _class = {\ static const AVClass imgname ## _class = {\
.class_name = AV_STRINGIFY(imgname) " demuxer",\ .class_name = AV_STRINGIFY(imgname) " demuxer",\
.item_name = av_default_item_name,\ .item_name = av_default_item_name,\
.option = options,\ .option = ff_img_options,\
.version = LIBAVUTIL_VERSION_INT,\ .version = LIBAVUTIL_VERSION_INT,\
};\ };\
AVInputFormat ff_image_ ## imgname ## _pipe_demuxer = {\ AVInputFormat ff_image_ ## imgname ## _pipe_demuxer = {\

Loading…
Cancel
Save