|
FFmpeg
|
#include <dlfcn.h>#include <unistd.h>#include "thread.h"#include "config.h"#include "pixdesc.h"#include "avstring.h"#include "imgutils.h"#include "hwcontext.h"#include "hwcontext_internal.h"#include "hwcontext_vulkan.h"#include "mem.h"#include "vulkan.h"#include "vulkan_loader.h"Go to the source code of this file.
Data Structures | |
| struct | VulkanDeviceFeatures |
| struct | VulkanDevicePriv |
| struct | VulkanFramesPriv |
| struct | AVVkFrameInternal |
| struct | FFVkFormatEntry |
| struct | VulkanOptExtension |
| struct | VulkanDeviceSelection |
Macros | |
| #define | VK_NO_PROTOTYPES |
| #define | VK_ENABLE_BETA_EXTENSIONS |
| #define | COPY_VAL(VAL) |
| #define | ASPECT_2PLANE (VK_IMAGE_ASPECT_PLANE_0_BIT | VK_IMAGE_ASPECT_PLANE_1_BIT) |
| #define | ASPECT_3PLANE (VK_IMAGE_ASPECT_PLANE_0_BIT | VK_IMAGE_ASPECT_PLANE_1_BIT | VK_IMAGE_ASPECT_PLANE_2_BIT) |
| #define | ADD_VAL_TO_LIST(list, count, val) |
| #define | RELEASE_PROPS(props, count) |
| #define | PICK_QF(type, vid_op) |
| #define | SET_OLD_QF(field, nb_field, type) |
| #define | CHECK_QUEUE(type, required, fidx, ctx_qf, qc) |
| #define | ADD_QUEUE(ctx_qf, qc, flag) |
Functions | |
| static void | device_features_init (AVHWDeviceContext *ctx, VulkanDeviceFeatures *feats) |
| static void | device_features_copy_needed (VulkanDeviceFeatures *dst, VulkanDeviceFeatures *src) |
| const VkFormat * | av_vkfmt_from_pixfmt (enum AVPixelFormat p) |
| Returns the optimal per-plane Vulkan format for a given sw_format, one for each plane. More... | |
| static const struct FFVkFormatEntry * | vk_find_format_entry (enum AVPixelFormat p) |
| static int | vkfmt_from_pixfmt2 (AVHWDeviceContext *dev_ctx, enum AVPixelFormat p, VkImageTiling tiling, VkFormat fmts[AV_NUM_DATA_POINTERS], int *nb_images, VkImageAspectFlags *aspect, VkImageUsageFlags *supported_usage, int disable_multiplane, int need_storage) |
| static int | load_libvulkan (AVHWDeviceContext *ctx) |
| const char ** | av_vk_get_optional_instance_extensions (int *count) |
| Returns an array of optional Vulkan instance extensions that FFmpeg may use if enabled. More... | |
| const char ** | av_vk_get_optional_device_extensions (int *count) |
| Returns an array of optional Vulkan device extensions that FFmpeg may use if enabled. More... | |
| static VkBool32 VKAPI_CALL | vk_dbg_callback (VkDebugUtilsMessageSeverityFlagBitsEXT severity, VkDebugUtilsMessageTypeFlagsEXT messageType, const VkDebugUtilsMessengerCallbackDataEXT *data, void *priv) |
| static int | vulkan_device_has_rebar (AVHWDeviceContext *ctx) |
| static int | check_extensions (AVHWDeviceContext *ctx, int dev, AVDictionary *opts, const char *const **dst, uint32_t *num, enum FFVulkanDebugMode debug_mode) |
| static int | check_layers (AVHWDeviceContext *ctx, AVDictionary *opts, const char *const **dst, uint32_t *num, enum FFVulkanDebugMode *debug_mode) |
| static int | create_instance (AVHWDeviceContext *ctx, AVDictionary *opts, enum FFVulkanDebugMode *debug_mode) |
| static const char * | vk_dev_type (enum VkPhysicalDeviceType type) |
| static int | find_device (AVHWDeviceContext *ctx, VulkanDeviceSelection *select) |
| static int | pick_queue_family (VkQueueFamilyProperties2 *qf, uint32_t num_qf, VkQueueFlagBits flags) |
| static int | pick_video_queue_family (VkQueueFamilyProperties2 *qf, VkQueueFamilyVideoPropertiesKHR *qf_vid, uint32_t num_qf, VkVideoCodecOperationFlagsKHR flags) |
| static int | setup_queue_families (AVHWDeviceContext *ctx, VkDeviceCreateInfo *cd) |
| static void | vulkan_device_free (AVHWDeviceContext *ctx) |
| static void | vulkan_device_uninit (AVHWDeviceContext *ctx) |
| static int | vulkan_device_create_internal (AVHWDeviceContext *ctx, VulkanDeviceSelection *dev_select, int disable_multiplane, AVDictionary *opts, int flags) |
| static void | lock_queue (AVHWDeviceContext *ctx, uint32_t queue_family, uint32_t index) |
| static void | unlock_queue (AVHWDeviceContext *ctx, uint32_t queue_family, uint32_t index) |
| static int | vulkan_device_init (AVHWDeviceContext *ctx) |
| static int | vulkan_device_create (AVHWDeviceContext *ctx, const char *device, AVDictionary *opts, int flags) |
| static int | vulkan_device_derive (AVHWDeviceContext *ctx, AVHWDeviceContext *src_ctx, AVDictionary *opts, int flags) |
| static int | vulkan_frames_get_constraints (AVHWDeviceContext *ctx, const void *hwconfig, AVHWFramesConstraints *constraints) |
| static int | alloc_mem (AVHWDeviceContext *ctx, VkMemoryRequirements *req, VkMemoryPropertyFlagBits req_flags, const void *alloc_extension, VkMemoryPropertyFlagBits *mem_flags, VkDeviceMemory *mem) |
| static void | vulkan_free_internal (AVVkFrame *f) |
| static void | vulkan_frame_free (AVHWFramesContext *hwfc, AVVkFrame *f) |
| static void | vulkan_frame_free_cb (void *opaque, uint8_t *data) |
| static int | alloc_bind_mem (AVHWFramesContext *hwfc, AVVkFrame *f, void *alloc_pnext, size_t alloc_pnext_stride) |
| static void | switch_new_props (enum PrepMode pmode, VkImageLayout *new_layout, VkAccessFlags2 *new_access) |
| static int | switch_layout (AVHWFramesContext *hwfc, FFVkExecPool *ectx, AVVkFrame *frame, enum PrepMode pmode) |
| static int | switch_layout_host (AVHWFramesContext *hwfc, FFVkExecPool *ectx, AVVkFrame *frame, enum PrepMode pmode) |
| static int | prepare_frame (AVHWFramesContext *hwfc, FFVkExecPool *ectx, AVVkFrame *frame, enum PrepMode pmode) |
| static void | get_plane_wh (uint32_t *w, uint32_t *h, enum AVPixelFormat format, int frame_w, int frame_h, int plane) |
| static int | create_frame (AVHWFramesContext *hwfc, AVVkFrame **frame, VkImageTiling tiling, VkImageUsageFlagBits usage, VkImageCreateFlags flags, int nb_layers, void *create_pnext) |
| static void | try_export_flags (AVHWFramesContext *hwfc, VkExternalMemoryHandleTypeFlags *comp_handle_types, VkExternalMemoryHandleTypeFlags *iexp, VkExternalMemoryHandleTypeFlagBits exp) |
| static AVBufferRef * | vulkan_pool_alloc (void *opaque, size_t size) |
| static void | lock_frame (AVHWFramesContext *fc, AVVkFrame *vkf) |
| static void | unlock_frame (AVHWFramesContext *fc, AVVkFrame *vkf) |
| static void | vulkan_frames_uninit (AVHWFramesContext *hwfc) |
| static int | vulkan_frames_init (AVHWFramesContext *hwfc) |
| static int | vulkan_get_buffer (AVHWFramesContext *hwfc, AVFrame *frame) |
| static int | vulkan_transfer_get_formats (AVHWFramesContext *hwfc, enum AVHWFrameTransferDirection dir, enum AVPixelFormat **formats) |
| static int | vulkan_map_to (AVHWFramesContext *hwfc, AVFrame *dst, const AVFrame *src, int flags) |
| static int | vulkan_map_from (AVHWFramesContext *hwfc, AVFrame *dst, const AVFrame *src, int flags) |
| static int | copy_buffer_data (AVHWFramesContext *hwfc, AVBufferRef *buf, AVFrame *swf, VkBufferImageCopy *region, int planes, int upload) |
| static int | get_plane_buf (AVHWFramesContext *hwfc, AVBufferRef **dst, AVFrame *swf, VkBufferImageCopy *region, int upload) |
| static int | host_map_frame (AVHWFramesContext *hwfc, AVBufferRef **dst, int *nb_bufs, AVFrame *swf, VkBufferImageCopy *region, int upload) |
| static int | vulkan_transfer_host (AVHWFramesContext *hwfc, AVFrame *hwf, AVFrame *swf, int upload) |
| static int | vulkan_transfer_frame (AVHWFramesContext *hwfc, AVFrame *swf, AVFrame *hwf, int upload) |
| static int | vulkan_transfer_data_to (AVHWFramesContext *hwfc, AVFrame *dst, const AVFrame *src) |
| static int | vulkan_transfer_data_from (AVHWFramesContext *hwfc, AVFrame *dst, const AVFrame *src) |
| static int | vulkan_frames_derive_to (AVHWFramesContext *dst_fc, AVHWFramesContext *src_fc, int flags) |
| AVVkFrame * | av_vk_frame_alloc (void) |
| Allocates a single AVVkFrame and initializes everything as 0. More... | |
Variables | |
| static const struct FFVkFormatEntry | vk_formats_list [] |
| static const int | nb_vk_formats_list = FF_ARRAY_ELEMS(vk_formats_list) |
| static const VulkanOptExtension | optional_instance_exts [] |
| static const VulkanOptExtension | optional_device_exts [] |
| const HWContextType | ff_hwcontext_type_vulkan |
| #define VK_NO_PROTOTYPES |
Definition at line 21 of file hwcontext_vulkan.c.
| #define VK_ENABLE_BETA_EXTENSIONS |
Definition at line 22 of file hwcontext_vulkan.c.
| #define COPY_VAL | ( | VAL | ) |
| #define ASPECT_2PLANE (VK_IMAGE_ASPECT_PLANE_0_BIT | VK_IMAGE_ASPECT_PLANE_1_BIT) |
Definition at line 368 of file hwcontext_vulkan.c.
| #define ASPECT_3PLANE (VK_IMAGE_ASPECT_PLANE_0_BIT | VK_IMAGE_ASPECT_PLANE_1_BIT | VK_IMAGE_ASPECT_PLANE_2_BIT) |
Definition at line 369 of file hwcontext_vulkan.c.
| #define RELEASE_PROPS | ( | props, | |
| count | |||
| ) |
| #define PICK_QF | ( | type, | |
| vid_op | |||
| ) |
| #define CHECK_QUEUE | ( | type, | |
| required, | |||
| fidx, | |||
| ctx_qf, | |||
| qc | |||
| ) |
| #define ADD_QUEUE | ( | ctx_qf, | |
| qc, | |||
| flag | |||
| ) |
| enum FFVulkanDebugMode |
| Enumerator | |
|---|---|
| FF_VULKAN_DEBUG_NONE | |
| FF_VULKAN_DEBUG_VALIDATE | |
| FF_VULKAN_DEBUG_PRINTF | |
| FF_VULKAN_DEBUG_PRACTICES | |
| FF_VULKAN_DEBUG_PROFILE | |
| FF_VULKAN_DEBUG_NB | |
Definition at line 807 of file hwcontext_vulkan.c.
| enum PrepMode |
| Enumerator | |
|---|---|
| PREP_MODE_GENERAL | |
| PREP_MODE_WRITE | |
| PREP_MODE_EXTERNAL_EXPORT | |
| PREP_MODE_EXTERNAL_IMPORT | |
| PREP_MODE_DECODING_DST | |
| PREP_MODE_DECODING_DPB | |
| PREP_MODE_ENCODING_DPB | |
Definition at line 2494 of file hwcontext_vulkan.c.
|
static |
Definition at line 207 of file hwcontext_vulkan.c.
Referenced by vulkan_device_create_internal().
|
static |
Definition at line 273 of file hwcontext_vulkan.c.
Referenced by vulkan_device_create_internal().
| const VkFormat* av_vkfmt_from_pixfmt | ( | enum AVPixelFormat | p | ) |
Returns the optimal per-plane Vulkan format for a given sw_format, one for each plane.
Returns NULL on unsupported formats.
Definition at line 491 of file hwcontext_vulkan.c.
Referenced by vulkan_transfer_frame().
|
static |
Definition at line 499 of file hwcontext_vulkan.c.
Referenced by try_export_flags(), and vulkan_frames_init().
|
static |
Definition at line 507 of file hwcontext_vulkan.c.
Referenced by vulkan_frames_get_constraints(), and vulkan_frames_init().
|
static |
Definition at line 605 of file hwcontext_vulkan.c.
Referenced by create_instance().
| const char** av_vk_get_optional_instance_extensions | ( | int * | count | ) |
Returns an array of optional Vulkan instance extensions that FFmpeg may use if enabled.
Definition at line 706 of file hwcontext_vulkan.c.
| const char** av_vk_get_optional_device_extensions | ( | int * | count | ) |
Returns an array of optional Vulkan device extensions that FFmpeg may use if enabled.
Definition at line 720 of file hwcontext_vulkan.c.
|
static |
Definition at line 734 of file hwcontext_vulkan.c.
Referenced by create_instance().
|
static |
Definition at line 787 of file hwcontext_vulkan.c.
Referenced by check_extensions().
|
static |
Definition at line 821 of file hwcontext_vulkan.c.
Referenced by create_instance(), and vulkan_device_create_internal().
|
static |
Definition at line 995 of file hwcontext_vulkan.c.
Referenced by create_instance().
|
static |
Definition at line 1146 of file hwcontext_vulkan.c.
Referenced by vulkan_device_create_internal().
|
static |
Definition at line 1295 of file hwcontext_vulkan.c.
Referenced by find_device().
|
static |
Definition at line 1307 of file hwcontext_vulkan.c.
Referenced by vulkan_device_create_internal().
|
inlinestatic |
Definition at line 1478 of file hwcontext_vulkan.c.
|
inlinestatic |
Definition at line 1507 of file hwcontext_vulkan.c.
|
static |
Definition at line 1536 of file hwcontext_vulkan.c.
Referenced by vulkan_device_create_internal().
|
static |
Definition at line 1733 of file hwcontext_vulkan.c.
Referenced by vulkan_device_create_internal().
|
static |
Definition at line 1756 of file hwcontext_vulkan.c.
|
static |
Definition at line 1769 of file hwcontext_vulkan.c.
Referenced by vulkan_device_create(), and vulkan_device_derive().
|
static |
Definition at line 1876 of file hwcontext_vulkan.c.
Referenced by init_vulkan(), and vulkan_device_init().
|
static |
Definition at line 1882 of file hwcontext_vulkan.c.
Referenced by init_vulkan(), and vulkan_device_init().
|
static |
Definition at line 1888 of file hwcontext_vulkan.c.
|
static |
Definition at line 2127 of file hwcontext_vulkan.c.
|
static |
Definition at line 2143 of file hwcontext_vulkan.c.
|
static |
Definition at line 2246 of file hwcontext_vulkan.c.
|
static |
Definition at line 2292 of file hwcontext_vulkan.c.
Referenced by alloc_bind_mem().
|
static |
Definition at line 2350 of file hwcontext_vulkan.c.
Referenced by vulkan_frame_free().
|
static |
Definition at line 2386 of file hwcontext_vulkan.c.
Referenced by create_frame(), vulkan_frame_free_cb(), vulkan_frames_init(), and vulkan_pool_alloc().
|
static |
Definition at line 2420 of file hwcontext_vulkan.c.
Referenced by vulkan_pool_alloc().
|
static |
Definition at line 2425 of file hwcontext_vulkan.c.
Referenced by vulkan_pool_alloc().
|
static |
Definition at line 2504 of file hwcontext_vulkan.c.
Referenced by switch_layout(), and switch_layout_host().
|
static |
Definition at line 2539 of file hwcontext_vulkan.c.
Referenced by prepare_frame().
|
static |
Definition at line 2602 of file hwcontext_vulkan.c.
Referenced by prepare_frame().
|
static |
Definition at line 2647 of file hwcontext_vulkan.c.
Referenced by vulkan_pool_alloc().
|
inlinestatic |
Definition at line 2663 of file hwcontext_vulkan.c.
Referenced by create_frame(), get_plane_buf(), vulkan_transfer_frame(), and vulkan_transfer_host().
|
static |
Definition at line 2680 of file hwcontext_vulkan.c.
Referenced by vulkan_frames_init(), and vulkan_pool_alloc().
|
static |
Definition at line 2790 of file hwcontext_vulkan.c.
Referenced by vulkan_pool_alloc().
|
static |
Definition at line 2852 of file hwcontext_vulkan.c.
Referenced by vulkan_frames_init().
|
static |
Definition at line 2927 of file hwcontext_vulkan.c.
Referenced by vulkan_frames_init().
|
static |
Definition at line 2932 of file hwcontext_vulkan.c.
Referenced by vulkan_frames_init().
|
static |
Definition at line 2937 of file hwcontext_vulkan.c.
|
static |
Definition at line 2955 of file hwcontext_vulkan.c.
Referenced by vulkan_frames_derive_to().
|
static |
Definition at line 3179 of file hwcontext_vulkan.c.
|
static |
Definition at line 3193 of file hwcontext_vulkan.c.
|
static |
Definition at line 4044 of file hwcontext_vulkan.c.
|
static |
Definition at line 4253 of file hwcontext_vulkan.c.
|
static |
Definition at line 4279 of file hwcontext_vulkan.c.
Referenced by vulkan_transfer_frame().
|
static |
Definition at line 4322 of file hwcontext_vulkan.c.
Referenced by vulkan_transfer_frame().
|
static |
Definition at line 4361 of file hwcontext_vulkan.c.
Referenced by vulkan_transfer_frame().
|
static |
Definition at line 4418 of file hwcontext_vulkan.c.
Referenced by vulkan_transfer_frame().
|
static |
Definition at line 4536 of file hwcontext_vulkan.c.
Referenced by vulkan_transfer_data_from(), and vulkan_transfer_data_to().
|
static |
Definition at line 4697 of file hwcontext_vulkan.c.
|
static |
Definition at line 4816 of file hwcontext_vulkan.c.
|
static |
Definition at line 4841 of file hwcontext_vulkan.c.
| AVVkFrame* av_vk_frame_alloc | ( | void | ) |
Allocates a single AVVkFrame and initializes everything as 0.
Definition at line 4847 of file hwcontext_vulkan.c.
Referenced by create_frame().
|
static |
Referenced by av_vkfmt_from_pixfmt(), vk_find_format_entry(), vkfmt_from_pixfmt2(), and vulkan_frames_get_constraints().
|
static |
Definition at line 489 of file hwcontext_vulkan.c.
Referenced by av_vkfmt_from_pixfmt(), vk_find_format_entry(), vkfmt_from_pixfmt2(), and vulkan_frames_get_constraints().
|
static |
Definition at line 648 of file hwcontext_vulkan.c.
Referenced by av_vk_get_optional_instance_extensions(), and check_extensions().
|
static |
Definition at line 655 of file hwcontext_vulkan.c.
Referenced by av_vk_get_optional_device_extensions(), check_extensions(), and vulkan_device_init().
| const HWContextType ff_hwcontext_type_vulkan |
Definition at line 4870 of file hwcontext_vulkan.c.
1.8.17