aboutsummaryrefslogtreecommitdiffstats
Commit message (Collapse)AuthorAgeFilesLines
* avformat/mux: Rename FF_FMT_ALLOW_FLUSH->FF_OFMT_FLAG_ALLOW_FLUSHAndreas Rheinhardt2024-03-2211-28/+36
| | | | | | | It better reflects that this is a muxer-only flag. Also document the flag. Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
* libavformat/westwood_audenc: Use proper logcontextAndreas Rheinhardt2024-03-221-3/+3
| | | | | | (AVStream did not have an AVClass when this muxer was added.) Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
* avformat/mp3enc: Improve query_codecAndreas Rheinhardt2024-03-221-1/+5
| | | | | | | Signal that anything except MP3 and the ID3V2 attached pic types are forbidden. Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
* avutil/frame: Use av_realloc_array(), improve overflow checkAndreas Rheinhardt2024-03-221-2/+3
| | | | | | | | Also use sizeof of the proper type, namely sizeof(**sd) and not sizeof(*sd). Reviewed-by: Jan Ekström <jeebjp@gmail.com> Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
* avutil/frame: Rename av_frame_side_data_get and add wrapper for itAndreas Rheinhardt2024-03-226-19/+31
| | | | | | | | | | | | | | | | | | | av_frame_side_data_get() has a const AVFrameSideData * const *sd parameter; so calling it with an AVFramesSideData **sd like AVCodecContext.decoded_side_data (or with a AVFramesSideData * const *sd) is safe, but the conversion is not performed automatically in C. All users of this function therefore resort to a cast. This commit changes this: av_frame_side_data_get() is renamed to av_frame_side_data_get_c(); furthermore, a static inline wrapper for it name av_frame_side_data_get() is added that accepts an AVFramesSideData * const * and converts this to const AVFramesSideData * const * in a Wcast-qual safe way. This also allows to remove the casts from the current users. Reviewed-by: Jan Ekström <jeebjp@gmail.com> Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
* avutil/frame: Constify av_frame_side_data_get()Andreas Rheinhardt2024-03-224-3/+6
| | | | | Reviewed-by: Jan Ekström <jeebjp@gmail.com> Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
* avcodec/libx265: Pass logctx as void*, not AVClass**Andreas Rheinhardt2024-03-221-3/+3
| | | | | | | | | | | | | | | | The latter need not be save, because av_log() expects to get a pointer to an AVClass-enabled structure and not only a fake object. If this function were actually be called in the following way: const AVClass *avcl = avctx->av_class; handle_mdcv(&avcl, ); the AVClass's item_name would expect to point to an actual AVCodecContext, potentially leading to a segfault. Reviewed-by: Jan Ekström <jeebjp@gmail.com> Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
* avcodec/libx265: Don't use AVBPrint unnecessarilyAndreas Rheinhardt2024-03-221-25/+6
| | | | | | | | | | | | | | | | | | This code uses the AVBPrint API for exactly one av_bprintf() in a scenario in which a good upper bound for the needed size of the buffer is available (with said upper bound being much smaller than sizeof(AVBPrint)). So one can simply use snprintf() instead. This also avoids the (always-false due to the current size of the internal AVBPrint buffer) check for whether the AVBPrint is complete. Furthermore, the old code used AV_BPRINT_SIZE_AUTOMATIC which implies that the AVBPrint buffer will never be (re)allocated and yet it used av_bprint_finalize(). This has of course also been removed. Reviewed-by: Jan Ekström <jeebjp@gmail.com> Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
* fftools/ffmpeg_enc: Don't call frame_data twiceAndreas Rheinhardt2024-03-221-1/+0
| | | | | Reviewed-by: Jan Ekström <jeebjp@gmail.com> Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
* avcodec/libx264: Remove unused variableAndreas Rheinhardt2024-03-221-1/+0
| | | | | Reviewed-by: Zhao Zhili <quinkblack@foxmail.com> Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
* avcodec/librav1e: Don't unnecessarily create new referencesAndreas Rheinhardt2024-03-221-6/+2
| | | | Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
* avcodec/libdav1d: Stop mangling AVPacket.opaqueAndreas Rheinhardt2024-03-221-27/+0
| | | | | | | Unnecessary since 67e7f0b05eeee37eee1357769038270fda08fe32 as there are no longer two opaque fields. Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
* avcodec/dovi_rpu: fix off-by-one in loopNiklas Haas2024-03-221-1/+1
| | | | Otherwise the last VDR would never get copied.
* avcodec/dovi_rpu: use OR instead of additionNiklas Haas2024-03-221-2/+2
|
* Changelog: mention ffplay with hwaccel decoding supportZhao Zhili2024-03-221-0/+1
| | | | Signed-off-by: Zhao Zhili <zhilizhao@tencent.com>
* avcodec/libx264: fix extradata when config annexb=0Zhao Zhili2024-03-222-25/+143
| | | | | | | | | | | | AVCodecContext extradata should be an AVCDecoderConfigurationRecord when bitstream format is avcc. Simply concatenating the NALUs output by x264_encoder_headers does not form a standard AVCDecoderConfigurationRecord. The following cmd generates broken file before the patch: ffmpeg -i foo.mp4 -c:v libx264 -x264-params annexb=0 bar.mp4 Signed-off-by: Zhao Zhili <zhilizhao@tencent.com>
* avcodec/decode: log hwaccel nameZhao Zhili2024-03-221-2/+2
| | | | | | | | Many users mistakenly think that hwaccel is an instance of a decoder, and cannot find the corresponding decoder name in the logs. Log hwaccel name so user know hwaccel has taken effect. Signed-off-by: Zhao Zhili <zhilizhao@tencent.com>
* avformat/flvenc: Avoid avio_write(pb, "", 0)Andreas Rheinhardt2024-03-221-0/+3
| | | | | | | | | When the compiler chooses to inline put_amf_string(pb, ""), the avio_write(pb, "", 0) can be avoided. Happens with Clang-17 with -O1 and higher and GCC 13 with -O2 and higher here. Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
* avcodec/hevc_ps: fix setting HEVCHdrParams fieldsJames Almer2024-03-213-35/+40
| | | | | | | | These were defined in a way compatible with the Vulkan HEVC acceleration, which expects bitmasks, yet the fields were being overwritting on each loop with the latest read value. Signed-off-by: James Almer <jamrial@gmail.com>
* avcodec/hevc_ps: allocate only the required HEVCHdrParams within a VPSJames Almer2024-03-212-2/+14
| | | | | | | Fixes: timeout Fixes: 64033/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_HEVC_fuzzer-5332101272305664 Signed-off-by: James Almer <jamrial@gmail.com>
* avformat/iamf_reader: propagate avio_skip() error valuesJames Almer2024-03-211-4/+2
| | | | | | | | Fixes: null pointer derference Fixes: 67007/clusterfuzz-testcase-minimized-ffmpeg_dem_IAMF_fuzzer-6522819204677632 Tested-by: Michael Niedermayer <michael@niedermayer.cc> Signed-off-by: James Almer <jamrial@gmail.com>
* avformat/movenc: only compile avif_write_trailer() when the avif muxer is ↵James Almer2024-03-201-0/+2
| | | | | | enabled Signed-off-by: James Almer <jamrial@gmail.com>
* configure: check for C17 by defaultJames Almer2024-03-201-1/+1
| | | | Signed-off-by: James Almer <jamrial@gmail.com>
* configure: make the C and C++ standard settableJames Almer2024-03-201-9/+66
| | | | | | | | | While ensuring it's at least C11, the minimum supported version. Also, enforce C11 on the host compiler, same as we already do for C11 on the target compiler. Tested-by: Michael Niedermayer <michael@niedermayer.cc> Signed-off-by: James Almer <jamrial@gmail.com>
* avcodec/libx265: add support for writing out CLL and MDCVJan Ekström2024-03-203-0/+110
| | | | | | | The newer of these two are the separate integers for content light level, introduced in 3952bf3e98c76c31594529a3fe34e056d3e3e2ea , with X265_BUILD 75. As we already require X265_BUILD of at least 89, no further conditions are required.
* avcodec/libx264: add support for writing out CLL and MDCVJan Ekström2024-03-204-0/+102
| | | | | | | | | | | | Both of these two structures were first available with X264_BUILD 163, so make relevant functionality conditional on the version being at least such. Keep handle_side_data available in all cases as this way X264_init does not require additional version based conditions within it. Finally, add a FATE test which verifies that pass-through of the MDCV/CLL side data is working during encoding.
* avcodec/libsvtav1: add support for writing out CLL and MDCVJan Ekström2024-03-203-0/+88
| | | | | | | | | | | | These two were added in 28e23d7f348c78d49a726c7469f9d4e38edec341 and 3558c1f2e97455e0b89edef31b9a72ab7fa30550 for version 0.9.0 of SVT-AV1, which is also our minimum requirement right now. In other words, no additional version limiting conditions seem to be required. Additionally, add a FATE test which verifies that pass-through of the MDCV/CLL side data is working during encoding.
* ffmpeg: pass first video AVFrame's side data to encoderJan Ekström2024-03-201-0/+15
| | | | | | This enables further configuration of output based on the results of input decoding and filtering in a similar manner as the color information.
* avcodec: add frame side data array to AVCodecContextJan Ekström2024-03-204-2/+20
| | | | This allows configuring an encoder by using AVFrameSideData.
* {avutil/version,APIchanges}: bump, document new AVFrameSideData functionsJan Ekström2024-03-202-1/+6
|
* avutil/frame: add helper for getting side data from arrayJan Ekström2024-03-202-5/+29
|
* avutil/frame: add helper for adding existing side data to arrayJan Ekström2024-03-202-0/+69
|
* avutil/frame: add helper for adding side data to arrayJan Ekström2024-03-206-0/+161
| | | | | Additionally, add an API test to check that the no-duplicates addition works after duplicates have been inserted.
* avutil/frame: split side data removal out to non-AVFrame functionJan Ekström2024-03-201-8/+16
| | | | This will make it possible to reuse logic in further commits.
* avutil/frame: split side_data_from_buf to base and AVFrame funcJan Ekström2024-03-201-8/+17
|
* avutil/frame: add helper for freeing arrays of side dataJan Ekström2024-03-202-0/+16
|
* avutil/frame: split side data list wiping out to non-AVFrame functionJan Ekström2024-03-201-9/+14
| | | | This will make it possible to to reuse logic in further commits.
* lavc/vvc: Fix check whether QG is in first tile colFrank Plowman2024-03-201-1/+1
| | | | | | | | | | | The second part of this condition is intended to check whether the current quantisation group is in the first CTU column of the current tile. The issue is that ctb_to_col_bd gives the x-ordinate of the first column of the current tile *in CTUs*, while xQg gives the x-ordinate of the quantisation group *in samples*. Rectify this by shifting xQg by ctb_log2_size to get xQg in CTUs before comparing. Fixes FFVVC issues #201 and #203.
* avformat/codec2: Don't allocate Codec2Context for muxerAndreas Rheinhardt2024-03-201-1/+0
| | | | | | | Only the demuxers use it. Reviewed-by: Tomas Härdin <git@haerdin.se> Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
* avformat/iamfenc: Remove unused headersAndreas Rheinhardt2024-03-201-5/+0
| | | | | | | Forgotten in c95c8a0158073be84338d84c46529561bcc70a03. Reviewed-by: James Almer <jamrial@gmail.com> Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
* avformat/iamfenc: Align check and error messageAndreas Rheinhardt2024-03-201-1/+1
| | | | | Reviewed-by: James Almer <jamrial@gmail.com> Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
* avformat/iamfenc: Remove always-false checkAndreas Rheinhardt2024-03-201-5/+0
| | | | | | | | This muxer does not have the AVFMT_NOSTREAMS flag; therefore it is checked generically that there is at least a stream. Reviewed-by: James Almer <jamrial@gmail.com> Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
* ffmpeg: set extra_hw_frames to account for frames held in queuesMark Thompson2024-03-193-1/+40
| | | | | | | | | | Since e0da916b8f5b079a4865eef7f64863f50785463d the ffmpeg utility has held multiple frames output by the decoder in internal queues without telling the decoder that it is going to do so. When the decoder has a fixed-size pool of frames (common in some hardware APIs where the output frames must be stored as an array texture) this could lead to the pool being exhausted and the decoder getting stuck. Fix this by telling the decoder to allocate additional frames according to the queue size.
* fftools/ffplay: use correct buffersink channel layout parametersMarton Balint2024-03-191-0/+2
| | | | | | Regression since 0995e1f1b31f6e937a1b527407ed3e850f138098. Signed-off-by: Marton Balint <cus@passwd.hu>
* doc/muxers/gif: apply consistency fixesStefano Sabatini2024-03-191-8/+7
|
* doc/muxers/flv: apply misc consistency fixesStefano Sabatini2024-03-191-5/+1
|
* doc/muxers: add flacStefano Sabatini2024-03-191-0/+20
|
* avcodec/mpeg12dec: extract only one type of CC substreamMarth642024-03-191-3/+61
| | | | | | | | | | | | | | | | | | | | | In MPEG-2 user data, there can be different types of Closed Captions formats embedded (A53, SCTE-20, or DVD). The current behavior of the CC extraction code in the MPEG-2 decoder is to not be aware of multiple formats if multiple exist, therefore allowing one format to overwrite the other during the extraction process since the CC extraction shares one output buffer for the normalized bytes. This causes sources that have two CC formats to produce flawed output. There exist real-world samples which contain both A53 and SCTE-20 captions in the same MPEG-2 stream, and that manifest this problem. Example of symptom: THANK YOU (expected) --> THTHANANK K YOYOUU (actual) The solution is to pick only the first CC substream observed with valid bytes, and ignore the other types. Additionally, provide an option for users to manually "force" a type in the event that this matters for a particular source. Signed-off-by: Marth64 <marth64@proxyid.net>
* avformat/matroska: use named constants for ITU-T T.35 metadataJames Almer2024-03-192-3/+6
| | | | Signed-off-by: James Almer <jamrial@gmail.com>
* avcodec/libdav1d: use named constants for ITU-T T.35 metadataJames Almer2024-03-191-5/+7
| | | | Signed-off-by: James Almer <jamrial@gmail.com>