diff options
author | Michael Niedermayer <michael@niedermayer.cc> | 2019-07-06 11:32:48 +0200 |
---|---|---|
committer | Michael Niedermayer <michael@niedermayer.cc> | 2019-07-17 23:18:50 +0200 |
commit | f6d1b18b3d58cd8f06eea653c4a6e22e4b9245e6 (patch) | |
tree | e9a30637682f6f1c265fbdaebd4df79fd823e453 /libavformat/rawdec.h | |
parent | 827faa18cfd08eed49ffff9129ef4378b8ccf5a5 (diff) | |
download | ffmpeg-streaming-f6d1b18b3d58cd8f06eea653c4a6e22e4b9245e6.zip ffmpeg-streaming-f6d1b18b3d58cd8f06eea653c4a6e22e4b9245e6.tar.gz |
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>
Diffstat (limited to 'libavformat/rawdec.h')
-rw-r--r-- | libavformat/rawdec.h | 19 |
1 files changed, 17 insertions, 2 deletions
diff --git a/libavformat/rawdec.h b/libavformat/rawdec.h index 3eb416b..85e0790 100644 --- a/libavformat/rawdec.h +++ b/libavformat/rawdec.h @@ -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,\ }; |