summaryrefslogtreecommitdiff
path: root/libavutil
Commit message (Collapse)AuthorAge
...
* avutil/frame: Treat frame as uninitialized in get_frame_defaults()Andreas Rheinhardt2021-12-05
| | | | | | | | | | | | | | Currently, it also tests whether extended_data points to something different than the AVFrame's data array and frees extended_data if it is different. Yet this is only necessary for one of its three callers, namely av_frame_unref(); meanwhile the other two callers took measures to avoid this (or rather, to make it to an av_free(NULL)). This commit moves this chunk to av_frame_unref() (so that get_frame_defaults() now treats its input as uninitialized) and removes the now superfluous code in the other two callers. Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
* lavu/frame: clarify doxyAnton Khirnov2021-12-04
| | | | | AVFrame.data[] elements not used by the format should ALWAYS be null, hwaccel formats are not an exception.
* lavu/frame: drop mentions of non-refcounted framesAnton Khirnov2021-12-04
| | | | All frames we deal with should always be refcounted now.
* libavutil/hwcontext_qsv: fix a bug for mapping vaapi frame to qsvnyanmisaka2021-12-04
| | | | | | | | | | | | | | The data stored in data[3] in VAAPI AVFrame is VASurfaceID while the data stored in pair->first is the pointer of VASurfaceID, so we need to do cast to make following commandline works: ffmpeg -hwaccel vaapi -hwaccel_device /dev/dri/renderD128 \ -hwaccel_output_format vaapi -i input.264 \ -vf "hwmap=derive_device=qsv,format=qsv" -c:v h264_qsv output.264 Signed-off-by: nyanmisaka <nst799610810@gmail.com> Signed-off-by: Wenbin Chen <wenbin.chen@intel.com> Signed-off-by: Anton Khirnov <anton@khirnov.net>
* lavu/avframe: add a time_base fieldLynne2021-12-03
| | | | | This adds a time_base field to AVFrame, as an analogue to the AVPacket.time_base field.
* all: Use av_memdup() where appropriateAndreas Rheinhardt2021-12-03
| | | | | Reviewed-by: Nicolas George <george@nsup.org> Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
* videotoolbox: add alpha supportrcombs2021-11-28
|
* lavu/videotoolbox: add 422 and 444 pixel format mappingsrcombs2021-11-28
|
* lavu/pixfmt: add high-bit-depth semi-planar 4:2:2/4:4:4 formatsrcombs2021-11-28
| | | | These are used by VideoToolbox hardware decoders.
* hwcontext_vulkan: use correct return value for allocation failureLynne2021-11-27
|
* avutil/hwcontext_vulkan: fully support customizable validation layersWu Jianhua2021-11-26
| | | | | | | | | | Validation layer is an indispensable part of developing on Vulkan. The following commands is on how to enable validation layers: ffmpeg -init_hw_device vulkan=0,debug=1,validation_layers=VK_LAYER_LUNARG_monitor+VK_LAYER_LUNARG_api_dump Signed-off-by: Wu Jianhua <jianhua.wu@intel.com>
* avutil/hwcontext_vulkan: check if created before destroying the instanceWu Jianhua2021-11-24
| | | | Signed-off-by: Wu Jianhua <jianhua.wu@intel.com>
* avutil/hwcontext_vulkan: check if created before destroying the deviceWu Jianhua2021-11-24
| | | | Signed-off-by: Wu Jianhua <jianhua.wu@intel.com>
* avutil/hwcontext_cuda: return more useful error codes from init functionsTimo Rothenpieler2021-11-22
|
* avutil/hwcontext_cuda: add option to use primary device contextTimo Rothenpieler2021-11-22
|
* hwcontext_vulkan: check for non-flagged transfer queue familiesLynne2021-11-20
| | | | | | | | | "All commands that are allowed on a queue that supports transfer operations are also allowed on a queue that supports either graphics or compute operations. Thus, if the capabilities of a queue family include VK_QUEUE_GRAPHICS_BIT or VK_QUEUE_COMPUTE_BIT, then reporting the VK_QUEUE_TRANSFER_BIT capability separately for that queue family is optional."
* lavu/vulkan: check for initialization when freeing buffersLynne2021-11-20
| | | | | | | | | What happens on startup is that ffmpeg.c initializes the filter, then frees it without feeding a single frame through. With no input frame, the filter lacks a hardware device. The rest of the uninit code checks if Vulkan objects exist, which they must if there's a hardware device, but vk->DeviceWaitIdle does not require an object. So, add a check for it.
* avutil/vulkan_glslang: fix compiling failure issueWu Jianhua2021-11-19
| | | | Signed-off-by: Wu Jianhua <jianhua.wu@intel.com>
* lavu/vulkan: add support for using libshaderc as a GLSL compilerLynne2021-11-19
| | | | | | | It's got a much better API that's actually maintained, it eliminates race conditions, it comes with a pkg-config file by default, and unfortunately isn't currently packaged by Debian or other large distributions.
* vulkan: fix checkheadersLynne2021-11-19
|
* lavfi/vulkan: split off lavfi-specific code into vulkan_filter.cLynne2021-11-19
| | | | | | | | | | | | | | | | | The issue is that libavfilter depends on libavcodec, and when doing a static build, if libavcodec also includes "libavfilter/vulkan.c", then during link-time, compiling programs will fail as there would be multiple definitions of the same symbols in both libavfilter and libavcodec's object files. Linkers are, however, more permitting if both files that include a common file that's used as a template are one-to-one identical. Hence, to make both files the same in the future, export all avfilter specific functions to a separate file. There is some work in progress to make templated files like this be compiled only once, so this is not a long-term solution. This also removes a macro that could be used to toggle SPIRV compilation capability on #include-time, as this could cause the files to be different.
* x86/intmath: add VEX encoded versions of av_clipf() and av_clipd()James Almer2021-11-19
| | | | | | | Prevents mixing inlined SSE instructions and AVX instructions when the compiler generates the latter. Signed-off-by: James Almer <jamrial@gmail.com>
* lavu/vulkan: add option to switch between shader compilers and cleanup glslangLynne2021-11-19
|
* lavu/vulkan: move common Vulkan code from libavfilter to libavutilLynne2021-11-19
|
* avutil/frame: Document the possibility of negative line sizesSoft Works2021-11-18
| | | | | Signed-off-by: softworkz <softworkz@hotmail.com> Signed-off-by: Marton Balint <cus@passwd.hu>
* avutil/hwcontext_qsv: Remove redundant checkAndreas Rheinhardt2021-11-18
| | | | | | | | | | | | | It has already been checked immediately before that said AVDictionaryEntry exists; checking again is redundant. Furthermore, av_hwdevice_find_type_by_name() requires its argument to be non-NULL, so adding a codepath that automatically calls it with that parameter is nonsense. The same goes for the argument corresponding to %s. Fixes Coverity issue 1491394. Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
* avutil/hwcontext_qsv: Fix leak of AVBuffer and AVBufferRefAndreas Rheinhardt2021-11-18
| | | | | | | | | This av_buffer_create() does nothing but leak an AVBuffer and an AVBufferRef (except on allocation error). Fixes Coverity issue 1491393. Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
* vulkan_loader: fix typo in error messageLynne2021-11-18
|
* avutil: Add Dolby Vision RPU side data typeDerek Buitenhuis2021-11-17
| | | | Signed-off-by: Derek Buitenhuis <derek.buitenhuis@gmail.com>
* aarch64: Add Armv8.5-A BTI supportJonathan Wright2021-11-16
| | | | | | | | | | | | | | | | | Add Branch Target Identifiers (BTIs) to all functions defined in AArch64 assembly files. Most of the BTI landing pads are added automatically by the 'function' macro. BTI support is turned on or off at compile time based on the presence of the __ARM_FEATURE_BTI_DEFAULT feature macro. A binary compiled with BTI support can be executed on an Armv8-A processor without BTI support because the instructions are defined in NOP space. Signed-off-by: Jonathan Wright <jonathan.wright@arm.com> Signed-off-by: Elijah Ahmad <elijah.ahmad@arm.com> Signed-off-by: Martin Storsjö <martin@martin.st>
* libavutil/common: clip nan value to aminMark Reid2021-11-15
| | | | | | | | | | | | Changes av_clipf to return amin if a is nan. Before if a is nan av_clipf_c returned nan and av_clipf_sse would return amax. Now the both should behave the same. This works because nan > amin is false. The max(nan, amin) will be amin. Signed-off-by: James Almer <jamrial@gmail.com>
* */version.h: define FF_API macros unconditionallyAnton Khirnov2021-11-15
| | | | | | | There is no reason to wrap them in #ifndef guards, they should only be defined here and nowhere else. The define guards just add the possibility to accidentally use the same FF_API name in different libraries.
* avutil/hwcontext_vulkan: add support for exporting memory via Win32 HandlesTimo Rothenpieler2021-11-14
|
* avutil/vulkan: load win32 external memory functionsTimo Rothenpieler2021-11-14
|
* avutil/opt: fix mis-alignment of option and constant values for filter helpSoft Works2021-11-13
| | | | | | | | | | | | | | | | | | | | | | | | | | | Before: overlay AVOptions: x <string> ..FV....... set the x expression (default "0") y <string> ..FV....... set the y expression (default "0") eof_action <int> ..FV....... Action to take when encountering EOF from secondary input (from 0 to 2) (default repeat) repeat 0 ..FV....... Repeat the previous frame. endall 1 ..FV....... End both streams. pass 2 ..FV....... Pass through the main input. eval <int> ..FV....... specify when to evaluate expressions (from 0 to 1) (default frame) After: a overlay AVOptions: x <string> ..FV....... set the x expression (default "0") y <string> ..FV....... set the y expression (default "0") eof_action <int> ..FV....... Action to take when encountering EOF from secondary input (from 0 to 2) (default repeat) repeat 0 ..FV....... Repeat the previous frame. endall 1 ..FV....... End both streams. pass 2 ..FV....... Pass through the main input. eval <int> ..FV....... specify when to evaluate expressions (from 0 to 1) (default frame) Signed-off-by: softworkz <softworkz@hotmail.com> Signed-off-by: Marton Balint <cus@passwd.hu>
* avutil/hwcontext_dxva2: add ARGB formatSoft Works2021-11-13
| | | | | | | | Required for uploading frames with alpha for qsv_overlay (v2: remove tab indent) Signed-off-by: softworkz <softworkz@hotmail.com> Signed-off-by: Marton Balint <cus@passwd.hu>
* hwcontext_vaapi: don't use the generic mapping struct for DRM/VAAPILynne2021-11-13
| | | | Avoids a per-frame allocation since we don't need the flag field.
* hwcontext_vulkan: fix small memory leak when unmappingLynne2021-11-13
|
* hwcontext_vulkan: wait for semaphores when unmapping from VAAPILynne2021-11-13
| | | | | We don't really want to do a full all-queue blocking wait here, since this happens once per frame, and this could delay future frames.
* hwcontext_vulkan: print error information on queue submission failureLynne2021-11-13
| | | | Makes it clearer what went wrong.
* hwcontext_vulkan: fix DMABUF import format check callLynne2021-11-13
| | | | | VkExternalImageFormatProperties is required to be present in the .pNext chain of VkImageFormatProperties2, or some drivers crash (RADV).
* hwcontext_vulkan: improve CUDA error handlingLynne2021-11-13
|
* hwcontext_vulkan: close exported memory FD on CUDA import errorLynne2021-11-13
| | | | Prevents resource leakage.
* hwcontext_vulkan: do not dup() semaphore FDs for CUDALynne2021-11-13
|
* hwcontext_vulkan: properly migrate queue families with DRM import/exportLynne2021-11-13
|
* hwcontext_vulkan: properly migrate between queue families on CUDA import/exportLynne2021-11-13
| | | | It's more correct.
* hwcontext_vulkan: properly error out if timeline semaphores are unsupportedLynne2021-11-13
| | | | Missing goto.
* hwcontext_vulkan: fix CreateSemaphore conflict with synchapi.hLynne2021-11-12
| | | | | | Include windows.h to fix it. Normally, it'd be better to include it in vulkan_functions.h, but I'm reasonably confident nothing else that uses the Vulkan code will need to include Windows functions and not windows.h.
* hwcontext_vulkan: use vkDeviceWaitIdle instead of vkWaitSemaphores on uninitLynne2021-11-12
| | | | | To silence a possible validation layer bug, switch the function. It only gets triggered by vf_libplacebo, which is odd.
* doc/APIchanges: update for Vulkan API changesLynne2021-11-12
|