summaryrefslogtreecommitdiff
Commit message (Collapse)AuthorAge
* lavc/vvc_parser: small cleanup for styleJun Zhao2024-03-23
| | | | | | | small cleanup for style, redundant semicolons, goto labels, in FFmpeg, we put goto labels at brace level. Signed-off-by: Jun Zhao <barryjzhao@tencent.com>
* avcodec/cbs_h266_syntax_template: Check tile_yMichael Niedermayer2024-03-23
| | | | | | | | Fixes: out of array access Fixes: 67021/clusterfuzz-testcase-minimized-ffmpeg_DEMUXER_fuzzer-4883576579489792 Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* tests/fate/ffmpeg: evaluate thread count in fate-run.sh rather than makeAnton Khirnov2024-03-23
| | | | Fixes fate-ffmpeg-loopback-decoding with THREADS=random*
* avformat/jpegxl_anim_dec: set pos for generic indexLeo Izen2024-03-23
| | | | | | | | avpkt->pos needs to be set for generic indexing or features such as the stream_loop option will not work. Co-authored-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com> Signed-off-by: Leo Izen <leo.izen@gmail.com>
* Changelog: add dnn libtorch backend entryWenbin Chen2024-03-23
| | | | Signed-off-by: Wenbin Chen <wenbin.chen@intel.com>
* doc/muxers: add hdsStefano Sabatini2024-03-23
|
* doc/muxers: add gxfStefano Sabatini2024-03-23
|
* lavf/gxfenc: return proper error codes in case of failureStefano Sabatini2024-03-23
|
* lavf/gxfenc: consistently use snake_case in function namesStefano Sabatini2024-03-23
|
* avcodec/mediacodec_wrapper: remove unnecessary NULL checks before calling ↵Matthieu Bouron2024-03-23
| | | | | | Delete{Global,Local}Ref() Delete{Global,Local}Ref already handle NULL.
* avcodec/mediacodec_wrapper: use an OFFSET() macro where relevantMatthieu Bouron2024-03-23
| | | | Reduces a bit the horizontal spacing.
* avcodec/jni: remove unnecessary NULL checks before calling DeleteLocalRef()Matthieu Bouron2024-03-23
| | | | Delete{Global,Local}Ref() already handle NULL.
* avcodec/jni: use size_t to store structure offsetsMatthieu Bouron2024-03-23
|
* avformat: add Android content resolver protocol supportMatthieu Bouron2024-03-23
| | | | Handles Android content URIs starting with content://.
* avcodec: add av_jni_{get,set}_android_app_ctx() helpersMatthieu Bouron2024-03-23
| | | | | This will allow users to pass the Android ApplicationContext which is mandatory to retrieve the ContentResolver responsible to resolve/open Android content URIS.
* avformat: Make init function out of write_header functions if possibleAndreas Rheinhardt2024-03-22
| | | | | | Also mark them as av_cold while just at it. Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
* avformat: Enforce codec_id where appropriateAndreas Rheinhardt2024-03-22
| | | | | | | | | | E.g. chromaprint expects to be fed 16bit signed PCM in native endianness, yet there was no check for this. Similarly for other muxers. Use the new FF_OFMT_FLAG_ONLY_DEFAULT_CODECS to enfore this where appropriate, e.g. for pcm/raw muxers. Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
* avformat/ttmlenc: Avoid unnecessary blockAndreas Rheinhardt2024-03-22
| | | | Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
* avformat/mux: Add flag for "only default codecs allowed"Andreas Rheinhardt2024-03-22
| | | | | | | | AVOutputFormat has default codecs for audio, video and subtitle and often these are the only codecs of this type allowed. So add a flag to AVOutputFormat so that this can be checked generically. Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
* avformat: Enforce one-stream limit where appropriateAndreas Rheinhardt2024-03-22
| | | | | | | | | | Several muxers (e.g. pcm muxers) did not check the number of streams even though the individual streams were not recoverable from the muxed files. This commit changes this by using the FF_OFMT_MAX_ONE_OF_EACH flag where appropriate. Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
* avformat/mux: Add flag for "not more than one stream of each type"Andreas Rheinhardt2024-03-22
| | | | | | | | | | | | | | | | More exactly: Not more than one stream of each type for which a default codec (i.e. AVOutputFormat.(audio|video|subtitle)_codec) is set; for those types for which no such codec is set (or for which no designated default codec in AVOutputFormat exists at all) no streams are permitted. Given that with this flag set the default codecs become more important, they are now set explicitly to AV_CODEC_ID_NONE for "unset"; the earlier code relied on AV_CODEC_ID_NONE being equal to zero, so that default static initialization set it accordingly; but this is not how one is supposed to use an enum. Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
* fate/filter-audio: Don't use pcm output for channelsplit testAndreas Rheinhardt2024-03-22
| | | | | | | | | | | This test muxes two streams into a single pcm file, although the two streams are of course not recoverable from the output (unless one has extra information). So use the streamhash muxer instead (which also provides coverage for it; it was surprisingly unused in FATE so far). This is in preparation for actually enforcing a limit of one stream for the PCM muxers. Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
* avformat/mux_utils: Don't report that AV_CODEC_ID_NONE can be muxedAndreas Rheinhardt2024-03-22
| | | | | | | | If AVOutputFormat.video_codec, audio_codec or subtitle_codec is AV_CODEC_ID_NONE, it means that there is no default codec for this format and not that it is supported to mux AV_CODEC_ID_NONE. Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
* avformat/amr: Move write_header closer to muxer definitionAndreas Rheinhardt2024-03-22
| | | | | | Avoids one #if. Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
* avformat/mux: Rename FF_FMT_ALLOW_FLUSH->FF_OFMT_FLAG_ALLOW_FLUSHAndreas Rheinhardt2024-03-22
| | | | | | | 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-22
| | | | | | (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-22
| | | | | | | 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-22
| | | | | | | | 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-22
| | | | | | | | | | | | | | | | | | | 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-22
| | | | | 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-22
| | | | | | | | | | | | | | | | 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-22
| | | | | | | | | | | | | | | | | | 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-22
| | | | | Reviewed-by: Jan Ekström <jeebjp@gmail.com> Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
* avcodec/libx264: Remove unused variableAndreas Rheinhardt2024-03-22
| | | | | 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-22
| | | | Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
* avcodec/libdav1d: Stop mangling AVPacket.opaqueAndreas Rheinhardt2024-03-22
| | | | | | | 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-22
| | | | Otherwise the last VDR would never get copied.
* avcodec/dovi_rpu: use OR instead of additionNiklas Haas2024-03-22
|
* Changelog: mention ffplay with hwaccel decoding supportZhao Zhili2024-03-22
| | | | Signed-off-by: Zhao Zhili <zhilizhao@tencent.com>
* avcodec/libx264: fix extradata when config annexb=0Zhao Zhili2024-03-22
| | | | | | | | | | | | 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-22
| | | | | | | | 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-22
| | | | | | | | | 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-21
| | | | | | | | 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-21
| | | | | | | 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-21
| | | | | | | | 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-20
| | | | | | enabled Signed-off-by: James Almer <jamrial@gmail.com>
* configure: check for C17 by defaultJames Almer2024-03-20
| | | | Signed-off-by: James Almer <jamrial@gmail.com>
* configure: make the C and C++ standard settableJames Almer2024-03-20
| | | | | | | | | 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-20
| | | | | | | 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-20
| | | | | | | | | | | | 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.