1
0
mirror of https://github.com/FFmpeg/FFmpeg.git synced 2025-08-04 22:03:09 +02:00
Commit Graph

120169 Commits

Author SHA1 Message Date
ad0a44028d avfilter: add pad_cuda filter
This patch adds the pad_cuda video filter. A filter similar to the existing pad filter but accelerated by CUDA.

The filter shares the same options as the software pad filter.

Example usage:
ffmpeg -hwaccel cuda -hwaccel_output_format cuda -i input.mp4 -vf "pad_cuda=w=iw+100:h=ih+100:x=-1:y=-1:color=red" out.mp4

Signed-off-by: Timo Rothenpieler <timo@rothenpieler.org>
2025-07-04 01:32:27 +02:00
ecbe3e7366 avcodec/rv60dec: Check ofs for overflows
Fixes: signed integer overflow: 30 + 2147483647 cannot be represented in type 'int'
Fixes: 418335931/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_RV60_fuzzer-6568264620900352

Reviewed-by: Peter Ross <pross@xvid.org>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2025-07-03 23:05:31 +02:00
e68599f551 avformat/rtpdec_asf: fix leak in ff_wms_parse_sdp_a_line()
In ff_wms_parse_sdp_a_line(), it allocates memory in buf, but doesn't
free buf when avformat_alloc_context() failed. Add av_free(buf) before
return to prevent from leak.

Signed-off-by: Lidong Yan <502024330056@smail.nju.edu.cn>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2025-07-03 23:05:27 +02:00
98afcd3da7 avcodec/sunrast: fix leak in sunrast_decode_frame()
In sunrast_decode_frame(), we use av_malloc_array() allocates memory
to ptr and ptr2. However if buf_end - buf < 1, this function returns
error code without freeing this memory thus cause a leak. Add av_freep()
before return.

Signed-off-by: Lidong Yan <502024330056@smail.nju.edu.cn>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2025-07-03 23:05:14 +02:00
7ed5a7094f avformat/rtpdec_latm: fix leak in parse_fmtp_config()
av_mallocz() allocates memory in config, but we forget to free it
if init_get_bits() failed. Replace return ret with goto end.

Signed-off-by: Lidong Yan <502024330056@smail.nju.edu.cn>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2025-07-03 23:04:57 +02:00
ba984355fe avformat/whip: fix format string for printing size_t 2025-07-03 22:51:15 +02:00
3f7e0fddee avformat/tls: clean up new whip options 2025-07-03 22:18:10 +02:00
4a4a566d6e avformat/tls: remove unused fingerprint option 2025-07-03 22:18:10 +02:00
043d3fef8a avformat/tls_openssl: use existing context handle 2025-07-03 22:18:10 +02:00
2e72924ad1 avformat/tls: fix udp init 2025-07-03 22:18:10 +02:00
23c70e3740 avformat/udp: don't override 0 localport 2025-07-03 22:18:10 +02:00
492aef2d94 avformat/tls: don't use http_proxy for udp sockets 2025-07-03 22:18:10 +02:00
311742eb5a avformat/tls: use non protocol specific error message 2025-07-03 22:18:10 +02:00
058b226313 avformat/whip: remove redundant WHIP: prefix from all logging 2025-07-03 22:18:10 +02:00
b92130293e avformat/whip: don't leak options dict 2025-07-03 22:18:10 +02:00
8f3ecc9db0 avformat/whip: use av_dict_set_int for int 2025-07-03 22:18:10 +02:00
cdc03240fe avformat/Makefile: don't hardcode openssl for whip muxer 2025-07-03 22:18:10 +02:00
42bcbdd456 fftools/ffmpeg_filter: always reap all available frames before requesting new ones
alfilter_graph_request_oldest() might return EAGAIN and produce a frame on not
the oldest sink.

Fixes ticket #11597.
Fixes excessive frame buffering in #10959.
Fixes excessive frame buffering in #11366.

Signed-off-by: Marton Balint <cus@passwd.hu>
2025-07-03 21:41:54 +02:00
af189e424b avfilter/f_select: port to activate
Multi-input or multi-output filters should use activate now.

Signed-off-by: Marton Balint <cus@passwd.hu>
2025-07-03 21:41:54 +02:00
223c2b03da avfilter/buffersink: keep requesting frames if one activation of the graph does not provide one
A frame graph activation might not produce a frame in the requested sink, so
keep on requesting a frame there unless we encounter a filter activation with
buffersrc empty error.

This makes av_buffersink_get_frame(_flags) work according to its documentation
which claims that EAGAIN is only returned if additional frames must be inserted
into the graph.

Fate changes are because audio frames will have different sizes at segment
boundaries, but content is the same.

Signed-off-by: Marton Balint <cus@passwd.hu>
2025-07-03 21:41:54 +02:00
d41bac1333 avfilter: signal an empty buffersrc with an explicit activate error code
No change in functionality.

Signed-off-by: Marton Balint <cus@passwd.hu>
2025-07-03 21:41:54 +02:00
eea6f0e32e tests/fate/filter-audio: add anullsink test
Tests ticket #11624 with a slight modification.

Signed-off-by: Marton Balint <cus@passwd.hu>
2025-07-03 21:41:54 +02:00
44546751db avfilter/avfilter: make filter_activate_default request frames on behalf of sinks
Sinks without an activate callback have no means to request frames in their
input, therefore the default activate callback should do it for them.

Fixes ticket #11624.
Fixes ticket #10988.
Fixes ticket #10990.

Signed-off-by: Marton Balint <cus@passwd.hu>
2025-07-03 21:41:54 +02:00
4440e499ba avfilter/avfilter: always forward request frame in filter_activate_default
Even if all inputs are blocked an activate callback should request a frame on
some if its inputs if a frame is requested on any of its outputs.

Signed-off-by: Marton Balint <cus@passwd.hu>
2025-07-03 21:41:54 +02:00
a85835bfb8 fate/filter-video: add ffprobe test for dual output select filter
Signed-off-by: Marton Balint <cus@passwd.hu>
2025-07-03 21:41:54 +02:00
a736ac72bb avfilter/avfilter: fix forwarding EOF for simple API filters in filter_activate_default
EOF only need to be forwarded back if all outputs have reached EOF.

Fixes infinte loop with ffprobe -f lavfi -i "smptebars=d=1,select=n=2:e=1[out0][out1]"
Regression since d9e41ead82.

Fixes ticket #10959.
Fixes ticket #11366.

Signed-off-by: Marton Balint <cus@passwd.hu>
2025-07-03 21:41:53 +02:00
29e696c9c0 avfilter/filters: simplify FF_FILTER_FORWARD_WANTED_ANY
The status check is unneeded because an outlink with a nonzero status should
always return 0 for ff_outlink_frame_wanted(). Also use unsigned for index
because nb_outputs is unsigned as well.

Signed-off-by: Marton Balint <cus@passwd.hu>
2025-07-03 21:41:53 +02:00
f3b7aa6c22 avfilter: factorize requesting an input frame from multi output filters
Signed-off-by: Marton Balint <cus@passwd.hu>
2025-07-03 21:41:53 +02:00
01ffe103e5 avcodec/rv34: Fix spelling mistake
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2025-07-03 20:35:32 +02:00
fa02dea036 avcodec/rv34: Don't report progress unnecessarily
ff_mpv_frame_end() already does it.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2025-07-03 20:35:32 +02:00
abc54c25be avcodec/mpegvideo: Move loop_filter to {H263Dec,MPVEnc,VC1}Context
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2025-07-03 20:35:32 +02:00
60f51bdaac avcodec/mpegvideo: Move partitioned_frame to {H263Dec,MPVEnc}Context
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2025-07-03 20:35:32 +02:00
0984724d1e avcodec/mpeg_er: Allow to skip setting partitioned_frame, p[pb]_time
Instead of setting these unconditionally (they are always zero
for H.261, MPEG-1/2, RV30/40, VC-1), add a variant of
ff_mpeg_er_frame_start() that sets them and remove setting them
from ff_mpeg_er_frame_start(). Also pass these values via parameters
instead of reading them from the MPVContext itself.
This will allow to move them from MPVContext.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2025-07-03 20:35:31 +02:00
3c06d87c93 avcodec/mpegvideo: Move fields to {H263Dec,MPVEnc}Context when possible
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2025-07-03 20:35:31 +02:00
00ea78f426 avcodec/flvdec: Binarize h263_flv
It used to be a tri-state encoding both whether to use FLV picture
headers and whether to use the FLV way of encoding escape values,
but the former is now unnecessary due to the switch to a function
pointer for reading the header. So binarize h263_flv.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2025-07-03 20:35:31 +02:00
532ae5dc7d avcodec/ituh263enc: Inline value of h263_flv
It is always two when we encode FLV1.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2025-07-03 20:35:31 +02:00
c660f45f8e avcodec/h263dec: Use function ptr for decode_picture_header
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2025-07-03 20:35:31 +02:00
3b6d1a6ee1 avcodec/msmpeg4dec: Move ff_msmpeg4_decode_init() down
Will avoid a forward declaration lateron.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2025-07-03 20:35:31 +02:00
502a6ea123 avcodec/mpegvideo: Move SLICE_* defs to h263dec.h, h261dec.c
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2025-07-03 20:35:31 +02:00
2089d39735 avcodec/mpegvideo: Move mb_skip_run to {RV34Dec,MPVEnc}Context
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2025-07-03 20:35:31 +02:00
d5fa282936 avcodec/mpeg12dec: Put mb_skip_run on the stack
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2025-07-03 20:35:31 +02:00
9f42725d75 avcodec/mpegvideo: Move mb_num_left to {H263,RV34}DecContext
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2025-07-03 20:35:31 +02:00
7db6267b30 avcodec/mpegvideo: Move fields only used by H.263 decoders to H263DecCtx
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2025-07-03 20:35:31 +02:00
f1c56c08ed avcodec/mpeg12dec: Don't use MPVContext.block
Instead add the necessary blocks directly into Mpeg12SliceContext.
This allows to completely remove MPVContext.block.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2025-07-03 20:35:31 +02:00
e40b0ebb2e avcodec/mpeg12dec: Move MpegEncContext.gb to Mpeg12SliceContext
It was its last user.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2025-07-03 20:35:31 +02:00
27d785746c avcodec/mpegvideo: Add missing headers
These files currently rely on implicit inclusions of avassert.h
and/or mathops.h via get_bits.h.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2025-07-03 20:35:31 +02:00
3a96a3c949 avcodec/mpeg12dec: Add Mpeg12SliceContext
This is in preparation for removing the GetBitContext
from MPVContext.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2025-07-03 20:35:31 +02:00
8a4accc24d avcodec/h263dec: Stop using MpegEncContext.gb
Add a GetBitContext to H263DecContext instead. This is in preparation
for removing MpegEncContext.gb.
Also move last_resync_gb to H263DecContext.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2025-07-03 20:35:31 +02:00
77add26918 avcodec/h263dec: Don't use MpegEncContext.block
Instead add the necessary blocks directly to H263DecContext
(only six are needed, not 12 as ff_mpv_common_init()
currently allocates).

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2025-07-03 20:35:31 +02:00
b2be342ab6 avcodec/h263dec: Remove redundant block parameter from decode_mb
With the exception of mpeg4_decode_studio_mb(), all decode_mb
functions implicitly presumed that the block provided as
argument coincides with MpegEncContext.block (they zeroed the latter
and then used the former to decode the block); mpeg4_decode_studio_mb()
meanwhile did not use the provided block at all (it uses blocks of
int32_t). So remove said parameter.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2025-07-03 20:35:31 +02:00