Commit Graph

107135 Commits

Author SHA1 Message Date
Marton Balint b3cca50638 avformat/librist: bump required version to 0.2.7
This is the first version for which fifo size setting actually works.

Signed-off-by: Marton Balint <cus@passwd.hu>
2022-06-18 16:32:23 +02:00
Andreas Rheinhardt 2d764069be avcodec/vlc: Use structure instead of VLC_TYPE array as VLC element
In C, qualifiers for arrays are broken:
const VLC_TYPE (*foo)[2] is a pointer to an array of two const VLC_TYPE
elements and unfortunately this is not compatible with a pointer
to a const array of two VLC_TYPE, because the latter does not exist
as array types are never qualified (the qualifier applies to the base
type instead). This is the reason why get_vlc2() doesn't accept
a const VLC table despite not modifying the table at all, as
there is no automatic conversion from VLC_TYPE (*)[2] to
const VLC_TYPE (*)[2].

Fix this by using a structure VLCElem for the VLC table.
This also has the advantage of making it clear which
element is which.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2022-06-17 16:47:29 +02:00
Wenbin Chen 97141ffeec libavcodec/qsvenc: add ROI support to qsv encoder
Use The mfxEncoderCtrl parameter to enable ROI. Get side data
"AVRegionOfInterest" and use it to configure "mfxExtEncoderROI" which is
the MediaSDK's ROI configuration.

Signed-off-by: Wenbin Chen <wenbin.chen@intel.com>
Signed-off-by: Haihao Xiang <haihao.xiang@intel.com>
2022-06-17 13:09:35 +08:00
Michael Niedermayer 6a02de2127 avformat/aiffdec: avoid integer overflow in get_meta()
Fixes: signed integer overflow: 2147483647 + 1 cannot be represented in type 'int'
Fixes: 45891/clusterfuzz-testcase-minimized-ffmpeg_dem_AIFF_fuzzer-6159183893889024

Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2022-06-17 01:54:05 +02:00
Michael Niedermayer c16a0ed242 avformat/aaxdec: Check for overlaping segments
Fixes: Timeout
Fixes: 45875/clusterfuzz-testcase-minimized-ffmpeg_dem_AAX_fuzzer-6121689903136768

Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2022-06-17 01:54:05 +02:00
Michael Niedermayer b0cac7082d avformat/demux: Count EAGAIN as 100 bytes in relation to read limit in avformat_find_stream_info()
Fixes: Timeout
Fixes: 43717/clusterfuzz-testcase-minimized-ffmpeg_IO_DEMUXER_fuzzer-5206008287330304
Fixes: 45738/clusterfuzz-testcase-minimized-ffmpeg_IO_DEMUXER_fuzzer-6142535657979904

Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2022-06-17 01:54:05 +02:00
Michael Niedermayer 02699490c1 avformat/demux: Make read_frame_internal() return AVERREOR(EAGAIN) on stuck empty input parser
Fixes: read_frame_internal() which does not return even though both demuxer and parser do return
Fixes: 43717/clusterfuzz-testcase-minimized-ffmpeg_IO_DEMUXER_fuzzer-5206008287330304

Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2022-06-17 01:54:05 +02:00
Marton Balint 1b3ec3c8ca avdevice/pulse_audio_dec: deprecate frame_size option
It does not do anything. Frame sizes can be controlled by using fragment_size.

Signed-off-by: Marton Balint <cus@passwd.hu>
2022-06-16 21:28:20 +02:00
Marton Balint b67ca8a7a5 avdevice/pulse_audio_dec: reduce default fragment size
Reduces default fragment size from the pulse audio default of 2 sec to 50 ms.
This also has an effect on the size of the returned frames, which will be
around 50 ms as well, making timestamps more accurate.

This should fix the regression in ticket #9776.

Pulseaudio timestamps for monitor sources are still pretty inaccurate for me,
but I don't see how else should we query latencies from the library.

Signed-off-by: Marton Balint <cus@passwd.hu>
2022-06-16 21:28:20 +02:00
Marton Balint b83032899a Revert "avdevice/pulse_audio_dec: only set adjust latency flag if fragment_size is not set"
This reverts commit 7f059a250b.

Apparently adjusting latency makes a difference even if fragment size is specifed.

Signed-off-by: Marton Balint <cus@passwd.hu>
2022-06-16 21:28:20 +02:00
Andreas Rheinhardt 672987b2db avformat/matroskaenc: Convert chapter metadata
It is no longer converted since mkv_write_chapters() is called
before mkv_write_tags() which happens since commit
4ebfc13c33. Given the fact that
chapters can also be written late, mkv_write_chapters() has to
convert the metadata itself.

Fixes ticket #9812.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2022-06-16 19:18:48 +02:00
Andreas Rheinhardt 49a63c6c66 avformat/matroskaenc: Reset cur_master_element when discarding master
Before this patch the muxer writes an invalid file
(namely one in which the Projection master is a child of
the Colour element) if the following conditions are met:
a) The stream contains AVMasteringDisplayMetadata without primaries
and luminance (i.e. useless AVMasteringDisplayMetadata).
b) The stream contains AV_PKT_DATA_SPHERICAL side data.
c) All the colour elements of the stream are equal to default
(i.e. unknown).
Fortunately these conditions are very unlikely to be met.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2022-06-16 19:06:10 +02:00
Andreas Rheinhardt 9ff0fbbc0a avformat/mxfdec: Offload allocating string to av_dict_set()
Reviewed-by: Tomas Härdin <tjoppen@acc.umu.se>
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2022-06-16 18:39:46 +02:00
Andreas Rheinhardt 6b5e3590c7 avformat/mxfdec: Use ff_data_to_hex() for data->hex conversion
In this case it also stops pretending that the length of
the output string is somehow checked (which is currently
being done by using snprintf that is called with the amount
of space needed instead of the amount of space actually available).

Reviewed-by: Tomas Härdin <tjoppen@acc.umu.se>
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2022-06-16 18:39:25 +02:00
Andreas Rheinhardt 8823900b14 avformat/mxfdec: Don't duplicate av_uuid_unparse
Also don't allocate the string ourselves, let av_dict_set()
do it.

Reviewed-by: Tomas Härdin <tjoppen@acc.umu.se>
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2022-06-16 18:39:09 +02:00
Andreas Rheinhardt 41365fdf5c avformat/mxf: Use AVUUID for uids
This is in preparation for using av_uuid functions directly.

Reviewed-by: Tomas Härdin <tjoppen@acc.umu.se>
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2022-06-16 18:38:50 +02:00
Peter Ross 5242ede48d doc: describe QOI image format 2022-06-16 15:16:58 +05:30
Paul B Mahol 42289d5eaf avfilter/vf_zscale: dissallow too small slices
Also change rounding type when calculating slices size.
2022-06-16 10:23:30 +02:00
Paul B Mahol afc7679c89 avcodec/mace: fix some style issues 2022-06-16 10:23:30 +02:00
Paul B Mahol d39f9feddc avfilter: add virtualbass filter 2022-06-16 10:23:30 +02:00
Gyan Doshi 557a1a8af2 doc/APIchanges: add missing marker for release 5.0 2022-06-16 12:52:24 +05:30
Andreas Rheinhardt 2c882f4708 avcodec/exif: Move tag_list out of header
It is only used by exif.c (and e.g. EXIF_TAG_NAME_LENGTH
is an implementation detail anyway).
Also remove the sentinel, as it is used in conjunction
with FF_ARRAY_ELEMS.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2022-06-15 04:58:14 +02:00
Andreas Rheinhardt ca2c60b060 swresample/noise_shaping_data: Remove unused tables
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2022-06-15 04:58:14 +02:00
Andreas Rheinhardt 40e6575aa3 all: Replace if (ARCH_FOO) checks by #if ARCH_FOO
This is more spec-compliant because it does not rely
on dead-code elimination by the compiler. Especially
MSVC has problems with this, as can be seen in
https://ffmpeg.org/pipermail/ffmpeg-devel/2022-May/296373.html
or
https://ffmpeg.org/pipermail/ffmpeg-devel/2022-May/297022.html

This commit does not eliminate every instance where we rely
on dead code elimination: It only tackles branching to
the initialization of arch-specific dsp code, not e.g. all
uses of CONFIG_ and HAVE_ checks. But maybe it is already
enough to compile FFmpeg with MSVC with whole-programm-optimizations
enabled (if one does not disable too many components).

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2022-06-15 04:56:37 +02:00
Michael Niedermayer e5f6707a7b avformat/ape: more bits in size for less overflows
Fixes: signed integer overflow: 2147483647 + 3 cannot be represented in type 'int'
Fixes: 46184/clusterfuzz-testcase-minimized-ffmpeg_IO_DEMUXER_fuzzer-4678059519770624

Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2022-06-14 16:46:28 +02:00
Michael Niedermayer b97e58da44 avcodec/binkaudio: Clear state on EAGAIN
Its not supported to maintain a frame as receive_frame() argument
over multiple calls
Fixes: store to null pointer of type 'FFTSample' (aka 'float')
Fixes: 46231/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_BINKAUDIO_DCT_fuzzer-6276566037954560
Fixes: ACDC.smo

Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2022-06-14 16:46:28 +02:00
Michael Niedermayer 9274fb2532 avformat/mov: Non overflowing ambisonic order check
Fixes: signed integer overflow: 536870913 * 536870913 cannot be represented in type 'int'
Fixes: 45862/clusterfuzz-testcase-minimized-ffmpeg_dem_MOV_fuzzer-4730373768085504

Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2022-06-14 16:46:28 +02:00
Zane van Iperen 9874baf2cd doc/APIchanges: add missing uuid and csp entries
Signed-off-by: Zane van Iperen <zane@zanevaniperen.com>
Signed-off-by: James Almer <jamrial@gmail.com>
2022-06-13 22:04:36 -03:00
Zane van Iperen ff59ecc4de avutil: bump version after UUID changes
Forgot to bump after 76e95daa08.

Signed-off-by: Zane van Iperen <zane@zanevaniperen.com>
Signed-off-by: James Almer <jamrial@gmail.com>
2022-06-13 22:01:28 -03:00
Andreas Rheinhardt 0e8a5ded7e swresample/resample: Remove unnecessary emms_c
The last MMX code in swresample has just been removed.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2022-06-14 01:28:29 +02:00
Andreas Rheinhardt dd61d6489b swresample/x86/resample: Remove obsolete MMXEXT functions
x64 always has MMX, MMXEXT, SSE and SSE2 and this means
that some functions for MMX, MMXEXT, SSE and 3dnow are always
overridden by other functions (unless one e.g. explicitly
disables SSE2). So given that the only systems which benefit
from the MMXEXT resamplers (which are overridden by SSE2)
are truely ancient 32bit x86s they are removed.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2022-06-14 01:28:29 +02:00
Andreas Rheinhardt 4e51e48ebd swresample/x86/rematrix: Remove obsolete MMX functions
x64 always has MMX, MMXEXT, SSE and SSE2 and this means
that some functions for MMX, MMXEXT and 3dnow are always
overridden by other functions (unless one e.g. explicitly
disables SSE2) for x64. So given that the only systems that
benefit from these functions are truely ancient 32bit x86s
they are removed.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2022-06-14 01:28:29 +02:00
Andreas Rheinhardt 2b94f23b06 swresample/x86/audio_convert: Remove obsolete MMX functions
x64 always has MMX, MMXEXT, SSE and SSE2 and this means
that some functions for MMX, MMXEXT and 3dnow are always
overridden by other functions (unless one e.g. explicitly
disables SSE2) for x64. So given that the only systems that
benefit from these functions are truely ancient 32bit x86s
they are removed.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2022-06-14 01:28:29 +02:00
Andreas Rheinhardt 55fc2c5a89 swresample/resample: Properly empty MMX state
There is a x86-32 MMXEXT implementation for resampling
planar 16bit data. multiple_resample() therefore calls
emms_c() if it thinks that this needed. And this is bad:

1. It is a maintenance nightmare because changes to the
x86 resample DSP code would necessitate changes to the check
whether to call emms_c().
2. The return value of av_get_cpu_flags() does not tell
whether the MMX DSP functions are in use, as they could
have been overridden by av_force_cpu_flags().
3. The MMX DSP functions will never be overridden in case of
an x86-32 build with --disable-sse2. In this scenario lots of
resampling tests (like swr-resample_exact_lin_async-s16p-8000-48000)
fail because the cpuflags indicate that SSE2 is available
(presuming that the test is run on a CPU with SSE2).
4. The check includes a call to av_get_cpu_flags(). This is not
optimized away for arches other than x86-32.
5. The check takes about as much time as emms_c() itself,
making it pointless.

This commit therefore removes the check and calls emms_c()
unconditionally (it is a no-op for non-x86).

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2022-06-14 01:28:29 +02:00
Stefano Sabatini ff07492cd8 ffprobe: add -o option
This enables printing to a resource specified with -o OUTPUT.

In case the output is not specified, prints to stdout as usual.

Address issue: http://trac.ffmpeg.org/ticket/8024

Signed-off-by: Marton Balint <cus@passwd.hu>
2022-06-13 22:42:55 +02:00
Stefano Sabatini 7cae3d8b76 lavf/avio: add avio_vprintf()
This new function makes it possible to use avio_printf() functionality from
a function taking a variable list of arguments.

Signed-off-by: Marton Balint <cus@passwd.hu>
2022-06-13 22:42:55 +02:00
Pierre-Anthony Lemieux 4d45f5acbd
avfilter/showinfo: refactor to use avutil/uuid 2022-06-12 18:34:38 +10:00
Pierre-Anthony Lemieux 751549af9b
avformat/imf: refactor to use avutil/uuid 2022-06-12 18:34:37 +10:00
Pierre-Anthony Lemieux 1fd6758178
avformat/smoothstreamingenc: refactor to use avutil/uuid 2022-06-12 18:34:37 +10:00
Pierre-Anthony Lemieux a2c1a439b3
avformat/mov: refactor to use avutil/uuid 2022-06-12 18:34:37 +10:00
Pierre-Anthony Lemieux 7c2f029ede
avutil/tests/uuid: add uuid tests 2022-06-12 18:34:37 +10:00
Zane van Iperen 76e95daa08
avutil/uuid: add utility library for manipulating UUIDs as specified in RFC 4122
Co-authored-by: Pierre-Anthony Lemieux <pal@palemieux.com>
Signed-off-by: Zane van Iperen <zane@zanevaniperen.com>
2022-06-12 18:34:28 +10:00
Marton Balint 843c4346b1 doc/ffmpeg: fix typo in VCD creation example
Fixes ticket #9753.

Signed-off-by: Marton Balint <cus@passwd.hu>
2022-06-12 09:35:50 +05:30
Andreas Rheinhardt 8678b75bda avcodec/x86/h264_qpel_8bit: Remove unused function
Namely ff_avg_h264_qpel8or16_hv1_lowpass_op_mmxext. It seems to exist
since 610e00b359 (a function like this
already existed before that commit, but it was static and
av_always_inline and was therefore not present in the actual binaries).

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2022-06-11 22:43:20 +02:00
Andreas Rheinhardt 1799e27020 avcodec/x86/rv34dsp: Remove unused ff_rv34_idct_dc_mmxext
Forgotten in 9ba9c34024.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2022-06-11 22:43:20 +02:00
Andreas Rheinhardt 50a8cbb23e avcodec/x86/fpel: Remove unused ff_avg_pixels4_mmx
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2022-06-11 22:43:19 +02:00
Andreas Rheinhardt 1cb038a7d5 avcodec/videodsp: Make ff_emulated_edge_mc_16 static
Only ff_emulated_edge_mc_8() is used outside of lavc/videodsp.c.

Reviewed-by: Ronald S. Bultje <rsbultje@gmail.com>
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2022-06-11 22:42:29 +02:00
Andreas Rheinhardt ae2dd5d42b avcodec/v4l2_m2m: Remove unused ff_v4l2_m2m_codec_full_reinit
Unused since df701ed0b5.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2022-06-11 16:29:07 +02:00
Andreas Rheinhardt 324545d02f avcodec/hevcdec: Make ff_hevc_pel_weight static
Only used here.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2022-06-11 16:29:07 +02:00
Andreas Rheinhardt 5eee930726 avcodec/x86/hevcdsp_init: Remove unnecessary inclusion of get_bits.h
This file does not use anything from get_bits.h at all;
furthermore hevcdsp.h now includes get_bits.h itself.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2022-06-11 16:29:07 +02:00