From 8e22245c2e7c5c8960a45b845342fa259737bc63 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Cl=C3=A9ment=20B=C5=93sch?= Date: Thu, 23 Oct 2014 14:20:27 +0200 Subject: [PATCH] avformat/WIP: add AVFMT_FULLREAD for standalone subtitles formats TODO: APIChanges TODO: bump avformat minor --- libavformat/aqtitledec.c | 1 + libavformat/assdec.c | 1 + libavformat/avformat.h | 4 +++- libavformat/jacosubdec.c | 1 + libavformat/lrcdec.c | 3 ++- libavformat/microdvddec.c | 1 + libavformat/mpl2dec.c | 1 + libavformat/mpsubdec.c | 1 + libavformat/pjsdec.c | 1 + libavformat/realtextdec.c | 1 + libavformat/samidec.c | 1 + libavformat/srtdec.c | 1 + libavformat/subviewer1dec.c | 1 + libavformat/subviewerdec.c | 1 + libavformat/tedcaptionsdec.c | 1 + libavformat/vplayerdec.c | 1 + libavformat/webvttdec.c | 1 + 17 files changed, 20 insertions(+), 2 deletions(-) diff --git a/libavformat/aqtitledec.c b/libavformat/aqtitledec.c index 9508766..a0a7391 100644 --- a/libavformat/aqtitledec.c +++ b/libavformat/aqtitledec.c @@ -145,4 +145,5 @@ AVInputFormat ff_aqtitle_demuxer = { .read_close = aqt_read_close, .extensions = "aqt", .priv_class = &aqt_class, + .flags = AVFMT_FULLREAD, }; diff --git a/libavformat/assdec.c b/libavformat/assdec.c index ccbf4c0..bf7d7e4 100644 --- a/libavformat/assdec.c +++ b/libavformat/assdec.c @@ -184,4 +184,5 @@ AVInputFormat ff_ass_demuxer = { .read_packet = ass_read_packet, .read_close = ass_read_close, .read_seek2 = ass_read_seek, + .flags = AVFMT_FULLREAD, }; diff --git a/libavformat/avformat.h b/libavformat/avformat.h index f21a1d6..0ce6553 100644 --- a/libavformat/avformat.h +++ b/libavformat/avformat.h @@ -445,6 +445,7 @@ typedef struct AVProbeData { */ #define AVFMT_SEEK_TO_PTS 0x4000000 /**< Seeking is based on PTS */ +#define AVFMT_FULLREAD 0x8000000 /**< Demuxer will read the full file at once */ /** * @addtogroup lavf_encoding @@ -577,7 +578,8 @@ typedef struct AVInputFormat { /** * Can use flags: AVFMT_NOFILE, AVFMT_NEEDNUMBER, AVFMT_SHOW_IDS, * AVFMT_GENERIC_INDEX, AVFMT_TS_DISCONT, AVFMT_NOBINSEARCH, - * AVFMT_NOGENSEARCH, AVFMT_NO_BYTE_SEEK, AVFMT_SEEK_TO_PTS. + * AVFMT_NOGENSEARCH, AVFMT_NO_BYTE_SEEK, AVFMT_SEEK_TO_PTS, + * AVFMT_FULLREAD. */ int flags; diff --git a/libavformat/jacosubdec.c b/libavformat/jacosubdec.c index 9a28870..783fc1c 100644 --- a/libavformat/jacosubdec.c +++ b/libavformat/jacosubdec.c @@ -268,4 +268,5 @@ AVInputFormat ff_jacosub_demuxer = { .read_packet = jacosub_read_packet, .read_seek2 = jacosub_read_seek, .read_close = jacosub_read_close, + .flags = AVFMT_FULLREAD, }; diff --git a/libavformat/lrcdec.c b/libavformat/lrcdec.c index df61853..23856d7 100644 --- a/libavformat/lrcdec.c +++ b/libavformat/lrcdec.c @@ -244,5 +244,6 @@ AVInputFormat ff_lrc_demuxer = { .read_header = lrc_read_header, .read_packet = lrc_read_packet, .read_close = lrc_read_close, - .read_seek2 = lrc_read_seek + .read_seek2 = lrc_read_seek, + .flags = AVFMT_FULLREAD, }; diff --git a/libavformat/microdvddec.c b/libavformat/microdvddec.c index ce3433c..6a5ba08 100644 --- a/libavformat/microdvddec.c +++ b/libavformat/microdvddec.c @@ -200,4 +200,5 @@ AVInputFormat ff_microdvd_demuxer = { .read_seek2 = microdvd_read_seek, .read_close = microdvd_read_close, .priv_class = µdvd_class, + .flags = AVFMT_FULLREAD, }; diff --git a/libavformat/mpl2dec.c b/libavformat/mpl2dec.c index 260b7be..02291d5 100644 --- a/libavformat/mpl2dec.c +++ b/libavformat/mpl2dec.c @@ -143,4 +143,5 @@ AVInputFormat ff_mpl2_demuxer = { .read_seek2 = mpl2_read_seek, .read_close = mpl2_read_close, .extensions = "txt,mpl2", + .flags = AVFMT_FULLREAD, }; diff --git a/libavformat/mpsubdec.c b/libavformat/mpsubdec.c index eddc594..1bf9160 100644 --- a/libavformat/mpsubdec.c +++ b/libavformat/mpsubdec.c @@ -141,4 +141,5 @@ AVInputFormat ff_mpsub_demuxer = { .read_seek2 = mpsub_read_seek, .read_close = mpsub_read_close, .extensions = "sub", + .flags = AVFMT_FULLREAD, }; diff --git a/libavformat/pjsdec.c b/libavformat/pjsdec.c index 5129b70..c6447ee 100644 --- a/libavformat/pjsdec.c +++ b/libavformat/pjsdec.c @@ -135,4 +135,5 @@ AVInputFormat ff_pjs_demuxer = { .read_seek2 = pjs_read_seek, .read_close = pjs_read_close, .extensions = "pjs", + .flags = AVFMT_FULLREAD, }; diff --git a/libavformat/realtextdec.c b/libavformat/realtextdec.c index 19af108..5c93190 100644 --- a/libavformat/realtextdec.c +++ b/libavformat/realtextdec.c @@ -153,4 +153,5 @@ AVInputFormat ff_realtext_demuxer = { .read_seek2 = realtext_read_seek, .read_close = realtext_read_close, .extensions = "rt", + .flags = AVFMT_FULLREAD, }; diff --git a/libavformat/samidec.c b/libavformat/samidec.c index 4dbf2cf..fecec1d 100644 --- a/libavformat/samidec.c +++ b/libavformat/samidec.c @@ -137,4 +137,5 @@ AVInputFormat ff_sami_demuxer = { .read_seek2 = sami_read_seek, .read_close = sami_read_close, .extensions = "smi,sami", + .flags = AVFMT_FULLREAD, }; diff --git a/libavformat/srtdec.c b/libavformat/srtdec.c index 02d75f1..5b602a5 100644 --- a/libavformat/srtdec.c +++ b/libavformat/srtdec.c @@ -171,4 +171,5 @@ AVInputFormat ff_srt_demuxer = { .read_packet = srt_read_packet, .read_seek2 = srt_read_seek, .read_close = srt_read_close, + .flags = AVFMT_FULLREAD, }; diff --git a/libavformat/subviewer1dec.c b/libavformat/subviewer1dec.c index 6b38533..f7b14e3 100644 --- a/libavformat/subviewer1dec.c +++ b/libavformat/subviewer1dec.c @@ -121,4 +121,5 @@ AVInputFormat ff_subviewer1_demuxer = { .read_seek2 = subviewer1_read_seek, .read_close = subviewer1_read_close, .extensions = "sub", + .flags = AVFMT_FULLREAD, }; diff --git a/libavformat/subviewerdec.c b/libavformat/subviewerdec.c index f1b0fdf..3b62abc 100644 --- a/libavformat/subviewerdec.c +++ b/libavformat/subviewerdec.c @@ -191,4 +191,5 @@ AVInputFormat ff_subviewer_demuxer = { .read_seek2 = subviewer_read_seek, .read_close = subviewer_read_close, .extensions = "sub", + .flags = AVFMT_FULLREAD, }; diff --git a/libavformat/tedcaptionsdec.c b/libavformat/tedcaptionsdec.c index 68063fa..494e356 100644 --- a/libavformat/tedcaptionsdec.c +++ b/libavformat/tedcaptionsdec.c @@ -363,4 +363,5 @@ AVInputFormat ff_tedcaptions_demuxer = { .read_close = tedcaptions_read_close, .read_probe = tedcaptions_read_probe, .read_seek2 = tedcaptions_read_seek, + .flags = AVFMT_FULLREAD, }; diff --git a/libavformat/vplayerdec.c b/libavformat/vplayerdec.c index 619ccfd..18473ff 100644 --- a/libavformat/vplayerdec.c +++ b/libavformat/vplayerdec.c @@ -125,4 +125,5 @@ AVInputFormat ff_vplayer_demuxer = { .read_seek2 = vplayer_read_seek, .read_close = vplayer_read_close, .extensions = "txt", + .flags = AVFMT_FULLREAD, }; diff --git a/libavformat/webvttdec.c b/libavformat/webvttdec.c index e457e8f..ddcc6f1 100644 --- a/libavformat/webvttdec.c +++ b/libavformat/webvttdec.c @@ -220,4 +220,5 @@ AVInputFormat ff_webvtt_demuxer = { .read_close = webvtt_read_close, .extensions = "vtt", .priv_class = &webvtt_demuxer_class, + .flags = AVFMT_FULLREAD, }; -- 2.1.2