aboutsummaryrefslogtreecommitdiffstats
path: root/libavformat/options.c
Commit message (Collapse)AuthorAgeFilesLines
* avformat: remove deprecated FF_API_GET_DUR_ESTIMATE_METHODJames Almer2025-03-281-7/+0
| | | | | | Deprecated since 2024-03-06. Signed-off-by: James Almer <jamrial@gmail.com>
* avformat: remove deprecated FF_API_AVSTREAM_SIDE_DATAJames Almer2025-03-281-5/+0
| | | | | | Deprecated since 2023-10-06. Signed-off-by: James Almer <jamrial@gmail.com>
* avformat: remove deprecated FF_API_LAVF_SHORTESTJames Almer2025-03-281-4/+0
| | | | | | Deprecated since 2023-09-18. Signed-off-by: James Almer <jamrial@gmail.com>
* lavf: move muxing-specific fields from FFFormatContext to FormatContextInternalAnton Khirnov2024-10-161-1/+1
|
* lavf: add new struct for data private to generic layerAnton Khirnov2024-10-161-2/+5
| | | | | | Trivial for now, will become more useful in future commits, as many fields from FFFormatContext should not be visible to individual (de)muxers.
* lavf: add a header for generic-layer interfacesAnton Khirnov2024-10-161-0/+1
| | | | Analogous to what was previously done in avcodec and avfilter.
* avformat: add an LCEVC stream groupJames Almer2024-09-191-1/+28
| | | | Signed-off-by: James Almer <jamrial@gmail.com>
* lavf: deprecate avformat_transfer_internal_stream_timing_info()Anton Khirnov2024-07-091-0/+2
| | | | | | | | | And av_stream_get_codec_timebase(). They were both added for ffmpeg CLI, which no longer calls either of them. Furthermore the notion of "internal stream timing info" that needs to be transferred with a special magic API function is fundamentally flawed and should be removed.
* avformat: Add a new stream disposition for multilayer videoDerek Buitenhuis2024-07-071-1/+2
| | | | | | | This lets us detect when a container has flagged a stream as multilayer. Signed-off-by: Derek Buitenhuis <derek.buitenhuis@gmail.com> Signed-off-by: Anton Khirnov <anton@khirnov.net>
* avutil/common: Don't auto-include mem.hAndreas Rheinhardt2024-03-311-0/+1
| | | | | | | | | | | There are lots of files that don't need it: The number of object files that actually need it went down from 2011 to 884 here. Keep it for external users in order to not cause breakages. Also improve the other headers a bit while just at it. Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
* avformat: remove deprecated FF_API_AVFORMAT_IO_CLOSEJames Almer2024-03-071-12/+0
| | | | Signed-off-by: James Almer <jamrial@gmail.com>
* avformat/options: Deprecate av_fmt_ctx_get_duration_estimation_method()Andreas Rheinhardt2024-03-061-0/+2
| | | | | | Forgotten in b7785d10b00c88029d8af7dbddac09ab0d6f2b7f. Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
* avformat: add a Tile Grid stream group typeJames Almer2024-02-261-0/+34
| | | | | | This will be used to support tiled image formats like HEIF. Signed-off-by: James Almer <jamrial@gmail.com>
* avformat: add a disposition field to AVStreamGroupJames Almer2024-02-131-21/+24
| | | | | | | | | | The existing (and upcoming) available group types are meant to combine several streams for presentation, with the result being treated as if it was a stream itself. For example, a file could export two stream groups of the same type with one of them as the "default". Signed-off-by: James Almer <jamrial@gmail.com>
* avformat/options: Only allocate AVCodecContext for demuxersAndreas Rheinhardt2024-02-071-3/+5
| | | | | | | | | | | The muxer's AVCodecContext is currently used for exactly one thing: To store a time base in it that has been derived via heuristics in avformat_transfer_internal_stream_timing_info(); said time base can then be read back via av_stream_get_codec_timebase(). But one does not need a whole AVCodecContext for that, a simple AVRational is enough. Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
* Revert "all: Don't set AVClass.item_name to its default value"Anton Khirnov2024-01-201-0/+2
| | | | | | | 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-2/+0
| | | | | | | | Unnecessary since acf63d5350adeae551d412db699f8ca03f7e76b9; also avoids relocations. Reviewed-by: Anton Khirnov <anton@khirnov.net> Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
* lavf: allow setting AVStream.discard as an AVOptionAnton Khirnov2023-12-221-0/+10
|
* avformat/options: skip the none type group in stream_group_child_iterate()James Almer2023-12-211-0/+3
| | | | | | Otherwise the function will not iterate through valid group types. Signed-off-by: James Almer <jamrial@gmail.com>
* avformat: introduce AVStreamGroupJames Almer2023-12-181-0/+139
| | | | Signed-off-by: James Almer <jamrial@gmail.com>
* avformat/options: add missing disposition flag to AVStream class optionsJames Almer2023-10-251-0/+1
| | | | Signed-off-by: James Almer <jamrial@gmail.com>
* avformat/avformat: use the side data from AVStream.codecparJames Almer2023-10-061-0/+2
| | | | | | | | | | | | Deprecate AVStream.side_data and its helpers in favor of the AVStream's codecpar.coded_side_data. This will considerably simplify the propagation of global side data to decoders and from encoders. Instead of having to do it inside packets, it will be available during init(). Global and frame specific side data will therefore be distinct. Signed-off-by: James Almer <jamrial@gmail.com>
* lavf: deprecate AVFMT_FLAG_SHORTESTAnton Khirnov2023-09-181-0/+2
| | | | | | | | | | | It was added in cb114ed4640 with the comment "This will allow fixing several bugs with the -shortest option". Since * there is no explanation of what these bugs are * libavformat is not the place to work around ffmpeg CLI bugs * there is no indication that this feature is actually in use deprecate it without replacement.
* lavf: fall back to a more meaningful log instance nameAnton Khirnov2023-04-041-1/+1
| | | | | | | | | | | | | | | An uninitialized AVFormatContext instance with neither iformat nor oformat set will currently log as 'NULL', which is confusing and unhelpful. Print 'AVFormatContext' instead, which provides more information. This happens e.g. if choosing an output format fails in avformat_alloc_output_context2(). E.g. with the following commandline: ffmpeg -i <input> -f foobar -y /dev/null before: [NULL @ 0x5580377834c0] Requested output format 'foobar' is not a suitable output format after: [AVFormatContext @ 0x55fa15bb34c0] Requested output format 'foobar' is not a suitable output format
* avformat: deprecate AVFormatContext io_close callbackMarton Balint2023-02-161-0/+6
| | | | | | io_close2 should be used instead. Signed-off-by: Marton Balint <cus@passwd.hu>
* avformat: remove FF_API_AVSTREAM_CLASSJames Almer2023-02-091-3/+0
| | | | Signed-off-by: James Almer <jamrial@gmail.com>
* avformat/utils: Move ff_format_io_close.* to options.c, avformat.cAndreas Rheinhardt2022-05-101-0/+5
| | | | | | | These are not pure avio-functions, but auxiliary AVFormatContext functions. Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
* avformat/demux: Add new demux.h headerAndreas Rheinhardt2022-05-101-0/+1
| | | | | | And move those stuff already in demuxer-only files to it. Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
* avformat/utils: Move stream_options, avformat_new_stream to options.cAndreas Rheinhardt2022-05-101-0/+151
| | | | | | | | | This is the appropriate place given that AVStream is about to become an AVOpt-enabled struct. Also move av_disposition_(to|from)_string, as these are tied to the disposition stream option. Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
* avformat/mux: Preserve sync even if later packet has negative tsAndreas Rheinhardt2022-01-211-1/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | write_packet() has code to shift the packets timestamps to make them nonnegative or even make them start at ts zero; this code inspects every packet that is written and if a packet with negative timestamp (whether this is dts or pts depends upon another flag; basically: Matroska uses pts, everyone else dts) is encountered, this is offset to make the timestamp zero. All further packets will be offset accordingly (with the offset converted according to the streams' timebases). This is based around an assumption, namely that the timestamps are indeed non-decreasing, so that the first packet with negative timestamps is the first packet with timestamps. This assumption is often fulfilled given that the default interleavement function by default interleaves per dts; yet there are scenarios in which it may not be fulfilled: a) av_write_frame() instead of av_interleaved_write_frame() is used. b) The audio_preload option is used. c) When the timestamps that are made nonnegative/zero are pts (i.e. with Matroska), because the packet with the smallest dts is not necessarily the packet with the smallest pts. d) Possibly with custom interleavement functions. In these cases the relative sync of the first few packet(s) is offset relative to the later packets. This contradicts the documentation ("When shifting is enabled, all output timestamps are shifted by the same amount"). Therefore this commit changes this: As soon as the first packet with valid timestamps is output, it is checked and recorded whether the timestamps need to be shifted. Further packets are no longer checked for needing to be offset; instead they are simply offset. In the cases above this leads to packets with negative timestamps (and the appropriate warnings) instead of desync. This will mostly be fixed in the next commit. This commit also factors handling the avoid_negative_ts stuff out of write_packet() in order to be able to return immediately. Tickets #4536 and #5784 as well as the matroska-avoid-negative-ts-test are examples of c); as has been said, some timestamps are now negative, yet the ref file update does not show it because ffmpeg.c sanitizes the timestamps (-copyts disables it; ffprobe and mkvinfo also show the original timestamps). Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
* avformat: introduce AVFormatContext io_close2 which returns an intMarton Balint2021-12-121-3/+4
| | | | | | | | | | | | | | | | | Otherwise there is no way to detect an error returned by avio_close() because ff_format_io_close cannot get the return value. Checking the return value of the close function is important in order to check if all data was successfully written and the underlying close() operation was successful. It can also be useful even for read mode because it can return any pending AVIOContext error, so the user don't have to manually check AVIOContext->error. In order to still support if the user overrides io_close, the generic code only uses io_close2 if io_close is either NULL or the default io_close callback. Signed-off-by: Marton Balint <cus@passwd.hu>
* avformat/demux: allow total size of packets in raw_packet_buffer to reach ↵Marton Balint2021-11-141-1/+0
| | | | | | | | | | | | | | probesize Previously this was hardcoded to 2500000 bytes, so probing of the stream codecs was always limited by this, and not probesize. Also keep track of the actual size of packets in raw_packet_buffer and not the remaining size for simplicity. Fixes ticket #5860. Signed-off-by: Marton Balint <cus@passwd.hu>
* avformat: Avoid allocation for AVFormatInternalAndreas Rheinhardt2021-09-171-29/+16
| | | | | | | | | | | | | Do this by allocating AVFormatContext together with the data that is currently in AVFormatInternal; or rather: Put AVFormatContext at the beginning of a new structure called FFFormatContext (which encompasses more than just the internal fields and is a proper context in its own right, hence the name) and remove AVFormatInternal altogether. The biggest simplifications occured in avformat_alloc_context(), where one can now simply call avformat_free_context() in case of errors. Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
* avutil: remove deprecated AVClass.child_class_nextJames Almer2021-04-271-38/+0
| | | | Signed-off-by: James Almer <jamrial@gmail.com>
* avformat: Remove deprecated old open callbacksAndreas Rheinhardt2021-04-271-7/+0
| | | | | Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com> Signed-off-by: James Almer <jamrial@gmail.com>
* avformat/utils: use av_packet_alloc() to allocate packetsJames Almer2021-03-171-1/+4
| | | | Signed-off-by: James Almer <jamrial@gmail.com>
* avformat/mux: use av_packet_alloc() to allocate packetsJames Almer2021-03-171-0/+6
| | | | Signed-off-by: James Almer <jamrial@gmail.com>
* avformat/options: use the iterate API in format_child_class_next()James Almer2020-10-191-10/+13
| | | | Signed-off-by: James Almer <jamrial@gmail.com>
* AVFormatContext: switch to child_class_iterate()Anton Khirnov2020-06-101-0/+64
|
* avformat/options: don't call avformat_free_context() within ↵James Almer2019-10-191-4/+6
| | | | | | | | | avformat_alloc_context() avformat_free_context() expects AVFormatContext->internal to not be NULL. Reviewed-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com> Signed-off-by: James Almer <jamrial@gmail.com>
* avformat: migrate to AVFormatContext->urlMarton Balint2018-01-281-1/+1
| | | | Signed-off-by: Marton Balint <cus@passwd.hu>
* avformat/options: log filename on openMichael Niedermayer2017-06-031-0/+12
| | | | | | | | | | | The loglevel is choosen so that the main filename and any images of multi image sequences are shown only at debug level to avoid clutter. This makes exploits in playlists more visible. As they would show accesses to private/sensitive files Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* avformat/mux: implement AVFMT_FLAG_SHORTESTMichael Niedermayer2016-09-111-0/+1
| | | | | | This will allow fixing several bugs with the -shortest option Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* avformat: Add a protocol blacklisting APIDerek Buitenhuis2016-03-041-1/+1
| | | | Signed-off-by: Derek Buitenhuis <derek.buitenhuis@gmail.com>
* Merge commit '9f61abc8111c7c43f49ca012e957a108b9cc7610'Derek Buitenhuis2016-02-101-0/+21
|\ | | | | | | | | | | | | | | | | This also deprecates our old duplicated callbacks. * commit '9f61abc8111c7c43f49ca012e957a108b9cc7610': lavf: allow custom IO for all files Merged-by: Derek Buitenhuis <derek.buitenhuis@gmail.com>
| * lavf: allow custom IO for all filesAnton Khirnov2016-01-241-0/+14
| | | | | | | | | | | | | | | | | | | | | | | | | | | | Some (de)muxers open additional files beyond the main IO context. Currently, they call avio_open() directly, which prevents the caller from using custom IO for such streams. This commit adds callbacks to AVFormatContext that default to avio_open2()/avio_close(), but can be overridden by the caller. All muxers and demuxers using AVIO are switched to using those callbacks instead of calling avio_open()/avio_close() directly. (de)muxers that use the URLProtocol layer directly instead of AVIO remain unconverted for now. This should be fixed in later commits.
* | Merge commit 'f046c3b5ac36848cce824b008e0347c621523041'Michael Niedermayer2015-07-031-0/+4
|\| | | | | | | | | | | | | | | * commit 'f046c3b5ac36848cce824b008e0347c621523041': lavc: Move deprecation warning disabling to files including the table lavc: Disable deprectation warnings coming from options table Merged-by: Michael Niedermayer <michaelni@gmx.at>
| * lavc: Move deprecation warning disabling to files including the tableVittorio Giovara2015-07-031-0/+4
| | | | | | | | | | | | Unbreak build from 7a5902c556d84a367dd64a003a4e7244fc3a73d1. Signed-off-by: Luca Barbato <lu_zero@gentoo.org>
* | avformat_alloc_context: initialize raw_packet_buffer_remaining_size.Reimar Döffinger2015-05-101-0/+1
| | | | | | | | | | | | | | | | This currently works for most users because avformat_open_input sets it, but this patch fixes any applications not using that function. Signed-off-by: Reimar Döffinger <Reimar.Doeffinger@gmx.de>
* | Merge commit 'c86d8aed748adc3ba8df96fb1fe14aa45da77a31'Michael Niedermayer2015-02-281-1/+1
|\| | | | | | | | | | | | | * commit 'c86d8aed748adc3ba8df96fb1fe14aa45da77a31': avio: Rename avclass symbols relating to avio Merged-by: Michael Niedermayer <michaelni@gmx.at>