summaryrefslogtreecommitdiff
path: root/libavutil
Commit message (Collapse)AuthorAge
* hwcontext_dxva2: support D3D9Exwm42017-02-13
| | | | | | | | | | 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> Merges Libav commit c2f97f0508708.
* AVFrame: add an opaque_ref fieldwm42017-02-13
| | | | | | | | | | | | | | | | | 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> Merges Libav commit 04f3bd349651.
* Revert "avutil/hwcontext_vaapi: fix SEGV in vaTerminate when vaInitialize fails"Mark Thompson2017-02-05
| | | | | | | | | | | The original code is correctly following the API - vaTerminate() must be called to free the resources of a VADisplay after it is created by any of the vaGetDisplay*() calls; it is not necessary to have successfully called vaInitialize() on it. The segfaults which prompted this change must therefore be bugs in libva or the driver it loads. This reverts commit 3606602f1137552ea54f2c259eb140c1e3c026d4.
* avutil/hwcontext_vaapi: fix SEGV in vaTerminate when vaInitialize failsAman Gupta2017-02-02
| | | | | | | | | | | | | | Program terminated with signal SIGSEGV, Segmentation fault. #0 0x0000000000aff8a4 in vaTerminate () #1 0x0000000000ae50ce in vaapi_device_free (ctx=<optimized out>) at libavutil/hwcontext_vaapi.c:882 #2 0x0000000000ae1f9e in hwdevice_ctx_free (opaque=<optimized out>, data=<optimized out>) at libavutil/hwcontext.c:66 #3 0x0000000000ad856f in buffer_replace (src=0x0, dst=0x7fffa26ef1b8) at libavutil/buffer.c:119 #4 av_buffer_unref (buf=buf@entry=0x7fffa26ef1f8) at libavutil/buffer.c:129 #5 0x0000000000ae299f in av_hwdevice_ctx_create (pdevice_ref=0x170ac50 <hw_device_ctx>, type=type@entry=AV_HWDEVICE_TYPE_VAAPI, device=<optimized out>, opts=opts@entry=0x0, flags=flags@entry=0) at libavutil/hwcontext.c:494 #6 0x0000000000400968 in vaapi_device_init (device=<optimized out>) at ffmpeg_vaapi.c:223 Signed-off-by: Mark Thompson <sw@jkqxz.net>
* Merge commit 'f637046d3134a331e4b5a7243ac3dfb92735b8a5'Clément Bœsch2017-02-02
|\ | | | | | | | | | | | | * commit 'f637046d3134a331e4b5a7243ac3dfb92735b8a5': libavutil: Always use some GCC style attributes on clang Merged-by: Clément Bœsch <cboesch@gopro.com>
| * libavutil: Always use some GCC style attributes on clangMartin Storsjö2016-07-21
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Clang normally disguises as GCC (defining __GNUC__), and thus get all the normal GCC specific attributes. Clang can also work as a drop-in replacement for MSVC, and in these cases, it doesn't define __GNUC__, but defines _MSC_VER instead. Even in these setups, it still supports the GCC style attributes, thus use them, especially where there isn't any MSVC specific version, or where the MSVC specific version doesn't work on clang (for DECLARE_ASM_CONST). Signed-off-by: Martin Storsjö <martin@martin.st>
* | Merge commit '6f9e34baea4f6f484392e4e67f606a0835d07b73'Clément Bœsch2017-02-02
|\| | | | | | | | | | | | | * commit '6f9e34baea4f6f484392e4e67f606a0835d07b73': arm: Check for support for the .fpu directive Merged-by: Clément Bœsch <cboesch@gopro.com>
| * arm: Check for support for the .fpu directiveMartin Storsjö2016-07-21
| | | | | | | | | | | | | | When targeting COFF (windows), clang doesn't support this directive (while binutils supports it for all targets). Signed-off-by: Martin Storsjö <martin@martin.st>
* | Merge commit '8e9cd81d291b1010c625b2766058aadf4affb537'James Almer2017-01-31
|\| | | | | | | | | | | | | * commit '8e9cd81d291b1010c625b2766058aadf4affb537': x86: cpu: Detect Conroe CPUs and their slow shuffle unit Merged-by: James Almer <jamrial@gmail.com>
| * x86: cpu: Detect Conroe CPUs and their slow shuffle unitFiona Glaser2016-07-20
| |
* | Merge commit '7d7355aa92bb36ca0765c49a569a999bcb96f332'James Almer2017-01-31
|\| | | | | | | | | | | | | * commit '7d7355aa92bb36ca0765c49a569a999bcb96f332': x86: Add SSSE3_SLOW CPU flag and related convenience macros Merged-by: James Almer <jamrial@gmail.com>
| * x86: Add SSSE3_SLOW CPU flag and related convenience macrosDiego Biurrun2016-07-20
| |
| * x86util: Extend SPLATW for avx2James Almer2016-07-18
| | | | | | | | | | | | Integration to Libav by Josh de Kock <josh@itanimul.li>. Signed-off-by: Alexandra Hájková <alexandra@khirnov.net>
* | avutil/frame: fix av_frame_copy for unknown layoutsMarton Balint2017-01-31
| | | | | | | | | | | | | | | | | | I wonder how unknown layouts ever worked without this? Reviewed-by: Nicolas George <george@nsup.org> Reviewed-by: Hendrik Leppkes <h.leppkes@gmail.com> Reviewed-by: Paul B Mahol <onemda@gmail.com> Signed-off-by: Marton Balint <cus@passwd.hu>
* | avutil/eval: add atan2 functionPaul B Mahol2017-01-30
| | | | | | | | Signed-off-by: Paul B Mahol <onemda@gmail.com>
* | avutil/channel_layout: add av_get_extended_channel_layoutMarton Balint2017-01-24
| | | | | | | | | | | | | | | | | | | | | | | | | | | | Return a channel layout and the number of channels based on the specified name. This function is similar to av_get_channel_layout(), but can also parse unknown channel layout specifications. Unknown channel layout specifications are a decimal number and a capital 'C' suffix, in order to not break compatibility with the lowercase 'c' suffix, which is used for a guessed channel layout with the specified number of channels. Signed-off-by: Marton Balint <cus@passwd.hu>
* | avutil/channel_layout: fix remains of old syntax in docs and commentsMarton Balint2017-01-24
| | | | | | | | Signed-off-by: Marton Balint <cus@passwd.hu>
* | hwcontext_cuda: implement frames_get_constraintswm42017-01-23
| | | | | | | | Copied and modified from hwcontext_qsv.c.
* | libavutil: add av_lfg_init_from_data() functionJonathan Campbell2017-01-22
| | | | | | | | | | | | seeds an AVLFG from binary data. Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* | hwcontext_vdpau: Fix missing subscriptsMark Thompson2017-01-17
| | | | | | | | | | | | Also remove the redundant casts which were hiding the error here. (cherry picked from commit 7081620aca36e616ea96f71fd71d2703e3abae09)
* | avutil/tests: add aes_ctr, audio_fifo and imgutils to .gitignoreMatthieu Bouron2017-01-17
| |
* | avutil/tests/audio_fifo.c: pass by reference for efficiency and change ↵Thomas Turner2017-01-13
| | | | | | | | | | | | | | datatype to const Signed-off-by: Thomas Turner <thomastdt@googlemail.com> Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* | avutil/reverse: move the ff_reverse declaration to a separate headerJames Almer2017-01-12
| | | | | | | | | | | | | | | | Fixes compilation with hardcoded tables after eaff1aa09e90e2711207c9463db8bf8e8dec8178 and e71b8119e7db675dd2dac3f7fb069b0df2943c38 Reviewed-by: Timo Rothenpieler <timo@rothenpieler.org> Signed-off-by: James Almer <jamrial@gmail.com>
* | x86inc: Avoid using eax/rax for storing the stack pointerHenrik Gramner2017-01-09
| | | | | | | | | | | | | | | | | | 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.
* | avutil/tile: check clock_gettime at runtime for apple platformsWang Bin2017-01-09
| | | | | | | | | | | | | | | | | | | | | | clock_gettime is avalible since macOS 10.12 and iOS 10.0. Because of weak linking, clock_gettime can be build without error with new macOS/iOS sdk, but the symbol may not exist on the target system. Explicitly checking the symbol is required. https://developer.apple.com/library/content/documentation/MacOSX/Conceptual/BPFrameworks/Concepts/WeakLinking.html Signed-off-by: Wang Bin <wbsecg1@gmail.com> Signed-off-by: Steven Liu <lq@chinaffmpeg.org>
* | avutil/tests: added selftest for aes_ctr.cThomas Turner2017-01-02
| | | | | | | | | | Signed-off-by: Thomas Turner <thomastdt@googlemail.com> Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* | avutil/tests: improved code coverage for atomicThomas Turner2017-01-01
| | | | | | | | | | Signed-off-by: Thomas Turner <thomastdt@googlemail.com> Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* | libavutil/random_seed: Ensure that get_generic_seed() spends at least 1/32 ↵Michael Niedermayer2016-12-31
| | | | | | | | | | | | | | | | sec gathering entropy This may fix the failures on windows Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* | avutil/tests/audio_fifo.c: Memory leak and tab space fixesThomas Turner2016-12-31
| | | | | | | | | | | | | | | | | | | | | | Prevents memory leak when read_samples_from_audio_fifo() is called more than once by deallocating before reallocating more memory. Fixes space indentation for contents in ERROR(). Signed-off-by: Thomas Turner <thomastdt@googlemail.com> Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* | avutil/tests/audio_fifo.c: use av_malloc() family of functionsThomas Turner2016-12-31
| | | | | | | | | | Signed-off-by: Thomas Turner <thomastdt@googlemail.com> Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* | avutil/tests/audio_fifo.c: Corrected test error messagesThomas Turner2016-12-28
| | | | | | | | | | Signed-off-by: Thomas Turner <thomastdt@googlemail.com> Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* | avutil/random_seed: Reduce the time needed on systems with very low ↵Michael Niedermayer2016-12-24
| | | | | | | | | | | | | | | | | | precission clock() This should fix issues on BSD CLOCKS_PER_SEC is 128 on BSD while SUSv2 requires it to be a million Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* | tests/audio_fifo: fix buffer allocation for non planar formatsJames Almer2016-12-23
| | | | | | | | Signed-off-by: James Almer <jamrial@gmail.com>
* | avutil/tests/random_seed: eliminate gotoMichael Niedermayer2016-12-23
| | | | | | | | Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* | avutil/tests: Improved code coverage for random_seedThomas Turner2016-12-23
| | | | | | | | | | Signed-off-by: Thomas Turner <thomastdt@googlemail.com> Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* | tests/avstring: free the pointer after calls to av_d2str()James Almer2016-12-22
| | | | | | | | | | | | Fixes memleaks. Signed-off-by: James Almer <jamrial@gmail.com>
* | avutil/random_seed: Improve get_generic_seed() with higher precission clock()Michael Niedermayer2016-12-22
| | | | | | | | | | Tested-by: Thomas Turner <thomastdt@googlemail.com> Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* | avutil/random_seed: Use uint64 instead of uint8 for struct to avoid ↵Michael Niedermayer2016-12-21
| | | | | | | | | | | | potential alignment issues Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* | avutil: Added selftest for libavutil/audio_fifo.cThomas Turner2016-12-21
| | | | | | | | | | Signed-off-by: Thomas Turner <thomastdt@googlemail.com> Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* | avutil: Improved test coverage for avstring.cThomas Turner2016-12-20
| | | | | | | | | | Signed-off-by: Thomas Turner <thomastdt@googlemail.com> Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* | avutil/imgutils: Clarify doxy for av_image_check_size2()Michael Niedermayer2016-12-16
| | | | | | | | | | Reviewed-by: Andreas Cadhalpun <andreas.cadhalpun@googlemail.com> Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* | Add missing #includes for standalone spherical-information-related headersDiego Biurrun2016-12-14
| | | | | | | | | | (cherry picked from commit f912fd767e55bbb5a1554bd99bacab007659609c) Signed-off-by: James Almer <jamrial@gmail.com>
* | avutil: fix data race in av_get_cpu_flags()Wan-Teh Chang2016-12-13
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Make the one-time initialization in av_get_cpu_flags() thread-safe. The static variable |cpu_flags| in libavutil/cpu.c is 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. 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> Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* | avutil/tests/imgutils: Remove unused variableMichael Niedermayer2016-12-13
| | | | | | | | Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* | opt: reject denominator zero as out of rangeAndreas Cadhalpun2016-12-13
| | | | | | | | | | Reviewed-by: Michael Niedermayer <michael@niedermayer.cc> Signed-off-by: Andreas Cadhalpun <Andreas.Cadhalpun@googlemail.com>
* | avutil/tests: run the cpu_init.c test conditionally on HAVE_THREADSWan-Teh Chang2016-12-10
| | | | | | | | | | | | | | Suggested by Diego Biurrun and James Almer. Signed-off-by: Wan-Teh Chang <wtc@google.com> Signed-off-by: James Almer <jamrial@gmail.com>
* | avutil/cpu_init: remove unnecessary arguments to the main() functionWan-Teh Chang2016-12-10
| | | | | | | | Signed-off-by: James Almer <jamrial@gmail.com>
* | avutil: Add av_image_check_size2()Michael Niedermayer2016-12-10
| | | | | | | | Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* | fate: add av_image_check_size() testMichael Niedermayer2016-12-10
| | | | | | | | Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* | lavu: Add AVSphericalMapping type and frame side dataVittorio Giovara2016-12-07
| | | | | | | | | | | | | | | | While no decoder currently exports spherical information, this type represents a frame property that has to be passed through from container to frames. Signed-off-by: Vittorio Giovara <vittorio.giovara@gmail.com>