FFmpeg
Data Fields
AVVulkanFramesContext Struct Reference

Allocated as AVHWFramesContext.hwctx, used to set pool-specific options. More...

#include <hwcontext_vulkan.h>

Data Fields

VkImageTiling tiling
 Controls the tiling of allocated frames. More...
 
VkImageUsageFlagBits usage
 Defines extra usage of output frames. More...
 
void * create_pnext
 Extension data for image creation. More...
 
void * alloc_pnext [AV_NUM_DATA_POINTERS]
 Extension data for memory allocation. More...
 
AVVkFrameFlags flags
 A combination of AVVkFrameFlags. More...
 
VkImageCreateFlags img_flags
 Flags to set during image creation. More...
 
VkFormat format [AV_NUM_DATA_POINTERS]
 Vulkan format for each image. More...
 
int nb_layers
 Number of layers each image will have. More...
 
void(* lock_frame )(struct AVHWFramesContext *fc, AVVkFrame *vkf)
 Locks a frame, preventing other threads from changing frame properties. More...
 
void(* unlock_frame )(struct AVHWFramesContext *fc, AVVkFrame *vkf)
 Similar to lock_frame(), unlocks a frame. More...
 

Detailed Description

Allocated as AVHWFramesContext.hwctx, used to set pool-specific options.

Definition at line 176 of file hwcontext_vulkan.h.

Field Documentation

◆ tiling

VkImageTiling AVVulkanFramesContext::tiling

Controls the tiling of allocated frames.

If left as VK_IMAGE_TILING_OPTIMAL (0), will use optimal tiling. Can be set to VK_IMAGE_TILING_LINEAR to force linear images, or VK_IMAGE_TILING_DRM_FORMAT_MODIFIER_EXT to force DMABUF-backed images.

Note
Imported frames from other APIs ignore this.

Definition at line 185 of file hwcontext_vulkan.h.

Referenced by ff_vk_decode_init(), ff_vk_filter_init_context(), try_export_flags(), vulkan_frames_init(), and vulkan_pool_alloc().

◆ usage

VkImageUsageFlagBits AVVulkanFramesContext::usage

Defines extra usage of output frames.

If non-zero, all flags MUST be supported by the VkFormat. Otherwise, will use supported flags amongst:

  • VK_IMAGE_USAGE_SAMPLED_BIT
  • VK_IMAGE_USAGE_STORAGE_BIT
  • VK_IMAGE_USAGE_TRANSFER_SRC_BIT
  • VK_IMAGE_USAGE_TRANSFER_DST_BIT

Definition at line 195 of file hwcontext_vulkan.h.

Referenced by ff_vk_decode_init(), ff_vk_filter_init_context(), libplacebo_config_output(), try_export_flags(), vulkan_frames_init(), and vulkan_pool_alloc().

◆ create_pnext

void* AVVulkanFramesContext::create_pnext

Extension data for image creation.

If DRM tiling is used, a VkImageDrmFormatModifierListCreateInfoEXT structure can be added to specify the exact modifier to use.

Additional structures may be added at av_hwframe_ctx_init() time, which will be freed automatically on uninit(), so users must only free any structures they've allocated themselves.

Definition at line 206 of file hwcontext_vulkan.h.

Referenced by ff_vk_decode_init(), try_export_flags(), vulkan_frames_init(), and vulkan_pool_alloc().

◆ alloc_pnext

void* AVVulkanFramesContext::alloc_pnext[AV_NUM_DATA_POINTERS]

Extension data for memory allocation.

Must have as many entries as the number of planes of the sw_format. This will be chained to VkExportMemoryAllocateInfo, which is used to make all pool images exportable to other APIs if the necessary extensions are present in enabled_dev_extensions.

Definition at line 215 of file hwcontext_vulkan.h.

Referenced by vulkan_pool_alloc().

◆ flags

AVVkFrameFlags AVVulkanFramesContext::flags

A combination of AVVkFrameFlags.

Unless AV_VK_FRAME_FLAG_NONE is set, autodetected flags will be OR'd based on the device and tiling during av_hwframe_ctx_init().

Definition at line 222 of file hwcontext_vulkan.h.

Referenced by vulkan_frames_init().

◆ img_flags

VkImageCreateFlags AVVulkanFramesContext::img_flags

Flags to set during image creation.

If unset, defaults to VK_IMAGE_CREATE_ALIAS_BIT.

Definition at line 228 of file hwcontext_vulkan.h.

Referenced by vulkan_frames_init(), and vulkan_pool_alloc().

◆ format

VkFormat AVVulkanFramesContext::format[AV_NUM_DATA_POINTERS]

Vulkan format for each image.

MUST be compatible with the pixel format. If unset, will be automatically set. There are at most two compatible formats for a frame - a multiplane format, and a single-plane multi-image format.

Definition at line 236 of file hwcontext_vulkan.h.

Referenced by create_frame(), ff_vk_decode_init(), and vulkan_frames_init().

◆ nb_layers

int AVVulkanFramesContext::nb_layers

Number of layers each image will have.

Definition at line 241 of file hwcontext_vulkan.h.

Referenced by ff_vk_decode_init(), vulkan_frames_init(), and vulkan_pool_alloc().

◆ lock_frame

void(* AVVulkanFramesContext::lock_frame) (struct AVHWFramesContext *fc, AVVkFrame *vkf)

Locks a frame, preventing other threads from changing frame properties.

Users SHOULD only ever lock just before command submission in order to get accurate frame properties, and unlock immediately after command submission without waiting for it to finish.

If unset, will be set to lavu-internal functions that utilize a mutex.

Definition at line 251 of file hwcontext_vulkan.h.

Referenced by vulkan_frames_init().

◆ unlock_frame

void(* AVVulkanFramesContext::unlock_frame) (struct AVHWFramesContext *fc, AVVkFrame *vkf)

Similar to lock_frame(), unlocks a frame.

Must only be called after locking.

Definition at line 256 of file hwcontext_vulkan.h.

Referenced by vulkan_frames_init().


The documentation for this struct was generated from the following file: