From f896e2a3478b9b8ba51a52b544697c2ccada18dc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?V=C3=ADctor=20Manuel=20J=C3=A1quez=20Leal?= Date: Wed, 9 Aug 2023 11:28:37 +0200 Subject: [PATCH] vkvideoutils: add VkVideoDecodeUsageInfoKHR in profile Part-of: --- .../gst-libs/gst/vulkan/gstvkvideoutils.c | 10 +++++++--- .../gst-libs/gst/vulkan/gstvkvideoutils.h | 1 + 2 files changed, 8 insertions(+), 3 deletions(-) diff --git a/subprojects/gst-plugins-bad/gst-libs/gst/vulkan/gstvkvideoutils.c b/subprojects/gst-plugins-bad/gst-libs/gst/vulkan/gstvkvideoutils.c index bb24cf9aa9..47e372377e 100644 --- a/subprojects/gst-plugins-bad/gst-libs/gst/vulkan/gstvkvideoutils.c +++ b/subprojects/gst-plugins-bad/gst-libs/gst/vulkan/gstvkvideoutils.c @@ -220,7 +220,11 @@ gst_vulkan_video_profile_from_caps (GstVulkanVideoProfile * profile, structure = gst_caps_get_structure (caps, 0); + profile->usage.sType = VK_STRUCTURE_TYPE_VIDEO_DECODE_USAGE_INFO_KHR; + profile->usage.videoUsageHints = VK_VIDEO_DECODE_USAGE_DEFAULT_KHR; + profile->profile.sType = VK_STRUCTURE_TYPE_VIDEO_PROFILE_INFO_KHR; + profile->profile.pNext = &profile->usage; mime = gst_structure_get_name (structure); for (i = 0; i < G_N_ELEMENTS (video_codecs_map); i++) { @@ -236,7 +240,7 @@ gst_vulkan_video_profile_from_caps (GstVulkanVideoProfile * profile, STD_VIDEO_H264_PROFILE_IDC_INVALID; profile->codec.h264.pictureLayout = VK_VIDEO_DECODE_H264_PICTURE_LAYOUT_FLAG_BITS_MAX_ENUM_KHR; - profile->profile.pNext = &profile->codec; + profile->usage.pNext = &profile->codec; profile_str = gst_structure_get_string (structure, "profile"); for (j = 0; profile_str && j < G_N_ELEMENTS (h264_profile_map); j++) { @@ -261,7 +265,7 @@ gst_vulkan_video_profile_from_caps (GstVulkanVideoProfile * profile, profile->codec.h265.sType = video_codecs_map[i].stype; profile->codec.h265.stdProfileIdc = STD_VIDEO_H265_PROFILE_IDC_INVALID; - profile->profile.pNext = &profile->codec; + profile->usage.pNext = &profile->codec; profile_str = gst_structure_get_string (structure, "profile"); for (j = 0; profile_str && j < G_N_ELEMENTS (h265_profile_map); j++) { @@ -274,7 +278,7 @@ gst_vulkan_video_profile_from_caps (GstVulkanVideoProfile * profile, break; } default: - profile->profile.pNext = NULL; + profile->usage.pNext = NULL; break; } diff --git a/subprojects/gst-plugins-bad/gst-libs/gst/vulkan/gstvkvideoutils.h b/subprojects/gst-plugins-bad/gst-libs/gst/vulkan/gstvkvideoutils.h index 9b90e08ebe..1bee84f34a 100644 --- a/subprojects/gst-plugins-bad/gst-libs/gst/vulkan/gstvkvideoutils.h +++ b/subprojects/gst-plugins-bad/gst-libs/gst/vulkan/gstvkvideoutils.h @@ -37,6 +37,7 @@ struct _GstVulkanVideoProfile /*< private >*/ #if GST_VULKAN_HAVE_VIDEO_EXTENSIONS VkVideoProfileInfoKHR profile; + VkVideoDecodeUsageInfoKHR usage; union { VkVideoDecodeH264ProfileInfoKHR h264; VkVideoDecodeH265ProfileInfoKHR h265;