mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2025-02-11 16:55:23 +00:00
vkvideoutils: add dec postfix to profiles
So it the future don't collide with encoding profiles. Original-patch-by: Stéphane Cerveau <scerveau@igalia.com> Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/4850>
This commit is contained in:
parent
bf7a01f3fd
commit
8ee0f04d8d
3 changed files with 19 additions and 19 deletions
|
@ -117,17 +117,17 @@ gst_vulkan_video_profile_to_caps (const GstVulkanVideoProfile * profile)
|
||||||
|
|
||||||
switch (profile->profile.videoCodecOperation) {
|
switch (profile->profile.videoCodecOperation) {
|
||||||
case VK_VIDEO_CODEC_OPERATION_DECODE_H264_BIT_KHR:
|
case VK_VIDEO_CODEC_OPERATION_DECODE_H264_BIT_KHR:
|
||||||
if (profile->codec.h264.sType == video_codecs_map[i].stype) {
|
if (profile->codec.h264dec.sType == video_codecs_map[i].stype) {
|
||||||
int j;
|
int j;
|
||||||
for (j = 0; j < G_N_ELEMENTS (h264_profile_map); j++) {
|
for (j = 0; j < G_N_ELEMENTS (h264_profile_map); j++) {
|
||||||
if (profile->codec.h264.stdProfileIdc
|
if (profile->codec.h264dec.stdProfileIdc
|
||||||
== h264_profile_map[j].vk_profile) {
|
== h264_profile_map[j].vk_profile) {
|
||||||
profile_str = h264_profile_map[j].profile_str;
|
profile_str = h264_profile_map[j].profile_str;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
for (j = 0; j < G_N_ELEMENTS (h264_layout_map); j++) {
|
for (j = 0; j < G_N_ELEMENTS (h264_layout_map); j++) {
|
||||||
if (profile->codec.h264.pictureLayout
|
if (profile->codec.h264dec.pictureLayout
|
||||||
== h264_layout_map[j].layout) {
|
== h264_layout_map[j].layout) {
|
||||||
layout = h264_layout_map[j].layout_str;
|
layout = h264_layout_map[j].layout_str;
|
||||||
break;
|
break;
|
||||||
|
@ -136,10 +136,10 @@ gst_vulkan_video_profile_to_caps (const GstVulkanVideoProfile * profile)
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case VK_VIDEO_CODEC_OPERATION_DECODE_H265_BIT_KHR:
|
case VK_VIDEO_CODEC_OPERATION_DECODE_H265_BIT_KHR:
|
||||||
if (profile->codec.h265.sType == video_codecs_map[i].stype) {
|
if (profile->codec.h265dec.sType == video_codecs_map[i].stype) {
|
||||||
int j;
|
int j;
|
||||||
for (j = 0; j < G_N_ELEMENTS (h265_profile_map); j++) {
|
for (j = 0; j < G_N_ELEMENTS (h265_profile_map); j++) {
|
||||||
if (profile->codec.h265.stdProfileIdc
|
if (profile->codec.h265dec.stdProfileIdc
|
||||||
== h265_profile_map[j].vk_profile)
|
== h265_profile_map[j].vk_profile)
|
||||||
profile_str = h265_profile_map[j].profile_str;
|
profile_str = h265_profile_map[j].profile_str;
|
||||||
}
|
}
|
||||||
|
@ -235,17 +235,17 @@ gst_vulkan_video_profile_from_caps (GstVulkanVideoProfile * profile,
|
||||||
case VK_VIDEO_CODEC_OPERATION_DECODE_H264_BIT_KHR:{
|
case VK_VIDEO_CODEC_OPERATION_DECODE_H264_BIT_KHR:{
|
||||||
int j;
|
int j;
|
||||||
|
|
||||||
profile->codec.h264.sType = video_codecs_map[i].stype;
|
profile->codec.h264dec.sType = video_codecs_map[i].stype;
|
||||||
profile->codec.h264.stdProfileIdc =
|
profile->codec.h264dec.stdProfileIdc =
|
||||||
STD_VIDEO_H264_PROFILE_IDC_INVALID;
|
STD_VIDEO_H264_PROFILE_IDC_INVALID;
|
||||||
profile->codec.h264.pictureLayout =
|
profile->codec.h264dec.pictureLayout =
|
||||||
VK_VIDEO_DECODE_H264_PICTURE_LAYOUT_FLAG_BITS_MAX_ENUM_KHR;
|
VK_VIDEO_DECODE_H264_PICTURE_LAYOUT_FLAG_BITS_MAX_ENUM_KHR;
|
||||||
profile->usage.pNext = &profile->codec;
|
profile->usage.pNext = &profile->codec;
|
||||||
|
|
||||||
profile_str = gst_structure_get_string (structure, "profile");
|
profile_str = gst_structure_get_string (structure, "profile");
|
||||||
for (j = 0; profile_str && j < G_N_ELEMENTS (h264_profile_map); j++) {
|
for (j = 0; profile_str && j < G_N_ELEMENTS (h264_profile_map); j++) {
|
||||||
if (g_strcmp0 (profile_str, h264_profile_map[j].profile_str) == 0) {
|
if (g_strcmp0 (profile_str, h264_profile_map[j].profile_str) == 0) {
|
||||||
profile->codec.h264.stdProfileIdc =
|
profile->codec.h264dec.stdProfileIdc =
|
||||||
h264_profile_map[j].vk_profile;
|
h264_profile_map[j].vk_profile;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
@ -253,7 +253,7 @@ gst_vulkan_video_profile_from_caps (GstVulkanVideoProfile * profile,
|
||||||
layout = gst_structure_get_string (structure, "interlace-mode");
|
layout = gst_structure_get_string (structure, "interlace-mode");
|
||||||
for (j = 0; layout && j < G_N_ELEMENTS (h264_layout_map); j++) {
|
for (j = 0; layout && j < G_N_ELEMENTS (h264_layout_map); j++) {
|
||||||
if (g_strcmp0 (layout, h264_layout_map[j].layout_str) == 0) {
|
if (g_strcmp0 (layout, h264_layout_map[j].layout_str) == 0) {
|
||||||
profile->codec.h264.pictureLayout = h264_layout_map[j].layout;
|
profile->codec.h264dec.pictureLayout = h264_layout_map[j].layout;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -262,15 +262,15 @@ gst_vulkan_video_profile_from_caps (GstVulkanVideoProfile * profile,
|
||||||
case VK_VIDEO_CODEC_OPERATION_DECODE_H265_BIT_KHR:{
|
case VK_VIDEO_CODEC_OPERATION_DECODE_H265_BIT_KHR:{
|
||||||
int j;
|
int j;
|
||||||
|
|
||||||
profile->codec.h265.sType = video_codecs_map[i].stype;
|
profile->codec.h265dec.sType = video_codecs_map[i].stype;
|
||||||
profile->codec.h265.stdProfileIdc =
|
profile->codec.h265dec.stdProfileIdc =
|
||||||
STD_VIDEO_H265_PROFILE_IDC_INVALID;
|
STD_VIDEO_H265_PROFILE_IDC_INVALID;
|
||||||
profile->usage.pNext = &profile->codec;
|
profile->usage.pNext = &profile->codec;
|
||||||
|
|
||||||
profile_str = gst_structure_get_string (structure, "profile");
|
profile_str = gst_structure_get_string (structure, "profile");
|
||||||
for (j = 0; profile_str && j < G_N_ELEMENTS (h265_profile_map); j++) {
|
for (j = 0; profile_str && j < G_N_ELEMENTS (h265_profile_map); j++) {
|
||||||
if (g_strcmp0 (profile_str, h265_profile_map[j].profile_str) == 0) {
|
if (g_strcmp0 (profile_str, h265_profile_map[j].profile_str) == 0) {
|
||||||
profile->codec.h265.stdProfileIdc =
|
profile->codec.h265dec.stdProfileIdc =
|
||||||
h265_profile_map[j].vk_profile;
|
h265_profile_map[j].vk_profile;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
|
@ -40,8 +40,8 @@ struct _GstVulkanVideoProfile
|
||||||
VkVideoDecodeUsageInfoKHR usage;
|
VkVideoDecodeUsageInfoKHR usage;
|
||||||
union {
|
union {
|
||||||
VkBaseInStructure base;
|
VkBaseInStructure base;
|
||||||
VkVideoDecodeH264ProfileInfoKHR h264;
|
VkVideoDecodeH264ProfileInfoKHR h264dec;
|
||||||
VkVideoDecodeH265ProfileInfoKHR h265;
|
VkVideoDecodeH265ProfileInfoKHR h265dec;
|
||||||
} codec;
|
} codec;
|
||||||
#endif
|
#endif
|
||||||
gpointer _reserved[GST_PADDING];
|
gpointer _reserved[GST_PADDING];
|
||||||
|
|
|
@ -134,7 +134,7 @@ GST_START_TEST (test_vulkan_profiles)
|
||||||
.chromaBitDepth = VK_VIDEO_COMPONENT_BIT_DEPTH_10_BIT_KHR,
|
.chromaBitDepth = VK_VIDEO_COMPONENT_BIT_DEPTH_10_BIT_KHR,
|
||||||
.lumaBitDepth = VK_VIDEO_COMPONENT_BIT_DEPTH_10_BIT_KHR,
|
.lumaBitDepth = VK_VIDEO_COMPONENT_BIT_DEPTH_10_BIT_KHR,
|
||||||
},
|
},
|
||||||
.codec.h265 = {
|
.codec.h265dec = {
|
||||||
.sType = VK_STRUCTURE_TYPE_VIDEO_DECODE_H265_PROFILE_INFO_KHR,
|
.sType = VK_STRUCTURE_TYPE_VIDEO_DECODE_H265_PROFILE_INFO_KHR,
|
||||||
.stdProfileIdc = STD_VIDEO_H265_PROFILE_IDC_MAIN_10,
|
.stdProfileIdc = STD_VIDEO_H265_PROFILE_IDC_MAIN_10,
|
||||||
}
|
}
|
||||||
|
@ -150,8 +150,8 @@ GST_START_TEST (test_vulkan_profiles)
|
||||||
== VK_STRUCTURE_TYPE_VIDEO_PROFILE_INFO_KHR);
|
== VK_STRUCTURE_TYPE_VIDEO_PROFILE_INFO_KHR);
|
||||||
fail_unless (profile2.profile.videoCodecOperation
|
fail_unless (profile2.profile.videoCodecOperation
|
||||||
== profile.profile.videoCodecOperation);
|
== profile.profile.videoCodecOperation);
|
||||||
fail_unless (profile2.codec.h265.stdProfileIdc
|
fail_unless (profile2.codec.h265dec.stdProfileIdc
|
||||||
== profile.codec.h265.stdProfileIdc);
|
== profile.codec.h265dec.stdProfileIdc);
|
||||||
}
|
}
|
||||||
|
|
||||||
GST_END_TEST;
|
GST_END_TEST;
|
||||||
|
@ -172,7 +172,7 @@ GST_START_TEST (test_decoding_image)
|
||||||
.chromaBitDepth = VK_VIDEO_COMPONENT_BIT_DEPTH_8_BIT_KHR,
|
.chromaBitDepth = VK_VIDEO_COMPONENT_BIT_DEPTH_8_BIT_KHR,
|
||||||
.lumaBitDepth = VK_VIDEO_COMPONENT_BIT_DEPTH_8_BIT_KHR,
|
.lumaBitDepth = VK_VIDEO_COMPONENT_BIT_DEPTH_8_BIT_KHR,
|
||||||
},
|
},
|
||||||
.codec.h264 = {
|
.codec.h264dec = {
|
||||||
.sType = VK_STRUCTURE_TYPE_VIDEO_DECODE_H264_PROFILE_INFO_KHR,
|
.sType = VK_STRUCTURE_TYPE_VIDEO_DECODE_H264_PROFILE_INFO_KHR,
|
||||||
.stdProfileIdc = STD_VIDEO_H264_PROFILE_IDC_MAIN,
|
.stdProfileIdc = STD_VIDEO_H264_PROFILE_IDC_MAIN,
|
||||||
.pictureLayout = VK_VIDEO_DECODE_H264_PICTURE_LAYOUT_PROGRESSIVE_KHR,
|
.pictureLayout = VK_VIDEO_DECODE_H264_PICTURE_LAYOUT_PROGRESSIVE_KHR,
|
||||||
|
|
Loading…
Reference in a new issue