ffmpeg.git
5 months agoavformat/hlsenc: fix memleak at hls_write_trailer
Steven Liu [Mon, 9 Sep 2019 06:15:21 +0000 (14:15 +0800)]
avformat/hlsenc: fix memleak at hls_write_trailer

Found-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
Signed-off-by: Steven Liu <lq@chinaffmpeg.org>
5 months agoavformat/hlsenc: print warning at the end when upload the last segment failed
Steven Liu [Sat, 7 Sep 2019 12:39:28 +0000 (20:39 +0800)]
avformat/hlsenc: print warning at the end when upload the last segment failed

Signed-off-by: Steven Liu <lq@chinaffmpeg.org>
5 months agoavformat/hlsenc: merge fmp4 and mpegts segment type m3u8 list AVIOConext
Steven Liu [Fri, 6 Sep 2019 07:39:02 +0000 (15:39 +0800)]
avformat/hlsenc: merge fmp4 and mpegts segment type m3u8 list AVIOConext

hlsenc has been merge fmp4 and mpegts workflow before
so it can merge m3u8 list AVIOContext now.

Signed-off-by: Steven Liu <lq@chinaffmpeg.org>
5 months agox85/opusdsp: enable the functions on all FMA3 CPUs
James Almer [Wed, 11 Sep 2019 23:50:45 +0000 (20:50 -0300)]
x85/opusdsp: enable the functions on all FMA3 CPUs

It's not using ymm registers, so limiting it to CPUs with fast AVX
is not necessary.

Signed-off-by: James Almer <jamrial@gmail.com>
5 months agox86/opusdps: clear the high bits from some gprs
James Almer [Wed, 11 Sep 2019 23:22:17 +0000 (20:22 -0300)]
x86/opusdps: clear the high bits from some gprs

Fixes checkasm on systems like win64.

Reviewed-by: Lynne
Signed-off-by: James Almer <jamrial@gmail.com>
5 months agoavcodec/htmlsubtitles: Avoid locale dependant isdigit()
Michael Niedermayer [Wed, 28 Aug 2019 19:56:35 +0000 (21:56 +0200)]
avcodec/htmlsubtitles: Avoid locale dependant isdigit()

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
5 months agoavcodec/mpeg12enc: Add FF_CODEC_CAP_INIT_CLEANUP
Michael Niedermayer [Tue, 27 Aug 2019 15:21:00 +0000 (17:21 +0200)]
avcodec/mpeg12enc: Add FF_CODEC_CAP_INIT_CLEANUP

Fixes: Multiple memleaks
Fixes: ffmpeg-memory-leak

Found-by: Francis Provencher <francis@protekresearchlab.com>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
5 months agoavcodec/alsdec: Check k from being outside what our implementation can handle
Michael Niedermayer [Sun, 25 Aug 2019 16:22:50 +0000 (18:22 +0200)]
avcodec/alsdec: Check k from being outside what our implementation can handle

The specification does not seem to list what the maximum valid
value is

Fixes: shift exponent 32 is too large for 32-bit type 'unsigned int'
Fixes: 16268/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_ALS_fuzzer-5638164544225280

Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
5 months agoavcodec/takdec: Fix integer overflow in decorrelate()
Michael Niedermayer [Sun, 25 Aug 2019 15:49:15 +0000 (17:49 +0200)]
avcodec/takdec: Fix integer overflow in decorrelate()

Fixes: signed integer overflow: -2424832 - 2145653689 cannot be represented in type 'int'
Fixes: 16138/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_TAK_fuzzer-5643451346976768

Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
5 months agoavcodec/aacps: Fix integer overflows in hybrid_synthesis()
Michael Niedermayer [Fri, 23 Aug 2019 22:11:02 +0000 (00:11 +0200)]
avcodec/aacps: Fix integer overflows in hybrid_synthesis()

Fixes: signed integer overflow: -822667928 + -1399761199 cannot be represented in type 'int'
Fixes: 15756/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_AAC_FIXED_fuzzer-5645182051024896

Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
5 months agoavcodec/mpeg4videodec: Fix integer overflow in mpeg4_decode_studio_block()
Michael Niedermayer [Thu, 22 Aug 2019 22:23:52 +0000 (00:23 +0200)]
avcodec/mpeg4videodec: Fix integer overflow in mpeg4_decode_studio_block()

Fixes: signed integer overflow: 24023040 * 112 cannot be represented in type 'int'
Fixes: 16570/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_MPEG4_fuzzer-5173275211071488

Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Reviewed-by: Kieran Kunhya <kierank@obe.tv>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
5 months agoavcodec/vp56rac: delay signaling an error on truncated input
Michael Niedermayer [Tue, 20 Aug 2019 07:16:40 +0000 (09:16 +0200)]
avcodec/vp56rac: delay signaling an error on truncated input

A threshold of 1 is sufficient for simple_dump_cut.webm, 10 is used
just to be sure the next truncated file doesnt cause the same issue

Obvious alternative fixes are to simply accept that the file is broken or to
write some advanced error concealment or to
simply accept that the decoder wont stop at the end of input.

Fixes: Ticket 8069 (artifacts not the differing md5 which was there before 1afd246960202917e244c844c534e9c1e3c323f5)
Fixes: simple_dump_cut.webm
Fixes: regression of 1afd246960202917e244c844c534e9c1e3c323f5

fate-vp5 changes because the last frame is truncated and now handled
differently.

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
5 months agoavcodec/v4l2_context: set frame SAR using VIDIOC_CROPCAP
Maxime Jourdan [Fri, 30 Aug 2019 21:19:12 +0000 (14:19 -0700)]
avcodec/v4l2_context: set frame SAR using VIDIOC_CROPCAP

Signed-off-by: Aman Gupta <aman@tmm1.net>
5 months agoavcodec/v4l2_buffers: use correct timebase for encoder/decoder
Aman Gupta [Wed, 11 Sep 2019 18:21:20 +0000 (11:21 -0700)]
avcodec/v4l2_buffers: use correct timebase for encoder/decoder

Signed-off-by: Aman Gupta <aman@tmm1.net>
5 months agoavcodec/v4l2_m2m_dec: fix compile
Aman Gupta [Wed, 11 Sep 2019 18:29:38 +0000 (11:29 -0700)]
avcodec/v4l2_m2m_dec: fix compile

internal.h header required for FF_CODEC_CAP_SETS_PKT_DTS

Signed-off-by: Aman Gupta <aman@tmm1.net>
5 months agoavcodec/v4l2_m2m_dec: fix dropped packets while decoding
Maxime Jourdan [Fri, 30 Aug 2019 18:34:52 +0000 (11:34 -0700)]
avcodec/v4l2_m2m_dec: fix dropped packets while decoding

* FFmpeg retrieves a packet from the bitstream
* It attempts to get an input buffer (from its own list or by dequeuing one from the driver)
* If no input buffer is found, the bitstream packet is dropped instead of scheduled for trying again later

It's an issue that showed especially at high speeds (like using `-f null -` as output parameters).

Signed-off-by: Aman Gupta <aman@tmm1.net>
5 months agoavcodec/v4l2_context: expose timeout for dequeue_frame
Aman Gupta [Sat, 24 Aug 2019 19:02:30 +0000 (12:02 -0700)]
avcodec/v4l2_context: expose timeout for dequeue_frame

Signed-off-by: Aman Gupta <aman@tmm1.net>
5 months agoavcodec/v4l2_m2m_dec: set pkt_dts on decoded frames to NOPTS
Aman Gupta [Fri, 30 Aug 2019 22:42:00 +0000 (15:42 -0700)]
avcodec/v4l2_m2m_dec: set pkt_dts on decoded frames to NOPTS

Without this ffmpeg will attempt to copy the dts from the
most recently enqueued packet into the most recently dequeued
frame, which does not account for the buffering inside v4l2
and is not accurate.

Signed-off-by: Aman Gupta <aman@tmm1.net>
5 months agoavcodec/v4l2_buffers: read height/width from the proper context
Aman Gupta [Fri, 30 Aug 2019 21:02:48 +0000 (14:02 -0700)]
avcodec/v4l2_buffers: read height/width from the proper context

Frames are generally dequeued into capture buffers, so using
the output properties here was incorrect. It happened to work
fine for decoding, since the output/capture buffers have the same
dimensions.

For the v4l2 scaler, the dimensions can be different between output
and capture. Using the buffer's associated context makes this code
work correctly regardless of where the frame is coming from.

Signed-off-by: Aman Gupta <aman@tmm1.net>
5 months agoavfilter/vf_v360: remove pointless special case when allocating stuff
Paul B Mahol [Wed, 11 Sep 2019 14:43:10 +0000 (16:43 +0200)]
avfilter/vf_v360: remove pointless special case when allocating stuff

5 months agoavfilter/vf_v360: refactor FoV calculation for stereographic
Paul B Mahol [Wed, 11 Sep 2019 14:21:25 +0000 (16:21 +0200)]
avfilter/vf_v360: refactor FoV calculation for stereographic

Move in out of loop.

5 months agoavcodec/h2645_parse: simplify memset call
Andriy Gelman [Sat, 7 Sep 2019 19:55:51 +0000 (15:55 -0400)]
avcodec/h2645_parse: simplify memset call

Removed (new_size - pkt->nals_allocated) because this value is always 1
during the call.

Signed-off-by: James Almer <jamrial@gmail.com>
5 months agoavfilter/vf_v360: extend max limit to vertical fov
Paul B Mahol [Wed, 11 Sep 2019 13:03:43 +0000 (15:03 +0200)]
avfilter/vf_v360: extend max limit to vertical fov

5 months agoavfilter/vf_v360: really fix FoV selection
Paul B Mahol [Wed, 11 Sep 2019 13:00:12 +0000 (15:00 +0200)]
avfilter/vf_v360: really fix FoV selection

Big thanks to Michael Koch for providing actual formula.

5 months agolavfi/sinc: fix memory leak in error handling path
Jun Zhao [Tue, 10 Sep 2019 10:50:11 +0000 (18:50 +0800)]
lavfi/sinc: fix memory leak in error handling path

free work&pi_wraps in error handling path to avoid memory leak.

Reviewed-by: Paul B Mahol <onemda@gmail.com>
Signed-off-by: Jun Zhao <barryjzhao@tencent.com>
5 months agolavfi/anequalizer: fix memory leak in error handling path
Jun Zhao [Tue, 10 Sep 2019 10:24:08 +0000 (18:24 +0800)]
lavfi/anequalizer: fix memory leak in error handling path

free the pad.name in error handling path to avoid memory leak.

Reviewed-by: Paul B Mahol <onemda@gmail.com>
Signed-off-by: Jun Zhao <barryjzhao@tencent.com>
5 months agocheckasm: add opusdsp tests
Lynne [Thu, 15 Aug 2019 10:42:19 +0000 (11:42 +0100)]
checkasm: add opusdsp tests

5 months agoopusdsp: adjust and optimize C function to match assembly
Lynne [Thu, 15 Aug 2019 10:13:35 +0000 (11:13 +0100)]
opusdsp: adjust and optimize C function to match assembly

The C and asm versions behaved differently _outside_ of the codec.

The C version returned pre-multiplied 'state' for the next execution
to use right away, while the assembly version outputted non-multiplied
'state' for the next execution to multiply to save instructions.
Since the initial state when initialized or seeking is always 0,
and since C and asm versions were never mixed, there was no issue.

However, comparing outputs directly in checkasm doesn't work without
dividing the initial state by CELT_EMPH_COEFF and multiplying the
returned state by CELT_EMPH_COEFF for the assembly function.

Since its actually faster to do this in C as well, copy the behavior the
asm versions use. As a reminder, the initial state 0 is divided by
CELT_EMPH_COEFF on seek and init (just in case in the future this is
changed, its technically more correct to init with CELT_EMPH_COEFF than 0,
however when seeking this will result in more audiable pops, unlike with 0
where the output gets in sync over a few samples).

5 months agoavcodec/v4l2_buffers: split out v4l2_buf_increase_ref helper
Lukas Rusak [Wed, 28 Aug 2019 21:56:47 +0000 (14:56 -0700)]
avcodec/v4l2_buffers: split out v4l2_buf_increase_ref helper

Signed-off-by: Aman Gupta <aman@tmm1.net>
5 months agoavcodec/v4l2_buffers: split out V4L2Buffer generation into helper method
Aman Gupta [Tue, 27 Aug 2019 01:53:05 +0000 (18:53 -0700)]
avcodec/v4l2_buffers: split out V4L2Buffer generation into helper method

Signed-off-by: Aman Gupta <aman@tmm1.net>
5 months agoavcodec/v4l2_buffers: split out AVFrame generation into helper method
Aman Gupta [Tue, 27 Aug 2019 00:59:00 +0000 (17:59 -0700)]
avcodec/v4l2_buffers: split out AVFrame generation into helper method

Signed-off-by: Aman Gupta <aman@tmm1.net>
5 months agoavcodec/v4l2_buffers: teach ff_v4l2_buffer_avframe_to_buf about contiguous planar...
Aman Gupta [Thu, 22 Aug 2019 20:57:27 +0000 (13:57 -0700)]
avcodec/v4l2_buffers: teach ff_v4l2_buffer_avframe_to_buf about contiguous planar formats

This fixes h264_v4l2m2m encoding on the Raspberry Pi

Signed-off-by: Aman Gupta <aman@tmm1.net>
5 months agoavcodec/v4l2_m2m_enc: fix indentation and add M2MENC_CLASS macro
Aman Gupta [Tue, 27 Aug 2019 18:59:50 +0000 (11:59 -0700)]
avcodec/v4l2_m2m_enc: fix indentation and add M2MENC_CLASS macro

Signed-off-by: Aman Gupta <aman@tmm1.net>
5 months agoavcodec/v4l2_m2m_dec: fix indentation and add M2MDEC_CLASS macro
Lukas Rusak [Wed, 25 Apr 2018 05:48:23 +0000 (22:48 -0700)]
avcodec/v4l2_m2m_dec: fix indentation and add M2MDEC_CLASS macro

This just makes the M2MDEC_CLASS similar to how it is done in rkmpp. It looks
clean and has proper indentation

Signed-off-by: Aman Gupta <aman@tmm1.net>
5 months agoavcodec/v4l2_m2m: decouple v4l2_m2m helpers from AVCodecContext
Aman Gupta [Fri, 23 Aug 2019 19:56:33 +0000 (12:56 -0700)]
avcodec/v4l2_m2m: decouple v4l2_m2m helpers from AVCodecContext

This will allow re-use of the m2m backend with AVFilterContext

Signed-off-by: Aman Gupta <aman@tmm1.net>
5 months agoavcodec/v4l2_buffers: Add handling for NV21 and YUV420P
Dave Stevenson [Thu, 22 Mar 2018 16:01:35 +0000 (16:01 +0000)]
avcodec/v4l2_buffers: Add handling for NV21 and YUV420P

The single planar support was for NV12 only.
Add NV21 and YUV420P support.

Signed-off-by: Aman Gupta <aman@tmm1.net>
5 months agoavcodec/v4l2_m2m: fix av_pix_fmt changing when multiple /dev/video* devices are probed
Aman Gupta [Wed, 28 Aug 2019 00:21:36 +0000 (17:21 -0700)]
avcodec/v4l2_m2m: fix av_pix_fmt changing when multiple /dev/video* devices are probed

On the RPI, three different /dev/video devices exist (decoder, scaler, encoder).

When probing the devices in order, the originally requested pix fmt
would be mutated causing the wrong one to be chosen when a matching
device was finally found.

Signed-off-by: Aman Gupta <aman@tmm1.net>
5 months agoavcodec/v4l2_m2m: disable info logging during device probe
Aman Gupta [Thu, 22 Aug 2019 18:33:24 +0000 (11:33 -0700)]
avcodec/v4l2_m2m: disable info logging during device probe

Signed-off-by: Aman Gupta <aman@tmm1.net>
5 months agoavcodec/v4l2_m2m_enc: add support for -force_key_frames
Aman Gupta [Thu, 22 Aug 2019 22:04:48 +0000 (15:04 -0700)]
avcodec/v4l2_m2m_enc: add support for -force_key_frames

Signed-off-by: Aman Gupta <aman@tmm1.net>
5 months agoavfilter/vf_v360: remove w/h changing for flat output
Paul B Mahol [Tue, 10 Sep 2019 22:33:33 +0000 (00:33 +0200)]
avfilter/vf_v360: remove w/h changing for flat output

Fixes crashes with bigger h/v fov.

5 months agoavfilter/vf_v360: increase h_fov max limit
Paul B Mahol [Tue, 10 Sep 2019 22:32:43 +0000 (00:32 +0200)]
avfilter/vf_v360: increase h_fov max limit

5 months agoavfilter/vf_v360: fix fov calculation for stereographic output
Paul B Mahol [Tue, 10 Sep 2019 21:34:53 +0000 (23:34 +0200)]
avfilter/vf_v360: fix fov calculation for stereographic output

5 months agoavcodec/mediacodec_surface: define and use FFANativeWindow to mimic NDK interface
Aman Gupta [Thu, 5 Sep 2019 19:49:00 +0000 (12:49 -0700)]
avcodec/mediacodec_surface: define and use FFANativeWindow to mimic NDK interface

This will make it easy to switch to ANativeWindow_fromSurface
and ANativeWindow_release in the future.

Signed-off-by: Aman Gupta <aman@tmm1.net>
5 months agoavcodec/mediacodecdec: warn when input buffers are not configured with proper size
Aman Gupta [Thu, 5 Sep 2019 18:04:09 +0000 (11:04 -0700)]
avcodec/mediacodecdec: warn when input buffers are not configured with proper size

In rare circumstances, if the codec is not configured with the
proper parameters the input buffers can be allocated with a size
that's too small to hold an individual packet. Since MediaCodec
expects exactly one incoming buffer with a given PTS, it is not
valid to split data for a given PTS across two input buffers.

See https://developer.android.com/reference/android/media/MediaCodec#data-processing:

  > Do not submit multiple input buffers with the same timestamp

Signed-off-by: Aman Gupta <aman@tmm1.net>
5 months agodoc/filters: extend flip options in v360 filter
Paul B Mahol [Tue, 10 Sep 2019 18:29:43 +0000 (20:29 +0200)]
doc/filters: extend flip options in v360 filter

5 months agoavfilter/vf_v360: increase v_fov max limit
Paul B Mahol [Tue, 10 Sep 2019 18:18:10 +0000 (20:18 +0200)]
avfilter/vf_v360: increase v_fov max limit

5 months agoavfilter/vf_v360: add support for stereographic as input projection
Paul B Mahol [Tue, 10 Sep 2019 16:56:03 +0000 (18:56 +0200)]
avfilter/vf_v360: add support for stereographic as input projection

5 months agoavcodec/pnm_parser: Use memchr() in pnm_parse()
Michael Niedermayer [Mon, 9 Sep 2019 22:04:08 +0000 (00:04 +0200)]
avcodec/pnm_parser: Use memchr() in pnm_parse()

Fixes: Timeout (45sec -> 0.5sec)
Fixes: 16942/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_PPM_fuzzer-5085393073995776

Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Reviewed-by: Paul B Mahol <onemda@gmail.com>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
5 months 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 months 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 months 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 months 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 months 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 months 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 months 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 months 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 months 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 months 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 months 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 months 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 months 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 months 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 months 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 months 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 months 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 months 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 months 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 months 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 months 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 months agodoc/filters: update v360
Paul B Mahol [Sun, 8 Sep 2019 16:44:30 +0000 (18:44 +0200)]
doc/filters: update v360

5 months 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 months 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 months 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 months 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 months 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 months 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 months 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 months 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 months 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 months 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 months 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 months 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 months 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 months 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 months 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 months 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 months 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 months 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 months 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 months 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 months 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 months 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 months 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 months 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 months 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 months 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 months 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 months 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 months 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 months 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