summaryrefslogtreecommitdiff
path: root/libavutil/hwcontext_vulkan.h
diff options
context:
space:
mode:
authorWenbin Chen <wenbin.chen@intel.com>2021-12-07 17:05:53 +0800
committerLynne <dev@lynne.ee>2021-12-10 17:03:48 +0100
commit83fe28221e92921f74d99ed15c258a3c79f4441d (patch)
treeb749c1f3240012bc895e5f4259e2fc2b3abf291e /libavutil/hwcontext_vulkan.h
parent0d524b170ec4bf762e11c49743d813de650d409a (diff)
hwcontext_vulkan: support creating DRM-tiled images and autodetecting modifiers
When vulkan image exports to drm, the tilling need to be VK_IMAGE_TILING_DRM_FORMAT_MODIFIER_EXT. Now add code to create vulkan image using this format. Now the following command line works: ffmpeg -hwaccel vaapi -hwaccel_device /dev/dri/renderD128 -hwaccel_output_format \ vaapi -i input_1080p.264 -vf "hwmap=derive_device=vulkan,format=vulkan, \ scale_vulkan=1920:1080,hwmap=derive_device=vaapi,format=vaapi" -c:v h264_vaapi output.264 Signed-off-by: Wenbin Chen <wenbin.chen@intel.com> Further-modifications-by: Lynne <dev@lynne.ee>
Diffstat (limited to 'libavutil/hwcontext_vulkan.h')
-rw-r--r--libavutil/hwcontext_vulkan.h11
1 files changed, 10 insertions, 1 deletions
diff --git a/libavutil/hwcontext_vulkan.h b/libavutil/hwcontext_vulkan.h
index ed59fe9f0a..8de79f5f33 100644
--- a/libavutil/hwcontext_vulkan.h
+++ b/libavutil/hwcontext_vulkan.h
@@ -156,7 +156,10 @@ typedef enum AVVkFrameFlags {
*/
typedef struct AVVulkanFramesContext {
/**
- * Controls the tiling of allocated frames.
+ * Controls the tiling of allocated frames. If left as optimal tiling,
+ * then during av_hwframe_ctx_init() will decide based on whether the device
+ * supports DRM modifiers, or if the linear_images flag is set, otherwise
+ * will allocate optimally-tiled images.
*/
VkImageTiling tiling;
@@ -168,6 +171,12 @@ typedef struct AVVulkanFramesContext {
/**
* Extension data for image creation.
+ * If VkImageDrmFormatModifierListCreateInfoEXT is present in the chain,
+ * and the device supports DRM modifiers, then images will be allocated
+ * with the specific requested DRM modifiers.
+ * Additional structures may be added at av_hwframe_ctx_init() time,
+ * which will be freed automatically on uninit(), so users need only free
+ * any structures they've allocated themselves.
*/
void *create_pnext;