1
0
mirror of https://github.com/FFmpeg/FFmpeg.git synced 2024-11-26 19:01:44 +02:00
Commit Graph

114544 Commits

Author SHA1 Message Date
Andreas Rheinhardt
888e2c0a85 avutil/hwcontext_vulkan: Include hwcontext.h
struct Foo * declares a new type (namely struct Foo)
if there is no declaration of struct Foo already visible
in the current scope; otherwise it is just a pointer to
an element of the already declared type "struct Foo".
There is a gotcha with the first case:
struct Foo is only declared in its scope; a later declaration
of struct Foo in an enclosing scope declares a different type.

This happens in hwcontext_vulkan.h if it is included before
hwcontext.h, because some declarations of struct AVHWDeviceContext
and struct AVHWFramesContext have function prototype scope.

Compilers warn about this (during checkheaders):
‘struct AVHWDeviceContext’ declared inside parameter list will not
be visible outside of this definition or declaration

Fix this by including hwcontext.h.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2024-03-31 00:08:43 +01:00
Andreas Rheinhardt
0f78b26e9c avutil/internal: Move FF_MEMORY_POISON to its only user
Namely mem.c.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2024-03-31 00:08:43 +01:00
Andreas Rheinhardt
8041a91a32 avutil/internal: Move libm inclusion to the beginning
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2024-03-31 00:08:43 +01:00
Andreas Rheinhardt
e4e6377afc avcodec/arm/mpegvideo_arm: Use static_assert to check offsets
Also move AV_CHECK_OFFSET to its only user, namely
lavc/arm/mpegvideo_arm.c and rename it to CHECK_OFFSET.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2024-03-31 00:08:43 +01:00
Andreas Rheinhardt
790f793844 avutil/common: Don't auto-include mem.h
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>
2024-03-31 00:08:43 +01:00
Andreas Rheinhardt
b616be1649 lib*/version: Use static_assert for static asserts
Also update the checks that guard against inserting
a new enum entry in the middle of a range.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2024-03-31 00:08:42 +01:00
Andreas Rheinhardt
2d38141ea6 swscale/swscale_internal: Don't export internal function
sws_alloc_set_opts() can actually be made internal to utils.c.
This commit does so.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2024-03-31 00:08:42 +01:00
Andreas Rheinhardt
ad1cef04a9 swscale/swscale_internal: Hoist branch out of loop
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2024-03-31 00:08:42 +01:00
Andreas Rheinhardt
c8549d480f avcodec/msmpeg4: Don't include x86-specific header unconditionally
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2024-03-31 00:08:42 +01:00
Andreas Rheinhardt
a265e8ca92 avcodec, avfilter: Don't use "" for system headers
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2024-03-31 00:08:42 +01:00
Andreas Rheinhardt
b49e621c83 swscale/ppc/swscale_altivec: Simplify macro
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2024-03-31 00:08:42 +01:00
Andreas Rheinhardt
72f4f1dafb swscale/ppc/swscale_altivec: Fix build with -O0
In this case GCC does not treat a const variable initialized
to the compile-time constant "3" as a compile-time constant
and errors out because the argument is not a literal value.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2024-03-31 00:08:42 +01:00
Andreas Rheinhardt
347a70f101 avcodec/pcm-bluray/dvd: Use correct pointer types on BE
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2024-03-31 00:08:42 +01:00
Andreas Rheinhardt
cd63dab55c avcodec/mips/ac3dsp_mips: Add missing includes
Likely broken in d7a75d2163.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2024-03-31 00:08:42 +01:00
Marton Balint
2df2b4067e avfilter/buffersrc: fix overriding unknown channel layouts with negotiated one
Fixes ffplay playback of unknown layouts, when SDL directly supports the audio
format, such as:

ffplay -f lavfi anullsrc=cl=2C,aformat=s16

Without the patch, "Channel layout change is not supported" errors are
generated because buffersrc (unknown 2 channel) and buffersink (stereo)
negotiated a stereo layout, but the stereo layout was never stored in the
BufferSourceContext.

This fixes a regression of 7251f90972, but this
is more of a regression of the avfilter channel layout conversion
(1f96db959c).

Signed-off-by: Marton Balint <cus@passwd.hu>
2024-03-30 20:59:15 +01:00
Andreas Rheinhardt
ff215d9559 fate/image: Fix EXR tests on big endian
These tests need a scale filter to convert to the prescribed
pixel format (the native format is endian-dependent).

Reviewed-by: Sean McGovern <gseanmcg@gmail.com>
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2024-03-30 20:33:56 +01:00
James Almer
e37b233ee2 Revert "avformat/mov: ignore item boxes for animated heif"
This reverts commit f6b7b473d4.
The image in the item boxes and the animation in the trak box are not
necessarely the same, so both should be exported.

Signed-off-by: James Almer <jamrial@gmail.com>
2024-03-30 12:25:59 -03:00
James Almer
f8fbec8686 avutil/frame: use the same data information as the source entry when cloning side data
src->{data,size} does not need to match src->buf->{data,size}.

Signed-off-by: James Almer <jamrial@gmail.com>
2024-03-30 10:15:02 -03:00
Andreas Rheinhardt
ba7980d9c0 avutil/opt: Avoid av_uninit
GCC 9-13 do not emit warnings for this at all optimization
levels even when -Wmaybe-uninitialized is not disabled.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2024-03-30 05:06:28 +01:00
Andreas Rheinhardt
dc7a60529c avcodec/ratecontrol: Use forward declaration for AVExpr
Avoids including eval.h everywhere where mpegvideo.h
is included.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2024-03-30 05:06:28 +01:00
Andreas Rheinhardt
348461e550 avcodec/h264_refs: Use smaller scope, don't use av_uninit
In particular, declare iterators with loop scope.
Also remove av_uninit while at it, because they
are now unnecessary due to the changes of the preceding
commit.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2024-03-30 05:06:28 +01:00
Andreas Rheinhardt
ac14d68277 avcodec/h264_refs: Rewrite code to make control flow clearer
While this change IMO makes the control flow clearer
for the human reader, it is especially important for
GCC: It erroneously believes that it is possible to
enter the SHORT2(UNUSED|LONG) cases without having
entered the preceding block that initializes pic,
frame_num, structure and j; it would emit -Wmaybe-uninitialized
warnings for these variables if they were not pseudo-
initialized with av_uninit(). This patch allows to remove
the latter.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2024-03-30 05:06:28 +01:00
Andreas Rheinhardt
4b44b5eaf0 swscale/swscale_internal: Only include altivec header iff HAVE_ALTIVEC
Reviewed-by: Sean McGovern <gseanmcg@gmail.com>
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2024-03-30 05:04:41 +01:00
Andreas Rheinhardt
7d9d400695 postproc/postprocess: Don't generally include arch-specific headers
Reviewed-by: Sean McGovern <gseanmcg@gmail.com>
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2024-03-30 05:04:27 +01:00
Sean McGovern
f63a87629e fate: fix sub2video_{basic, time_limited} on big-endian targets
The reference file uses BGRA pixel format, so request it here.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2024-03-30 05:03:43 +01:00
Timo Rothenpieler
e99c273fec avcodec/nvdec: reset bitstream_len/nb_slices when resetting bitstream pointer 2024-03-30 00:12:23 +01:00
James Almer
547c920193 avcodec/hevc_ps: don't use a fixed sized buffer for parameter set raw data
Allocate it instead, and use it to compare sets instead of the parsed struct.

Signed-off-by: James Almer <jamrial@gmail.com>
2024-03-29 15:34:21 -03:00
Tong Wu
6bf17136a2 avcodec/hevc_ps: fix the problem of memcmp losing effectiveness
HEVCHdrParams* receives a pointer which points to a dynamically
allocated memory block. It causes the memcmp always returning 1.
Add a function to do the comparision. A condition is also added to
avoid malloc(0).

Reviewed-by: James Almer <jamrial@gmail.com>
Signed-off-by: Tong Wu <tong1.wu@intel.com>
Signed-off-by: James Almer <jamrial@gmail.com>
2024-03-29 12:35:54 -03:00
Anton Khirnov
fa110c32b5 lavfi/setpts: unset frame durations
Actual frame durations are, in general, not computable without buffering
a frame.

FIxes #10886
2024-03-29 09:09:40 +01:00
Anton Khirnov
f121d954ac lavf/vf_setpts: unset output framerate
This filter produces VFR output in general.

Avoids dropping frames in the setpts test.
2024-03-29 09:07:13 +01:00
Anton Khirnov
c240ff98b3 lavc/packet: schedule AV_PKT_DATA_QUALITY_FACTOR for removal
It is unused internally and has been marked as deprecated a long time
ago.
2024-03-29 09:01:54 +01:00
Anton Khirnov
1d843ae6c7 lavc: rename avpacket.c to packet.c
For consistency with its API header packet.h.
2024-03-29 09:01:54 +01:00
Anton Khirnov
24b9f29ff2 fftools/ffmpeg_sched: make sure to always run task cleanup
Even in cases where sch_start() failed. This ensures all links are
properly closed and no tasks are left hanging.

Fixes #10916.
2024-03-29 08:51:12 +01:00
Anton Khirnov
af81788f30 fftools/ffmpeg_sched: move sch_stop() to the bottom of the file
Will allow avoiding forward declarations in following commits.
2024-03-29 08:51:12 +01:00
Andreas Rheinhardt
8d1093a784 avcodec/libvpxenc: Remove obsolete av_unused
Forgotten in 753074721b.

Reviewed-by: James Zern <jzern@google.com>
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2024-03-29 00:58:05 +01:00
Andreas Rheinhardt
1093b40218 avcodec/libvpxenc: Only search for side data when intending to use it
Also rewrite the code so that a variable that is only used
depending upon CONFIG_LIBVPX_VP9_ENCODER is not declared
outside of the #if block.
(The variable was declared with av_uninit, but it should have been
av_unused, as the former does not work for all compilers.)

Reviewed-by: James Zern <jzern@google.com>
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2024-03-29 00:45:17 +01:00
Andreas Rheinhardt
e465cebfee avcodec/Makefile: Remove redundant dependencies on hevc_data.o
hevc_data.c only provides ff_hevc_diag_scan tables and
neither the QSV HEVC encoder nor the HEVC parser use these
directly and the indirect dependency is already accounted
for in the dependencies of the hevcparse subsystem since
b0c61209cd, so remove these
spurious dependencies.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2024-03-29 00:39:11 +01:00
James Almer
e54591369f avformat/flac_picture: print a warning when mimetype is unknown
It's not an error since bba6df9ac7.

Reviewed-by: Michael Niedermayer <michael@niedermayer.cc>
Signed-off-by: James Almer <jamrial@gmail.com>
2024-03-28 18:00:34 -03:00
Michael Niedermayer
3d5f03bbc8
avfilter/vf_signature: Dont crash on no frames
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2024-03-28 18:07:13 +01:00
Dale Curtis
bba6df9ac7
Don't throw an error when attached picture isn't recognized.
The MIME type field is required per the FLAC standard, but it's
not an error just because ffmpeg doesn't recognize it.

Signed-off-by: Dale Curtis <dalecurtis@chromium.org>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2024-03-28 18:07:13 +01:00
Tobias Rapp
02eb2fc577 examples/decode_filter_video: Add loop for draining the filtergraph
Depending on the filters used, the filtergraph may produce trailing data
after feeding it the last input frame. Update the example to include the
necessary loop for draining the filtergraph.

Reviewed-by: Stefano Sabatini <stefasab@gmail.com>
Signed-off-by: Tobias Rapp <t.rapp@noa-archive.com>
2024-03-28 12:04:09 +01:00
Tobias Rapp
55ce666062 examples/decode_filter_audio: Add loop for draining the filtergraph
Depending on the filters used, the filtergraph may produce trailing data
after feeding it the last input frame. Update the example to include the
necessary loop for draining the filtergraph.

Reviewed-by: Stefano Sabatini <stefasab@gmail.com>
Signed-off-by: Tobias Rapp <t.rapp@noa-archive.com>
2024-03-28 12:03:57 +01:00
Tobias Rapp
94ebe604b0 tests/audiogen: Fix total RIFF chunk size
The "RIFF" identifier and chunk size fields should not be included
within the size value.
2024-03-28 11:54:41 +01:00
Andreas Rheinhardt
5d71f97e0e all: Don't use ATOMIC_VAR_INIT
C11 required to use ATOMIC_VAR_INIT to statically initialize
atomic objects with static storage duration. Yet this macro
was unsuitable for initializing structures [1] and was actually
unneeded for all known implementations (this includes our
compatibility fallback implementations which simply wrap the value
in parentheses: #define ATOMIC_VAR_INIT(value) (value)).
Therefore C17 deprecated the macro and C23 actually removed it [2].

Since commit 5ff0eb34d2 we default
to C17 if the compiler supports it; Clang warns about ATOMIC_VAR_INIT
in this mode. Given that no implementation ever needed this macro,
this commit stops using it to avoid this warning.

[1]: https://www.open-std.org/jtc1/sc22/wg14/www/docs/n2396.htm#dr_485
[2]: https://en.cppreference.com/w/c/atomic/ATOMIC_VAR_INIT

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2024-03-28 09:12:48 +01:00
Anton Khirnov
a69cedb6a6 fftools/ffmpeg_demux: make InputStream.autorotate private
It is no longer accessed outside of ffmpeg_demux.
2024-03-28 08:40:11 +01:00
Anton Khirnov
c9a90c052a fftools/ffmpeg_enc: stop copying demuxer side data to the muxer
All side data should be propagated through the trancoding pipeline.
2024-03-28 08:40:11 +01:00
Anton Khirnov
e0de84ad2e lavc/encode: map AVCodecContext.decoded_side_data to coded_side_data
This way it can be automagically propagated through the encoder to
muxing.
2024-03-28 08:40:11 +01:00
Anton Khirnov
a3f4670943 lavc/decode: move sd_global_map to avcodec
It will be shared with encoding code.
2024-03-28 08:40:01 +01:00
Anton Khirnov
e1f384adbf lavc/frame_thread_encoder: avoid assigning a whole AVCodecContext
It is highly unsafe, as AVCodecContext contains many allocated fields.
Almost everything needed by worker threads should be covered by
routing through AVCodecParameters and av_opt_copy(), except for a few
fields that are copied manually.

avcodec_free_context() can now be used for per-thread contexts.
2024-03-28 08:40:01 +01:00
Anton Khirnov
198a7788e7 lavc: avoid leaking AVCodecContext.chroma_intra_matrix 2024-03-28 08:40:01 +01:00