Commit Graph

114016 Commits

Author SHA1 Message Date
Marton Balint aa299faa9a avformat/mxfdec: remove resolve_strong_ref usage with AnyType
UUIDs do not have to be unique if their type sets them apart, so avoid using
AnyType, since we are only interested in specific types.

Signed-off-by: Marton Balint <cus@passwd.hu>
2024-03-02 18:49:31 +01:00
Marth64 a1304272c3 libavformat/dvdvideo: add DVD-Video demuxer, powered by libdvdread and libdvdnav
Signed-off-by: Marth64 <marth64@proxyid.net>
Signed-off-by: Anton Khirnov <anton@khirnov.net>
2024-03-02 08:12:29 +01:00
Michael Niedermayer b95c0d93ff avcodec/vvc/vvcdec: allow vvc_decode_close() on failed open
Fixes: division by 0
Fixes: 67008/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_VVC_fuzzer-5873503163187200

Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2024-03-02 13:29:07 +08:00
Andreas Rheinhardt 45c612702f configure: Add missing vvc_decoder->cbs_h266 dependency
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2024-03-02 13:28:21 +08:00
Andreas Rheinhardt d25b3497f2 avcodec/x86/rv40dsp, simple_idct: Remove remnants of MMX
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2024-03-02 02:54:12 +01:00
Andreas Rheinhardt 0f944c8b27 tests/checkasm: Improve included headers
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2024-03-02 02:54:12 +01:00
Andreas Rheinhardt cfe21a66e2 checkasm/vvc_mc: Don't use declare_func_emms
There is no MMX DSP code for VVC, so one can use the stricter
declare_func which also tests that we are not in MMX mode
at the end of this function.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2024-03-02 02:54:12 +01:00
Andreas Rheinhardt 540d8e7740 avcodec/vvc/vvc_mvs: Add proper header include
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2024-03-02 02:54:12 +01:00
Andreas Rheinhardt 33a3a23b79 avcodec/vvc/vvc_intra: Move utils out of vvc_intra.c
Otherwise vvc_intra.o gets pulled in by the vvc_mc checkasm
test and it in turn pulls vvc_ctu.o and then the rest of vvcdec
and lavc in. Besides being bad size-wise this also has the downside
that it pulls in avpriv_(cga|vga16)_font from libavutil which are
marked as being imported from another library when building
libavcodec as a DLL and this breaks checkasm because it links
both lavc and lavu statically.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2024-03-02 02:54:12 +01:00
Andreas Rheinhardt 4460cb485b avcodec/svq1enc: Move initializing DSP out of svq1enc.c
Otherwise svq1enc.o gets pulled in by the svq1encdsp checkasm
test and it in turn pulls the rest of lavc in.
Besides being bad size-wise this also has the downside that
it pulls in avpriv_(cga|vga16)_font from libavutil which are
marked as being imported from another library when building
libavcodec as a DLL and this breaks checkasm because it links
both lavc and lavu statically.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2024-03-02 02:54:11 +01:00
Andreas Rheinhardt 88b3b09afa avcodec/aacenc: Move initializing DSP out of aacenc.c
Otherwise aacenc.o gets pulled in by the aacencdsp checkasm
test and it in turn pulls the rest of lavc in.
Besides being bad size-wise this also has the downside that
it pulls in avpriv_(cga|vga16)_font from libavutil which are
marked as being imported from another library when building
libavcodec as a DLL and this breaks checkasm because it links
both lavc and lavu statically.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2024-03-02 02:54:11 +01:00
Andreas Rheinhardt 6c693da690 fftools/ffmpeg_demux, sync_queue: Constify a bit
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2024-03-02 02:51:59 +01:00
Andreas Rheinhardt b295aafb08 swresample/swresample: Constify swr_convert()
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2024-03-02 02:51:55 +01:00
Andreas Rheinhardt 58e3ef7f54 avutil/timestamp: Constify av_ts_make_time_string()
(Actually, the time base should be passed by value.)

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2024-03-02 02:51:10 +01:00
Andreas Rheinhardt dfb9d8a5a2 avformat/avio: Make avio_print_string_array() accept const pointers
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2024-03-02 02:49:48 +01:00
Andreas Rheinhardt 1e98cc4787 avcodec/bsf/mp3_header_decompress: Remove BSF
This BSF is supposed to be used in conjunction with mp3_header_compress,
which has been removed more than ten years ago in commit
c6080d8900. It mangled the headers
by removing the CRC field as well as fields that are supposed
to stay constant for the entirety of a stream (which are put into
extradata). This made these files unplayable; they need to be
decompressed with the BSF first (which does not happen automatically).
Even in this case the CRC does not get restored.

I am not aware that such compressed files exist at all; therefore
this commit removes the BSF completely.

Reviewed-by: Anton Khirnov <anton@khirnov.net>
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2024-03-02 02:47:50 +01:00
Andreas Rheinhardt e70e9b6554 avutil/hwcontext_vulkan: Allocate pub and priv frames hwctx together
This is possible because the lifetime of both coincide.
Besides reducing the number of allocations this also simplifies
access to VulkanFramesPriv as one no longer has to
go through AVHWFramesInternal.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2024-03-01 18:48:06 +01:00
Andreas Rheinhardt 2d63379cae avutil/hwcontext_vulkan: Allocate public and priv device hwctx together
This is possible because the lifetime of both coincide.
Besides reducing the number of allocations this also simplifies
access to VulkanDevicePriv as one no longer has to
go through AVHWDeviceInternal.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2024-03-01 18:48:06 +01:00
Andreas Rheinhardt ac7e72972c avutil/hwcontext_cuda: Allocate public and internal device ctx jointly
Reviewed-by: Timo Rothenpieler <timo@rothenpieler.org>
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2024-03-01 18:32:40 +01:00
Andreas Rheinhardt 8d277de009 avutil/hwcontext_cuda: Don't use AVHWFramesInternal.priv
Use AVHWFramesContext.hwctx instead.
This simplifies accesses to VDPAUFramesContext as one no longer has
to go through AVHWFramesInternal.

Tested-by: Timo Rothenpieler <timo@rothenpieler.org>
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2024-03-01 18:32:01 +01:00
Andreas Rheinhardt cb92b4bd83 avutil/hwcontext: Clarify documentation of AVHWFramesContext.hwctx
Correct the names of the format-specific headers (not hwframe_*.h)
and clarify that the user shall ignore this field if there is no
public context associated with it.
In particular, this allows to use this field for the private context
alone if there is no public context. This can't break conforming
API users, because they always have to live with the possibility
that a new public context has been introduced.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2024-03-01 18:32:01 +01:00
Anton Khirnov 200f82e3f8 lavu/opt: get rid of useless read_number() calls
The option type is known and fixed for all these, so reading the value
directly is simpler and more clear.
2024-03-01 16:57:24 +01:00
Anton Khirnov 1ffa657a03 lavu/opt: simplify error handling in get_number() 2024-03-01 16:57:24 +01:00
Anton Khirnov 84ba46fa5e lavu/opt: drop an always-NULL argument to get_number() 2024-03-01 16:57:24 +01:00
Anton Khirnov 9fabdd64b2 lavu/opt: drop useless handling of NULL return from get_bool_name()
That function always returns an actual string.
2024-03-01 16:57:24 +01:00
Anton Khirnov 333cc9bff8 lavu/opt: factor out printing option default from opt_list() 2024-03-01 16:57:24 +01:00
Anton Khirnov 8904f35133 lavu/opt: simplify printing option type in opt_list() 2024-03-01 16:57:24 +01:00
Anton Khirnov 6456dd50a6 lavu/opt: cosmetics, group option reading function together 2024-03-01 16:57:24 +01:00
Anton Khirnov 2a3a33d04b lavu/opt: cosmetics, group option setting function together 2024-03-01 16:57:24 +01:00
Anton Khirnov cc0bd9da70 lavu/opt: cosmetics, group (un)init and management functions together 2024-03-01 16:57:24 +01:00
Anton Khirnov 067fde4966 lavu/opt: document AVOption.flags 2024-03-01 16:57:24 +01:00
Anton Khirnov 39a3a1c69b lavu/opt: cosmetics, move AV_OPT_FLAG_* out of AVOption
Also drop an obsolete FIXME.
2024-03-01 16:57:24 +01:00
Anton Khirnov 105a1bc150 lavu/opt: cosmetics, change option flags to (1 << N) style
It is easier to read. Also, change their doxy comments to use the same
style.
2024-03-01 16:57:24 +01:00
Anton Khirnov e48055fdce fftools/ffmpeg: remove options deprecated before 6.0 2024-03-01 16:51:11 +01:00
Zhao Zhili f7545e90df avutil/hwcontext_opencl: Add map from Videotoolbox to OpenCL
For example:
./ffmpeg -hwaccel videotoolbox \
	-hwaccel_output_format videotoolbox_vld \
	-i foo.mp4 \
	-vf hwmap=derive_device=opencl,transpose_opencl=dir=clock,hwmap,format=nv12 \
	-c:v hevc_videotoolbox \
	-c:a copy \
	-b:v 2M -tag:v hvc1 bar.mp4

Signed-off-by: Zhao Zhili <zhilizhao@tencent.com>
2024-03-01 17:24:00 +08:00
Zhao Zhili dcfc6089b1 avutil/hwcontext_opencl: Fix missing linesize when map from opencl
Signed-off-by: Zhao Zhili <zhilizhao@tencent.com>
2024-03-01 17:23:50 +08:00
Zhao Zhili 35dc129940 avcodec/encode: Fix default setting of bits_per_raw_sample
bits_per_raw_sample doesn't always match size of AV_SAMPLE_FMT_,
e.g., S24.

Signed-off-by: Zhao Zhili <zhilizhao@tencent.com>
2024-03-01 17:23:38 +08:00
Zhao Zhili b56b343e43 avformat/mov: Update bits_per_coded_sample after read pcmC
Fix #10878
2024-03-01 17:23:18 +08:00
Zhao Zhili ab8aab5e2f avfilter/vf_scale_vulkan: Fix typo
Fix #10875

Signed-off-by: Zhao Zhili <zhilizhao@tencent.com>
2024-03-01 17:22:25 +08:00
Zhao Zhili 74e27d9e31 avutil/hwcontext_vulkan: Fix memleaks when transfer to vulkan
Without ff_vk_exec_discard_deps which is called by ff_vk_exec_wait,
the reference count of hwframe context cannot reach zero due to
circular reference created by ff_vk_exec_add_dep_frame.

Fix #10873

Signed-off-by: Zhao Zhili <zhilizhao@tencent.com>
2024-03-01 17:22:14 +08:00
Zhao Zhili f6f06fb42a avutil/vulkan: avoid overreads in ff_vk_count_images
Signed-off-by: Zhao Zhili <zhilizhao@tencent.com>
2024-03-01 17:20:35 +08:00
Zhao Zhili 03275b0f09 avutil/hwcontext_vulkan: Fix leaks in map_from_drm
Also simplify error handing.

Signed-off-by: Zhao Zhili <zhilizhao@tencent.com>
2024-03-01 17:20:29 +08:00
Zhao Zhili 6f9730cb28 avutil/hwcontext_vulkan: Fix leaks when semaphore creation fails
Signed-off-by: Zhao Zhili <zhilizhao@tencent.com>
2024-03-01 17:20:21 +08:00
Zhao Zhili 3bb00c0a42 avutil/hwcontext: Don't assume frames_uninit is reentrant
Fix heap use after free when vulkan_frames_init failed.

Signed-off-by: Zhao Zhili <zhilizhao@tencent.com>
2024-03-01 17:20:00 +08:00
Zhao Zhili 90bbe1e8e2 avutil/hwcontext: Don't assume device_uninit is reentrant
device_uninit will be called by hwdevice_ctx_free. vulkan_device_uninit
is non-reentrant.

Signed-off-by: Zhao Zhili <zhilizhao@tencent.com>
2024-03-01 17:19:52 +08:00
Zhao Zhili 39a0c55347 fftools/ffplay: Fix output color_spaces of filter
The sdl_supported_color_spaces only meant for SDL builtin renderer.

Signed-off-by: Zhao Zhili <zhilizhao@tencent.com>
2024-03-01 17:19:15 +08:00
Andreas Rheinhardt 601bb6a739 avcodec/mss[12]: Cleanup generically on init failure
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2024-03-01 01:35:42 +01:00
Andreas Rheinhardt 80736531da avcodec/decode: Improve validity check a bit
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2024-03-01 01:35:42 +01:00
Andreas Rheinhardt 22dda5615e avutil/mem_internal: Remove unneeded headers
Unneeded since 21814a70db.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2024-03-01 01:35:42 +01:00
Andreas Rheinhardt 72becd0627 avcodec/refstruct: Don't use STRIDE_ALIGN for alignment
It was always intended that the buffers returned by
RefStruct shall have the same alignment guarantees
as the buffers returned by av_malloc(); said alignment
depends upon the arch and the enabled instruction set
and the code used STRIDE_ALIGN as a proxy for this.

Yet since 7945d30e91
there is a better way to get av_malloc's alignment:
ALIGN_64 in mem_internal.h. So use this.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2024-03-01 01:35:42 +01:00