From 60fba5f380fac0c77d86bfc95a747d78f99a33b5 Mon Sep 17 00:00:00 2001 From: Thibault Saunier Date: Mon, 8 Jun 2020 12:30:59 -0400 Subject: [PATCH] docs: Add some more plugin API types And allow creating vulkan device object without specifying an instance so it can be introspected. --- docs/plugins/gst_plugins_cache.json | 135 +++++++++++++++++++++- ext/faac/gstfaac.c | 3 + ext/vulkan/vksink.c | 4 + gst-libs/gst/vulkan/gstvkphysicaldevice.c | 8 +- 4 files changed, 148 insertions(+), 2 deletions(-) diff --git a/docs/plugins/gst_plugins_cache.json b/docs/plugins/gst_plugins_cache.json index 218c479517..58300a8166 100644 --- a/docs/plugins/gst_plugins_cache.json +++ b/docs/plugins/gst_plugins_cache.json @@ -13287,7 +13287,43 @@ }, "filename": "gstfaac", "license": "LGPL", - "other-types": {}, + "other-types": { + "GstFaacBrtype": { + "kind": "enum", + "values": [ + { + "desc": "VBR", + "name": "VBR encoding", + "value": "1" + }, + { + "desc": "ABR", + "name": "ABR encoding", + "value": "2" + } + ] + }, + "GstFaacShortCtl": { + "kind": "enum", + "values": [ + { + "desc": "SHORTCTL_NORMAL", + "name": "Normal block type", + "value": "0" + }, + { + "desc": "SHORTCTL_NOSHORT", + "name": "No short blocks", + "value": "1" + }, + { + "desc": "SHORTCTL_NOLONG", + "name": "No long blocks", + "value": "2" + } + ] + } + }, "package": "GStreamer Bad Plug-ins git", "source": "gst-plugins-bad", "tracers": {}, @@ -178527,6 +178563,103 @@ "filename": "gstvulkan", "license": "LGPL", "other-types": { + "GstVulkanDevice": { + "hierarchy": [ + "GstVulkanDevice", + "GstObject", + "GInitiallyUnowned", + "GObject" + ], + "kind": "object", + "properties": { + "instance": { + "blurb": "Associated Vulkan Instance", + "conditionally-available": false, + "construct": false, + "construct-only": false, + "controllable": false, + "mutable": "playing", + "readable": true, + "type": "GstVulkanInstance", + "writable": false + }, + "physical-device": { + "blurb": "Associated Vulkan Physical Device", + "conditionally-available": false, + "construct": false, + "construct-only": true, + "controllable": false, + "mutable": "playing", + "readable": true, + "type": "GstVulkanPhysicalDevice", + "writable": true + } + } + }, + "GstVulkanInstance": { + "hierarchy": [ + "GstVulkanInstance", + "GstObject", + "GInitiallyUnowned", + "GObject" + ], + "kind": "object", + "signals": { + "create-device": { + "args": [], + "return-type": "GstVulkanDevice", + "when": "last" + } + } + }, + "GstVulkanPhysicalDevice": { + "hierarchy": [ + "GstVulkanPhysicalDevice", + "GstObject", + "GInitiallyUnowned", + "GObject" + ], + "kind": "object", + "properties": { + "device-index": { + "blurb": "Device Index", + "conditionally-available": false, + "construct": false, + "construct-only": true, + "controllable": false, + "default": "0", + "max": "-1", + "min": "0", + "mutable": "playing", + "readable": true, + "type": "guint", + "writable": true + }, + "instance": { + "blurb": "Associated Vulkan Instance", + "conditionally-available": false, + "construct": false, + "construct-only": true, + "controllable": false, + "mutable": "playing", + "readable": true, + "type": "GstVulkanInstance", + "writable": true + }, + "name": { + "blurb": "Device Name", + "conditionally-available": false, + "construct": false, + "construct-only": false, + "controllable": false, + "default": "", + "mutable": "playing", + "readable": true, + "type": "gchararray", + "writable": false + } + } + }, "GstVulkanStereoDownmix": { "kind": "enum", "values": [ diff --git a/ext/faac/gstfaac.c b/ext/faac/gstfaac.c index 8b861edce7..edae8e2ecc 100644 --- a/ext/faac/gstfaac.c +++ b/ext/faac/gstfaac.c @@ -204,6 +204,9 @@ gst_faac_class_init (GstFaacClass * klass) "Free MPEG-2/4 AAC encoder", "Ronald Bultje "); + gst_type_mark_as_plugin_api (GST_TYPE_FAAC_RATE_CONTROL, 0); + gst_type_mark_as_plugin_api (GST_TYPE_FAAC_SHORTCTL, 0); + base_class->stop = GST_DEBUG_FUNCPTR (gst_faac_stop); base_class->set_format = GST_DEBUG_FUNCPTR (gst_faac_set_format); base_class->handle_frame = GST_DEBUG_FUNCPTR (gst_faac_handle_frame); diff --git a/ext/vulkan/vksink.c b/ext/vulkan/vksink.c index 9177b98fca..ef6bde2746 100644 --- a/ext/vulkan/vksink.c +++ b/ext/vulkan/vksink.c @@ -149,6 +149,10 @@ gst_vulkan_sink_class_init (GstVulkanSinkClass * klass) gst_element_class_add_static_pad_template (element_class, &gst_vulkan_sink_template); + gst_type_mark_as_plugin_api (GST_TYPE_VULKAN_DEVICE, 0); + gst_type_mark_as_plugin_api (GST_TYPE_VULKAN_PHYSICAL_DEVICE, 0); + gst_type_mark_as_plugin_api (GST_TYPE_VULKAN_INSTANCE, 0); + gobject_class->finalize = gst_vulkan_sink_finalize; gstelement_class->change_state = gst_vulkan_sink_change_state; diff --git a/gst-libs/gst/vulkan/gstvkphysicaldevice.c b/gst-libs/gst/vulkan/gstvkphysicaldevice.c index 9091cb2f64..87de53c6ce 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)) {