docs: Add some more plugin API types
authorThibault Saunier <tsaunier@igalia.com>
Mon, 8 Jun 2020 16:30:59 +0000 (12:30 -0400)
committerThibault Saunier <tsaunier@igalia.com>
Tue, 9 Jun 2020 16:28:13 +0000 (12:28 -0400)
And allow creating vulkan device object without specifying an instance
so it can be introspected.

docs/plugins/gst_plugins_cache.json
ext/faac/gstfaac.c
ext/vulkan/vksink.c
gst-libs/gst/vulkan/gstvkphysicaldevice.c

index 218c479517c933bf8afaa8f61a12f26570072cb6..58300a8166f848406b996560200a727158842d02 100644 (file)
         },
         "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": {},
         "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": [
index 8b861edce7b36c8364d65db6c60733aa8fdf287c..edae8e2eccdf55f5b8677e9cb11ff7b948542d53 100644 (file)
@@ -204,6 +204,9 @@ gst_faac_class_init (GstFaacClass * klass)
       "Free MPEG-2/4 AAC encoder",
       "Ronald Bultje <rbultje@ronald.bitfreak.net>");
 
+  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);
index 9177b98fca0dc8b6b281d30bd942d6d85a15110b..ef6bde2746a59f494333689f131d28495225cd39 100644 (file)
@@ -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;
index 9091cb2f6407470b7780a141f89a2910212ec178..87de53c6ce957c0a685669a9742342de8d14f276 100644 (file)
@@ -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)) {