Commit Graph

44758 Commits

Author SHA1 Message Date
Luca Barbato
c5c76370ae doc: Drop the legacy symlink to README
Windows does not like symlinks and README.md is pretty common nowadays.
2017-06-19 11:23:43 +02:00
Martin Storsjö
fd1ffa1f10 d3d11va: Link directly to dxgi.dll and d3d11.dll functions if LoadLibrary is unavailable
When targeting the UWP API subset, the LoadLibrary function is not
available (and the fallback, LoadPackagedLibrary, can't be used to
load system DLLs). In these cases, link directly to the functions
in the DLLs instead of trying to load them dynamically at runtime.

Signed-off-by: Martin Storsjö <martin@martin.st>
2017-06-18 23:45:03 +03:00
Mark Thompson
c2b0bea40f avconv_hw: Free device on initialisation failure 2017-06-18 17:01:49 +01:00
Mark Thompson
a670eea560 vf_hwmap: Properly free a locally derived device 2017-06-18 17:01:31 +01:00
Mark Thompson
5635c80bf5 vf_hwmap: Add missing error code 2017-06-18 15:31:17 +01:00
Diego Biurrun
d9da7151ee configure: Fix handling of _select dependencies
The handling of _select dependencies had two issues:

1) extralibs from _select dependencies of a component were not added to
   the list of extralibs for that component.
2) extralibs from dependencies were only added to the extralibs of a
   component if the component was enabled. This led to incorrect results
   if that component was enabled by another component later in the dependency
   resolution process. Instead, always generate the full list of component
   extralibs for use later in the dependency resolution process.

Also remove a leftover unused variable.
2017-06-17 19:12:27 +02:00
Diego Biurrun
7b1f9873be build: Adjust dependencies for faan(i)dct components 2017-06-17 19:12:27 +02:00
Diego Biurrun
635897ac78 configure: Factorize qsv dependencies 2017-06-17 19:12:27 +02:00
Diego Biurrun
c599c43fa1 configure: Add missing arch dependencies for arch extensions 2017-06-17 19:12:27 +02:00
Diego Biurrun
9d12dd6fa8 configure: Add x86 dependency for mmx_internal
This ensures that mmx_internal is only ever enabled on x86.
2017-06-17 19:12:26 +02:00
Diego Biurrun
2f792cb670 build: Add missing idctdsp dependency for clearvideo 2017-06-17 19:12:26 +02:00
Diego Biurrun
de099641d5 build: Add missing mpeg4audio dependency for RTP muxer 2017-06-17 19:12:26 +02:00
Mark Thompson
4993a68f0f hwcontext: Mark local table static const 2017-06-15 00:02:06 +01:00
Michael Niedermayer
f61265571d libfdk-aacdec: Correct buffer_size parameter
The timeDataSize argument to aacDecoder_DecodeFrame() seems undocumented
and until 2016 04 (203e3f28fbebec7011342017fafc2a0bda0ce530) unused.
After that commit libfdk-aacdec interprets it as size in sample units
and memsets that on error.

FFmpeg as well as others (like GStreamer) did interpret it as size in
bytes.

Fixes: 1442/clusterfuzz-testcase-minimized-4540199973421056 (This requires recent libfdk to reproduce)

Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Signed-off-by: Martin Storsjö <martin@martin.st>
2017-06-13 22:08:44 +03:00
Diego Biurrun
04f691cd4f mmal: Add missing .item_name to AVClass declaration 2017-06-13 13:30:34 +02:00
Diego Biurrun
e2edf1529c configure: Simplify AltiVec/VSX check with a helper function 2017-06-13 12:34:35 +02:00
Diego Biurrun
d76479c502 ppc: Drop support for Apple GCC
Apple GCC has not been a thing anymore on PowerPC since many years.
2017-06-13 12:34:35 +02:00
Diego Biurrun
97cfe1d8bd Convert all AVClass struct declarations to designated initializers. 2017-06-12 11:01:10 +02:00
Srinath K R
98ea98069b nvenc: Add default value for AVCodecContext::refs
AVCodecContext::refs is used to control the DPB size to be used by the
encoder. The default value for AVCodecContext::refs as set in
libavcodec/options_table.h is 1.

This patch sets AVCodecContext::refs to 0 for h264_nvenc and hevc_nvenc in
order to let the driver take the decision of the correct DPB size to use in
all cases.

Signed-off-by: Srinath K R <skr@nvidia.com>
Signed-off-by: Luca Barbato <lu_zero@gentoo.org>
2017-06-10 17:30:32 +02:00
wm4
f9e7a2f95a dxva: add support for new dxva2 and d3d11 hwaccel APIs
This also adds support to avconv (which is trivial due to the new
hwaccel API being generic enough).

The new decoder setup code in dxva2.c is significantly based on work by
Steve Lhomme <robux4@gmail.com>, but with heavy changes/rewrites.

Signed-off-by: Diego Biurrun <diego@biurrun.de>
2017-06-08 21:20:18 +02:00
wm4
831cfe10b4 dxva: move d3d11 locking/unlocking to functions
I want to make it non-mandatory to set a mutex in the D3D11 device
context, and replacing it with user callbacks seems like the best
solution. This is preparation for it. Also makes the code slightly more
readable.

Signed-off-by: Diego Biurrun <diego@biurrun.de>
2017-06-08 20:55:57 +02:00
wm4
4dec101acc dxva: preparations for new hwaccel API
The actual hwaccel code will need to access an internal context instead
of avctx->hwaccel_context, so add a new DXVA_CONTEXT() macro, that will
dispatch between the "old" external and the new internal context.

Also, the new API requires a new D3D11 pixfmt, so all places which check
for the pixfmt need to be adjusted. Introduce a ff_dxva2_is_d3d11()
function, which does the check.

Signed-off-by: Diego Biurrun <diego@biurrun.de>
2017-06-08 20:55:52 +02:00
wm4
bd747b9226 lavc: set avctx->hwaccel before init
So a hwaccel can access avctx->hwaccel in init for whatever reason. This
is for the new d3d hwaccel API. We could create separate entrypoints for
each of the 3 hwaccel types (dxva2, d3d11va, new d3d11va), but this
seems nicer.

Signed-off-by: Diego Biurrun <diego@biurrun.de>
2017-06-08 20:55:45 +02:00
wm4
fff90422d1 lavu: add new D3D11 pixfmt and hwcontext
To be used with the new d3d11 hwaccel decode API.

With the new hwaccel API, we don't want surfaces to depend on the
decoder (other than the required dimension and format). The old D3D11VA
pixfmt uses ID3D11VideoDecoderOutputView pointers, which include the
decoder configuration, and thus is incompatible with the new hwaccel
API. This patch introduces AV_PIX_FMT_D3D11, which uses ID3D11Texture2D
and an index. It's simpler and compatible with the new hwaccel API.

The introduced hwcontext supports only the new pixfmt.

Frame upload code untested.

Significantly based on work by Steve Lhomme <robux4@gmail.com>, but with
heavy changes/rewrites.

Signed-off-by: Diego Biurrun <diego@biurrun.de>
2017-06-08 20:55:36 +02:00
Diego Biurrun
ed434be106 configure: Bail out if both GnuTLS and OpenSSL are enabled
Both libraries provide similar functionality and cannot be used together.
When both are enabled one is used and the other ignored arbitrarily. Error
out instead and have the user choose which library to use.
2017-06-06 14:47:42 +02:00
Diego Biurrun
adfd7892e3 configure: Move x86 assembler sanity check into assembler probe function
This allows for more graceful fallback from NASM to Yasm if the available
NASM version is too old.
2017-06-03 19:34:08 +02:00
Diego Biurrun
5e27ef800b build: Add missing zlib dependencies for several protocols 2017-06-03 19:34:08 +02:00
Diego Biurrun
908f737d6c cmdutils: Mark conditionally used variable as av_unused
avtools/cmdutils.c🔢28: warning: unused variable ‘pix_fmt’ [-Wunused-variable]
2017-06-03 19:34:08 +02:00
Diego Biurrun
f960fd2fb1 build: Skip generating .version files when reconfiguring
The .version files are only relevant during an actual build.
2017-06-03 19:34:08 +02:00
James Almer
a876958d0f avutil/md5: fix misaligned reads
This makes ubsan happy and also considerably increases performance on
big endian systems.

Tested on an IBM POWER7 3.55 GHz

Before:

2.24user 0.14system 0:02.39elapsed 99%CPU (0avgtext+0avgdata 2624maxresident)k
2.26user 0.11system 0:02.38elapsed 99%CPU (0avgtext+0avgdata 2688maxresident)k
2.23user 0.15system 0:02.38elapsed 99%CPU (0avgtext+0avgdata 2624maxresident)k
2.25user 0.12system 0:02.38elapsed 100%CPU (0avgtext+0avgdata 2624maxresident)k
2.20user 0.15system 0:02.36elapsed 99%CPU (0avgtext+0avgdata 2624maxresident)k

After:

1.86user 0.13system 0:02.00elapsed 99%CPU (0avgtext+0avgdata 2624maxresident)k
1.89user 0.11system 0:02.01elapsed 99%CPU (0avgtext+0avgdata 2624maxresident)k
1.85user 0.14system 0:02.00elapsed 99%CPU (0avgtext+0avgdata 2624maxresident)k
1.84user 0.15system 0:01.99elapsed 99%CPU (0avgtext+0avgdata 2624maxresident)k
1.89user 0.13system 0:02.02elapsed 99%CPU (0avgtext+0avgdata 2688maxresident)k

Tested-by: Nicolas George <george@nsup.org>
Reviewed-by: Michael Niedermayer <michael@niedermayer.cc>
Signed-off-by: James Almer <jamrial@gmail.com>
Signed-off-by: Sean McGovern <gseanmcg@gmail.com>
2017-06-02 21:00:35 -04:00
Diego Biurrun
61cec5adaa tls: Hide backend implementation details from users
TLS is currently implemented over either OpenSSL or GnuTLS, with more
backends likely to appear in the future. Currently, those backend libraries
are part of the protocol names used during e.g. the configure stage of a
build. Hide those details behind a generically-named declaration for the
TLS protocol to avoid leaking those details into the configuration stage.
2017-06-02 10:41:52 +02:00
Diego Biurrun
5edded9df3 smacker: Improve error handling
Return sensible error values and forward error codes.
2017-06-01 14:22:01 +02:00
Michael Niedermayer
b98f082d8d smacker: Check that the data size is a multiple of a sample vector
Fixes out of array access
Fixes: ce19e41f0ef1e52a23edc488faecdb58/asan_heap-oob_2504e97_4202_ffa0df1baed14022b9bfd4f8ac23d0cb.smk

Bug-Id: CVE-2015-8365
CC: libav-stable@libav.org

Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
(cherry picked from commit 4a9af07a49)
Signed-off-by: Diego Biurrun <diego@biurrun.de>
2017-06-01 14:22:01 +02:00
Martin Storsjö
2ca759657b os_support: Remove the dynamic loading of getaddrinfo from the fallback getaddrinfo
If we for some unexplicable reason didn't pick up getaddrinfo
at configure, the default, IPv4-only, fallback should be good enough.

This effectively reverts 6023d84a2b.

Signed-off-by: Martin Storsjö <martin@martin.st>
2017-06-01 13:29:55 +03:00
Martin Storsjö
4d444d04c1 configure: Default to _WIN32_WINNT=0x0502 (XP) as minimum, for legacy mingw
This makes the getaddrinfo functions visible, which aren't normally
by default on legacy mingw.

We already force __MSVCRT_VERSION__ to an XP version.

Signed-off-by: Martin Storsjö <martin@martin.st>
2017-06-01 13:29:51 +03:00
Luca Barbato
16cb06bb30 hlsenc: Support recovery from an already present playlist
Parse the playlist to recover the start sequence and previously
generated segments and continue muxing from there.

Mainly useful for near-seamless recovery in live scenarios.
2017-05-31 14:22:52 +02:00
Luca Barbato
91622f6446 avconv: Always initialize the opkt struct on streamcopy 2017-05-31 12:51:55 +02:00
Martin Storsjö
427f7a1f9e configure: Fix the msvcrt version check for mingw32
This was actually broken when committed in 46e3936fb04; the
test never succeeded, and thus, _aligned_malloc wasn't actually
used on legacy mingw.

Signed-off-by: Martin Storsjö <martin@martin.st>
2017-05-31 13:30:24 +03:00
Elviss Strazdins
2017ffc18f vaapi: Add ABGR map only if VA_FOURCC_ABGR is defined
Signed-off-by: Luca Barbato <lu_zero@gentoo.org>
2017-05-29 13:50:03 +02:00
Luca Barbato
6a7e928555 configure: Do not check for the __builtin_vec_vsx_ld
Clang support for Altivec/VSX uses a different approach.
2017-05-29 13:40:47 +02:00
Aaron Levinson
3d040513a1 avutil/hwcontext_dxva2: Don't improperly free IDirect3DSurface9 objects
Add dxva2_pool_release_dummy() and use it in call to
av_buffer_create() in dxva2_pool_alloc().

Prior to this change, av_buffer_create() was called with NULL for the
third argument, which indicates that av_buffer_default_free() should
be used to free the buffer's data.  Eventually, it gets to
buffer_pool_free() and calls buf->free() on a surface object (which is
av_buffer_default_free()).

This can result in a crash when the debug version of the C-runtime is
used on Windows.  While it doesn't appear to result in a crash when
the release version of the C-runtime is used on Windows, it likely
results in memory corruption, since av_free() is being called on
memory that was allocated using
IDirectXVideoAccelerationService::CreateSurface().

Signed-off-by: Aaron Levinson <alevinsn@aracnet.com>
Reviewed-by: wm4 <nfxjfg@googlemail.com>
Reviewed-by: Steven Liu <lingjiujianke@gmail.com>
Reviewed-by: Mark Thompson <sw@jkqxz.net>
Signed-off-by: Anton Khirnov <anton@khirnov.net>
2017-05-20 09:41:45 +02:00
Anton Khirnov
8652a2c248 decode: fix the code reducing cropping to preserve alignment
Currently it does not work at all.

Bug-Id: 1058
2017-05-20 09:41:30 +02:00
Anton Khirnov
c3f0357bdf hevcdec: move the MD5 context out of HEVCSEIPictureHash back into HEVCContext
HEVCSEIPictureHash should store only the information extracted from the
bitstream and exported to the higher layer (the decoder or the parser).
The MD5 context is allocated, used and freed by this higher layer, so it
makes more sense for it to also be stored there.
2017-05-20 09:41:30 +02:00
James Almer
d7dcd825de extract_extradata_bsf: make sure all needed parameter set NALUs were found
This mimics the behavior of the now unused h264/hevc parser's split()
function and fixes decoding some files when extract_extradata bsf is
enabled.

Signed-off-by: James Almer <jamrial@gmail.com>
Signed-off-by: Anton Khirnov <anton@khirnov.net>
2017-05-20 09:41:30 +02:00
Anton Khirnov
3fb6b98b5e vp9_superframe_bsf: cache input packets directly
Avoids unnecessary allocs+copies and makes the code slightly simpler.
2017-05-20 09:41:30 +02:00
Anton Khirnov
126bc2c33b vp9_superframe_bsf: convert to the new bitstream reader 2017-05-20 09:41:30 +02:00
Mark Thompson
3daaa44173 hevc: Add names for reserved NAL unit types
While not yet used, these NAL units do already have some defined
semantics and are referred to elsewhere.
2017-05-16 22:23:14 +01:00
Mark Thompson
6ea220cbee h264_sei: Add namespace prefix to all SEI values
This avoids confusion with equivalent H.265 SEI values when both are
being used at the same time.
2017-05-16 22:23:14 +01:00
Mark Thompson
4d56f7ab8f avconv: Flush output BSFs when stream copy reaches EOF
Same as f64d1100a5, for stream copy
rather than encode.
2017-05-16 22:23:14 +01:00
Mark Thompson
66aa9b94da doc: Document hwupload, hwdownload and hwmap filters 2017-05-16 22:23:09 +01:00