summaryrefslogtreecommitdiff
path: root/gst-libs/gst/vulkan
diff options
context:
space:
mode:
authorThibault Saunier <tsaunier@igalia.com>2020-06-08 12:30:59 -0400
committerThibault Saunier <tsaunier@igalia.com>2020-06-09 12:28:13 -0400
commit60fba5f380fac0c77d86bfc95a747d78f99a33b5 (patch)
treec3f427b3db53208ec999c94a2a00273b0ea6a84e /gst-libs/gst/vulkan
parent3a98a3737532604ddcf465612f4e8d9cb88ea15d (diff)
downloadgstreamer-plugins-bad-60fba5f380fac0c77d86bfc95a747d78f99a33b5.tar.gz
docs: Add some more plugin API types
And allow creating vulkan device object without specifying an instance so it can be introspected.
Diffstat (limited to 'gst-libs/gst/vulkan')
-rw-r--r--gst-libs/gst/vulkan/gstvkphysicaldevice.c8
1 files changed, 7 insertions, 1 deletions
diff --git a/gst-libs/gst/vulkan/gstvkphysicaldevice.c b/gst-libs/gst/vulkan/gstvkphysicaldevice.c
index 9091cb2f6..87de53c6c 100644
--- a/gst-libs/gst/vulkan/gstvkphysicaldevice.c
+++ b/gst-libs/gst/vulkan/gstvkphysicaldevice.c
@@ -112,7 +112,8 @@ gst_vulkan_physical_device_set_property (GObject * object, guint prop_id,
break;
case PROP_DEVICE_ID:{
guint device_id = g_value_get_uint (value);
- if (device_id >= device->instance->n_physical_devices) {
+ if (device->instance == VK_NULL_HANDLE
+ || device_id >= device->instance->n_physical_devices) {
g_critical ("%s: Cannot set device-index larger than the "
"number of physical devices", GST_OBJECT_NAME (device));
} else {
@@ -159,6 +160,11 @@ gst_vulkan_physical_device_constructed (GObject * object)
GstVulkanPhysicalDevice *device = GST_VULKAN_PHYSICAL_DEVICE (object);
GError *error = NULL;
+ if (device->instance == VK_NULL_HANDLE) {
+ GST_ERROR_OBJECT (object, "Constructed without any instance set");
+ return;
+ }
+
device->device = device->instance->physical_devices[device->device_index];
if (!gst_vulkan_physical_device_fill_info (device, &error)) {