avformat/rawdec: Make the raw packet size configurable

This allows testing parsers with a wider range of input packet sizes.
Which is important and usefull for regression testing, some of our
parsers in fact to not work if the packet size is changed from 1024

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
This commit is contained in:
Michael Niedermayer
2019-07-06 11:32:48 +02:00
parent 827faa18cf
commit f6d1b18b3d
13 changed files with 69 additions and 5 deletions

View File

@@ -28,12 +28,19 @@
typedef struct FFRawVideoDemuxerContext {
const AVClass *class; /**< Class for private options. */
int raw_packet_size;
char *video_size; /**< String describing video size, set by a private option. */
char *pixel_format; /**< Set by a private option. */
AVRational framerate; /**< AVRational describing framerate, set by a private option. */
} FFRawVideoDemuxerContext;
typedef struct FFRawDemuxerContext {
const AVClass *class; /**< Class for private options. */
int raw_packet_size;
} FFRawDemuxerContext;
extern const AVOption ff_rawvideo_options[];
extern const AVOption ff_raw_options[];
int ff_raw_read_partial_packet(AVFormatContext *s, AVPacket *pkt);
@@ -45,6 +52,14 @@ int ff_raw_subtitle_read_header(AVFormatContext *s);
int ff_raw_data_read_header(AVFormatContext *s);
#define FF_RAW_DEMUXER_CLASS(name)\
static const AVClass name ## _demuxer_class = {\
.class_name = #name " demuxer",\
.item_name = av_default_item_name,\
.option = ff_raw_options,\
.version = LIBAVUTIL_VERSION_INT,\
};
#define FF_RAWVIDEO_DEMUXER_CLASS(name)\
static const AVClass name ## _demuxer_class = {\
.class_name = #name " demuxer",\
@@ -75,7 +90,7 @@ FF_DEF_RAWVIDEO_DEMUXER2(shortname, longname, probe, ext, id, AVFMT_GENERIC_INDE
static const AVClass name ## _demuxer_class = {\
.class_name = #name " demuxer",\
.item_name = av_default_item_name,\
.option = NULL,\
.option = ff_raw_options,\
.version = LIBAVUTIL_VERSION_INT,\
};
@@ -90,7 +105,7 @@ AVInputFormat ff_ ## shortname ## _demuxer = {\
.extensions = ext,\
.flags = flag,\
.raw_codec_id = id,\
.priv_data_size = 0,\
.priv_data_size = sizeof(FFRawDemuxerContext),\
.priv_class = &shortname ## _demuxer_class,\
};