Go to the documentation of this file.
19 #ifndef AVUTIL_HWCONTEXT_VULKAN_H
20 #define AVUTIL_HWCONTEXT_VULKAN_H
22 #if defined(_WIN32) && !defined(VK_USE_PLATFORM_WIN32_KHR)
23 #define VK_USE_PLATFORM_WIN32_KHR
25 #include <vulkan/vulkan.h>
63 const VkAllocationCallbacks *
alloc;
115 #if FF_API_VULKAN_FIXED_QUEUES
VkPhysicalDevice phys_dev
Physical device.
AVPixelFormat
Pixel format.
@ AV_VK_FRAME_FLAG_DISABLE_MULTIPLANE
PFN_vkGetInstanceProcAddr get_proc_addr
Pointer to a vkGetInstanceProcAddr loading function.
void * create_pnext
Extension data for image creation.
attribute_deprecated int queue_family_encode_index
Queue family index for video encode ops, and the amount of queues enabled.
VkInstance inst
Vulkan instance.
void(* lock_frame)(struct AVHWFramesContext *fc, AVVkFrame *vkf)
Locks a frame, preventing other threads from changing frame properties.
#define fc(width, name, range_min, range_max)
const VkAllocationCallbacks * alloc
Custom memory allocator, else NULL.
VkImage img[AV_NUM_DATA_POINTERS]
Vulkan images to which the memory is bound to.
ptrdiff_t offset[AV_NUM_DATA_POINTERS]
Describes the binding offset of each image to the VkDeviceMemory.
@ AV_VK_FRAME_FLAG_CONTIGUOUS_MEMORY
AVVkFrameFlags flags
A combination of AVVkFrameFlags.
attribute_deprecated int nb_tx_queues
VkDeviceMemory mem[AV_NUM_DATA_POINTERS]
Memory backing the images.
Allocated as AVHWFramesContext.hwctx, used to set pool-specific options.
attribute_deprecated int queue_family_decode_index
Queue family index for video decode ops, and the amount of queues enabled.
This struct aggregates all the (hardware/vendor-specific) "high-level" state, i.e.
attribute_deprecated int nb_encode_queues
void(* unlock_frame)(struct AVHWFramesContext *fc, AVVkFrame *vkf)
Similar to lock_frame(), unlocks a frame.
VkImageCreateFlags img_flags
Flags to set during image creation.
Main Vulkan context, allocated as AVHWDeviceContext.hwctx.
int nb_enabled_dev_extensions
VkMemoryPropertyFlagBits flags
OR'd flags for all memory allocated.
void * alloc_pnext[AV_NUM_DATA_POINTERS]
Extension data for memory allocation.
void(* unlock_queue)(struct AVHWDeviceContext *ctx, uint32_t queue_family, uint32_t index)
Similar to lock_queue(), unlocks a queue.
attribute_deprecated int nb_decode_queues
attribute_deprecated int queue_family_tx_index
Queue family index for transfer operations and the number of queues enabled.
const char *const * enabled_inst_extensions
Enabled instance extensions.
VkFormat format[AV_NUM_DATA_POINTERS]
Vulkan format for each image.
VkImageUsageFlagBits usage
Defines extra usage of output frames.
AVVulkanDeviceQueueFamily qf[64]
Queue families used.
size_t size[AV_NUM_DATA_POINTERS]
VkAccessFlagBits access[AV_NUM_DATA_POINTERS]
Updated after every barrier.
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.
#define AV_NUM_DATA_POINTERS
#define FF_API_VULKAN_CONTIGUOUS_MEMORY
#define attribute_deprecated
attribute_deprecated int queue_family_index
Queue family index for graphics operations, and the number of queues enabled for it.
AVVkFrame * av_vk_frame_alloc(void)
Allocates a single AVVkFrame and initializes everything as 0.
uint32_t queue_family[AV_NUM_DATA_POINTERS]
Queue family of the images.
void(* lock_queue)(struct AVHWDeviceContext *ctx, uint32_t queue_family, uint32_t index)
Locks a queue, preventing other threads from submitting any command buffers to this queue.
attribute_deprecated int queue_family_comp_index
Queue family index for compute operations and the number of queues enabled.
AVVkFrameFlags
Defines the behaviour of frame allocation.
VkSemaphore sem[AV_NUM_DATA_POINTERS]
Synchronization timeline semaphores, one for each VkImage.
This struct describes a set or pool of "hardware" frames (i.e.
VkImageTiling tiling
Tiling for the frame.
attribute_deprecated int nb_graphics_queues
VkImageTiling tiling
Controls the tiling of allocated frames.
uint64_t sem_value[AV_NUM_DATA_POINTERS]
Up to date semaphore value at which each image becomes accessible.
const char *const * enabled_dev_extensions
Enabled device extensions.
int nb_layers
Number of layers each image will have.
VkImageLayout layout[AV_NUM_DATA_POINTERS]
VkDevice act_dev
Active device.
int nb_enabled_inst_extensions
VkPhysicalDeviceFeatures2 device_features
This structure should be set to the set of features that present and enabled during device creation.
VkVideoCodecOperationFlagBitsKHR video_caps
attribute_deprecated int nb_comp_queues