Commit Graph

90278 Commits

Author SHA1 Message Date
Marton Balint 8d37dd6ed3 avutil/parseutils: only accept full us duration, do not accept mss duration
Accepting 'u' suffix for a time specification is neither intuitive nor
consistent (now that we don't accept m). Also there was a bug in the code
accepting an extra 's' even after 'ms'.

Signed-off-by: Marton Balint <cus@passwd.hu>
2018-03-09 22:01:38 +01:00
Marton Balint cf5ffe0183 avformat/mxfdec: do not allow more partitions than INT_MAX/2
Some math (e.g: partition binary search) overflows if we have that many
parititions.

Signed-off-by: Marton Balint <cus@passwd.hu>
2018-03-09 20:37:49 +01:00
Marton Balint 90756e67a0 avformat/mxfdec: use binary search in mxf_absolute_bodysid_offset
Signed-off-by: Marton Balint <cus@passwd.hu>
2018-03-09 20:37:49 +01:00
Marton Balint 3aaf97e773 avformat/mxfdec: fix opAtom audio demuxing
Consider edit rate when determining edit_units_per_packet and also make sure
that checks are done in edit rate time base and not in stream time base.

Fixes some errors reported with the sample in ticket #5863.

Signed-off-by: Marton Balint <cus@passwd.hu>
2018-03-09 20:37:49 +01:00
James Almer d168e78eff avcodec/extract_extradata: zero initalize the padding bytes in all allocated buffers
Reviewed-by: Derek Buitenhuis <derek.buitenhuis@gmail.com>
Signed-off-by: James Almer <jamrial@gmail.com>
2018-03-09 13:00:58 -03:00
James Almer c4cee26129 avformat/mov: print the projection type when reporting it as unsupported
Reviewed-by: Derek Buitenhuis <derek.buitenhuis@gmail.com>
Signed-off-by: James Almer <jamrial@gmail.com>
2018-03-09 12:17:53 -03:00
Xiaohan Wang 3386be16d5 ffmpeg: Fix stts_data memory allocation
In this loop, |i| is the "index". And the memory allocated should be at
least the current "count", which is |i + 1|.

BUG=801821

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2018-03-09 02:39:21 +01:00
Jérôme Martinez 00035a6b4a avcodec/ffv1enc: remove warning about transparency
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2018-03-09 02:39:21 +01:00
Rodger Combs 63d875772d lavc/videotoolbox: fix threaded decoding
AVHWAccel.end_frame can run on a worker thread. The assumption of the
frame threading code is that the worker thread will change the AVFrame
image data, not the AVFrame fields. So the AVFrame fields are not synced
back to the main thread. But this breaks videotoolbox due to its special
requirements (everything else is fine). It actually wants to update
AVFrame fields.

The actual videotoolbox frame is now stored in the dummy AVBufferRef, so
it mimics what happens in non-videotoolbox cases. (Changing the
AVBufferRef contents is a bit like changing the image data.) The
post_process callback copies that reference to the proper AVFrame field.

Based on a patch by wm4.

Signed-off-by: Aman Gupta <aman@tmm1.net>
2018-03-08 14:04:25 -08:00
Carl Eugen Hoyos 9fe61b6107 lavfi/drawutils: Do not claim to support P016.
Fixes fate on big-endian.
2018-03-08 11:56:41 +01:00
Calvin Walton 2b2c8b22da libavfilter/vf_fps: Minor cleanups
Since the config_props function now references both the input and output
links, rename the 'link' variable to 'outlink'.

Fix up some mismatching indentation.

Don't bother setting the width and height on the outlink; the filter
framework does that for us.
2018-03-08 11:23:34 +01:00
Calvin Walton e4edc567a0 libavfilter/vf_fps: Rewrite using activate callback
The old version of the filter had a problem where it would queue up
all of the duplicate frames required to fill a timestamp gap in a
single call to filter_frame. In problematic files - I've hit this in
webcam streams with large gaps due to network issues - this will queue
up a potentially huge number of frames. (I've seen it trigger the Linux
OOM-killer on particularly large pts gaps.)

This revised version of the filter using the activate callback will
generate at most 1 frame each time it is called.
2018-03-08 11:23:34 +01:00
Paul B Mahol 2f147588f7 avfilter/vf_vaguedenoiser: fix plane copy for >8 bit depth formats
Fixes #7072.

Signed-off-by: Paul B Mahol <onemda@gmail.com>
2018-03-08 11:04:57 +01:00
Yingming Fan 80798e3857 checkasm/hevc_sao : add hevc_sao for checkasm
Signed-off-by: James Almer <jamrial@gmail.com>
2018-03-07 23:53:32 -03:00
Haihao Xiang 00ae5c1d3d lavc/vaapi_encode: Don't return error if the underlying driver doesn't support B frames
The underlying driver need not support B frames - since they are enabled
by default for some codecs, it is better to disable them rather than
returning an error in this case.  This makes the default settings usable
for low-power encoding on Intel platforms.

Signed-off-by: Haihao Xiang <haihao.xiang@intel.com>
Signed-off-by: Mark Thompson <sw@jkqxz.net>
2018-03-08 00:30:23 +00:00
Aman Gupta 823a758543 avcodec/mediacodecdec: add more trace logging of input/output buffers
Signed-off-by: Aman Gupta <aman@tmm1.net>
Signed-off-by: Matthieu Bouron <matthieu.bouron@gmail.com>
2018-03-07 16:22:50 -08:00
Aman Gupta 2a0eb86857 avcodec/mediacodecdec: add delay_flush option
The default behavior of the mediacodec decoder before this commit
was to delay flushes until all pending hardware frames were
returned to the decoder. This was useful for certain types of
applications, but was unexpected behavior for others.

The new default behavior with this commit is now to execute
flushes immediately to invalidate all pending frames. The old
behavior can be enabled by setting delay_flush=1.

With the new behavior, video players implementing seek can simply
call flush on the decoder without having to worry about whether
they have one or more mediacodec frames still buffered in their
rendering pipeline. Previously, all these frames had to be
explictly freed (or rendered) before the seek/flush would execute.

The new behavior matches the behavior of all other lavc decoders,
reducing the amount of special casing required when using the
mediacodec decoder.

Signed-off-by: Aman Gupta <aman@tmm1.net>
Signed-off-by: Matthieu Bouron <matthieu.bouron@gmail.com>
2018-03-07 16:22:47 -08:00
Aurelien Jacobs 840f6eb77a Changelog: list the new SBC codec 2018-03-07 22:26:53 +01:00
Aurelien Jacobs f677718bc8 sbcenc: add armv6 and neon asm optimizations
This was originally based on libsbc, and was fully integrated into ffmpeg.
2018-03-07 22:26:53 +01:00
Aurelien Jacobs f1e490b1ad sbcenc: add MMX optimizations
This was originally based on libsbc, and was fully integrated into ffmpeg.

Rough speed test:
C version:    speed= 592x
MMX version:  speed= 785x
2018-03-07 22:26:53 +01:00
Aurelien Jacobs 88508a87a5 sbc: add raw muxer for SBC 2018-03-07 22:26:53 +01:00
Aurelien Jacobs ff4600d954 sbc: implement SBC encoder (low-complexity subband codec)
This was originally based on libsbc, and was fully integrated into ffmpeg.
2018-03-07 22:26:53 +01:00
Aurelien Jacobs 2e08de0815 sbc: add raw demuxer for SBC 2018-03-07 22:26:53 +01:00
Aurelien Jacobs 2505ebc632 sbc: add parser for SBC 2018-03-07 22:26:53 +01:00
Aurelien Jacobs 4439887198 sbc: implement SBC decoder (low-complexity subband codec)
This was originally based on libsbc, and was fully integrated into ffmpeg.
2018-03-07 22:26:53 +01:00
Aurelien Jacobs 0b4ad86959 crc: add AV_CRC_8_SBC as a 8 bits CRC with polynomial 0x1D 2018-03-07 22:26:53 +01:00
Paul B Mahol ea0963181a avfilter/af_alimiter: check if buffer_size is valid
Fixes #7050.

Signed-off-by: Paul B Mahol <onemda@gmail.com>
2018-03-07 21:37:01 +01:00
Michael Niedermayer 1b1362e408 avformat/utils: Fix integer overflow of fps_first/last_dts
Fixes: runtime error: signed integer overflow: 7738135736989908991 - -7898362169240453118 cannot be represented in type 'long'
Fixes: Chromium bug 796778
Reported-by: Matt Wolenetz <wolenetz@google.com>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2018-03-07 20:37:33 +01:00
Michael Niedermayer da069e9c68 avformat/oggdec: Fix metadata memleak on multiple headers
Fixes: Chromium bug 800123
Reported-by: Matt Wolenetz <wolenetz@google.com>
Reviewed-by: Matt Wolenetz <wolenetz@google.com>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2018-03-07 20:37:33 +01:00
Michael Niedermayer 3934aa495d libavformat/oggparsevorbis: Fix memleak on multiple headers
Fixes: Chromium bug 800123
Reported-by: Matt Wolenetz <wolenetz@google.com>
Reviewed-by: Matt Wolenetz <wolenetz@google.com>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2018-03-07 20:37:33 +01:00
Michael Niedermayer 367929bed9 avformat/mov: Fix integer overflow in mov_get_stsc_samples()
Fixes: runtime error: signed integer overflow: 5 * -2147483647 cannot be represented in type 'int'
Fixes: Chromium bug 817338
Reviewed-by: Matt Wolenetz <wolenetz@google.com>
Reported-by: Matt Wolenetz <wolenetz@google.com>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2018-03-07 20:37:33 +01:00
Michael Niedermayer c87bf5b6d0 avfilter/vf_*_vaapi: Add missing AV_OPT_FLAG_FILTERING_PARAM
Reviewed-by: Jun Zhao <mypopydev@gmail.com>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2018-03-07 20:37:33 +01:00
Michael Niedermayer 5735a390a6 avformat/internal: Document the freeing behavior of ff_alloc_extradata()
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2018-03-07 20:37:33 +01:00
Matt Wolenetz b59b599446 lavc/vorbisdec: Allow avcodec_open2 to call .close
If there is a decoder initialization failure detected in avcodec_open2
after .init is called, allow graceful decoder .close to prevent leaking
vorbis decoder allocations such as those from vorbis_parse_setup_*.

BUG=772699

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2018-03-07 20:37:33 +01:00
Aman Gupta 23c91abe4f avcodec/aacdec: log configuration change details
Signed-off-by: Aman Gupta <aman@tmm1.net>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2018-03-07 11:32:50 -08:00
Stefan _ 5ab0ecf283 avcodec/mediacodec_wrapper: fix false positives in swdec blacklist
'OMX.SEC.avc.dec' is a valid hardware decoder, while the decoders
we seek to blacklist all match 'OMX.SEC.*.sw.dec'.
2018-03-07 13:52:02 +01:00
James Almer a43e9cdd44 avformat/isom: don't free extradata before calling ff_get_extradata()
ff_get_extradata() frees any existing extradata before allocating now,
and using av_free() here leaves a dangling pointer that will result in
a double free.

Fixes a regression since 0ca33b1d4e.

Tested-by: Michael Niedermayer <michael@niedermayer.cc>
Signed-off-by: James Almer <jamrial@gmail.com>
2018-03-06 23:41:32 -03:00
Masaki Tanaka 8b0a9f79c8 mpegvideo_parser: fix indentation of an if statement 2018-03-07 02:11:10 +02:00
Stefan _ 7c39305a17 libavformat/tls_libtls: pass numeric hostnames to tls_connect_cbs()
Numeric hosts in certificates are not very common, but supported by LibreSSL.
Forward the IP address to make verification work in this case.

Fixes ticket #7029
2018-03-07 02:06:09 +02:00
Mark Thompson 56912555bc h264_metadata: Actually fail when sei_user_data option is invalid 2018-03-06 23:44:07 +00:00
James Almer 2aa42fac77 avformat/utils: simplify ff_alloc_extradata()
Cosmetic refactor

Reviewed-by: 74a2fa708af88d225ed708af758f236f869b1a57
Signed-off-by: James Almer <jamrial@gmail.com>
2018-03-06 19:13:46 -03:00
James Almer 0ca33b1d4e avformat/utils: free existing extradata before trying to allocate a new one
This prevents leaks in the rare cases the function is called when extradata
already exists.

Reviewed-by: Paul B Mahol <onemda@gmail.com>
Signed-off-by: James Almer <jamrial@gmail.com>
2018-03-06 19:13:12 -03:00
Aman Gupta b19e11a4dc MAINTAINERS: add myself to mediacodec
Signed-off-by: Matthieu Bouron <matthieu.bouron@gmail.com>
2018-03-06 13:54:35 -08:00
Aman Gupta c22e7b00e4 avcodec/mediacodec: reduce loglevel for per-frame logging
Signed-off-by: Aman Gupta <aman@tmm1.net>
Signed-off-by: Matthieu Bouron <matthieu.bouron@gmail.com>
2018-03-06 13:54:16 -08:00
Stefan _ 313b6057fb avcodec/mediacodec_wrapper: blacklist more software decoders
Additionally blacklist ffmpeg, Samsung and Qualcomm
software implementations offered through MediaCodec.

Signed-off-by: Aman Gupta <aman@tmm1.net>
Signed-off-by: Matthieu Bouron <matthieu.bouron@gmail.com>
2018-03-06 13:52:24 -08:00
Zhong Li 0645698ecc lavc/qsvenc: disable h264 look_ahead by default
Look_ahead can provide quality improvements, but would better disable it by default due to some reasons:
1. It is only available for some codecs (e.g. HEVC is not supported) on Intel
   Haswell and plus platforms. Thus means it will be failed on some platforms.
2. It significantly increases encoding latency and memory consumption.
3. It may overwrite some other options such as CBR and CAVLC.

Signed-off-by: Zhong Li <zhong.li@intel.com>
Signed-off-by: Mark Thompson <sw@jkqxz.net>
2018-03-06 00:23:16 +00:00
Mark Thompson 0cf9fa9924 Merge commit '2d6b3f3a9dce409ca51d70ef4b85c0593bb4b109'
* commit '2d6b3f3a9dce409ca51d70ef4b85c0593bb4b109':
  qsvenc: Provide a detailed error message if the parameters are invalid

Merged-by: Mark Thompson <sw@jkqxz.net>
2018-03-05 23:16:29 +00:00
Mark Thompson 9053b08859 Merge commit 'e2399e0c1aeb110456405d23e211066fab6cb041'
* commit 'e2399e0c1aeb110456405d23e211066fab6cb041':
  fate: Error out more gracefully on configure failure

This commit is a noop, the configure failure reporting issue does not
appear to affect FFmpeg.

Merged-by: Mark Thompson <sw@jkqxz.net>
2018-03-05 23:14:58 +00:00
Mark Thompson 706d2c66e8 Merge commit 'dc40e64adb1712b1209c018914a44f809bc32664'
* commit 'dc40e64adb1712b1209c018914a44f809bc32664':
  hvcc: zero initialize the nal buffers past the last written byte

This commit is a noop, see 9482ec1b20

Merged-by: Mark Thompson <sw@jkqxz.net>
2018-03-05 22:34:24 +00:00
Mark Thompson 085a2eb8e2 Merge commit '8ca39b855a7b0e4d9f726fa9d285bc8edcb953e6'
* commit '8ca39b855a7b0e4d9f726fa9d285bc8edcb953e6':
  qsv: Default PicStruct to progressive

Merged-by: Mark Thompson <sw@jkqxz.net>
2018-03-05 22:31:03 +00:00