]> git.sesse.net Git - ffmpeg/log
ffmpeg
3 years agodoc/APIchanges: fill in missing fields
Michael Niedermayer [Fri, 19 Mar 2021 23:39:48 +0000 (00:39 +0100)]
doc/APIchanges: fill in missing fields

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
3 years agoavcodec/mpeg4videoenc: Check extradata malloc()
Michael Niedermayer [Fri, 19 Mar 2021 15:30:08 +0000 (16:30 +0100)]
avcodec/mpeg4videoenc: Check extradata malloc()

Fixes: Null pointer dereference
Fixes: any mpeg4 testcase which fails the malloc at that exact spot
Found-by: Rafael Dutra <rafael.dutra@cispa.de>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
3 years agoavformat/mov: Check offset addition for overflow
Michael Niedermayer [Wed, 17 Mar 2021 12:31:28 +0000 (13:31 +0100)]
avformat/mov: Check offset addition for overflow

Fixes: signed integer overflow: 9223372036854775807 + 536870912 cannot be represented in type 'long'
Fixes: 31678/clusterfuzz-testcase-minimized-ffmpeg_dem_MOV_fuzzer-5614204619980800
Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
3 years agoavcodec/speedhq: Width < 8 is not supported
Michael Niedermayer [Wed, 17 Mar 2021 12:14:39 +0000 (13:14 +0100)]
avcodec/speedhq: Width < 8 is not supported

Fixes: out of array access
Fixes: 31733/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_SPEEDHQ_fuzzer-4704307963363328
Fixes: 31736/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_SPEEDHQ_fuzzer-6190960292790272
Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
3 years agoavformat/rtsp: support buffer_size and pkt_size options for RTP
Jiangjie Gao [Tue, 9 Mar 2021 06:21:19 +0000 (14:21 +0800)]
avformat/rtsp: support buffer_size and pkt_size options for RTP

And forward it to the underlying UDP protocol.

Fixes ticket #7517.

Signed-off-by: Jiangjie Gao <gaojiangjie@live.com>
Signed-off-by: Marton Balint <cus@passwd.hu>
3 years agoavfilter/vf_ocr: add white space to whitelist
Dominic Mayers [Thu, 18 Mar 2021 19:52:53 +0000 (15:52 -0400)]
avfilter/vf_ocr: add white space to whitelist

Fixes #9151. The current version of libavfilter/vf_ocr.c does not have white
space in the default whitelist. But it is recommanded to include white
space. See https://github.com/tesseract-ocr/tesseract/issues/2923

Signed-off-by: Marton Balint <cus@passwd.hu>
3 years agoavformat/libsrt: fix help message
Zhao Zhili [Mon, 15 Mar 2021 09:05:19 +0000 (17:05 +0800)]
avformat/libsrt: fix help message

SRTO_TLPKTDROP works for receiver and sender both.

Signed-off-by: Marton Balint <cus@passwd.hu>
3 years agoavformat/libsrt: fix setsockopt() typo
Zhao Zhili [Mon, 15 Mar 2021 09:05:18 +0000 (17:05 +0800)]
avformat/libsrt: fix setsockopt() typo

Signed-off-by: Marton Balint <cus@passwd.hu>
3 years agoavformat/http,tls: honor http_proxy command line variable for HTTPS
Moritz Barsnick [Sun, 23 Aug 2020 11:53:39 +0000 (13:53 +0200)]
avformat/http,tls: honor http_proxy command line variable for HTTPS

Add the "http_proxy" option and its handling to the "tls" protocol,
pass the option from the "https" protocol.

The "https" protocol already defines the "http_proxy" command line
option, like the "http" protocol does. The "http" protocol properly
honors that command line option in addition to the environment
variable. The "https" protocol doesn't, because the proxy is
evaluated in the underlying "tls" protocol, which doesn't have this
option, and thus only handles the environment variable, which it
has access to.

Fixes #7223.

Signed-off-by: Moritz Barsnick <barsnick@gmx.net>
Signed-off-by: Marton Balint <cus@passwd.hu>
3 years agolavc/videotoolboxenc: Add support for HEVC with Alpha.
Hironori Bono [Tue, 23 Feb 2021 05:02:27 +0000 (14:02 +0900)]
lavc/videotoolboxenc: Add support for HEVC with Alpha.

This change supports the "HEVC Video with Alpha" profile introduced in WWDC 2019
<https://developer.apple.com/videos/play/wwdc2019/506/>. (This change is a
partial fix for Ticket #7965.)

For example, the following command converts an animation PNG file to an HEVC
with Alpha video:
./ffmpeg -i fate-suite/apng/clock.png -c:v hevc_videotoolbox -allow_sw 1 -alpha_quality 0.75 -vtag hvc1 clock.mov

(This change uses the "HEVC Video with Alpha" profile only when the
'-alpha_quality' value is not 0 for backward compatibility.)

Signed-off-by: Hironori Bono <bouno@rouge.plala.or.jp>
3 years agovideotoolboxenc: enable constant quality with -q:v on Apple Silicon Macs and use...
Simone Karin Lehmann [Fri, 22 Jan 2021 20:21:33 +0000 (21:21 +0100)]
videotoolboxenc: enable constant quality with -q:v on Apple Silicon Macs and use b-frames für HEVC and H264 and b-pyramid for HEVC.

Signed-off-by: Simone Karin Lehmann <simone@lisanet.de>
Signed-off-by: Rick Kern <kernrj@gmail.com>
3 years agoavcodec: move core AVCodecContext functions from util.c to a new file
James Almer [Wed, 17 Mar 2021 13:21:33 +0000 (10:21 -0300)]
avcodec: move core AVCodecContext functions from util.c to a new file

Signed-off-by: James Almer <jamrial@gmail.com>
3 years agoavcodec: move AVCodecParameters related functions from util.c to a new file
James Almer [Wed, 17 Mar 2021 04:25:22 +0000 (01:25 -0300)]
avcodec: move AVCodecParameters related functions from util.c to a new file

Signed-off-by: James Almer <jamrial@gmail.com>
3 years agofate: add adpcm_ima_cunning stereo test case
Zane van Iperen [Mon, 15 Mar 2021 15:49:24 +0000 (01:49 +1000)]
fate: add adpcm_ima_cunning stereo test case

Signed-off-by: Zane van Iperen <zane@zanevaniperen.com>
3 years agoavformat/pp_bnk: treat music files as stereo
Zane van Iperen [Fri, 13 Nov 2020 01:30:51 +0000 (11:30 +1000)]
avformat/pp_bnk: treat music files as stereo

These files are technically a series of planar mono tracks.
If the "music" flag is set, merge the packets from the two
mono tracks, essentially replicating:

  [0:a:0][0:a:1]join=inputs=2:channel_layout=stereo[a]

Signed-off-by: Zane van Iperen <zane@zanevaniperen.com>
3 years agoavcodec/adpcm_ima_cunning: reindent
Zane van Iperen [Tue, 16 Mar 2021 00:58:05 +0000 (10:58 +1000)]
avcodec/adpcm_ima_cunning: reindent

Signed-off-by: Zane van Iperen <zane@zanevaniperen.com>
3 years agoavcodec/adpcm_ima_cunning: support stereo
Zane van Iperen [Thu, 12 Nov 2020 14:09:02 +0000 (00:09 +1000)]
avcodec/adpcm_ima_cunning: support stereo

Changes the sample format to S16P, but was only ever mono so it
affects nothing.

Signed-off-by: Zane van Iperen <zane@zanevaniperen.com>
3 years agodoc/filters: remove option band in delogo
Gyan Doshi [Fri, 19 Mar 2021 11:51:03 +0000 (17:21 +0530)]
doc/filters: remove option band in delogo

Deprecated option removed in 74fe697f9650 but I forgot to remove
the docs entry.

3 years agodoc/ffmpeg: document parameters set by -target
Gyan Doshi [Fri, 12 Mar 2021 13:46:28 +0000 (19:16 +0530)]
doc/ffmpeg: document parameters set by -target

3 years agoavutil/adler32: Switch av_adler32_update() to size_t on bump
Andreas Rheinhardt [Thu, 18 Mar 2021 03:33:28 +0000 (04:33 +0100)]
avutil/adler32: Switch av_adler32_update() to size_t on bump

av_adler32_update() is used by av_hash_update() which will be switched
to size_t at the next bump. So it also has to be made to use size_t.
This is also necessary for framecrcenc.c, because the size of side data
will become a size_t, too.

Reviewed-by: James Almer <jamrial@gmail.com>
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
3 years agoavcodec/packet: Also change av_packet_pack/unpack_dictionary to size_t
Andreas Rheinhardt [Wed, 17 Mar 2021 18:31:45 +0000 (19:31 +0100)]
avcodec/packet: Also change av_packet_pack/unpack_dictionary to size_t

These are auxiliary side-data functions, so they should have been
switched to size_t in d79e0fe65c51491f9bf8a470bbe36fb09f3e1280,
but this has been forgotten.

Reviewed-by: James Almer <jamrial@gmail.com>
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
3 years agoavcodec/avpacket: Improve overflow checks when packing dictionary
Andreas Rheinhardt [Wed, 17 Mar 2021 17:32:36 +0000 (18:32 +0100)]
avcodec/avpacket: Improve overflow checks when packing dictionary

Also avoid reallocations.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
3 years agoavformat: Make AVChapter.id an int64_t on next major bump
Andreas Rheinhardt [Tue, 16 Mar 2021 07:29:59 +0000 (08:29 +0100)]
avformat: Make AVChapter.id an int64_t on next major bump

64 bits are needed in order to retain the uid values of Matroska
chapters; the type is kept signed because the semantics of NUT chapters
depend upon whether the id is > 0 or < 0.

Reviewed-by: Anton Khirnov <anton@khirnov.net>
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
3 years agoavformat/matroskaenc: Check chapter ids for duplicates
Andreas Rheinhardt [Mon, 15 Mar 2021 20:17:25 +0000 (21:17 +0100)]
avformat/matroskaenc: Check chapter ids for duplicates

Up until now, there has been no check that each chapter has a unique id;
there was only a check for whether a chapter id is zero (this happens
often when the chapters originated from a format that lacks the concept
of chapter id and simply counts from zero) which is invalid in Matroska.
In this case the chapter ids are offset by 1 to make them nonnegative.
Yet offsetting won't fix duplicate ids, therefore this is changed to
simply create new chapter uids when the input chapter uids don't conform
to the requirements of Matroska (in which case it can be presumed that
they did not originate from Matroska, so that we don't need to bother
to preserve them).

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
3 years agoavcodec/libxvid: Remove set-but-unused variable
Andreas Rheinhardt [Fri, 19 Mar 2021 00:49:04 +0000 (01:49 +0100)]
avcodec/libxvid: Remove set-but-unused variable

Set-but-unused since 2101b99777860c853ca2321031eb3f4047dc5894.

Reviewed-by: James Almer <jamrial@gmail.com>
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
3 years agoavcodec/libxvid: Fix leak of AVPacket on error
Andreas Rheinhardt [Fri, 19 Mar 2021 00:38:59 +0000 (01:38 +0100)]
avcodec/libxvid: Fix leak of AVPacket on error

Regression since 2101b99777860c853ca2321031eb3f4047dc5894.
Fixes Coverity issue #1473721.

Reviewed-by: James Almer <jamrial@gmail.com>
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
3 years agoavformat/tests/fifo_muxer: Fix memleak on error, fix API violation
Andreas Rheinhardt [Fri, 19 Mar 2021 00:31:31 +0000 (01:31 +0100)]
avformat/tests/fifo_muxer: Fix memleak on error, fix API violation

The test program for the FIFO muxer allocates a buffer without padding
and wraps it into a packet via av_packet_from_data(). This is an API
violation. Furthermore, said buffer leaks in case av_packet_from_data()
fails. Fix both of these issues by using av_new_packet() instead.

Reviewed-by: James Almer <jamrial@gmail.com>
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
3 years agoavformat/tests/fifo_muxer: Fix leak of AVPacket on error
Andreas Rheinhardt [Fri, 19 Mar 2021 00:24:28 +0000 (01:24 +0100)]
avformat/tests/fifo_muxer: Fix leak of AVPacket on error

Also factor allocating and freeing the packet out.
Fixes Coverity issues #1473722 and #1473723; it is a regression
since 4b386b2059806ca7ee7f991d2c8b735410693e8c.

Reviewed-by: James Almer <jamrial@gmail.com>
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
3 years agoavformat/mxfdec: Fix leak on error
Andreas Rheinhardt [Fri, 12 Mar 2021 12:16:38 +0000 (13:16 +0100)]
avformat/mxfdec: Fix leak on error

It was introduced in d3d9b1fc8e2dfc8b4d66c9916ab7221062ff4660;
Fixes Coverity issue #733800.

Reviewed-by: Tomas Härdin <tjoppen@acc.umu.se>
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
3 years agoavformat/mxfdec: Don't use wrong type of pointer
Andreas Rheinhardt [Fri, 12 Mar 2021 11:59:47 +0000 (12:59 +0100)]
avformat/mxfdec: Don't use wrong type of pointer

If one of the two results of a ternary conditional is a pointer to void,
the type of the whole conditional operator is a pointer to void, even
when the other possible result is not a pointer to void. This loophole
in the type system has allowed mxf_read_local_tags to have a pointer of
type pointer to MXFMetadataSet that actually points to an MXFContext.

Reviewed-by: Tomas Härdin <tjoppen@acc.umu.se>
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
3 years agoavcodec/pngdec: Fix memleak by postponing allocation
Andreas Rheinhardt [Wed, 10 Mar 2021 19:16:32 +0000 (20:16 +0100)]
avcodec/pngdec: Fix memleak by postponing allocation

Fixes Coverity ticket #1322342.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
3 years agolavfi/dnn_backend_openvino.c: fix mem leak for TaskItem upon error
Guo, Yejun [Sat, 13 Mar 2021 06:14:51 +0000 (14:14 +0800)]
lavfi/dnn_backend_openvino.c: fix mem leak for TaskItem upon error

3 years agolavfi/dnn_backend_openvino.c: fix mem leak for RequestItem upon error
Guo, Yejun [Sat, 13 Mar 2021 06:09:33 +0000 (14:09 +0800)]
lavfi/dnn_backend_openvino.c: fix mem leak for RequestItem upon error

3 years agolavfi/dnn_backend_openvino.c: fix typo upon error
Guo, Yejun [Sat, 13 Mar 2021 05:56:40 +0000 (13:56 +0800)]
lavfi/dnn_backend_openvino.c: fix typo upon error

3 years agolavfi/dnn_backend_openvino.c: fix mem leak for input_blob and output_blob upon error
Guo, Yejun [Sat, 13 Mar 2021 05:52:21 +0000 (13:52 +0800)]
lavfi/dnn_backend_openvino.c: fix mem leak for input_blob and output_blob upon error

3 years agolavfi/dnn_backend_openvino.c: fix mem leak for AVFrame upon error
Guo, Yejun [Sat, 13 Mar 2021 05:35:29 +0000 (13:35 +0800)]
lavfi/dnn_backend_openvino.c: fix mem leak for AVFrame upon error

3 years agofftools/ffmpeg: use av_packet_alloc() to allocate packets
James Almer [Fri, 29 Jan 2021 22:09:18 +0000 (19:09 -0300)]
fftools/ffmpeg: use av_packet_alloc() to allocate packets

Signed-off-by: James Almer <jamrial@gmail.com>
3 years agofftools/ffprobe: use av_packet_alloc() to allocate packets
James Almer [Fri, 29 Jan 2021 16:58:55 +0000 (13:58 -0300)]
fftools/ffprobe: use av_packet_alloc() to allocate packets

Signed-off-by: James Almer <jamrial@gmail.com>
3 years agodoc/examples/vaapi_transcode: use av_packet_alloc() to allocate packets
James Almer [Sun, 31 Jan 2021 17:52:34 +0000 (14:52 -0300)]
doc/examples/vaapi_transcode: use av_packet_alloc() to allocate packets

Signed-off-by: James Almer <jamrial@gmail.com>
3 years agodoc/examples/vaapi_encode: use av_packet_alloc() to allocate packets
James Almer [Sun, 31 Jan 2021 17:42:47 +0000 (14:42 -0300)]
doc/examples/vaapi_encode: use av_packet_alloc() to allocate packets

Signed-off-by: James Almer <jamrial@gmail.com>
3 years agodoc/examples/transcoding: use av_packet_alloc() to allocate packets
James Almer [Sun, 31 Jan 2021 17:28:13 +0000 (14:28 -0300)]
doc/examples/transcoding: use av_packet_alloc() to allocate packets

Signed-off-by: James Almer <jamrial@gmail.com>
3 years agodoc/examples/transcode_aac: use av_packet_alloc() to allocate packets
James Almer [Sun, 31 Jan 2021 16:33:56 +0000 (13:33 -0300)]
doc/examples/transcode_aac: use av_packet_alloc() to allocate packets

Signed-off-by: James Almer <jamrial@gmail.com>
3 years agodoc/examples/demuxing_decoding: use av_packet_alloc() to allocate packets
James Almer [Sun, 31 Jan 2021 16:30:40 +0000 (13:30 -0300)]
doc/examples/demuxing_decoding: use av_packet_alloc() to allocate packets

Signed-off-by: James Almer <jamrial@gmail.com>
3 years agotests/api/api-flac-test: use av_packet_alloc() to allocate packets
James Almer [Sun, 31 Jan 2021 16:28:43 +0000 (13:28 -0300)]
tests/api/api-flac-test: use av_packet_alloc() to allocate packets

Signed-off-by: James Almer <jamrial@gmail.com>
3 years agotools/target_bsf_fuzzer: use av_packet_alloc() to allocate packets
James Almer [Sun, 31 Jan 2021 16:22:43 +0000 (13:22 -0300)]
tools/target_bsf_fuzzer: use av_packet_alloc() to allocate packets

Signed-off-by: James Almer <jamrial@gmail.com>
3 years agotools/target_dem_fuzzer: use av_packet_alloc() to allocate packets
James Almer [Sun, 31 Jan 2021 16:20:20 +0000 (13:20 -0300)]
tools/target_dem_fuzzer: use av_packet_alloc() to allocate packets

Signed-off-by: James Almer <jamrial@gmail.com>
3 years agotools/target_dec_fuzzer: use av_packet_alloc() to allocate packets
James Almer [Sun, 31 Jan 2021 16:18:01 +0000 (13:18 -0300)]
tools/target_dec_fuzzer: use av_packet_alloc() to allocate packets

Signed-off-by: James Almer <jamrial@gmail.com>
3 years agotools/pktdumper: use av_packet_alloc() to allocate packets
James Almer [Sun, 31 Jan 2021 16:08:51 +0000 (13:08 -0300)]
tools/pktdumper: use av_packet_alloc() to allocate packets

Signed-off-by: James Almer <jamrial@gmail.com>
3 years agoavfilter/vf_uspp: use av_packet_alloc() to allocate packets
James Almer [Fri, 29 Jan 2021 16:54:05 +0000 (13:54 -0300)]
avfilter/vf_uspp: use av_packet_alloc() to allocate packets

Signed-off-by: James Almer <jamrial@gmail.com>
3 years agoavfilter/vf_mcdeint: use av_packet_alloc() to allocate packets
James Almer [Fri, 29 Jan 2021 16:32:19 +0000 (13:32 -0300)]
avfilter/vf_mcdeint: use av_packet_alloc() to allocate packets

Signed-off-by: James Almer <jamrial@gmail.com>
3 years agoavdevice/xcbgrab: stop using av_init_packet()
James Almer [Fri, 29 Jan 2021 16:28:42 +0000 (13:28 -0300)]
avdevice/xcbgrab: stop using av_init_packet()

Signed-off-by: James Almer <jamrial@gmail.com>
3 years agoavdevice/decklink_dec: stop using av_init_packet()
James Almer [Fri, 29 Jan 2021 16:27:02 +0000 (13:27 -0300)]
avdevice/decklink_dec: stop using av_init_packet()

Signed-off-by: James Almer <jamrial@gmail.com>
3 years agoavformat/tests/movenc: use av_packet_alloc() to allocate packets
James Almer [Fri, 29 Jan 2021 15:31:41 +0000 (12:31 -0300)]
avformat/tests/movenc: use av_packet_alloc() to allocate packets

Signed-off-by: James Almer <jamrial@gmail.com>
3 years agoavformat/tests/fifo_muxer: use av_packet_alloc() to allocate packets
James Almer [Fri, 29 Jan 2021 15:22:18 +0000 (12:22 -0300)]
avformat/tests/fifo_muxer: use av_packet_alloc() to allocate packets

Signed-off-by: James Almer <jamrial@gmail.com>
3 years agoavformat/wc3movie: use av_packet_alloc() to allocate packets
James Almer [Fri, 29 Jan 2021 15:22:07 +0000 (12:22 -0300)]
avformat/wc3movie: use av_packet_alloc() to allocate packets

Signed-off-by: James Almer <jamrial@gmail.com>
3 years agoavformat/subtitles: use av_packet_alloc() to allocate packets
James Almer [Wed, 3 Feb 2021 23:55:27 +0000 (20:55 -0300)]
avformat/subtitles: use av_packet_alloc() to allocate packets

Signed-off-by: James Almer <jamrial@gmail.com>
3 years agoavformat/rtpenc_mpegts: use av_packet_alloc() to allocate packets
James Almer [Fri, 29 Jan 2021 15:07:57 +0000 (12:07 -0300)]
avformat/rtpenc_mpegts: use av_packet_alloc() to allocate packets

Signed-off-by: James Almer <jamrial@gmail.com>
3 years agoavformat/rtpdec: use av_packet_alloc() to allocate packets
James Almer [Fri, 29 Jan 2021 14:55:40 +0000 (11:55 -0300)]
avformat/rtpdec: use av_packet_alloc() to allocate packets

Signed-off-by: James Almer <jamrial@gmail.com>
3 years agoavformat/mpegtsenc: use av_packet_alloc() to allocate packets
James Almer [Fri, 29 Jan 2021 14:30:44 +0000 (11:30 -0300)]
avformat/mpegtsenc: use av_packet_alloc() to allocate packets

Signed-off-by: James Almer <jamrial@gmail.com>
3 years agoavformat/mpegts: use av_packet_alloc() to allocate packets
James Almer [Fri, 29 Jan 2021 14:23:45 +0000 (11:23 -0300)]
avformat/mpegts: use av_packet_alloc() to allocate packets

Signed-off-by: James Almer <jamrial@gmail.com>
3 years agoavformat/movenc: use av_packet_alloc() to allocate packets
James Almer [Fri, 29 Jan 2021 14:13:18 +0000 (11:13 -0300)]
avformat/movenc: use av_packet_alloc() to allocate packets

Signed-off-by: James Almer <jamrial@gmail.com>
3 years agoavformat/matroskaenc: use av_packet_alloc() to allocate packets
James Almer [Fri, 29 Jan 2021 13:46:43 +0000 (10:46 -0300)]
avformat/matroskaenc: use av_packet_alloc() to allocate packets

Signed-off-by: James Almer <jamrial@gmail.com>
3 years agoavformat/matroskadec: use av_packet_alloc() to allocate packets
James Almer [Fri, 29 Jan 2021 13:42:48 +0000 (10:42 -0300)]
avformat/matroskadec: use av_packet_alloc() to allocate packets

Signed-off-by: James Almer <jamrial@gmail.com>
3 years agoavformat/hls: use av_packet_alloc() to allocate packets
James Almer [Fri, 29 Jan 2021 13:27:05 +0000 (10:27 -0300)]
avformat/hls: use av_packet_alloc() to allocate packets

Signed-off-by: James Almer <jamrial@gmail.com>
3 years agoavformat/flacdec: use av_packet_alloc() to allocate packets
James Almer [Fri, 29 Jan 2021 13:20:21 +0000 (10:20 -0300)]
avformat/flacdec: use av_packet_alloc() to allocate packets

Signed-off-by: James Almer <jamrial@gmail.com>
3 years agoavformat/id3v2: replace call to av_init_packet()
James Almer [Sun, 31 Jan 2021 19:59:31 +0000 (16:59 -0300)]
avformat/id3v2: replace call to av_init_packet()

Signed-off-by: James Almer <jamrial@gmail.com>
3 years agoavformat/flac_picture: replace call to av_init_packet()
James Almer [Sun, 31 Jan 2021 19:59:07 +0000 (16:59 -0300)]
avformat/flac_picture: replace call to av_init_packet()

Signed-off-by: James Almer <jamrial@gmail.com>
3 years agoavformat/avienc: use av_packet_alloc() to allocate packets
James Almer [Fri, 29 Jan 2021 03:02:12 +0000 (00:02 -0300)]
avformat/avienc: use av_packet_alloc() to allocate packets

Signed-off-by: James Almer <jamrial@gmail.com>
3 years agoavformat/avidec: use av_packet_alloc() to allocate packets
James Almer [Sun, 31 Jan 2021 15:10:13 +0000 (12:10 -0300)]
avformat/avidec: use av_packet_alloc() to allocate packets

Signed-off-by: James Almer <jamrial@gmail.com>
3 years agoavformat/asfdec_o: use av_packet_alloc() to allocate packets
James Almer [Fri, 29 Jan 2021 02:52:46 +0000 (23:52 -0300)]
avformat/asfdec_o: use av_packet_alloc() to allocate packets

Signed-off-by: James Almer <jamrial@gmail.com>
3 years agoavformat/amvenc: use av_packet_alloc() to allocate packets
James Almer [Fri, 29 Jan 2021 02:27:10 +0000 (23:27 -0300)]
avformat/amvenc: use av_packet_alloc() to allocate packets

Signed-off-by: James Almer <jamrial@gmail.com>
3 years agoavformat/utils: use av_packet_alloc() to allocate packets
James Almer [Sun, 31 Jan 2021 16:05:49 +0000 (13:05 -0300)]
avformat/utils: use av_packet_alloc() to allocate packets

Signed-off-by: James Almer <jamrial@gmail.com>
3 years agoavformat/mux: use av_packet_alloc() to allocate packets
James Almer [Sat, 30 Jan 2021 18:04:24 +0000 (15:04 -0300)]
avformat/mux: use av_packet_alloc() to allocate packets

Signed-off-by: James Almer <jamrial@gmail.com>
3 years agoavcodec/tests/avpacket: use av_packet_alloc() to allocate packets
James Almer [Fri, 29 Jan 2021 02:21:05 +0000 (23:21 -0300)]
avcodec/tests/avpacket: use av_packet_alloc() to allocate packets

Signed-off-by: James Almer <jamrial@gmail.com>
3 years agoavcodec/webp: use av_packet_alloc() to allocate packets
James Almer [Fri, 29 Jan 2021 02:15:36 +0000 (23:15 -0300)]
avcodec/webp: use av_packet_alloc() to allocate packets

Signed-off-by: James Almer <jamrial@gmail.com>
3 years agoavcodec/tiff: use av_packet_alloc() to allocate AVPackets
James Almer [Fri, 29 Jan 2021 02:10:06 +0000 (23:10 -0300)]
avcodec/tiff: use av_packet_alloc() to allocate AVPackets

Signed-off-by: James Almer <jamrial@gmail.com>
3 years agoavcodec/tdsc: use av_packet_alloc() to allocate packets
James Almer [Fri, 29 Jan 2021 02:07:10 +0000 (23:07 -0300)]
avcodec/tdsc: use av_packet_alloc() to allocate packets

Signed-off-by: James Almer <jamrial@gmail.com>
3 years agoavcodec/pthread_frame: use av_packet_alloc() to allocate packets
James Almer [Wed, 3 Feb 2021 18:24:58 +0000 (15:24 -0300)]
avcodec/pthread_frame: use av_packet_alloc() to allocate packets

Signed-off-by: James Almer <jamrial@gmail.com>
3 years agoavcodec/mpegvideo_enc: use av_packet_alloc() to allocate packets
James Almer [Fri, 29 Jan 2021 02:02:50 +0000 (23:02 -0300)]
avcodec/mpegvideo_enc: use av_packet_alloc() to allocate packets

Signed-off-by: James Almer <jamrial@gmail.com>
3 years agoavcodec/libxvid: use av_packet_alloc() to allocate packets
James Almer [Fri, 29 Jan 2021 01:49:37 +0000 (22:49 -0300)]
avcodec/libxvid: use av_packet_alloc() to allocate packets

Signed-off-by: James Almer <jamrial@gmail.com>
3 years agoavcodec/encode: silence a deprecation warning about av_init_packet()
James Almer [Tue, 16 Mar 2021 15:01:32 +0000 (12:01 -0300)]
avcodec/encode: silence a deprecation warning about av_init_packet()

No need to adapt this code as it will be removed long before av_init_packet()

Signed-off-by: James Almer <jamrial@gmail.com>
3 years agoavcodec/cri: use av_packet_alloc() to allocate packets
James Almer [Fri, 29 Jan 2021 01:45:29 +0000 (22:45 -0300)]
avcodec/cri: use av_packet_alloc() to allocate packets

Signed-off-by: James Almer <jamrial@gmail.com>
3 years agoavcodec/packet_internal: make avpriv_packet_list_* functions use an internal struct
James Almer [Fri, 5 Mar 2021 14:26:24 +0000 (11:26 -0300)]
avcodec/packet_internal: make avpriv_packet_list_* functions use an internal struct

The next pointer is kept at the end for backwards compatability until the
major bump, when it should ideally be moved at the front.

Signed-off-by: James Almer <jamrial@gmail.com>
3 years agoavcodec/packet: deprecate av_init_packet()
James Almer [Wed, 27 Jan 2021 19:24:10 +0000 (16:24 -0300)]
avcodec/packet: deprecate av_init_packet()

Once removed, sizeof(AVPacket) will stop being a part of the public ABI.

Signed-off-by: James Almer <jamrial@gmail.com>
3 years agoavcodec/vaapi_encode: use AVCodecContext.get_encode_buffer()
James Almer [Fri, 12 Mar 2021 23:50:42 +0000 (20:50 -0300)]
avcodec/vaapi_encode: use AVCodecContext.get_encode_buffer()

Signed-off-by: James Almer <jamrial@gmail.com>
3 years agoavcodec/nvenc: use AVCodecContext.get_encode_buffer()
James Almer [Fri, 12 Mar 2021 23:50:01 +0000 (20:50 -0300)]
avcodec/nvenc: use AVCodecContext.get_encode_buffer()

Signed-off-by: James Almer <jamrial@gmail.com>
3 years agoavcodec/mfenc: use AVCodecContext.get_encode_buffer()
James Almer [Sat, 13 Mar 2021 00:07:42 +0000 (21:07 -0300)]
avcodec/mfenc: use AVCodecContext.get_encode_buffer()

Signed-off-by: James Almer <jamrial@gmail.com>
3 years agoavcodec/librav1e: use AVCodecContext.get_encode_buffer()
James Almer [Fri, 12 Mar 2021 23:50:22 +0000 (20:50 -0300)]
avcodec/librav1e: use AVCodecContext.get_encode_buffer()

Signed-off-by: James Almer <jamrial@gmail.com>
3 years agoavcodec/amfenc: use AVCodecContext.get_encode_buffer()
James Almer [Fri, 12 Mar 2021 23:49:44 +0000 (20:49 -0300)]
avcodec/amfenc: use AVCodecContext.get_encode_buffer()

Signed-off-by: James Almer <jamrial@gmail.com>
3 years agoavformat/mov: Handle when we have an mfra box but have not read the full sidx for...
Derek Buitenhuis [Mon, 15 Mar 2021 14:20:17 +0000 (14:20 +0000)]
avformat/mov: Handle when we have an mfra box but have not read the full sidx for a fragment

Use the tfra timestamp if it is available and sidx timestamp is not.

Fixes reading the entire file after seeking in a live-style DASH FMP4
with an MFRA.

This specifically fixes when use_mfra_for is set.

Signed-off-by: Derek Buitenhuis <derek.buitenhuis@gmail.com>
3 years agoavcodec/libdavs2: unbreak compilation failure
Gyan Doshi [Wed, 17 Mar 2021 05:21:30 +0000 (10:51 +0530)]
avcodec/libdavs2: unbreak compilation failure

FF_CODEC_CAP_AUTO_THREADS added in 8a129077cc requires internal.h

Signed-off-by: Timo Rothenpieler <timo@rothenpieler.org>
3 years agoavformat/aviobuf: don't reduce short seek threshold
Andriy Gelman [Sun, 14 Mar 2021 04:54:32 +0000 (23:54 -0500)]
avformat/aviobuf: don't reduce short seek threshold

Commit 8c8e5d5286bf598a89ef9993a2cf6ea409d03a32 added a way to reduce
seek time by waiting for the windowed tcp packets instead of creating a
new socket connection. It implemented this by overwriting
s->short_seek_threshold in avio_seek(). However,
s->short_seek_threshold could already be set and be higher than the
threshold set by the protocol (i.e. s->short_seek_threshold is set in
ff_configure_buffers_for_index()).

This new feature was only enabled for tls connections in
70d8077b795766e2486e6ec8110f22a97362d6d6. As in Ticket #9148 it reduced
performance because instead of waiting to refill the AVIOContext buffers
with an existing connections, a new HTTP request was often made instead.

Fixes Ticket #9148.

Reviewed-by: Martin Storsjö <martin@martin.st>
Signed-off-by: Andriy Gelman <andriy.gelman@gmail.com>
3 years agolavc: drop unused argument from lock_avcodec()
Anton Khirnov [Wed, 10 Mar 2021 08:01:50 +0000 (09:01 +0100)]
lavc: drop unused argument from lock_avcodec()

3 years agolavc: drop ff_ prefix from ff_(un)lock_avcodec
Anton Khirnov [Wed, 10 Mar 2021 08:01:00 +0000 (09:01 +0100)]
lavc: drop ff_ prefix from ff_(un)lock_avcodec

It is unnecessary and misleading, as those are static functions.

3 years agolavc: move decoder bsf init into decoder-specific code
Anton Khirnov [Tue, 9 Mar 2021 11:00:09 +0000 (12:00 +0100)]
lavc: move decoder bsf init into decoder-specific code

3 years agolavc: factor decoder validation/setup from avcodec_open2()
Anton Khirnov [Tue, 9 Mar 2021 10:35:47 +0000 (11:35 +0100)]
lavc: factor decoder validation/setup from avcodec_open2()

3 years agolavc/encode: reindent after previous commit
Anton Khirnov [Tue, 9 Mar 2021 10:39:42 +0000 (11:39 +0100)]
lavc/encode: reindent after previous commit

3 years agolavc: factor out encoder init/validation from avcodec_open2()
Anton Khirnov [Tue, 9 Mar 2021 10:35:47 +0000 (11:35 +0100)]
lavc: factor out encoder init/validation from avcodec_open2()

avcodec_open2() is massive, splitting it makes it more readable.

Also, add a missing error code to ticks_per_frame sanity check.

3 years agocmdutils: replace strncpy() with direct assignment
Anton Khirnov [Wed, 24 Feb 2021 10:19:27 +0000 (11:19 +0100)]
cmdutils: replace strncpy() with direct assignment

Only one character is actually rewritten.

Fixes truncation warnings, such as
warning: ‘strncpy’ output truncated before terminating nul copying 3 bytes from a string of the same length [-Wstringop-truncation]
in gcc 10.2.0

3 years agolavc: rename AV_CODEC_CAP_AUTO_THREADS->AV_CODEC_CAP_OTHER_THREADS
Anton Khirnov [Tue, 9 Mar 2021 17:35:56 +0000 (18:35 +0100)]
lavc: rename AV_CODEC_CAP_AUTO_THREADS->AV_CODEC_CAP_OTHER_THREADS

This cap is currently used to mark multithreading-capable codecs that
wrap external libraries with their own multithreading code. The name is
highly confusing for our API users, since libavcodec ALWAYS handles
thread_count=0 (see commit message in previous commit). Therefore rename
the cap and update its documentation to make its meaning clear.

The old name is kept deprecated until next+1 major bump.