mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2024-12-23 00:36:51 +00:00
tests: check if vulkan h264 decoding is supported
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/4716>
This commit is contained in:
parent
365454790a
commit
b982fae9c7
1 changed files with 21 additions and 3 deletions
|
@ -33,15 +33,19 @@ static GstVulkanQueue *queue = NULL;
|
||||||
static gboolean
|
static gboolean
|
||||||
_choose_queue (GstVulkanDevice * device, GstVulkanQueue * _queue, gpointer data)
|
_choose_queue (GstVulkanDevice * device, GstVulkanQueue * _queue, gpointer data)
|
||||||
{
|
{
|
||||||
#if GST_VULKAN_HAVE_VIDEO_EXTENSIONS
|
|
||||||
guint flags =
|
guint flags =
|
||||||
device->physical_device->queue_family_props[_queue->family].queueFlags;
|
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));
|
gst_object_replace ((GstObject **) & queue, GST_OBJECT_CAST (_queue));
|
||||||
return FALSE;
|
return FALSE;
|
||||||
}
|
}
|
||||||
#endif
|
|
||||||
|
|
||||||
return TRUE;
|
return TRUE;
|
||||||
}
|
}
|
||||||
|
@ -175,9 +179,23 @@ GST_START_TEST (test_decoding_image)
|
||||||
};
|
};
|
||||||
/* *INDENT-ON* */
|
/* *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)
|
if (!queue)
|
||||||
return;
|
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);
|
dec_caps = gst_vulkan_video_profile_to_caps (&profile);
|
||||||
fail_unless (dec_caps);
|
fail_unless (dec_caps);
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue