aboutsummaryrefslogtreecommitdiffstats
path: root/libavformat
Commit message (Collapse)AuthorAgeFilesLines
...
* avformat/demux: Use enum AVCodecID for raw_codec_idAndreas Rheinhardt2024-03-071-1/+1
| | | | Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
* avformat/avformat: Add FFInputFormat, hide internals of AVInputFormatAndreas Rheinhardt2024-03-07274-1812/+2028
| | | | | | | | | | | | | | | | | | | | | 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>
* avformat/version_major: postpone some deprecations until the next bumpJames Almer2024-03-071-4/+4
| | | | | | They are either too recent, or are not trivial to remove. Signed-off-by: James Almer <jamrial@gmail.com>
* avutil: remove deprecated FF_API_PKT_DURATIONJames Almer2024-03-071-7/+0
| | | | Signed-off-by: James Almer <jamrial@gmail.com>
* avutil: remove deprecated FF_API_OLD_CHANNEL_LAYOUTJames Almer2024-03-078-135/+1
| | | | Signed-off-by: James Almer <jamrial@gmail.com>
* avformat: remove deprecated FF_API_AVIO_WRITE_NONCONSTJames Almer2024-03-078-66/+0
| | | | Signed-off-by: James Almer <jamrial@gmail.com>
* avformat: remove deprecated FF_API_AVFORMAT_IO_CLOSEJames Almer2024-03-0710-65/+2
| | | | Signed-off-by: James Almer <jamrial@gmail.com>
* avformat: remove deprecated FF_API_AVIODIRCONTEXTJames Almer2024-03-073-9/+0
| | | | Signed-off-by: James Almer <jamrial@gmail.com>
* avformat: remove deprecated FF_API_GET_END_PTSJames Almer2024-03-073-18/+0
| | | | Signed-off-by: James Almer <jamrial@gmail.com>
* avformat/options: Deprecate av_fmt_ctx_get_duration_estimation_method()Andreas Rheinhardt2024-03-064-1/+8
| | | | | | Forgotten in b7785d10b00c88029d8af7dbddac09ab0d6f2b7f. Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
* avformat/mov: fix setting dependent disposition on ambisonic IAMF streamsJames Almer2024-03-051-1/+4
| | | | Signed-off-by: James Almer <jamrial@gmail.com>
* avformat/avformat: add a function to return the name of stream groupsJames Almer2024-03-053-1/+16
| | | | | Reviewed-by: Stefano Sabatini <stefasab@gmail.com> Signed-off-by: James Almer <jamrial@gmail.com>
* avformat/iamf_writer: constify some variablesJames Almer2024-03-051-10/+11
| | | | Signed-off-by: James Almer <jamrial@gmail.com>
* avformat/iamf_writer: clear extradata_size on extradata allocation failureJames Almer2024-03-051-1/+3
| | | | Signed-off-by: James Almer <jamrial@gmail.com>
* avformat/dashenc, hlsenc: Return 0 on succes from write_headerAndreas Rheinhardt2024-03-052-2/+2
| | | | | | | | | | | | | Do not propagate the return value of avformat_write_header(), as it contains the information whether the output had already been initialized in avformat_init_output(), but this is set generically; the return value of FFOutputFormat.write_header is not documented at all (and is currently ignored if >= 0), but it is more future-proof to simply return 0 on success. Reviewed-by: Liu Steven <lq@chinaffmpeg.org> Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
* avformat/hlsenc: Redo checking for strftime %s support to avoid warningsAndreas Rheinhardt2024-03-051-7/+12
| | | | | | | | | This is intended to avoid -Wformat= warnings on systems where %s might not be supported (and also generally emitted by GCC with -pedantic). Reviewed-by: Liu Steven <lq@chinaffmpeg.org> Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
* avformat/avio: Avoid av_strdup(NULL)Andreas Rheinhardt2024-03-051-8/+12
| | | | Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
* avformat/avio: Avoid indirection in ffio_fdopen()Andreas Rheinhardt2024-03-051-19/+21
| | | | Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
* avformat/avio: Avoid function pointer castsAndreas Rheinhardt2024-03-055-10/+14
| | | | | | | It is undefined behaviour to use a different type for a call than the actual type of the function. Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
* avformat/aviobuf: Move code specific to URLContexts to avio.cAndreas Rheinhardt2024-03-053-190/+189
| | | | | | | This separates the URL-layer adjacent parts of the code from the parts that are also usable with custom IO. Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
* avformat/iamfenc: ensure updated extradata is writtenJames Almer2024-03-041-1/+29
| | | | Signed-off-by: James Almer <jamrial@gmail.com>
* avformat/iamf_writer: update extradata from packet side dataJames Almer2024-03-043-14/+46
| | | | | | | Some encoders, like flac, propagate updated extradata at the end of encoding as packet side data. Use it to update the relevant codec_config. Signed-off-by: James Almer <jamrial@gmail.com>
* avformat/mov: set stream index field in tile gridsJames Almer2024-03-041-0/+1
| | | | | | It was forgotten for grid type derived images. Signed-off-by: James Almer <jamrial@gmail.com>
* avformat/mov: don't mark an item referenced by a grid as dependent if it's ↵James Almer2024-03-041-1/+2
| | | | | | | | | the primary item If it's the primary item, then it's expected to be ready for presentation even outside of the grid it belongs to. Signed-off-by: James Almer <jamrial@gmail.com>
* avformat/mov: fix setting disposition for the first iamf streamJames Almer2024-03-041-1/+1
| | | | | | st->disposition will be overwritten with disposition later in the function. Signed-off-by: James Almer <jamrial@gmail.com>
* fix /// comments that should be ///<Andrew Sayers2024-03-041-2/+2
| | | | | | Actual command: sed -i -e "s/\([;,] *\)<* *\/\/\/ *<* */\1\/\/\/< /" $( git grep -l "[;,] */// " ) Signed-off-by: Andrew Sayers <ffmpeg-devel@pileofstuff.org>
* avformat/dvdvideodec: fix -pgc and -pg optionsMarth642024-03-041-10/+13
| | | | | | | | | | Rebased on top of recently merged fixes (should apply correctly now). In merged DVD patch, -pgc and -pg options were broken. While these are rather advanced options, they are the only means to get content for some strangely authored discs. Signed-off-by: Marth64 <marth64@proxyid.net>
* avformat/mpegts: detect synchronous metadata KLV more reliablyMarton Balint2024-03-041-2/+5
| | | | | | | | | | | | | | | | The mpegts code historically tries to strip (the first) metadata access unit header from synchronous KLV metadata, but the detection for such streams was unreliable causing strips of asynchronous metadata or ID3 as well. MISB ST 1402 specifies required stream type, stream id and registration descriptor (which eventually maps to the codec ID) so let's use all of these for reliable detection. Fixes a regression caused by 468615f2045da325e0f73e8e668d49cf456ccb37. Fixes ticket #10828, #10883. Signed-off-by: Marton Balint <cus@passwd.hu>
* avformat/dvdvideodec: Reorder allocations to simplify freeingAndreas Rheinhardt2024-03-031-8/+4
| | | | | Reviewed-by: Marth64 <marth64@proxyid.net> Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
* avformat/dvdvideodec: Only free allocated buffersAndreas Rheinhardt2024-03-031-1/+0
| | | | | Reviewed-by: Marth64 <marth64@proxyid.net> Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
* avformat/dvdvideodec: Don't store AVInputFormat*Andreas Rheinhardt2024-03-031-6/+2
| | | | | | | | | | | The inner AVInputFormat* of the inner mpegps-demuxer is only used once (in avformat_open_input()), so don't even store it. In fact, just use ff_mpegps_demuxer directly, as this demuxer has a configure dependency on it. Reviewed-by: Marth64 <marth64@proxyid.net> Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
* avformat/dvdvideodec: Explicitly return 0 on successAndreas Rheinhardt2024-03-031-9/+6
| | | | | | | Don't "return ret" even when ret is zero on success. Reviewed-by: Marth64 <marth64@proxyid.net> Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
* avformat/iamf_writer: constify some function parametersJames Almer2024-03-022-4/+4
| | | | Signed-off-by: James Almer <jamrial@gmail.com>
* avformat/wavdec: dynamically set max_size by defaultMarton Balint2024-03-021-1/+18
| | | | | | | | | | | | | The wav demuxer by default tried to demux 4096-byte packets which caused packets with very few number of samples for files with high channel count. This caused a significant overhead especially since the latest ffmpeg.c threading changes. So let's use a similar approach for selecting audio frame size which is already used in the PCM demuxer, which is to read 25 times per second but at most 1024 samples. Signed-off-by: Marton Balint <cus@passwd.hu>
* avformat/mxfdec: track metadata sets by their typeMarton Balint2024-03-022-69/+60
| | | | | | | | | We typically are only interesed in a single type of metadata set, so it is better to keep them separated instead of always filtering for them. Also use av_dynarray_add for increasing their array. Signed-off-by: Marton Balint <cus@passwd.hu>
* avformat/mxfdec: remove resolve_strong_ref usage with AnyTypeMarton Balint2024-03-022-37/+20
| | | | | | | UUIDs do not have to be unique if their type sets them apart, so avoid using AnyType, since we are only interested in specific types. Signed-off-by: Marton Balint <cus@passwd.hu>
* libavformat/dvdvideo: add DVD-Video demuxer, powered by libdvdread and libdvdnavMarth642024-03-023-0/+1413
| | | | | Signed-off-by: Marth64 <marth64@proxyid.net> Signed-off-by: Anton Khirnov <anton@khirnov.net>
* avformat/avio: Make avio_print_string_array() accept const pointersAndreas Rheinhardt2024-03-023-4/+4
| | | | Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
* avformat/mov: Update bits_per_coded_sample after read pcmCZhao Zhili2024-03-011-0/+1
| | | | Fix #10878
* avformat/iamf: remove duplicated functionJames Almer2024-02-293-31/+15
| | | | Signed-off-by: James Almer <jamrial@gmail.com>
* avformat/mov: Don't use entry[-1] in pointer arithmeticAndreas Rheinhardt2024-02-271-5/+6
| | | | | | | | | | | | | It is undefined behaviour. Fixes many failed tests with UBSan and GCC 13 like "src/libavformat/mov.c:4229:44: runtime error: store to address 0x5572abe20f80 with insufficient space for an object of type 'struct MOVIndexRange'" (The line number does not refer to the line where &entry[-1] is assigned.) Reviewed-by: James Almer <jamrial@gmail.com> Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
* Revert "avformat/mov: zero initialize the index ranges buffer"Andreas Rheinhardt2024-02-271-1/+2
| | | | | | | | | | | | This reverts commit eee3b7e2fb0664b889e58c03f76e19ef23e4d1d8. It has been made in an attempt to fix UBSan test failures with GCC 13 (see e.g. [1]), but it did not help at all. So revert it, but use av_malloc_array() instead of going back to av_malloc(). [1]: https://fate.ffmpeg.org/report.cgi?slot=x86_64-archlinux-gcc-ubsan&time=20240226182430 Reviewed-by: James Almer <jamrial@gmail.com> Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
* avformat/mov: add support for tile HEIF still imagesJames Almer2024-02-266-49/+480
| | | | | | | | | | | | Export each tile as its own stream, and the grid information as a Stream Group of type TILE_GRID. This also enables exporting other stream items like thumbnails, which may be present in non tiled HEIF images too. For those, the primary stream will be tagged with the default disposition. Based on a patch by Swaraj Hota Signed-off-by: James Almer <jamrial@gmail.com>
* avformat: add a Tile Grid stream group typeJames Almer2024-02-265-2/+232
| | | | | | This will be used to support tiled image formats like HEIF. Signed-off-by: James Almer <jamrial@gmail.com>
* avformat/libsrt: use SRT_EPOLL_IN for waiting for an incoming connectionMarton Balint2024-02-251-7/+10
| | | | | | | | | This is the proper poll mode for waiting for an incoming connection according to the SRT API docs. Fixes ticket #9142. Signed-off-by: Marton Balint <cus@passwd.hu>
* avformat/libsrt: Remove manually free AV_OPT_TYPE_STRINGZhao Zhili2024-02-221-3/+0
| | | | Signed-off-by: Zhao Zhili <zhilizhao@tencent.com>
* Avoid OOM for invalid STCO / CO64 constructions.Dale Curtis2024-02-211-0/+7
| | | | | | | | | | | The `entries` value is read directly from the stream and used to allocate memory. This change clamps `entries` to however many are possible in the remaining atom or file size (whichever is smallest). Fixes https://crbug.com/1429357 Signed-off-by: Dale Curtis <dalecurtis@chromium.org> Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* avformat/movenc: Make check actually check what is intendedAndreas Rheinhardt2024-02-201-1/+1
| | | | | | | | | Also fixes a Clang warning: "overlapping comparisons always evaluate to false [-Wtautological-overlap-compare]" Reviewed-by: James Almer <jamrial@gmail.com> Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
* flvdec: Honor the "flv_metadata" option for the "datastream" metadata fieldMartin Storsjö2024-02-201-6/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | By default the option "flv_metadata" (internally using the field name "trust_metadata") is set to 0, meaning that we don't allocate streams based on information in the metadata, only based on actual streams we encounter. However the "datastream" metadata field still would allocate a subtitle stream. When muxing, the "datastream" field is added if either a data stream or subtitle stream is present - but the same metadata field is used to preemtively create a subtitle stream only. Thus, if the field was added due to a data stream, not a subtitle stream, the demuxer would create a stream which won't get any actual packets. If there was such an extra, empty subtitle stream, running avformat_find_stream_info still used to terminate within reasonable time before 3749eede66c3774799766b1f246afae8a6ffc9bb. After that commit, it no longer would terminate until it reaches the max analyze duration, which is 90 seconds for flv streams (see e6a084641aada7a2e4672172f2ee26642800a361, 24fdf7334d2bb9aab0abdbc878b8ae51eb57c86b and f58e011a1f30332ba824c155078ca701e29aef63). Before that commit (which removed the deprecated AVStream.codec), the "st->codecpar->codec_id = AV_CODEC_ID_TEXT", set within the demuxer, would get propagated into st->codec->codec_id by numerous avcodec_parameters_to_context(st->codec, st->codecpar), then further into st->internal->avctx->codec_id by update_stream_avctx within read_frame_internal in libavformat/utils.c (demux.c these days). Signed-off-by: Martin Storsjö <martin@martin.st>
* avformat/movenc: add support for Immersive Audio Model and Formats in ISOBMFFJames Almer2024-02-202-69/+294
| | | | Signed-off-by: James Almer <jamrial@gmail.com>