Commit Graph

2172 Commits

Author SHA1 Message Date
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
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
Martin Storsjö
59cee42d7d arm: Check for the .arch directive in configure
When targeting windows, the .arch directive isn't available.

So far, when building for windows, we've always used gas-preprocessor,
both when using msvc's armasm and when using clang. Lately, clang/llvm
has implemented the last missing piece (altmacro support) for building
our assembly without gas-preprocessor. This means that we now build
for arm/windows with clang without any extra compatibility layer.

Signed-off-by: Martin Storsjö <martin@martin.st>
2017-05-08 14:21:08 +03:00
Mark Thompson
c5714b51aa hwcontext: Improve allocation in derived contexts
Use the flags argument of av_hwframe_ctx_create_derived() to pass the
mapping flags which will be used on allocation.  Also, set the format
and hardware context on the allocated frame automatically - the user
should not be required to do this themselves.
2017-04-30 17:33:18 +01:00
Mark Thompson
e1c5d56b18 hwcontext_qsv: Implement mapping frames to the child device type 2017-04-30 17:33:18 +01:00
Mark Thompson
eaa5e07104 hwcontext_qsv: Implement mapping frames from the child device type
Factorises out existing surface initialisation code to reuse.
2017-04-30 17:33:06 +01:00
Mark Thompson
27978155bc hwcontext: Add frame context mapping for nontrivial contexts
Some frames contexts are not usable without additional format-specific
state in hwctx.  This change adds new functions frames_derive_from and
frames_derive_to to initialise this state appropriately when deriving
a frames context which will require it to be set.
2017-04-30 16:13:56 +01:00
Mark Thompson
aa51bb3d27 hwcontext_qsv: Support derivation from child devices 2017-04-30 16:13:56 +01:00
James Almer
ad52eef997 spherical: add functions to retrieve and request projection names
Signed-off-by: James Almer <jamrial@gmail.com>
Signed-off-by: Vittorio Giovara <vittorio.giovara@gmail.com>
2017-04-27 09:59:54 -04:00
Anton Khirnov
04b0f0e371 mem: uninline av_malloc(z)_array()
Inlining public functions hardcodes their implementation into the ABI,
so it should be avoided unless there is a very good reason for it. No
such reason exists in this case.
2017-04-26 09:05:28 +02:00
Paul B Mahol
030c8be7a2 pixfmt: Add gbrap10 pixel format
Signed-off-by: Paul B Mahol <onemda@gmail.com>
Signed-off-by: Luca Barbato <lu_zero@gentoo.org>
2017-04-13 14:09:07 +02:00
Diego Biurrun
193b091890 thread: Define ff_mutex_* macros as stub functions when threads are disabled
Silences a bunch of "statement with no effect" warnings with threads disabled.
2017-04-12 10:07:09 +02:00
Martin Storsjö
10f4511f14 libavutil: Make LOCAL_ALIGNED(xx be equal to LOCAL_ALIGNED_xx(
Previously, the former form always produced a manually aligned,
padded buffer, while the latter can use DECLARE_ALIGNED, if that
amount of stack alignment is supported.

libavutil/internal.h needs to include mem.h, since it uses
the DECLARE_ALIGNED macro.

Signed-off-by: Martin Storsjö <martin@martin.st>
2017-03-31 22:06:52 +03:00
Mark Thompson
1bd986ed4b hwcontext: Move NONE to the be the first member of AVHWDeviceType
Also use that to fix a warning in av_hwdevice_get_type_name().
2017-03-27 21:54:06 +01:00
Vittorio Giovara
5f90ad99bb spherical: Change types of bounding and pad to uint32_t
These values are defined to be 32bit in the specification,
so it makes more sense to store them as fixed width.

Based on a patch by Micahel Niedermayer <michael@niedermayer.cc>.

Signed-off-by: Vittorio Giovara <vittorio.giovara@gmail.com>
2017-03-23 10:09:18 +01:00
Vittorio Giovara
35cf146a33 lavu: Drop deprecated av_dlog macro
Deprecated in 05/2015.
2017-03-23 10:09:17 +01:00
Vittorio Giovara
619a433eca lavu: Drop deprecated option type
Deprecated in 02/2014.
2017-03-23 10:09:17 +01:00
Vittorio Giovara
dd343fd986 lavu: Drop deprecated VDPAU pixel formats
Deprecated in 07/2013.
2017-03-23 10:09:17 +01:00
Vittorio Giovara
0648dec19d lavc: Drop deprecated stream codec tag
Deprecated in 07/2015.
2017-03-23 10:09:17 +01:00
Diego Biurrun
dcc39ee10e lavc: Remove deprecated XvMC support hacks
Deprecated in 11/2013.
2017-03-23 10:09:14 +01:00
Vittorio Giovara
07a2b15594 Bump major versions of all libraries
This disables everything that was deprecated at least 18 months ago.

Readjust the minimum API version as needed, postponing any
API-incompatible changes until the next bump.

Signed-off-by: Vittorio Giovara <vittorio.giovara@gmail.com>
2017-03-23 09:56:20 +01:00
Martin Storsjö
8e2346154e libavutil: Hook up the rest of the gcc specific attributes to clang as well
Hook up all attributes that don't have a MSVC specific version at the
moment.

See f637046d31 for details.

These don't seem to be critical for building with clang in MSVC mode
though, and thus haven't been hooked up until now.

These seem to build fine with as old clang as 3.3 at least.
(clang 3.3 disguises itself as gcc 4.2 normally, so all of these
have been used for clang before, except for av_cold.)

The clang version numbers themselves are useless for detecting what
attributes are available, since Apple's clang builds use a completely
different versioning (presenting itself as e.g. clang 8.0 instead
of 3.8).

Signed-off-by: Martin Storsjö <martin@martin.st>
2017-03-22 14:25:45 +02:00
Martin Storsjö
3aa9c523e9 libavutil: Define the noreturn attribute for clang in MSVC mode as well
This is a follow-up to f637046d31.

Without the noreturn attribute set, avconv_opt.c fails to build after
d2e6dd32a4 with the error "control may reach end of non-void function".
By making sure the noreturn attribute is set properly, this compiles
as intended.

Signed-off-by: Martin Storsjö <martin@martin.st>
2017-03-21 22:57:21 +01:00
Mark Thompson
b7487f4f3c hwcontext: Make it easier to work with device types
Adds functions to convert to/from strings and a function to iterate
over all supported device types.  Also adds a new invalid type
AV_HWDEVICE_TYPE_NONE, which acts as a sentinel value.
2017-03-20 23:15:43 +00:00
Mark Thompson
b266ad56fe hwcontext: Add device derivation
Creates a new device context from another of a different type which
refers to the same underlying hardware.
2017-03-20 23:15:43 +00:00
Diego Biurrun
994c4bc107 x86util: Port all macros to cpuflags
Also do some small cosmetic changes: Drop pointless _MMX suffix from ABSD2
macro name, drop pointless check for MMX support, we always assume MMX is
available in our SIMD code, fix spelling.
2017-03-14 17:23:32 +01:00
Vittorio Giovara
6bce6aa17d spherical: Add tiled equirectangular type and projection-specific properties
Signed-off-by: Vittorio Giovara <vittorio.giovara@gmail.com>
2017-03-07 11:07:02 -05:00
James Almer
19d57ca62e libavutil: add av_mod_uintp2
Signed-off-by: James Almer <jamrial@gmail.com>
2017-03-01 11:23:19 -05:00
Ganesh Ajjanagadde
7bfda7d157 intmath: add faster clz support 2017-03-01 11:23:19 -05:00
Diego Biurrun
39e208f4d4 build: Generalize yasm/nasm-related variable names
None of them are specific to the YASM assembler.
2017-03-01 10:18:15 +01:00
Martin Storsjö
8847eeaa14 aarch64: Add parentheses around the offset parameter in movrel
This fixes building with clang for linux with PIC enabled.

Signed-off-by: Martin Storsjö <martin@martin.st>
2017-02-16 09:56:11 +02:00
Mark Thompson
e791b915c7 hwcontext_vaapi: Try to support the VDPAU wrapper
The driver is somewhat bitrotten (not updated for years) but is still
usable for decoding with this change.  To support it, this adds a new
driver quirk to indicate no support at all for surface attributes.

Based on a patch by wm4 <nfxjfg@googlemail.com>.
2017-02-13 21:44:47 +00:00
wm4
c2f97f0508 hwcontext_dxva2: support D3D9Ex
D3D9Ex uses different driver paths. This helps with "headless"
configurations when no user logs in. Plain D3D9 device creation will
fail if no user is logged in, while it works with D3D9Ex.

Signed-off-by: Anton Khirnov <anton@khirnov.net>
2017-02-11 11:37:45 +01:00
wm4
04f3bd3496 AVFrame: add an opaque_ref field
This is an extended version of the AVFrame.opaque field, which can be
used to attach arbitrary user information to an AVFrame.

The usefulness of the opaque field is rather limited, because it can
store only up to 32 bits of information (or 64 bit on 64 bit systems).
It's not possible to set this field to a memory allocation, because
there is no way to deallocate it correctly.

The opaque_ref field circumvents this by letting the user set an
AVBuffer, which makes the user data refcounted.

Signed-off-by: Anton Khirnov <anton@khirnov.net>
2017-02-11 11:37:45 +01:00
Anton Khirnov
4de220d2e3 frame: allow align=0 (meaning automatic) for av_frame_get_buffer()
This will avoid every caller from hardcoding some specific alignment,
which may break in the future with new instruction sets.
2017-02-11 11:37:45 +01:00
Anton Khirnov
e6bff23f1e cpu: add a function for querying maximum required data alignment 2017-02-11 11:37:45 +01:00
Vittorio Giovara
ce6d72d107 imgutils: Document av_image_get_buffer_size() 2017-02-10 16:25:58 -05:00
Diego Biurrun
7abdd026df asm: Consistently uppercase SECTION markers 2017-02-03 11:37:53 +01:00
wm4
3ad825793a hwcontext_cuda: implement frames_get_constraints
Copied and modified from hwcontext_qsv.c.

Signed-off-by: Anton Khirnov <anton@khirnov.net>
2017-02-01 10:43:00 +01:00
Anton Khirnov
fd9212f2ed Mark some arrays that never change as const. 2017-02-01 10:42:59 +01:00
Luca Barbato
562ef82d6a fifo: Return the correct AVERROR value 2017-01-26 10:25:20 +01:00
Diego Biurrun
b83aea7340 des-test: Pass the proper types to av_des_*() functions
Fixes a number of incompatible pointer type warnings.
2017-01-24 13:25:53 +01:00
Anton Khirnov
52627248e4 frame: add a cropping rectangle to AVFrame
Extend the width/height doxy to clarify that it should store coded
values.
2017-01-12 16:22:44 +01:00
Diego Biurrun
00b6a76543 hmac: Explicitly convert types at function pointer assignment
Fixes a number of warnings of the type
libavutil/hmac.c:61:21: warning: assignment from incompatible pointer type
2017-01-09 15:18:16 +01:00
Diego Biurrun
e435beb1ea crypto: consistently use size_t as type for length parameters
size_t is the correct type to use for sizes.
2017-01-09 15:17:43 +01:00
Henrik Gramner
3cba1ad76d x86inc: Avoid using eax/rax for storing the stack pointer
When allocating stack space with an alignment requirement that is larger
than the current stack alignment we need to store a copy of the original
stack pointer in order to be able to restore it later.

If we chose to use another register for this purpose we should not pick
eax/rax since it can be overwritten as a return value.

Signed-off-by: Anton Khirnov <anton@khirnov.net>
2017-01-09 13:21:12 +01:00
Diego Biurrun
92db508307 build: Generate pkg-config files from Make and not from configure
This moves work from the configure to the Make stage where it can
be parallelized and ensures that pkgconfig files are updated when
library versions change.

Bug-Id: 449
2016-12-22 12:30:54 +01:00
Diego Biurrun
05a603a94e ppc: Merge types_altivec.h into util_altivec.h
There is no point in keeping the two separate.
2016-12-14 14:08:43 +01:00
Wan-Teh Chang
2170017a1c avutil: fix data race in av_get_cpu_flags()
Make the one-time initialization in av_get_cpu_flags() thread-safe. The
static variables |flags|, |cpuflags_mask|, and |checked| in
libavutil/cpu.c are read and written using normal load and store
operations. These are considered as data races. The fix is to use atomic
load and store operations.

Remove the |checked| variable because the invalid value of -1 for
|flags| can be used to indicate the same condition. Rename |flags| to
|cpu_flags| and move it to file scope.

The fix can be verified by running the libavutil/tests/cpu_init.c test
program under ThreadSanitizer:
    ./configure --toolchain=clang-tsan
    make libavutil/tests/cpu_init
    libavutil/tests/cpu_init

There should be no warnings from ThreadSanitizer.

Co-author: Dmitry Vyukov of Google, who suggested the data race fix.

Signed-off-by: Wan-Teh Chang <wtc@google.com>
2016-12-08 15:53:58 -05:00
Diego Biurrun
f912fd767e Add missing #includes for standalone spherical-information-related headers 2016-12-08 20:12:23 +01:00