aboutsummaryrefslogtreecommitdiffstats
path: root/libavformat/webvttdec.c
Commit message (Collapse)AuthorAgeFilesLines
* avformat/webvttdec,webvttenc: update documentationLeon Grutters20 hours1-1/+1
| | | | | | The previous links lead to a 404 page as that page doesn't exist anymore. Signed-off-by: Leon Grutters <gruttersleonbot2@gmail.com>
* avformat/webvttdec: Add webvtt extension and MIME typesoftworkz2025-03-141-1/+2
| | | | | | | The webvtt extension is sometimes used in HLS playlists. Signed-off-by: softworkz <softworkz@hotmail.com> Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* avformat/internal: Move FF_FMT_INIT_CLEANUP to demux.hAndreas Rheinhardt2024-03-261-1/+1
| | | | | | | | | and rename it to FF_INFMT_INIT_CLEANUP. This flag is demuxer-only, so this is the more appropriate place for it. This does not preclude adding internal flags common to both demuxer and muxer in the future. Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
* avformat/webvttdec: Skip more parts of header to let parsing continueKristoffer Brånemyr2024-03-121-0/+2
| | | | | Signed-off-by: Kristoffer Brånemyr <ztion1@yahoo.se> Signed-off-by: Marton Balint <cus@passwd.hu>
* avformat/avformat: Add FFInputFormat, hide internals of AVInputFormatAndreas Rheinhardt2024-03-071-5/+6
| | | | | | | | | | | | | | | | | | | | | This commit does for AVInputFormat what commit 59c9dc82f450638a3068deeb1db5c56f6d155752 did for AVOutputFormat: It adds a new type FFInputFormat, moves all the internals of AVInputFormat to it and adds a now reduced AVInputFormat as first member. This does not affect/improve extensibility of both public or private fields for demuxers (it is still a mess due to lavd). This is possible since 50f34172e0cca2cabc5836308ec66dbf93f5f2a3 (which removed the last usage of an internal field of AVInputFormat in fftools). (Hint: tools/probetest.c accesses the internals of FFInputFormat as well, but given that it is a testing tool this is not considered a problem.) Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
* all: use designated initializers for AVOption.unitAnton Khirnov2024-02-141-5/+5
| | | | | | | | | | | | | | | | | | | | | | | | Makes it robust against adding fields before it, which will be useful in following commits. Majority of the patch generated by the following Coccinelle script: @@ typedef AVOption; identifier arr_name; initializer list il; initializer list[8] il1; expression tail; @@ AVOption arr_name[] = { il, { il1, - tail + .unit = tail }, ... }; with some manual changes, as the script: * has trouble with options defined inside macros * sometimes does not handle options under an #else branch * sometimes swallows whitespace
* Revert "all: Don't set AVClass.item_name to its default value"Anton Khirnov2024-01-201-0/+1
| | | | | | | Some callers assume that item_name is always set, so this may be considered an API break. This reverts commit 0c6203c97a99f69dbaa6e4011d48c331e1111f5e.
* all: Don't set AVClass.item_name to its default valueAndreas Rheinhardt2023-12-221-1/+0
| | | | | | | | Unnecessary since acf63d5350adeae551d412db699f8ca03f7e76b9; also avoids relocations. Reviewed-by: Anton Khirnov <anton@khirnov.net> Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
* libavformat: fix incorrect handling of incomplete AVBPrint.Reimar Döffinger2023-07-291-1/+3
| | | | | | | | | | | | | Change some internal APIs a bit to make it harder to make such mistakes. In particular, have the read chunk functions return an error when the result is incomplete. This might be less flexible, but since there has been no use-case for that so far, avoiding coding mistakes seems better. Add a function to queue a AVBPrint directly (ff_subtitles_queue_insert_bprint). Also fixes a leak in lrcdec when ff_subtitles_queue_insert fails. Signed-off-by: Reimar Döffinger <Reimar.Doeffinger@gmx.de>
* avformat/webvttdec: Simplify cleanup after read_header failureAndreas Rheinhardt2021-07-081-2/+1
| | | | | | by setting the FF_FMT_INIT_CLEANUP flag. Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
* avformat: Constify all muxer/demuxersAndreas Rheinhardt2021-04-271-1/+1
| | | | | | | This is possible now that the next-API is gone. Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com> Signed-off-by: James Almer <jamrial@gmail.com>
* avutil/buffer: Switch AVBuffer API to size_tAndreas Rheinhardt2021-04-271-1/+1
| | | | | | | Announced in 14040a1d913794d9a3fd6406a6d8c2f0e37e0062. Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com> Signed-off-by: James Almer <jamrial@gmail.com>
* avformat/webvttdec: Accept \r as newlineAndreas Rheinhardt2020-06-261-1/+1
| | | | | | | | | | | | | After parsing the end timestamp of a WebVTT cue block, the current code skips everything after the start of the timestamp that is not a \t, ' ' or \n and treats what is next as the start of a WebVTT cue settings list. Yet if there is no such list, but a single \r, this will skip a part of the cue payload (namely everything until the first occurence of \t, ' ' or \n) and treat what has not been skipped as the beginning of the WebVTT cue settings list that extends until the next \r or \n (or the end). Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
* avformat/webvttdec: Fix memleak upon read header failureAndreas Rheinhardt2020-06-151-0/+2
| | | | | | | The already parsed subtitles (contained in an FFDemuxSubtitlesQueue) would leak if an error happened upon reading a subsequent subtitle. Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
* avformat/webvttdec: Remove write-only variableAndreas Rheinhardt2020-04-231-3/+1
| | | | Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
* lavf/webvtt: fix ffmpeg -h demuxer=webvtt can't dump optionsJun Zhao2019-06-141-5/+5
| | | | | | fix ffmpeg -h demuxer=webvtt can't dump options Signed-off-by: Jun Zhao <barryjzhao@tencent.com>
* lavf: Constify the probe function argument.Carl Eugen Hoyos2019-03-211-1/+1
| | | | | Reviewed-by: Lauri Kasanen Reviewed-by: Tomas Härdin
* Merge commit '9200514ad8717c63f82101dc394f4378854325bf'Derek Buitenhuis2016-04-101-2/+2
| | | | | | | | | | | | | | | | * commit '9200514ad8717c63f82101dc394f4378854325bf': lavf: replace AVStream.codec with AVStream.codecpar This has been a HUGE effort from: - Derek Buitenhuis <derek.buitenhuis@gmail.com> - Hendrik Leppkes <h.leppkes@gmail.com> - wm4 <nfxjfg@googlemail.com> - Clément Bœsch <clement@stupeflix.com> - James Almer <jamrial@gmail.com> - Michael Niedermayer <michael@niedermayer.cc> - Rostislav Pehlivanov <atomnuker@gmail.com> Merged-by: Derek Buitenhuis <derek.buitenhuis@gmail.com>
* avformat/webvttdec: Don't stop parsing on commentsRicardo Constantino2015-10-121-1/+2
| | | | Signed-off-by: Ricardo Constantino <wiiaboo@gmail.com>
* avformat/subtitles: forward log context in ff_subtitles_queue_finalize() for ↵Clément Bœsch2015-09-101-1/+1
| | | | logging
* avformat/webvttdec: Dont skip over a never checked byte after -->Michael Niedermayer2014-01-071-1/+1
| | | | | | | Fixes use of uninitialized memory Fixes: msan_uninit-mem_7f49667d83db_3396_WebVTT_capability_tester.vtt Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
* lavf/webvttdec: use private option to specify WebVTT kindMatthew Heaney2013-06-251-0/+24
| | | | | | | | | | | | | | | WebVTT subtitle tracks have four kinds. Certain downstream muxers (such as for WebM) need to know which WebVTT kind this is, in order to specify the codec id of the output track. A new private input option, "-kind", has been added to the WebVTT demuxer. It accepts as a value any of "subtitles" (the default), "captions", "descriptions", and "metadata". The kind option value is used to assign a value to the stream disposition flag, to which four new values have been added, corresponding the four WebVTT kinds. Signed-off-by: Matthew Heaney <matthewjheaney@google.com> Signed-off-by: Clément Bœsch <ubitux@gmail.com>
* lavf/webvttdec: factorize identifier and settings side data code.Clément Bœsch2013-06-011-21/+13
|
* lavf/webvttdec: save cue id and settings as side dataMatthew Heaney2013-06-011-11/+42
| | | | | | | | | | | | | | | | | | | | | | Currently the WebVTT demuxer parses the cues but throws away the cue id (the optional first line of the cue) and cue settings (the optional rendering instructions that follow the timestamp). However, in order to write inband text tracks (to WebM files), the entire cue payload from the WebVTT source must be preserved. This commit makes no change to the data part of the output buffer packet (where the actual cue text is stored), but does add the cue id and settings as a side data items, if they're present in the cue. Existing code that cares only about the data part of the packet can continue to ignore the side data. There are two new packet data type flags, AV_PKT_DATA_WEBVTT_IDENTIFIER and AV_PKT_DATA_WEBVTT_SETTINGS.
* lavf/webvtt: use ff_subtitles_read_chunk().Clément Bœsch2013-01-031-30/+10
| | | | | The FATE test is updated because the line breaks in the dialogue rectangles are now proper CRLF.
* lavf: remove generic index flag from text subtitles.Clément Bœsch2013-01-021-1/+0
| | | | This flag is not necessary.
* lavf: use ff_subtitles_queue_seek() for text subtitles demuxers.Clément Bœsch2012-12-021-0/+9
|
* lavf/webvttdec: fix potential timing overflows.Clément Bœsch2012-10-211-2/+2
| | | | Should fix CID733781 and CID733782.
* WebVTT demuxer and decoder.Clément Bœsch2012-09-231-0/+188