tests: check if vulkan h264 decoding is supported

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/4716>
This commit is contained in:
Víctor Manuel Jáquez Leal 2023-05-23 11:52:36 +02:00
parent 365454790a
commit b982fae9c7

View file

@ -33,15 +33,19 @@ static GstVulkanQueue *queue = NULL;
static gboolean
_choose_queue (GstVulkanDevice * device, GstVulkanQueue * _queue, gpointer data)
{
#if GST_VULKAN_HAVE_VIDEO_EXTENSIONS
guint flags =
device->physical_device->queue_family_props[_queue->family].queueFlags;
guint expected_flags = VK_QUEUE_COMPUTE_BIT;
if ((flags & VK_QUEUE_COMPUTE_BIT) != 0) {
#if GST_VULKAN_HAVE_VIDEO_EXTENSIONS
if (data)
expected_flags = VK_QUEUE_VIDEO_DECODE_BIT_KHR;
#endif
if ((flags & expected_flags) != 0) {
gst_object_replace ((GstObject **) & queue, GST_OBJECT_CAST (_queue));
return FALSE;
}
#endif
return TRUE;
}
@ -175,9 +179,23 @@ GST_START_TEST (test_decoding_image)
};
/* *INDENT-ON* */
/* force to use a queue with decoding support */
if (queue && (device->physical_device->queue_family_ops[queue->family].video
& VK_VIDEO_CODEC_OPERATION_DECODE_H264_BIT_KHR) == 0)
gst_clear_object (&queue);
if (!queue) {
gst_vulkan_device_foreach_queue (device, _choose_queue,
GUINT_TO_POINTER (1));
}
if (!queue)
return;
if ((device->physical_device->queue_family_ops[queue->family].video
& VK_VIDEO_CODEC_OPERATION_DECODE_H264_BIT_KHR) == 0)
return;
dec_caps = gst_vulkan_video_profile_to_caps (&profile);
fail_unless (dec_caps);