]> git.sesse.net Git - ffmpeg/log
ffmpeg
5 years agoavfilter/vf_fps: Avoid inlink fifo build up.
Nikolas Bowe [Thu, 29 Aug 2019 02:13:20 +0000 (19:13 -0700)]
avfilter/vf_fps: Avoid inlink fifo build up.

When duplicating frames we need to schedule for activation again, otherwise frames can build up in the inlink fifo.

Reviewed-by: Paul B Mahol <onemda@gmail.com>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
5 years agoavcodec/webp: fix decoding for trailing junk
Pascal Massimino [Wed, 28 Aug 2019 07:41:42 +0000 (09:41 +0200)]
avcodec/webp: fix decoding for trailing junk

some bitstream have trailing junk, despite being valid webp data.
In case of apparent error, abort the loop and let *got_frame
decide whether this is an error or not.

fixes trac #8107 (/#7612)

Another possibility would be turning the loop into:
    while (!*got_frame) {...}

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
5 years agolavf/avidec: fix memory leak in error handling path
Jun Zhao [Tue, 10 Sep 2019 11:39:27 +0000 (19:39 +0800)]
lavf/avidec: fix memory leak in error handling path

free the value in error handling path to avoid the memory leak.

Signed-off-by: Jun Zhao <barryjzhao@tencent.com>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
5 years agoavcodec/mips: Fix a warnning of indentation not reflect the block structure.
Shiyou Yin [Mon, 9 Sep 2019 03:50:51 +0000 (11:50 +0800)]
avcodec/mips: Fix a warnning of indentation not reflect the block structure.

The indentation of code dose not reflect the if block structure in
'apply_ltp_mips', and this will generate a warnning when build with
'-Wall' or '-Wmisleading-indentation'.

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
5 years agoavcodec/h264: Fix poc_lsb in open gop context
Nicolas Gaullier [Tue, 23 Jul 2019 12:08:59 +0000 (14:08 +0200)]
avcodec/h264: Fix poc_lsb in open gop context

When no IDR nor mmco_reset is found, prev_poc_lsb is
undefined and shall not be assumed to be zero

5 years agotools/target_dec_fuzzer: Adjust threshold for LSCR
Michael Niedermayer [Sun, 25 Aug 2019 15:42:19 +0000 (17:42 +0200)]
tools/target_dec_fuzzer: Adjust threshold for LSCR

Fixes: Timeout (12sec -> 3sec)
Fixes: 15327/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_LSCR_fuzzer-5702887719567360
Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
5 years agodoc/filters: fix typo in v360
Paul B Mahol [Mon, 9 Sep 2019 20:46:48 +0000 (22:46 +0200)]
doc/filters: fix typo in v360

5 years agoavcodec/mediacodec_surface: drop unnecessary local variable
Aman Gupta [Mon, 9 Sep 2019 20:20:41 +0000 (13:20 -0700)]
avcodec/mediacodec_surface: drop unnecessary local variable

Signed-off-by: Aman Gupta <aman@tmm1.net>
5 years agoavcodec/mediacodecdec_common: log codec name during configure/start failures
Aman Gupta [Thu, 5 Sep 2019 18:33:32 +0000 (11:33 -0700)]
avcodec/mediacodecdec_common: log codec name during configure/start failures

Signed-off-by: Aman Gupta <aman@tmm1.net>
Signed-off-by: Matthieu Bouron <matthieu.bouron@gmail.com>
5 years agoavcodec/mediacodecdec_common: ensure current input buffer is always used correctly
Aman Gupta [Thu, 5 Sep 2019 18:20:40 +0000 (11:20 -0700)]
avcodec/mediacodecdec_common: ensure current input buffer is always used correctly

The loop may mutate the input buffer, so re-fetch it to ensure
the current one is always used.

Signed-off-by: Aman Gupta <aman@tmm1.net>
Signed-off-by: Matthieu Bouron <matthieu.bouron@gmail.com>
5 years agoavcodec/mediacodecdec_common: improve trace logging for end-of-stream
Aman Gupta [Thu, 5 Sep 2019 18:11:15 +0000 (11:11 -0700)]
avcodec/mediacodecdec_common: improve trace logging for end-of-stream

Signed-off-by: Aman Gupta <aman@tmm1.net>
Signed-off-by: Matthieu Bouron <matthieu.bouron@gmail.com>
5 years agoavcodec/mediacodecdec_common: warn when PTS is missing
Aman Gupta [Thu, 5 Sep 2019 18:10:03 +0000 (11:10 -0700)]
avcodec/mediacodecdec_common: warn when PTS is missing

MediaCodec decoders require PTS for proper operation.

Signed-off-by: Aman Gupta <aman@tmm1.net>
Signed-off-by: Matthieu Bouron <matthieu.bouron@gmail.com>
5 years agoavfilter/vf_v360: add padding to u/v/ker
Paul B Mahol [Mon, 9 Sep 2019 16:36:56 +0000 (18:36 +0200)]
avfilter/vf_v360: add padding to u/v/ker

Fixes use of uninitialized variables.

5 years agoswscale/swscale: delete unwanted assignments
Limin Wang [Sun, 8 Sep 2019 13:12:14 +0000 (21:12 +0800)]
swscale/swscale: delete unwanted assignments

Signed-off-by: Limin Wang <lance.lmwang@gmail.com>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
5 years agotests: Fix bash errors in lavf_container tests.
Andrey Semashev [Wed, 28 Aug 2019 15:32:37 +0000 (18:32 +0300)]
tests: Fix bash errors in lavf_container tests.

Because the lavf_container is sometimes called with only 2 arguments,
fate tests produce bash errors like this:

  tests/fate-run.sh: 299: test: =: unexpected operator

This commit fixes this.

Reviewed-by: Limin Wang <lance.lmwang@gmail.com>
Reviewed-by: Michael Niedermayer <michael@niedermayer.cc>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
5 years agoavfilter/vf_v360: add guards against NaNs
Paul B Mahol [Mon, 9 Sep 2019 16:03:17 +0000 (18:03 +0200)]
avfilter/vf_v360: add guards against NaNs

Also normalize vector after rotation, it might be needed,
otherwise one can get NaNs.

5 years agoavfilter/vf_v360: partialy revert previous commit
Paul B Mahol [Mon, 9 Sep 2019 15:43:16 +0000 (17:43 +0200)]
avfilter/vf_v360: partialy revert previous commit

roll/pitch can do exactly same thing.

5 years agoavfilter/vf_v360: extend stereographic projection
Paul B Mahol [Mon, 9 Sep 2019 12:01:23 +0000 (14:01 +0200)]
avfilter/vf_v360: extend stereographic projection

Add option to change central point projection.

5 years agoavfilter/vf_v360: factor vector normalization out
Paul B Mahol [Mon, 9 Sep 2019 08:55:36 +0000 (10:55 +0200)]
avfilter/vf_v360: factor vector normalization out

5 years agolavfi/concat: fix logic error in framerate check
Jun Zhao [Mon, 9 Sep 2019 01:39:38 +0000 (09:39 +0800)]
lavfi/concat: fix logic error in framerate check

fix logic error in framerate check, it's introduced by commit
3ad5d4df9ce794d3eeb0f526c5f3e446bf97c616

Reviewed-by: Paul B Mahol <onemda@gmail.com>
Signed-off-by: Jun Zhao <barryjzhao@tencent.com>
5 years agoconfigure: check for a sufficiently recent enough AMF version
Hendrik Leppkes [Sun, 8 Sep 2019 22:49:23 +0000 (00:49 +0200)]
configure: check for a sufficiently recent enough AMF version

Due to the recent addition of Vulkan support to AMF, we require more
recent headers that include the new structures, which have been
available since AMF 1.4.9 released in September 2018.

Fixes Ticket #8125

5 years agodoc/filters: update v360
Paul B Mahol [Sun, 8 Sep 2019 16:44:30 +0000 (18:44 +0200)]
doc/filters: update v360

5 years agoavfilter/vf_v360: add stereographic output projection
Paul B Mahol [Sun, 8 Sep 2019 16:17:57 +0000 (18:17 +0200)]
avfilter/vf_v360: add stereographic output projection

5 years agoavfilter/vf_v360: disallow too low h_fov/v_fov
Paul B Mahol [Sun, 8 Sep 2019 16:19:27 +0000 (18:19 +0200)]
avfilter/vf_v360: disallow too low h_fov/v_fov

5 years agolavfi/concat: allow to support inputs with different frame rates
Calvin Walton [Fri, 30 Aug 2019 17:28:17 +0000 (13:28 -0400)]
lavfi/concat: allow to support inputs with different frame rates

Right now, the concat filter does not set the frame_rate value on any of
the out links. As a result, the default ffmpeg behaviour kicks in - to
copy the framerate from the first input to the outputs.

If a later input is higher framerate, this results in dropped frames; if
a later input is lower framerate it might cause judder.

This patch checks if all of the video inputs have the same framerate, and
if not it sets the out link to use '1/0' as the frame rate, the value
meaning "unknown/vfr".

A test is added to verify the VFR behaviour. The existing test for CFR
behaviour passes unchanged.

5 years agoavfilter/vf_v360: add aliases for some projections
Paul B Mahol [Sun, 8 Sep 2019 08:47:38 +0000 (10:47 +0200)]
avfilter/vf_v360: add aliases for some projections

5 years agoavfilter/vf_scale: split the scale_frame function from filter_frame for activate...
Limin Wang [Sat, 7 Sep 2019 15:11:25 +0000 (23:11 +0800)]
avfilter/vf_scale: split the scale_frame function from filter_frame for activate function support

Signed-off-by: Limin Wang <lance.lmwang@gmail.com>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
5 years agoavfilter/vf_v360: add options to h/w unflip input video
Paul B Mahol [Sat, 7 Sep 2019 17:54:00 +0000 (19:54 +0200)]
avfilter/vf_v360: add options to h/w unflip input video

5 years agoavfilter/vf_v360: support transposed input/output
Paul B Mahol [Sat, 7 Sep 2019 14:32:16 +0000 (16:32 +0200)]
avfilter/vf_v360: support transposed input/output

5 years agoavcodec/qdm2: Check frame size
Michael Niedermayer [Thu, 29 Aug 2019 19:26:43 +0000 (21:26 +0200)]
avcodec/qdm2: Check frame size

Fixes: index 2304 out of bounds for type 'float [2304]'
Fixes: 16332/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_QDM2_fuzzer-5679142481166336
Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
5 years agoavformat/vividas: check for tiny blocks using alignment
Michael Niedermayer [Sat, 31 Aug 2019 21:20:01 +0000 (23:20 +0200)]
avformat/vividas: check for tiny blocks using alignment

Ask for a sample for these
Fixes: out of array access
Fixes: 16624/clusterfuzz-testcase-minimized-ffmpeg_DEMUXER_fuzzer-5762455661182976
Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
5 years agoavcodec/vc1_pred: Fix refdist in scaleforopp()
Michael Niedermayer [Sat, 31 Aug 2019 20:12:38 +0000 (22:12 +0200)]
avcodec/vc1_pred: Fix refdist in scaleforopp()

Fixes: out of array access
Fixes: 16601/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_VC1IMAGE_fuzzer-5656105392275456
Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
5 years agoavfilter/vf_showinfo: display GOP timecode side data
Limin Wang [Sat, 24 Aug 2019 16:17:59 +0000 (00:17 +0800)]
avfilter/vf_showinfo: display GOP timecode side data

Signed-off-by: Limin Wang <lance.lmwang@gmail.com>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
5 years agoswscale/output: fix some code indentations
Linjie Fu [Thu, 5 Sep 2019 03:01:15 +0000 (11:01 +0800)]
swscale/output: fix some code indentations

Signed-off-by: Linjie Fu <linjie.fu@intel.com>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
5 years agoavcodec/vorbisdec: fix FASTDIV usage for vr_type == 2
Michael Niedermayer [Fri, 6 Sep 2019 10:06:30 +0000 (12:06 +0200)]
avcodec/vorbisdec: fix FASTDIV usage for vr_type == 2

This reverts a hunk from f1ca40ee00402102046fc7e59606651930436b0e

Fixes: out of array read
Fixes: 16924/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_VORBIS_fuzzer-5157893162139648
Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
5 years agolavf/rawenc: Only accept the appropriate stream type for raw muxers.
Carl Eugen Hoyos [Sun, 30 Jun 2019 22:37:08 +0000 (00:37 +0200)]
lavf/rawenc: Only accept the appropriate stream type for raw muxers.

This does not affect the rawvideo muxer.

Fixes ticket #7979.

5 years agox86/vf_v360: use a faster horizontal add in remap4_8bit_line_avx2
James Almer [Fri, 6 Sep 2019 14:18:45 +0000 (11:18 -0300)]
x86/vf_v360: use a faster horizontal add in remap4_8bit_line_avx2

Signed-off-by: James Almer <jamrial@gmail.com>
5 years agox86/vf_v360: make remap{1,2}_8bit_line_avx2 work on x86_32
James Almer [Fri, 6 Sep 2019 14:11:45 +0000 (11:11 -0300)]
x86/vf_v360: make remap{1,2}_8bit_line_avx2 work on x86_32

Signed-off-by: James Almer <jamrial@gmail.com>
5 years agoavfilter/vf_v360: add option to pick rotation order
Paul B Mahol [Fri, 6 Sep 2019 11:14:29 +0000 (13:14 +0200)]
avfilter/vf_v360: add option to pick rotation order

5 years agoavfilter/vf_v360: reduce allocations by reusing duplicated remaps
Paul B Mahol [Fri, 6 Sep 2019 09:46:11 +0000 (11:46 +0200)]
avfilter/vf_v360: reduce allocations by reusing duplicated remaps

5 years agoavfilter/vf_v360: x86 SIMD for interpolations
Paul B Mahol [Tue, 3 Sep 2019 16:54:44 +0000 (18:54 +0200)]
avfilter/vf_v360: x86 SIMD for interpolations

5 years agoavfilter/vf_v360: add asserts to guard against invalid conditions
Paul B Mahol [Tue, 3 Sep 2019 15:02:20 +0000 (17:02 +0200)]
avfilter/vf_v360: add asserts to guard against invalid conditions

5 years agoavfilter/vf_v360: stop using floats in interpolation
Paul B Mahol [Tue, 3 Sep 2019 11:15:03 +0000 (13:15 +0200)]
avfilter/vf_v360: stop using floats in interpolation

5 years agoavfilter/vf_v360: rewrite storing of remap positions and interpolations
Paul B Mahol [Tue, 3 Sep 2019 09:45:25 +0000 (11:45 +0200)]
avfilter/vf_v360: rewrite storing of remap positions and interpolations

In preparation of SIMD assembly.

5 years agodoc/filters: correct range for contrast in eq filter
Sourabh Sharma [Fri, 6 Sep 2019 02:58:13 +0000 (08:28 +0530)]
doc/filters: correct range for contrast in eq filter

Fixes #8111

Reviewed-by: Gyan Doshi <ffmpeg@gyani.pro>
5 years agoavformat/hlsenc: fix compiling error of hlsenc
Steven Liu [Fri, 6 Sep 2019 04:47:15 +0000 (12:47 +0800)]
avformat/hlsenc: fix compiling error of hlsenc

5 years agoavformat/hlsenc: fix code style
Steven Liu [Fri, 6 Sep 2019 04:15:45 +0000 (12:15 +0800)]
avformat/hlsenc: fix code style

Signed-off-by: Steven Liu <lq@chinaffmpeg.org>
5 years agoavformat/hlsenc: move the warning message from every segment upload to init part
Steven Liu [Fri, 6 Sep 2019 04:10:15 +0000 (12:10 +0800)]
avformat/hlsenc: move the warning message from every segment upload to init part

Signed-off-by: Steven Liu <lq@chinaffmpeg.org>
5 years agoavformat/hlsenc: avformat/hlsenc: reopen new http session for http_persistent
Steven Liu [Thu, 29 Aug 2019 23:14:28 +0000 (07:14 +0800)]
avformat/hlsenc: avformat/hlsenc: reopen new http session for http_persistent

fix ticket: 7975

Tested-by: Ian Klassen <ian@virtualfunc.com>
Suggested-by: Ian Klassen <ian@virtualfunc.com>
Signed-off-by: Steven Liu <lq@chinaffmpeg.org>
5 years agoavformat/http: add ff_http_get_shutdown_status api for check the status of shutdown
Steven Liu [Thu, 29 Aug 2019 23:14:27 +0000 (07:14 +0800)]
avformat/http: add ff_http_get_shutdown_status api for check the status of shutdown

this function is used to get the previous shutdown status
when reusing the old connection in block mode.

Signed-off-by: Steven Liu <lq@chinaffmpeg.org>
5 years agofate: add test for stream_loop
Gyan Doshi [Wed, 4 Sep 2019 09:53:35 +0000 (15:23 +0530)]
fate: add test for stream_loop

Checks that seek to start indeed seeks to start.

5 years agoffmpeg: switch to avformat_seek_file for stream_loop
Gyan Doshi [Sat, 31 Aug 2019 14:15:58 +0000 (19:45 +0530)]
ffmpeg: switch to avformat_seek_file for stream_loop

Fixes stream_loop with very short files where seeking is generic index
search

5 years agoavcodec/iff: Check for overlap in cmap_read_palette()
Michael Niedermayer [Wed, 21 Aug 2019 21:22:39 +0000 (23:22 +0200)]
avcodec/iff: Check for overlap in cmap_read_palette()

Fixes: undefined memcpy() use
Fixes: 16302/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_IFF_ILBM_fuzzer-5678750575886336
Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
5 years agoavcodec/vqavideo: Limit resolution
Michael Niedermayer [Thu, 22 Aug 2019 17:39:29 +0000 (19:39 +0200)]
avcodec/vqavideo: Limit resolution

Fixes: Timeout (288sec -> 1ms)
Fixes: 16353/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_VQA_fuzzer-5633402606190592
Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
5 years agoavcodec/apedec: Fix 32bit int overflow in do_apply_filter()
Michael Niedermayer [Mon, 2 Sep 2019 20:44:50 +0000 (22:44 +0200)]
avcodec/apedec: Fix 32bit int overflow in do_apply_filter()

Fixes: signed integer overflow: 2147480546 + 4096 cannot be represented in type 'int'
Fixes: 16280/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_APE_fuzzer-5123442566758400
Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Reviewed-by: Tomas Härdin <tjoppen@acc.umu.se>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
5 years agoconfigure: fix --disable-v4l2-m2m can't work
Jun Zhao [Wed, 4 Sep 2019 09:39:59 +0000 (17:39 +0800)]
configure: fix --disable-v4l2-m2m can't work

Use the command ./configure with/without --disable-v4l2-m2m test.

Reviewed-by: Aman Gupta <aman@tmm1.net>
Signed-off-by: Jun Zhao <barryjzhao@tencent.com>
5 years agoconfigure: fix --disable-alsa can't work
Jun Zhao [Wed, 4 Sep 2019 09:27:09 +0000 (17:27 +0800)]
configure: fix --disable-alsa can't work

fix --disable-alsa can't work in configure

Signed-off-by: Jun Zhao <barryjzhao@tencent.com>
5 years agodoc/filters: fix alphabetic order of some video filters
Paul B Mahol [Thu, 5 Sep 2019 09:32:21 +0000 (11:32 +0200)]
doc/filters: fix alphabetic order of some video filters

5 years agoavutil/version: bump for hwcontext_videotoolbox api change
Aman Gupta [Wed, 4 Sep 2019 19:55:52 +0000 (12:55 -0700)]
avutil/version: bump for hwcontext_videotoolbox api change

av_map_videotoolbox_format_from_pixfmt2() added in previous
commit to support full-range pixel formats.

Signed-off-by: Aman Gupta <aman@tmm1.net>
5 years agoavcodec/videotoolbox: add support for full range pixel formats
Akemi [Sat, 13 Apr 2019 14:36:01 +0000 (16:36 +0200)]
avcodec/videotoolbox: add support for full range pixel formats

Signed-off-by: Aman Gupta <aman@tmm1.net>
5 years agoavformat/mxfenc: fix warning: unused function 'klv_ber_length' [-Wunused-function]
Limin Wang [Thu, 29 Aug 2019 08:44:01 +0000 (16:44 +0800)]
avformat/mxfenc: fix warning: unused function 'klv_ber_length' [-Wunused-function]

Signed-off-by: Limin Wang <lance.lmwang@gmail.com>
5 years agolibavfilter/dnn: add header into native model file
Guo, Yejun [Mon, 2 Sep 2019 04:35:58 +0000 (12:35 +0800)]
libavfilter/dnn: add header into native model file

Signed-off-by: Guo, Yejun <yejun.guo@intel.com>
Signed-off-by: Pedro Arthur <bygrandao@gmail.com>
5 years agoavformat/matroskadec: use av_fast_realloc to reallocate ebml list arrays
James Almer [Tue, 3 Sep 2019 21:45:04 +0000 (18:45 -0300)]
avformat/matroskadec: use av_fast_realloc to reallocate ebml list arrays

Speeds up the process considerably.

Fixes ticket #8109.

Suggested-by: nevcairiel
Suggested-by: cehoyos
Signed-off-by: James Almer <jamrial@gmail.com>
5 years agoavformat/matroskadec: use proper types for some EbmlSyntax fields
James Almer [Tue, 3 Sep 2019 21:52:51 +0000 (18:52 -0300)]
avformat/matroskadec: use proper types for some EbmlSyntax fields

Signed-off-by: James Almer <jamrial@gmail.com>
5 years agoavcodec/nuv: prevent frame copying when outputting duplicate frames
James Almer [Wed, 4 Sep 2019 02:54:19 +0000 (23:54 -0300)]
avcodec/nuv: prevent frame copying when outputting duplicate frames

Signed-off-by: James Almer <jamrial@gmail.com>
5 years agoavcodec/wcmv: prevent frame copying when outputting duplicate frames
James Almer [Wed, 4 Sep 2019 02:53:46 +0000 (23:53 -0300)]
avcodec/wcmv: prevent frame copying when outputting duplicate frames

Signed-off-by: James Almer <jamrial@gmail.com>
5 years agoRevert "avcodec/wcmv: Avoid copying frames if they are unchanged"
James Almer [Wed, 4 Sep 2019 02:49:00 +0000 (23:49 -0300)]
Revert "avcodec/wcmv: Avoid copying frames if they are unchanged"

This reverts commit 976dae8b32f48d17cccfd6b19d2beb01770dfa7c.

An alternative approach to reduce frame copying will follow.

5 years agoavcodec/wcmv: use ff_reget_buffer()
James Almer [Thu, 29 Aug 2019 22:24:10 +0000 (19:24 -0300)]
avcodec/wcmv: use ff_reget_buffer()

Signed-off-by: James Almer <jamrial@gmail.com>
5 years agoavcodec/decode: add a flags parameter to ff_reget_buffer()
James Almer [Fri, 30 Aug 2019 14:37:25 +0000 (11:37 -0300)]
avcodec/decode: add a flags parameter to ff_reget_buffer()

Some decoders may not need a writable buffer in some specific cases, but only
a reference to the existing buffer with updated frame properties instead, for
the purpose of returning duplicate frames. For this, the
FF_REGET_BUFFER_FLAG_READONLY flag is added, which will prevent potential
allocations and buffer copies when they are not needed.

Signed-off-by: James Almer <jamrial@gmail.com>
5 years agoavformat/mpegts: Check if ready on SCTE reception
Anthony Delannoy [Tue, 3 Sep 2019 15:54:24 +0000 (17:54 +0200)]
avformat/mpegts: Check if ready on SCTE reception

On some DVB stream SCTE-35 data packet are available before the end of
MpegTSContext initialization. We have to check if it is the case to
avoid a SEGFAULT.

Signed-off-by: Marton Balint <cus@passwd.hu>
5 years agoconfigure: ensure --enable-omx-rpi uses rpi-specific IL headers
Aman Gupta [Mon, 2 Sep 2019 20:04:42 +0000 (21:04 +0100)]
configure: ensure --enable-omx-rpi uses rpi-specific IL headers

When compiling natively on an RPI where libomxil-bellagio-dev
was also installed, `check_headers OMX_Core.h` succeeded and
the -isystem compiler flag was never added to the build.

For non-native builds, the error message now mentions the
raspberrypi/firmware repository where the RPI specific
headers are available.

Signed-off-by: Aman Gupta <aman@tmm1.net>
5 years agoavcodec/v4l2_m2m: fix minor indentation issue
Aman Gupta [Wed, 28 Aug 2019 19:27:20 +0000 (12:27 -0700)]
avcodec/v4l2_m2m: fix minor indentation issue

5 years agoavcodec/v4l2_m2m: use log_ctx variable consistently
Aman Gupta [Fri, 23 Aug 2019 19:31:24 +0000 (12:31 -0700)]
avcodec/v4l2_m2m: use log_ctx variable consistently

Signed-off-by: Aman Gupta <aman@tmm1.net>
5 years agoavcodec/v4l2_m2m: log planar mode used by driver
Aman Gupta [Thu, 22 Aug 2019 18:03:31 +0000 (11:03 -0700)]
avcodec/v4l2_m2m: log planar mode used by driver

Signed-off-by: Aman Gupta <aman@tmm1.net>
5 years agoavcodec/v4l2_context: use EAGAIN to signal when input buffers are unavailable
Aman Gupta [Wed, 28 Aug 2019 23:42:46 +0000 (16:42 -0700)]
avcodec/v4l2_context: use EAGAIN to signal when input buffers are unavailable

ENOMEM indicates an allocation failure, and there are no allocations
happening here. The buffers are pre-allocated and there are simply
none available at this time.

Signed-off-by: Aman Gupta <aman@tmm1.net>
5 years agoavcodec/v4l2m2m: fix error handling during buffer init
Jorge Ramirez-Ortiz [Sun, 6 May 2018 17:56:30 +0000 (19:56 +0200)]
avcodec/v4l2m2m: fix error handling during buffer init

Signed-off-by: Jorge Ramirez-Ortiz <jramirez@baylibre.com>
Signed-off-by: Aman Gupta <aman@tmm1.net>
5 years agoavcodec/v4l2_buffers: return int64_t in v4l2_get_pts
Lukas Rusak [Mon, 8 Jan 2018 23:27:37 +0000 (15:27 -0800)]
avcodec/v4l2_buffers: return int64_t in v4l2_get_pts

v4l2_pts is type int64_t we should return that instead of uint64_t

Signed-off-by: Aman Gupta <aman@tmm1.net>
5 years agoavcodec/v4l2_context: return {decoder,encoder}_cmd errors
Aman Gupta [Mon, 26 Aug 2019 22:17:43 +0000 (15:17 -0700)]
avcodec/v4l2_context: return {decoder,encoder}_cmd errors

Signed-off-by: Aman Gupta <aman@tmm1.net>
5 years agoavcodec/v4l2_m2m_enc: fix typo in log message
Aman Gupta [Fri, 23 Aug 2019 20:39:32 +0000 (13:39 -0700)]
avcodec/v4l2_m2m_enc: fix typo in log message

Signed-off-by: Aman Gupta <aman@tmm1.net>
5 years agoavcodec/v4l2_m2m_enc: log errno on v4l2_set_ext_ctrl failures
Aman Gupta [Thu, 22 Aug 2019 23:00:37 +0000 (16:00 -0700)]
avcodec/v4l2_m2m_enc: log errno on v4l2_set_ext_ctrl failures

Signed-off-by: Aman Gupta <aman@tmm1.net>
5 years agoavcodec/v4l2_buffers: fix minor typos and whitespace
Aman Gupta [Thu, 22 Aug 2019 19:42:34 +0000 (12:42 -0700)]
avcodec/v4l2_buffers: fix minor typos and whitespace

Signed-off-by: Aman Gupta <aman@tmm1.net>
5 years agoavcodec/v4l2_context: log VIDIOC_REQBUFS failures
Aman Gupta [Thu, 22 Aug 2019 19:20:56 +0000 (12:20 -0700)]
avcodec/v4l2_context: log VIDIOC_REQBUFS failures

Signed-off-by: Aman Gupta <aman@tmm1.net>
5 years agoavcodec/v4l2_m2m: remove trailing whitespace in output identifier
Aman Gupta [Thu, 22 Aug 2019 19:20:40 +0000 (12:20 -0700)]
avcodec/v4l2_m2m: remove trailing whitespace in output identifier

Signed-off-by: Aman Gupta <aman@tmm1.net>
5 years agoavcodec/v4l2_m2m: log requested pixel formats
Aman Gupta [Thu, 22 Aug 2019 19:06:24 +0000 (12:06 -0700)]
avcodec/v4l2_m2m: log requested pixel formats

Signed-off-by: Aman Gupta <aman@tmm1.net>
5 years agoavformat: Add ZeroMQ as a protocol
Andriy Gelman [Tue, 30 Jul 2019 18:39:32 +0000 (14:39 -0400)]
avformat: Add ZeroMQ as a protocol

When ffmpeg was streaming, multiple clients were only supported by using a
multicast destination address. An alternative was to stream to a server which
re-distributes the content. This commit adds ZeroMQ as a protocol, which allows
multiple clients to connect to a single ffmpeg instance.

Signed-off-by: Marton Balint <cus@passwd.hu>
5 years agoavcodec/omx: fix xFramerate calculation
Aman Gupta [Thu, 29 Aug 2019 23:00:50 +0000 (16:00 -0700)]
avcodec/omx: fix xFramerate calculation

Integer overflow in the Q16 framerate calculation was sending
invalid values to the OMX encoder.

On the RPI4, this manifested as bitrate controls being ignored
on video streams with 60000/1001 framerates. Video streams with
30000/1001 framerates were not affected.

Signed-off-by: Aman Gupta <aman@tmm1.net>
5 years agoavformat/mpegtsenc: fix flushing of audio packets
Marton Balint [Sun, 25 Aug 2019 23:05:40 +0000 (01:05 +0200)]
avformat/mpegtsenc: fix flushing of audio packets

7d097a0fc57f0fa8385962a539c657c2f40b5ed0 had the same purpose as
3700f655c55e2001b57215210b957b169d66b50f but the former is much simpler, so
let's remove the latter.

Unfortunately both checks were wrong, because in order to make sure DTS > PCR
we have to give us some headroom, so instead of using a dts_difference <
max_delay check let's use a dts_difference < max_delay/2 check.

Fixes DTS < PCR errors with this command line:

./ffmpeg -loglevel verbose -y -f lavfi -i \
  "testsrc=s=64x64:d=20,split=2[out0][tmp1];[tmp1]vflip[out1];sine=d=20,asetnsamples=1000[out2]" \
  -flags +bitexact -fflags +bitexact -sws_flags +accurate_rnd+bitexact  \
  -codec:v libx264 -codec:a mp2 -b:a 32k -pix_fmt yuv420p \
  -map '0:v:0' \
  -map '0:v:1' \
  -map '0:a:0'  \
  -muxrate 800000 \
  -program st=0:st=2 -program st=1:st=2 -program st=2 -program st=0 -f mpegts out1.ts

Signed-off-by: Marton Balint <cus@passwd.hu>
5 years agodocs/formats: fix max_interleave_delta default
Marton Balint [Sun, 25 Aug 2019 21:47:52 +0000 (23:47 +0200)]
docs/formats: fix max_interleave_delta default

Signed-off-by: Marton Balint <cus@passwd.hu>
5 years agoavcodec/ralf: fix undefined shift in extend_code()
Michael Niedermayer [Sat, 17 Aug 2019 17:25:01 +0000 (19:25 +0200)]
avcodec/ralf: fix undefined shift in extend_code()

Fixes: left shift of negative value -3
Fixes: 16147/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_RALF_fuzzer-5658392722407424
Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
5 years agoavcodec/ralf: fix undefined shift
Michael Niedermayer [Sat, 17 Aug 2019 17:18:31 +0000 (19:18 +0200)]
avcodec/ralf: fix undefined shift

Fixes: left shift of negative value -2
Fixes: 16145/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_RALF_fuzzer-5146671058518016
Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
5 years agoavcodec/pngdec: Optimize has_trns code
Michael Niedermayer [Sat, 17 Aug 2019 23:28:38 +0000 (01:28 +0200)]
avcodec/pngdec: Optimize has_trns code

add inner loop specialisations for 2 bpp and 4 bpp
These are all cases for which i found testsamples.

30M cycles -> 5M cycles

Testcase: fate-rgbapng-4816
Testcase: 16097/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_APNG_fuzzer-5664690889293824

Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
5 years agovcodec/apedec: Fix integer overflow in filter_3800()
Michael Niedermayer [Sat, 17 Aug 2019 22:36:17 +0000 (00:36 +0200)]
vcodec/apedec: Fix integer overflow in filter_3800()

Fixes: signed integer overflow: 2021654528 + 2032575680 cannot be represented in type 'int'
Fixes: 16270/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_APE_fuzzer-5732438816325632
Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
5 years agoavcodec/apedec: Fix integer overflow in filter_fast_3320()
Michael Niedermayer [Sat, 17 Aug 2019 22:28:34 +0000 (00:28 +0200)]
avcodec/apedec: Fix integer overflow in filter_fast_3320()

Fixes: signed integer overflow: -1094994793 * 2 cannot be represented in type 'int'
Fixes: 16139/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_APE_fuzzer-5663911036059648
Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
5 years agolavc/v4l2_m2m: don't close the file descriptor we don't own
Pavel Koshevoy [Mon, 2 Sep 2019 06:34:35 +0000 (00:34 -0600)]
lavc/v4l2_m2m: don't close the file descriptor we don't own

ff_v4l2_m2m_create_context initialized V4L2m2mContext.fd to 0
which is a valid file descriptor value. Next ff_v4l2_m2m_codec_init
failed and v4l2_m2m_destroy_context closed file descriptor 0 even
though it didn't belong to V4L2m2mContext.

Signed-off-by: Pavel Koshevoy <pkoshevoy@gmail.com>
5 years agoconfigure: Update libmysofa check with a new symbol.
Andrey Semashev [Wed, 28 Aug 2019 20:16:35 +0000 (23:16 +0300)]
configure: Update libmysofa check with a new symbol.

The current code in libavfilter/af_sofalizer.c requires
mysofa_neighborhood_init_withstepdefine function, which only appeared
in libmysofa 0.7. Use this function in configure script to bail out
early if a too old libmysofa is found in the system instead of failing
at compile time.

5 years agoavcodec/bgmc: Check input space in ff_bgmc_decode_init()
Michael Niedermayer [Sun, 1 Sep 2019 20:31:45 +0000 (22:31 +0200)]
avcodec/bgmc: Check input space in ff_bgmc_decode_init()

Fixes: Infinite loop
Fixes: 16608/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_ALS_fuzzer-5636229827133440
Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Reviewed-by: Thilo Borgmann <thilo.borgmann@mail.de>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
5 years agoavcodec/vp3: Check for end of input in 2 places of vp4_unpack_macroblocks()
Michael Niedermayer [Sun, 1 Sep 2019 15:37:47 +0000 (17:37 +0200)]
avcodec/vp3: Check for end of input in 2 places of vp4_unpack_macroblocks()

Fixes: Timeout (82sec -> 1sec)
Fixes: 16411/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_VP3_fuzzer-5166958151991296
Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Reviewed-by: Peter Ross <pross@xvid.org>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
5 years agoavfilter/vf_v360: remove not needed items from ThreadData
Paul B Mahol [Mon, 2 Sep 2019 14:45:55 +0000 (16:45 +0200)]
avfilter/vf_v360: remove not needed items from ThreadData

5 years agoavfilter/vf_delogo: unbreak fate
Paul B Mahol [Mon, 2 Sep 2019 14:12:01 +0000 (16:12 +0200)]
avfilter/vf_delogo: unbreak fate

It is not clear what was real intention of previous commit to this filter.
It was not working correctly, hopefully this is fixed now.
It never checked that new x/y/w/h are actually valid, hopeffully this is fixed now.
It uses named variables in expressions that are never set, still not fixed.
It does not set named variables that uses actual frame widht/height, making actual
expressions less usable for our users, still now fixed.

5 years agoavfilter/vf_v360: set much smaller limit to w/h
Paul B Mahol [Mon, 2 Sep 2019 08:47:29 +0000 (10:47 +0200)]
avfilter/vf_v360: set much smaller limit to w/h