Commit Graph

90484 Commits

Author SHA1 Message Date
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
Diego Biurrun
dd7e63af93 configure: Restore original endianness test
Previously the bit pattern for the endianness test was declared as a
global, instead of a local, variable. This ensures that the pattern
appears unchanged in the object file and is not optimized out.
2018-03-08 14:02:30 +01: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
Alexander Kravchenko
80a4e6a46f amf: Replace writer_id option with LIBAV_AMF_WRITER_ID constant
AMFTraceWriter is an abstraction to configure how AMF outputs its logs
for the current process and can be configured to output different levels
of trace output. If multiple LibavWriter objects are used in one process,
there will be duplication of output in av_log. Use a constant writer_id
to prevent this scenario.

Signed-off-by: Diego Biurrun <diego@biurrun.de>
2018-03-07 14:23:28 +01:00
Diego Biurrun
31a53ab34e configure: Add check_as() helper function to simplify some expressions 2018-03-07 13:55:07 +01:00
Diego Biurrun
18dc1ff0fb configure: Add check_ld() helper function to simplify some expressions 2018-03-07 13:55:07 +01:00
Diego Biurrun
9c37d765ef configure: Add check_cc/require_cc helper functions to simplify some expressions 2018-03-07 13:55:07 +01:00
Diego Biurrun
83fef16b6a configure: Add check_cpp_condition() helper function to simplify some expressions 2018-03-07 13:55:07 +01:00
Diego Biurrun
a5e011c8dc configure: Add check_cmd() helper function to simplify some expressions 2018-03-07 13:55:07 +01:00
Diego Biurrun
49804dc2ba configure: Use test_ prefix for helper functions that do not set variables 2018-03-07 13:55:06 +01:00
Diego Biurrun
8c893aa3cd configure: Drop unnecessary variables, shifts, and quotes in helper functions 2018-03-07 13:55:06 +01:00
Diego Biurrun
121314895f configure: Fix logic of AMF external library check
Fail if AMF is requested but unavailable, as we do for all
other external libraries that need to be explicitly enabled.
2018-03-07 13:53:27 +01: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
Andreas Unterweger
0711d14299 examples: Use new API for transcoding example
Signed-off-by: Diego Biurrun <diego@biurrun.de>
2018-03-07 12:36:13 +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