]> git.sesse.net Git - ffmpeg/log
ffmpeg
4 years agodoc/filters: clarify metadata and logging for blackdetect
Gyan Doshi [Mon, 13 Apr 2020 05:53:24 +0000 (11:23 +0530)]
doc/filters: clarify metadata and logging for blackdetect

4 years agofftools/ffmpeg: also flush encoders which have a variable frame size
Marton Balint [Tue, 24 Mar 2020 23:27:45 +0000 (00:27 +0100)]
fftools/ffmpeg: also flush encoders which have a variable frame size

Signed-off-by: Marton Balint <cus@passwd.hu>
4 years agoavcodec/cbs: Avoid leaving the ... out in calls to variadic macros
Andreas Rheinhardt [Sun, 22 Mar 2020 19:34:21 +0000 (20:34 +0100)]
avcodec/cbs: Avoid leaving the ... out in calls to variadic macros

According to C99, there has to be at least one argument for every ...
in a variadic function-like macro. In practice most (all?) compilers also
allow to leave it completely out, but it is nevertheless required: In a
variadic macro "there shall be more arguments in the invocation than there
are parameters in the macro definition (excluding the ...)." (C99,
6.10.3.4).

CBS (not the framework itself, but the macros used in the
cbs_*_syntax_template.c files) relies on the compiler allowing to leave
a variadic macro argument out. This leads to warnings when compiling in
-pedantic mode, e.g. "warning: must specify at least one argument for
'...' parameter of variadic macro [-Wgnu-zero-variadic-macro-arguments]"
from Clang.

Most of these warnings can be easily avoided: The syntax_templates
mostly contain helper macros that expand to more complex variadic macros
and these helper macros often omit an argument for the .... Modifying
them to always expand to complex macros with an empty argument for the
... at the end fixes most of these warnings: The number of warnings went
down from 400 to 0 for cbs_av1, from 1114 to 32 for cbs_h2645, from 38 to
0 for cbs_jpeg, from 166 to 0 for cbs_mpeg2 and from 110 to 8 for cbs_vp9.

These eight remaining warnings for cbs_vp9 have been fixed by switching
to another macro in cbs_vp9_syntax_template: The fixed values for the
sync bytes as well as the trailing bits for byte-alignment are now read
via the fixed() macro (this also adds a check to ensure that trailing
bits are indeed zero as they have to be).

Reviewed-by: Mark Thompson <sw@jkqxz.net>
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
4 years agolavu/mem: Make other alloc functions more similar to av_malloc().
Carl Eugen Hoyos [Sat, 11 Apr 2020 22:36:30 +0000 (00:36 +0200)]
lavu/mem: Make other alloc functions more similar to av_malloc().

Do not limit the array allocation functions and av_calloc() to allocations
of INT_MAX, instead depend on max_alloc_size like av_malloc().

Allows a workaround for ticket #7140.

4 years agoavformat/Makefile: Add missing rawenc dependency for iLBC muxer
Andreas Rheinhardt [Tue, 7 Apr 2020 17:17:19 +0000 (19:17 +0200)]
avformat/Makefile: Add missing rawenc dependency for iLBC muxer

Forgotten in ab502fab.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
4 years agotools/target_dec_fuzzer: Adjust threshold for zerocodec
Michael Niedermayer [Sat, 22 Feb 2020 23:08:19 +0000 (00:08 +0100)]
tools/target_dec_fuzzer: Adjust threshold for zerocodec

Fixes: Timeout (147sec -> 1sec)
Fixes: 20764/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_ZEROCODEC_fuzzer-5068274603917312
Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
4 years agoavformat/oggdec: Check for EOF after page header
Michael Niedermayer [Wed, 1 Apr 2020 18:58:52 +0000 (20:58 +0200)]
avformat/oggdec: Check for EOF after page header

Fixes: Infinite loop
Fixes: Ticket8594
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
4 years agoswscale/yuv2rgb: Fix vertical dither offset with slices
Michael Niedermayer [Thu, 2 Apr 2020 20:38:46 +0000 (22:38 +0200)]
swscale/yuv2rgb: Fix vertical dither offset with slices

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
4 years agoavcodec/mips: fix get_cabac_inline_mips function name
Rosen Penev [Sun, 12 Apr 2020 01:54:33 +0000 (18:54 -0700)]
avcodec/mips: fix get_cabac_inline_mips function name

On other platforms, the functions are named get_cabac_inline_xxx but not
this one. There's also a define.

Signed-off-by: Rosen Penev <rosenp@gmail.com>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
4 years agoconfigure: add mv30 blockdsp dependency
Peter Ross [Fri, 10 Apr 2020 13:05:51 +0000 (23:05 +1000)]
configure: add mv30 blockdsp dependency

fix link error introduced in 481ebb1c8b3368e2a1bb9e33bd10b50a8818dbf7

Signed-off-by: Peter Ross <pross@xvid.org>
Reviewed-by: Anton Khirnov <anton@khirnov.net>
4 years agoavcodec/libaomenc,cosmetics: fix a typo
James Zern [Sat, 11 Apr 2020 22:22:35 +0000 (15:22 -0700)]
avcodec/libaomenc,cosmetics: fix a typo

tradeof -> trade-off

Signed-off-by: James Zern <jzern@google.com>
4 years agoavcodec/libaomenc.c: Add a libaom command-line option 'tune'
Wang Cao [Fri, 3 Apr 2020 21:00:26 +0000 (05:00 +0800)]
avcodec/libaomenc.c: Add a libaom command-line option 'tune'

Signed-off-by: Wang Cao <wangcao@google.com>
Signed-off-by: James Zern <jzern@google.com>
4 years agolibavformat/mov: fix multiple trun per traf
John Stebbins [Sun, 29 Mar 2020 21:27:38 +0000 (14:27 -0700)]
libavformat/mov: fix multiple trun per traf

dts would start over at the beginning of each trun when they should be
computed contiguously for each trun in a traf

Fixes ticket 8070

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
4 years agomov: fix seek to next root atom in fragmented mp4
John Stebbins [Sun, 29 Mar 2020 20:32:45 +0000 (13:32 -0700)]
mov: fix seek to next root atom in fragmented mp4

If some but not all moof's are referenced in an sidx, whole fragments
were being skipped.

Fixes tickets 7377, 7389, and 8502

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
4 years agoavcodec/dpcm: clip exponent into supported range in XAN DPCM
Michael Niedermayer [Thu, 9 Apr 2020 13:37:55 +0000 (15:37 +0200)]
avcodec/dpcm: clip exponent into supported range in XAN DPCM

Fixes: shift exponent 32 is too large for 32-bit type 'int'
Fixes: 21200/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_XAN_DPCM_fuzzer-5754704894361600
Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Reviewed-by: Anton Khirnov <anton@khirnov.net>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
4 years agolibavcodec/jpeg2000: fix precinct coordinate calculation
Gautam Ramakrishnan [Sat, 11 Apr 2020 06:40:09 +0000 (12:10 +0530)]
libavcodec/jpeg2000: fix precinct coordinate calculation

The calculation of precinct boundaries has been
fixed. The precinct boundaries were calculated
as an offset to the band boundary, but must
instead be calculated as an offset from the
reslevel. This patch fixes #4669 and #4679.

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
4 years agolibavcodec/jpeg2000dec.c: fix error in cod marker
Gautam Ramakrishnan [Sat, 11 Apr 2020 06:40:08 +0000 (12:10 +0530)]
libavcodec/jpeg2000dec.c: fix error in cod marker

This patch fixes an error where the COC marker
overrides all data of the SPcod field of the
COD marker. It must override only one bit of
SPcod field. This now allows p0_08.j2k to be
decoded correctly (mentioned in #4679).

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
4 years agoavcodec/ac3_tab: Zero-terminate ff_ac3_sample_rate_tab
Andreas Rheinhardt [Sat, 11 Apr 2020 14:11:01 +0000 (16:11 +0200)]
avcodec/ac3_tab: Zero-terminate ff_ac3_sample_rate_tab

This is required to use it as an AVCodec.supported_samplerates array.
Adding the sentinel has been forgotten in 4679a474.
Without it e.g. the FATE-test ffmpeg-filter_complex_audio fails with ASAN.

Reviewed-by: Carl Eugen Hoyos <ceffmpeg@gmail.com>
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
4 years agoavcodec/adpcm: remove unused shift parameter from adpcm_ima_qt_expand_nibble()
Zane van Iperen [Sat, 11 Apr 2020 08:12:40 +0000 (08:12 +0000)]
avcodec/adpcm: remove unused shift parameter from adpcm_ima_qt_expand_nibble()

Signed-off-by: Zane van Iperen <zane@zanevaniperen.com>
4 years agolavc/amrwbdec: Add a comment about the missing muting technique.
Carl Eugen Hoyos [Sat, 11 Apr 2020 12:23:51 +0000 (14:23 +0200)]
lavc/amrwbdec: Add a comment about the missing muting technique.

4 years agolavc/amrwbdec: Output silence for frames marked as corrupt.
Carl Eugen Hoyos [Sun, 5 Apr 2020 15:35:38 +0000 (17:35 +0200)]
lavc/amrwbdec: Output silence for frames marked as corrupt.

Fixes ticket #7113.

4 years agolavc/amrwbdec: Remove a dead comparison.
Carl Eugen Hoyos [Sat, 11 Apr 2020 12:08:49 +0000 (14:08 +0200)]
lavc/amrwbdec: Remove a dead comparison.

Modes > MODE_SID are already filtered out at this point.
Simplifies the following change.

4 years agoavcodec/aacdec: fix compilation under soft float MIPS
Rosen Penev [Mon, 6 Apr 2020 03:37:10 +0000 (20:37 -0700)]
avcodec/aacdec: fix compilation under soft float MIPS

Place HAVE_MIPSFPU further up so that functions that use floating point
ASM are defined away. Otherwise compilation failures result when soft
float in enabled on the toolchain.

Signed-off-by: Rosen Penev <rosenp@gmail.com>
4 years agolavfi/telecine: Mark telecined frames as interlaced.
Carl Eugen Hoyos [Sat, 4 Apr 2020 23:00:44 +0000 (01:00 +0200)]
lavfi/telecine: Mark telecined frames as interlaced.

4 years agolavf/oggparsevorbis: Use case-insensitive key compare for vorbis picture
Mattias Wadman [Sat, 11 Apr 2020 10:56:21 +0000 (12:56 +0200)]
lavf/oggparsevorbis: Use case-insensitive key compare for vorbis picture

Regression since 8d3630c5402fdda2889fe4f74f7dcdd50ebca654 where keys were changed
to not be touppered but the picture block strcmp was not changed to be case-insensitive.

Fixes ticket #8608.

4 years agolibavformat/mov: restore use of mfra time as dts
John Stebbins [Mon, 6 Apr 2020 17:42:26 +0000 (11:42 -0600)]
libavformat/mov: restore use of mfra time as dts

This was inadvertantly removed in 4a9d32baca

Reviewed-by: Gyan Doshi <ffmpeg@gyani.pro>
4 years agoavfilter/delogo: correct indentation for option show.
Gyan Doshi [Fri, 10 Apr 2020 19:29:18 +0000 (00:59 +0530)]
avfilter/delogo: correct indentation for option show.

4 years agoavfilter/delogo: remove deprecated options
Gyan Doshi [Fri, 10 Apr 2020 18:43:04 +0000 (00:13 +0530)]
avfilter/delogo: remove deprecated options

Deprecated in 2015 in 8bc708fcee1

4 years agolavc/xsubenc: return meaningfull error codes
John Stebbins [Fri, 10 Apr 2020 18:48:01 +0000 (12:48 -0600)]
lavc/xsubenc: return meaningfull error codes

Signed-off-by: Philip Langdale <philipl@overt.org>
4 years agolavc/webvttenc: return more meaningful error codes
John Stebbins [Fri, 10 Apr 2020 18:36:23 +0000 (12:36 -0600)]
lavc/webvttenc: return more meaningful error codes

Signed-off-by: Philip Langdale <philipl@overt.org>
4 years agolavc/srtenc: return more meaninful error codes
John Stebbins [Fri, 10 Apr 2020 18:34:30 +0000 (12:34 -0600)]
lavc/srtenc: return more meaninful error codes

Signed-off-by: Philip Langdale <philipl@overt.org>
4 years agolavc/movtextenc: return more meaningful error codes
John Stebbins [Fri, 10 Apr 2020 18:30:10 +0000 (12:30 -0600)]
lavc/movtextenc: return more meaningful error codes

Signed-off-by: Philip Langdale <philipl@overt.org>
4 years agolavc/assenc: return more meaningful error code
John Stebbins [Fri, 10 Apr 2020 18:15:26 +0000 (12:15 -0600)]
lavc/assenc: return more meaningful error code

When the buffer is too small, return AVERROR_BUFFER_TOO_SMALL

Signed-off-by: Philip Langdale <philipl@overt.org>
4 years agolavc/dvbsub: return meaningful error codes
John Stebbins [Fri, 10 Apr 2020 18:08:46 +0000 (12:08 -0600)]
lavc/dvbsub: return meaningful error codes

Signed-off-by: Philip Langdale <philipl@overt.org>
4 years agolavc/dvbsub: fix potential encode buffer overflow
John Stebbins [Fri, 10 Apr 2020 18:07:59 +0000 (12:07 -0600)]
lavc/dvbsub: fix potential encode buffer overflow

encode buffer size was ignored

Signed-off-by: Philip Langdale <philipl@overt.org>
4 years agoChangelog: Add entry for expanded styling support in movtext
Philip Langdale [Fri, 10 Apr 2020 16:30:53 +0000 (09:30 -0700)]
Changelog: Add entry for expanded styling support in movtext

4 years agolavc/movtextenc: handle changes to hilight alpha
John Stebbins [Thu, 9 Apr 2020 19:12:39 +0000 (13:12 -0600)]
lavc/movtextenc: handle changes to hilight alpha

Signed-off-by: Philip Langdale <philipl@overt.org>
4 years agolavc/movtextenc: add option to scale fontsize with height
John Stebbins [Sun, 5 Apr 2020 21:02:27 +0000 (15:02 -0600)]
lavc/movtextenc: add option to scale fontsize with height

If the video dimensions are different than the ASS play_res then the
font sizes need to be adjusted to get the same apparent render size.

Signed-off-by: Philip Langdale <philipl@overt.org>
4 years agolavc/movtextenc: add font name handling
John Stebbins [Sun, 5 Apr 2020 20:26:02 +0000 (14:26 -0600)]
lavc/movtextenc: add font name handling

Initializes the mov text sample description from the ASS header and
creates an mov font table from the fonts available in the ASS Styles.

Signed-off-by: Philip Langdale <philipl@overt.org>
4 years agolavc/movtextenc: simplify initialization of new style record
John Stebbins [Sun, 5 Apr 2020 14:44:24 +0000 (08:44 -0600)]
lavc/movtextenc: simplify initialization of new style record

Signed-off-by: Philip Langdale <philipl@overt.org>
4 years agolavc/movtextenc: handle cancel overrides callback
John Stebbins [Sun, 5 Apr 2020 14:34:45 +0000 (08:34 -0600)]
lavc/movtextenc: handle cancel overrides callback

Signed-off-by: Philip Langdale <philipl@overt.org>
4 years agolavc/movtextenc: add font size tag handling
John Stebbins [Sat, 4 Apr 2020 22:46:40 +0000 (16:46 -0600)]
lavc/movtextenc: add font size tag handling

Signed-off-by: Philip Langdale <philipl@overt.org>
4 years agolavc/movtextenc: add alpha tag handling
John Stebbins [Sat, 4 Apr 2020 22:34:16 +0000 (16:34 -0600)]
lavc/movtextenc: add alpha tag handling

Signed-off-by: Philip Langdale <philipl@overt.org>
4 years agolavc/movtextenc: add color tag handling
John Stebbins [Sat, 4 Apr 2020 22:05:18 +0000 (16:05 -0600)]
lavc/movtextenc: add color tag handling

Signed-off-by: Philip Langdale <philipl@overt.org>
4 years agolavc/movtextenc: init style record from ASS dialog style
John Stebbins [Sat, 4 Apr 2020 21:23:34 +0000 (15:23 -0600)]
lavc/movtextenc: init style record from ASS dialog style

Signed-off-by: Philip Langdale <philipl@overt.org>
4 years agolavc/movtextenc: fix unclosed style records
John Stebbins [Sat, 4 Apr 2020 20:52:00 +0000 (14:52 -0600)]
lavc/movtextenc: fix unclosed style records

The last record at the end of each dialog was never closed

Signed-off-by: Philip Langdale <philipl@overt.org>
4 years agolavc/movtextenc: simplify style record updates
John Stebbins [Sat, 4 Apr 2020 20:43:25 +0000 (14:43 -0600)]
lavc/movtextenc: simplify style record updates

Makes style update code easier to extend for style types not yet handled

Signed-off-by: Philip Langdale <philipl@overt.org>
4 years agolavc/movtextenc: keep values in native byte order till written
John Stebbins [Sat, 4 Apr 2020 19:52:44 +0000 (13:52 -0600)]
lavc/movtextenc: keep values in native byte order till written

Signed-off-by: Philip Langdale <philipl@overt.org>
4 years agolavc/movtextenc: use correct color component order
John Stebbins [Sat, 4 Apr 2020 19:36:51 +0000 (13:36 -0600)]
lavc/movtextenc: use correct color component order

Signed-off-by: Philip Langdale <philipl@overt.org>
4 years agolavc/ass_split: fix parsing utf8 scripts
John Stebbins [Sat, 4 Apr 2020 19:17:33 +0000 (13:17 -0600)]
lavc/ass_split: fix parsing utf8 scripts

The [Script Info] section was skipped if starts with UTF8 BOM

Signed-off-by: Philip Langdale <philipl@overt.org>
4 years agolavc/movtextdec: allow setting subtitle frame dimensions
John Stebbins [Sat, 4 Apr 2020 18:33:54 +0000 (12:33 -0600)]
lavc/movtextdec: allow setting subtitle frame dimensions

Font sizes are relative to the subtitle frame dimensions. If the
expected frame dimensions are not known, the font sizes will most
likely be incorrect.

Signed-off-by: Philip Langdale <philipl@overt.org>
4 years agolavc/movtextdec: restore active style color after hilite
John Stebbins [Sat, 4 Apr 2020 18:14:48 +0000 (12:14 -0600)]
lavc/movtextdec: restore active style color after hilite

Signed-off-by: Philip Langdale <philipl@overt.org>
4 years agolavc/movtextdec: add color and alpha style tags
John Stebbins [Sat, 4 Apr 2020 18:06:39 +0000 (12:06 -0600)]
lavc/movtextdec: add color and alpha style tags

Signed-off-by: Philip Langdale <philipl@overt.org>
4 years agolavc/movtextdec: add alpha default to ass header colors
John Stebbins [Sat, 4 Apr 2020 17:53:59 +0000 (11:53 -0600)]
lavc/movtextdec: add alpha default to ass header colors

Signed-off-by: Philip Langdale <philipl@overt.org>
4 years agolavc/movtextdec: make sure default font name is set
John Stebbins [Sat, 4 Apr 2020 17:45:20 +0000 (11:45 -0600)]
lavc/movtextdec: make sure default font name is set

Signed-off-by: Philip Langdale <philipl@overt.org>
4 years agolavc/movtextdec: only write fontsize, fontID tags if not default
John Stebbins [Sat, 4 Apr 2020 17:40:57 +0000 (11:40 -0600)]
lavc/movtextdec: only write fontsize, fontID tags if not default

Signed-off-by: Philip Langdale <philipl@overt.org>
4 years agolavc/movtextdec: handle changes to default style flags
John Stebbins [Sat, 4 Apr 2020 17:29:53 +0000 (11:29 -0600)]
lavc/movtextdec: handle changes to default style flags

Style flags were only being turned on.  If the default was on and style
record turned off, style flag remained on.

Signed-off-by: Philip Langdale <philipl@overt.org>
4 years agolavc/movtextdec: fix bold, italic, underline flags
John Stebbins [Sat, 4 Apr 2020 17:21:16 +0000 (11:21 -0600)]
lavc/movtextdec: fix bold, italic, underline flags

They should be 0 or 1 so that 0 or -1 is written to the ass header

Signed-off-by: Philip Langdale <philipl@overt.org>
4 years agolavc/movtextdec: simplify style record walk
John Stebbins [Sat, 4 Apr 2020 17:01:43 +0000 (11:01 -0600)]
lavc/movtextdec: simplify style record walk

It's not necessary to walk the style record list twice per subtitle
character.  style records are in order and do not overlap.

Signed-off-by: Philip Langdale <philipl@overt.org>
4 years agolavc/movtextdec: fix ass header colors
John Stebbins [Sat, 4 Apr 2020 16:51:04 +0000 (10:51 -0600)]
lavc/movtextdec: fix ass header colors

A conversion from rgb to bgr is necessary

Signed-off-by: Philip Langdale <philipl@overt.org>
4 years agolavc: install codec_desc.h
Anton Khirnov [Fri, 10 Apr 2020 15:06:15 +0000 (17:06 +0200)]
lavc: install codec_desc.h

Forgotten in 672946c7fe6de56ccf5d2271ad1bfeb2290f394f

4 years agoh264dec: do not set picture_structure on init
Anton Khirnov [Sun, 30 Jul 2017 12:43:33 +0000 (14:43 +0200)]
h264dec: do not set picture_structure on init

This has been cargo culted from mpegvideo and serves no useful purpose.
It will be initialize correctly in h264_field_start()

4 years agoh264dec: rename flush_dpb()
Anton Khirnov [Sat, 29 Jul 2017 19:21:50 +0000 (21:21 +0200)]
h264dec: rename flush_dpb()

The name is misleading, this function does a lot more than just flushing
the DPB.

4 years agoh264_ps: make the PPS hold a reference to its SPS
Anton Khirnov [Mon, 1 May 2017 19:42:54 +0000 (21:42 +0200)]
h264_ps: make the PPS hold a reference to its SPS

It represents the relationship between them more naturally and will be
useful in the following commits.

Allows significantly more frames in fate-h264-attachment-631 to be
decoded.

4 years agoh264_sei: parse the picture timing SEIs correctly
Anton Khirnov [Fri, 19 May 2017 08:44:59 +0000 (10:44 +0200)]
h264_sei: parse the picture timing SEIs correctly

Those SEIs refer to the currently active SPS. However, since the SEI
NALUs precede the coded picture data in the bitstream, the active SPS is
in general not known when we are decoding the SEI.

Therefore, store the content of the picture timing SEIs and actually
parse it when the active SPS is known.

4 years agoh264_sei: use a separate reader for the individual SEI messages
Anton Khirnov [Fri, 19 May 2017 08:25:08 +0000 (10:25 +0200)]
h264_sei: use a separate reader for the individual SEI messages

This tells the parsing functions the payload size and prevents them from
overreading.

4 years agoh264dec: do not abort if decoding extradata fails
Anton Khirnov [Sat, 5 Aug 2017 16:36:12 +0000 (18:36 +0200)]
h264dec: do not abort if decoding extradata fails

Such errors are not necessarily fatal and decoding might still be
possible, e.g. it happens for MVC streams where we do not handle the
subset SPS thus failing to parse its corresponding PPS.

4 years agolavc: do not implicitly share the frame pool between threads
Anton Khirnov [Tue, 17 Jan 2017 15:28:30 +0000 (16:28 +0100)]
lavc: do not implicitly share the frame pool between threads

Currently the frame pool used by the default get_buffer2()
implementation is a single struct, allocated when opening the decoder.
A pointer to it is simply copied to each frame thread and we assume that
no thread attempts to modify it at an unexpected time. This is rather
fragile and potentially dangerous.

With this commit, the frame pool is made refcounted, with the reference
being propagated across threads along with other context variables. The
frame pool is now also immutable - when the stream parameters change we
drop the old reference and create a new one.

4 years agopthread_frame: do not copy a range of AVCodecContext fields at once
Anton Khirnov [Sun, 15 Jan 2017 12:56:42 +0000 (13:56 +0100)]
pthread_frame: do not copy a range of AVCodecContext fields at once

This is extremely fragile against reordering and hides what is actually
being copied. Copy all the fields manually instead.

4 years agopthread_frame: do not embed full AVFrame structs into per-thread contexts
Anton Khirnov [Sun, 15 Jan 2017 12:46:27 +0000 (13:46 +0100)]
pthread_frame: do not embed full AVFrame structs into per-thread contexts

Use the AVFrame API to properly allocate and free frames for delayed
release.

4 years agopthread_frame: do not share priv_data between multiple codec contexts
Anton Khirnov [Sun, 15 Jan 2017 13:52:04 +0000 (14:52 +0100)]
pthread_frame: do not share priv_data between multiple codec contexts

Specifically, between the user-facing one and the first frame thread
one.

This is fragile and dangerous, allocate separate private data for each
per-thread context.

4 years agopthread_frame: merge the functionality for normal decoder init and init_thread_copy
Anton Khirnov [Mon, 9 Jan 2017 17:04:42 +0000 (18:04 +0100)]
pthread_frame: merge the functionality for normal decoder init and init_thread_copy

The current design, where
- proper init is called for the first per-thread context
- first thread's private data is copied into private data for all the
  other threads
- a "fixup" function is called for all the other threads to e.g.
  allocate dynamically allocated data
is very fragile and hard to follow, so it is abandoned. Instead, the
same init function is used to init each per-thread context. Where
necessary, AVCodecInternal.is_copy can be used to differentiate between
the first thread and the other ones (e.g. for decoding the extradata
just once).

4 years agolavc: replace AVCodecInternal.allocate_progress with an internal cap
Anton Khirnov [Mon, 9 Jan 2017 17:01:02 +0000 (18:01 +0100)]
lavc: replace AVCodecInternal.allocate_progress with an internal cap

This is a constant codec property, so a capability flag is more appropriate.

4 years agompeg4videodec: do not copy a range of fields at once
Anton Khirnov [Wed, 11 Mar 2020 17:08:28 +0000 (18:08 +0100)]
mpeg4videodec: do not copy a range of fields at once

This is extremely fragile against reordering and hides what is actually
being copied. Copy all the fields manually instead.

4 years agoavcodec.h: split AVCodecDescriptor API into its own header
Anton Khirnov [Tue, 7 Apr 2020 14:41:48 +0000 (16:41 +0200)]
avcodec.h: split AVCodecDescriptor API into its own header

4 years agoavcodec.h: split codec IDs into their own header
Anton Khirnov [Tue, 7 Apr 2020 14:41:48 +0000 (16:41 +0200)]
avcodec.h: split codec IDs into their own header

4 years agoavcodec.h: split AVPacket API into its own header
Anton Khirnov [Tue, 7 Apr 2020 14:41:48 +0000 (16:41 +0200)]
avcodec.h: split AVPacket API into its own header

4 years agowavpack: fully support stream parameter changes
Anton Khirnov [Sun, 5 Apr 2020 20:01:40 +0000 (22:01 +0200)]
wavpack: fully support stream parameter changes

Fix invalid memory access on DSD streams with changing channel count.

4 years agodecode: make sure ff_get_buffer() cleans the frame on failure
Anton Khirnov [Sun, 5 Apr 2020 08:48:33 +0000 (10:48 +0200)]
decode: make sure ff_get_buffer() cleans the frame on failure

Merge ff_get_buffer() and get_buffer_internal() to simplify the code.

4 years agopthread_frame: make sure ff_thread_release_buffer always cleans the frame
Anton Khirnov [Sun, 5 Apr 2020 08:41:35 +0000 (10:41 +0200)]
pthread_frame: make sure ff_thread_release_buffer always cleans the frame

4 years agolavc/libopenh264enc: fix the if-else coding style
Linjie Fu [Mon, 6 Apr 2020 11:14:45 +0000 (19:14 +0800)]
lavc/libopenh264enc: fix the if-else coding style

Signed-off-by: Linjie Fu <linjie.fu@intel.com>
Signed-off-by: Anton Khirnov <anton@khirnov.net>
4 years agoavcodec/zerocodec: use init cleanup internal cap
Paul B Mahol [Thu, 9 Apr 2020 08:48:35 +0000 (10:48 +0200)]
avcodec/zerocodec: use init cleanup internal cap

4 years agoavcodec/zerocodec: implement flushing
Paul B Mahol [Thu, 9 Apr 2020 08:45:55 +0000 (10:45 +0200)]
avcodec/zerocodec: implement flushing

4 years agoavcodec: add MV30 decoder
Paul B Mahol [Tue, 18 Feb 2020 18:33:33 +0000 (19:33 +0100)]
avcodec: add MV30 decoder

4 years agoavformat/hlsenc: return media_url directly if failed to get seperator
Limin Wang [Thu, 9 Apr 2020 01:50:46 +0000 (09:50 +0800)]
avformat/hlsenc: return media_url directly if failed to get seperator

Fix ticket: 8606
Signed-off-by: Limin Wang <lance.lmwang@gmail.com>
4 years agoavformat/matroskaenc: Remove unnecessary headers
Andreas Rheinhardt [Thu, 9 Apr 2020 22:25:14 +0000 (00:25 +0200)]
avformat/matroskaenc: Remove unnecessary headers

subtitles.h has been included in order to use ff_subtitles_next_line()
to help parsing srt subtitles which at that time had their timing as
part of the payload and not as part of the AVPacket fields. When this
changed (in 55180b32) it has been forgotten to remove this header.

libavcodec/internal.h meanwhile has been added in bb47aa5850c and has
never been used at all.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
4 years agoavcodec/jpeg2000dec: Fix mixed declaration and code
Andreas Rheinhardt [Thu, 9 Apr 2020 12:37:37 +0000 (14:37 +0200)]
avcodec/jpeg2000dec: Fix mixed declaration and code

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
4 years agoavformat/mpeg: Don't use unintialized value
Andreas Rheinhardt [Tue, 22 Oct 2019 12:54:09 +0000 (14:54 +0200)]
avformat/mpeg: Don't use unintialized value

vobsub_read_packet() didn't check whether an array of AVPackets was
valid and therefore used uninitialized values.

Reviewed-by: Michael Niedermayer <michael@niedermayer.cc>
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
4 years agoavfilter/ebur128: prefer to use variable instead of type for sizeof
Limin Wang [Thu, 9 Apr 2020 11:07:20 +0000 (19:07 +0800)]
avfilter/ebur128: prefer to use variable instead of type for sizeof

Signed-off-by: Limin Wang <lance.lmwang@gmail.com>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
4 years agolibavcodec/jpeg2000dec.c: Add support for PPT marker
Gautam Ramakrishnan [Tue, 7 Apr 2020 16:57:13 +0000 (22:27 +0530)]
libavcodec/jpeg2000dec.c: Add support for PPT marker

This patch adds functional changes to support the
PPT marker. This patch fixes bug ticket #4610.

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
4 years agoavcodec/v4l2_context: Use av_freep()
Andriy Gelman [Sun, 5 Apr 2020 05:36:13 +0000 (01:36 -0400)]
avcodec/v4l2_context: Use av_freep()

Reviewed-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
Signed-off-by: Andriy Gelman <andriy.gelman@gmail.com>
4 years agoavfilter/vf_drawtext: only test available exceptions
Rosen Penev [Tue, 7 Apr 2020 00:38:59 +0000 (17:38 -0700)]
avfilter/vf_drawtext: only test available exceptions

soft float systems do not define these macros under musl.

Fixes: Ticket7102
Signed-off-by: Rosen Penev <rosenp@gmail.com>
4 years agoavformat/segment: always use interleaved writes for formats with custom interleaving
Marton Balint [Tue, 31 Mar 2020 23:03:29 +0000 (01:03 +0200)]
avformat/segment: always use interleaved writes for formats with custom interleaving

Signed-off-by: Marton Balint <cus@passwd.hu>
4 years agoavformat/hlsenc: use av_asprintf()
Limin Wang [Thu, 26 Mar 2020 13:57:00 +0000 (21:57 +0800)]
avformat/hlsenc: use av_asprintf()

Signed-off-by: Limin Wang <lance.lmwang@gmail.com>
4 years agoavformat/hlsenc: Factor out deleting files from deleting segments
Andreas Rheinhardt [Wed, 8 Apr 2020 13:23:03 +0000 (15:23 +0200)]
avformat/hlsenc: Factor out deleting files from deleting segments

Removes code duplication.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
4 years agoavformat: add subtitle support in master playlist m3u8
Limin Wang [Sun, 29 Mar 2020 11:13:44 +0000 (19:13 +0800)]
avformat: add subtitle support in master playlist m3u8

Test with the following command for the webvtt subtitle:
$ ./ffmpeg -y -i input_with_subtitle.mkv \
 -b:v:0 5250k -c:v h264 -pix_fmt yuv420p -profile:v main -level 4.1 \
 -b:a:0 256k \
 -c:s webvtt -c:a mp2 -ar 48000 -ac 2 -map 0:v -map 0:a:0 -map 0:s:0 \
 -f hls -var_stream_map "v:0,a:0,s:0,sgroup:subtitle" \
 -master_pl_name master.m3u8 -t 300 -hls_time 10 -hls_init_time 4 -hls_list_size \
 10 -master_pl_publish_rate 10  -hls_flags \
 delete_segments+discont_start+split_by_time ./tmp/video.m3u8

Check the master m3u8:
$ cat tmp/master.m3u8
#EXTM3U
#EXT-X-VERSION:3
#EXT-X-MEDIA:TYPE=SUBTITLES,GROUP-ID="subtitle",NAME="subtitle_0",DEFAULT=YES,URI="video_vtt.m3u8"
#EXT-X-STREAM-INF:BANDWIDTH=6056600,RESOLUTION=1280x720,CODECS="avc1.4d4829,mp4a.40.33",SUBTITLES="subtitle"
video.m3u8

Check the result by convert to mkv:
$ ./ffmpeg -strict experimental -i ./tmp/master.m3u8 -c:v copy -c:a mp2 -c:s srt ./test.mkv

Signed-off-by: Limin Wang <lance.lmwang@gmail.com>
4 years agoavformat/hlsplaylist: simplify code for checking whether the string is empty
Limin Wang [Thu, 26 Mar 2020 13:56:58 +0000 (21:56 +0800)]
avformat/hlsplaylist: simplify code for checking whether the string is empty

Signed-off-by: Limin Wang <lance.lmwang@gmail.com>
4 years agoavformat/hlsenc: remove the first slash of the relative path line in the master m3u8...
Limin Wang [Thu, 26 Mar 2020 13:56:57 +0000 (21:56 +0800)]
avformat/hlsenc: remove the first slash of the relative path line in the master m3u8 file

Please testing with the following command:
./ffmpeg -y -i input.mkv \
 -b:v:0 5250k -c:v h264 -pix_fmt yuv420p -profile:v main -level 4.1 \
 -b:a:0 256k \
 -c:a mp2 -ar 48000 -ac 2 -map 0:v -map 0:a:0\
 -f hls -var_stream_map "v:0,a:0" \
 -master_pl_name master.m3u8 -t 300 -hls_time 10 -hls_init_time 4 -hls_list_size \
 10 -master_pl_publish_rate 10  -hls_flags \
 delete_segments+discont_start+split_by_time ./tmp/video.m3u8

then cat ./tmp/master.m3u8
before:
#EXTM3U
#EXT-X-VERSION:3
#EXT-X-STREAM-INF:BANDWIDTH=6056600,RESOLUTION=1280x720,CODECS="avc1.4d4829,mp4a.40.33"
/video.m3u8

$ ./ffmpeg -i  ./tmp/master.m3u8 -c:v copy -c:a mp2 ./test.mkv
[hls @ 0x7f82f9000000] Skip ('#EXT-X-VERSION:3')
[hls @ 0x7f82f9000000] Opening '/video.m3u8' for reading
[hls @ 0x7f82f9000000] parse_playlist error No such file or directory [/video.m3u8]
./tmp/master.m3u8: No such file or directory

after:
#EXTM3U
#EXT-X-VERSION:3
#EXT-X-STREAM-INF:BANDWIDTH=6056600,RESOLUTION=1280x720,CODECS="avc1.4d4829,mp4a.40.33"
video.m3u8

Signed-off-by: Limin Wang <lance.lmwang@gmail.com>
4 years agoavformat/hlsenc: Use AVBPrint to avoid allocations of strings
Andreas Rheinhardt [Wed, 8 Apr 2020 11:14:17 +0000 (13:14 +0200)]
avformat/hlsenc: Use AVBPrint to avoid allocations of strings

when deleting old segments.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
4 years agoavformat/hlsenc: Fix memleak when deleting old segments
Andreas Rheinhardt [Wed, 8 Apr 2020 10:19:39 +0000 (12:19 +0200)]
avformat/hlsenc: Fix memleak when deleting old segments

if the directory name of the segments contains "%v".

This memleak is caused by masking the pointer that will eventually
be freed by a variable of the same name in a smaller scope.
Therefore the pointer that gets freed is always NULL when it is
freed and the allocated data leaks.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>