{
PROP_DISPLAY_NAME = 1,
PROP_CAPS,
- PROP_DEVICE_CLASS
+ PROP_DEVICE_CLASS,
+ PROP_PROPERTIES
};
enum
GstCaps *caps;
gchar *device_class;
gchar *display_name;
+ GstStructure *properties;
};
g_param_spec_string ("device-class", "Device Class",
"The Class of the device", "",
G_PARAM_STATIC_STRINGS | G_PARAM_READWRITE | G_PARAM_CONSTRUCT_ONLY));
+ g_object_class_install_property (object_class, PROP_PROPERTIES,
+ g_param_spec_boxed ("properties", "Properties",
+ "The extra properties of the device", GST_TYPE_STRUCTURE,
+ G_PARAM_STATIC_STRINGS | G_PARAM_READWRITE | G_PARAM_CONSTRUCT_ONLY));
signals[REMOVED] = g_signal_new ("removed", G_TYPE_FROM_CLASS (klass),
G_SIGNAL_RUN_LAST, 0, NULL, NULL, NULL, G_TYPE_NONE, 0);
gst_caps_replace (&device->priv->caps, NULL);
+ if (device->priv->properties)
+ gst_structure_free (device->priv->properties);
g_free (device->priv->display_name);
g_free (device->priv->device_class);
case PROP_DEVICE_CLASS:
g_value_take_string (value, gst_device_get_device_class (gstdevice));
break;
+ case PROP_PROPERTIES:
+ if (gstdevice->priv->properties)
+ g_value_take_boxed (value, gst_device_get_properties (gstdevice));
+ break;
default:
G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
break;
case PROP_DEVICE_CLASS:
gstdevice->priv->device_class = g_value_dup_string (value);
break;
+ case PROP_PROPERTIES:
+ if (gstdevice->priv->properties)
+ gst_structure_free (gstdevice->priv->properties);
+ gstdevice->priv->properties = g_value_dup_boxed (value);
+ break;
default:
G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
break;
}
/**
+ * gst_device_get_properties:
+ * @device: a #GstDevice
+ *
+ * Gets the extra properties of a device.
+ *
+ * Returns: The extra properties or %NULL when there are none.
+ * Free with gst_structure_free() after use.
+ *
+ * Since: 1.6
+ */
+GstStructure *
+gst_device_get_properties (GstDevice * device)
+{
+ g_return_val_if_fail (GST_IS_DEVICE (device), NULL);
+
+ if (device->priv->properties != NULL)
+ return gst_structure_copy (device->priv->properties);
+ else
+ return NULL;
+}
+
+/**
* gst_device_reconfigure_element:
* @device: a #GstDevice
* @element: a #GstElement
struct _GstDeviceClass {
GstObjectClass parent_class;
- GstElement * (*create_element) (GstDevice * device, const gchar * name);
- gboolean (*reconfigure_element) (GstDevice * device, GstElement * element);
+ GstElement * (*create_element) (GstDevice * device, const gchar * name);
+ gboolean (*reconfigure_element) (GstDevice * device, GstElement * element);
/*< private >*/
gpointer _gst_reserved[GST_PADDING];
};
-GType gst_device_get_type (void);
+GType gst_device_get_type (void);
-GstElement * gst_device_create_element (GstDevice * device, const gchar * name);
+GstElement * gst_device_create_element (GstDevice * device, const gchar * name);
-GstCaps * gst_device_get_caps (GstDevice * device);
-gchar * gst_device_get_display_name (GstDevice * device);
-gchar * gst_device_get_device_class (GstDevice * device);
-gboolean gst_device_reconfigure_element (GstDevice * device,
- GstElement * element);
+GstCaps * gst_device_get_caps (GstDevice * device);
+gchar * gst_device_get_display_name (GstDevice * device);
+gchar * gst_device_get_device_class (GstDevice * device);
+GstStructure * gst_device_get_properties (GstDevice * device);
+gboolean gst_device_reconfigure_element (GstDevice * device,
+ GstElement * element);
-gboolean gst_device_has_classesv (GstDevice * device,
- gchar ** classes);
+gboolean gst_device_has_classesv (GstDevice * device,
+ gchar ** classes);
-gboolean gst_device_has_classes (GstDevice * device,
- const gchar * classes);
+gboolean gst_device_has_classes (GstDevice * device,
+ const gchar * classes);
G_END_DECLS