Loading...
Searching...
No Matches
AVVulkanFramesContext Struct Reference

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

`#include <libavutil/hwcontext_vulkan.h>`

## Data Fields

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

## Detailed Description

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

Definition at line 220 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 229 of file hwcontext_vulkan.h.

## usage

VkImageUsageFlagBits AVVulkanFramesContext::usage

Defines extra usage of output frames.

If non-zero, all flags MUST be supported by the VkFormat. Regardless, frames will always have the following usage flags enabled, if supported by the format:

- 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 240 of file hwcontext_vulkan.h.

## 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 251 of file hwcontext_vulkan.h.

## 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 260 of file hwcontext_vulkan.h.

## 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 267 of file hwcontext_vulkan.h.

## img_flags

VkImageCreateFlags AVVulkanFramesContext::img_flags

Flags to set during image creation.

If unset, defaults to VK_IMAGE_CREATE_ALIAS_BIT.

Definition at line 273 of file hwcontext_vulkan.h.

## 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 281 of file hwcontext_vulkan.h.

## nb_layers

int AVVulkanFramesContext::nb_layers

Number of layers each image will have.

Definition at line 286 of file hwcontext_vulkan.h.

## 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 296 of file hwcontext_vulkan.h.

## 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 301 of file hwcontext_vulkan.h.

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

- libavutil/hwcontext_vulkan.h