Commit 7992174a authored by Olivier Crête's avatar Olivier Crête 👻

DeviceProvider: Rename from DeviceMonitor

parent 4720e6d0
......@@ -117,10 +117,10 @@ Windows. It is released under the GNU Library General Public License
<chapter id="gstreamer-device-probing">
<title>GStreamer Device Discovery and Device Probing</title>
<xi:include href="xml/gstdevice.xml" />
<xi:include href="xml/gstdevicemonitor.xml" />
<xi:include href="xml/gstdevicemonitorfactory.xml" />
<xi:include href="xml/gstglobaldevicemonitor.xml" />
<xi:include href="xml/gstdevice.xml" />
<xi:include href="xml/gstdeviceprovider.xml" />
<xi:include href="xml/gstdeviceproviderfactory.xml" />
</chapter>
<chapter id="gstreamer-support">
......
......@@ -3353,61 +3353,61 @@ gst_device_get_type
</SECTION>
<SECTION>
<FILE>gstdevicemonitor</FILE>
<TITLE>GstDeviceMonitor</TITLE>
GstDeviceMonitor
GstDeviceMonitorClass
gst_device_monitor_can_monitor
gst_device_monitor_class_add_metadata
gst_device_monitor_class_add_static_metadata
gst_device_monitor_class_get_metadata
gst_device_monitor_class_set_metadata
gst_device_monitor_class_set_static_metadata
gst_device_monitor_device_add
gst_device_monitor_device_remove
gst_device_monitor_get_bus
gst_device_monitor_get_devices
gst_device_monitor_get_factory
gst_device_monitor_register
gst_device_monitor_start
gst_device_monitor_stop
<FILE>gstdeviceprovider</FILE>
<TITLE>GstDeviceProvider</TITLE>
GstDeviceProvider
GstDeviceProviderClass
gst_device_provider_can_monitor
gst_device_provider_class_add_metadata
gst_device_provider_class_add_static_metadata
gst_device_provider_class_get_metadata
gst_device_provider_class_set_metadata
gst_device_provider_class_set_static_metadata
gst_device_provider_device_add
gst_device_provider_device_remove
gst_device_provider_get_bus
gst_device_provider_get_devices
gst_device_provider_get_factory
gst_device_provider_register
gst_device_provider_start
gst_device_provider_stop
<SUBSECTION Standard>
GstDevicePrivate
GST_DEVICE_MONITOR
GST_DEVICE_MONITOR_CAST
GST_DEVICE_MONITOR_CLASS
GST_DEVICE_MONITOR_GET_CLASS
GST_IS_DEVICE_MONITOR
GST_IS_DEVICE_MONITOR_CLASS
GST_TYPE_DEVICE_MONITOR
gst_device_monitor_get_type
GST_DEVICE_PROVIDER
GST_DEVICE_PROVIDER_CAST
GST_DEVICE_PROVIDER_CLASS
GST_DEVICE_PROVIDER_GET_CLASS
GST_IS_DEVICE_PROVIDER
GST_IS_DEVICE_PROVIDER_CLASS
GST_TYPE_DEVICE_PROVIDER
gst_device_provider_get_type
</SECTION>
<SECTION>
<FILE>gstdevicemonitorfactory</FILE>
<TITLE>GstDeviceMonitorFactory</TITLE>
GstDeviceMonitorFactory
GstDeviceMonitorFactoryClass
gst_device_monitor_factory_find
gst_device_monitor_factory_get
gst_device_monitor_factory_get_by_name
gst_device_monitor_factory_get_device_monitor_type
gst_device_monitor_factory_get_metadata
gst_device_monitor_factory_get_metadata_keys
gst_device_monitor_factory_has_classes
gst_device_monitor_factory_has_classesv
gst_device_monitor_factory_list_get_device_monitors
<FILE>gstdeviceproviderfactory</FILE>
<TITLE>GstDeviceProviderFactory</TITLE>
GstDeviceProviderFactory
GstDeviceProviderFactoryClass
gst_device_provider_factory_find
gst_device_provider_factory_get
gst_device_provider_factory_get_by_name
gst_device_provider_factory_get_device_provider_type
gst_device_provider_factory_get_metadata
gst_device_provider_factory_get_metadata_keys
gst_device_provider_factory_has_classes
gst_device_provider_factory_has_classesv
gst_device_provider_factory_list_get_device_providers
<SUBSECTION Standard>
GstDeviceMonitorPrivate
GST_DEVICE_MONITOR_FACTORY
GST_DEVICE_MONITOR_FACTORY_CAST
GST_DEVICE_MONITOR_FACTORY_CLASS
GST_TYPE_DEVICE_MONITOR_FACTORY
GST_IS_DEVICE_MONITOR_FACTORY
GST_IS_DEVICE_MONITOR_FACTORY_CLASS
gst_device_monitor_factory_get_type
GstDeviceProviderPrivate
GST_DEVICE_PROVIDER_FACTORY
GST_DEVICE_PROVIDER_FACTORY_CAST
GST_DEVICE_PROVIDER_FACTORY_CLASS
GST_TYPE_DEVICE_PROVIDER_FACTORY
GST_IS_DEVICE_PROVIDER_FACTORY
GST_IS_DEVICE_PROVIDER_FACTORY_CLASS
gst_device_provider_factory_get_type
</SECTION>
<SECTION>
......
......@@ -36,7 +36,7 @@ GObject
GstPadTemplate
GstPlugin
GstPluginFeature
GstDeviceMonitorFactory
GstDeviceProviderFactory
GstElementFactory
GstTypeFindFactory
GstRegistry
......
......@@ -72,8 +72,8 @@ libgstreamer_@GST_API_VERSION@_la_SOURCES = \
gstdatetime.c \
gstdebugutils.c \
gstdevice.c \
gstdevicemonitor.c \
gstdevicemonitorfactory.c \
gstdeviceprovider.c \
gstdeviceproviderfactory.c \
gstelement.c \
gstelementfactory.c \
gsterror.c \
......@@ -177,8 +177,8 @@ gst_headers = \
gstelement.h \
gstelementmetadata.h \
gstdevice.h \
gstdevicemonitor.h \
gstdevicemonitorfactory.h \
gstdeviceprovider.h \
gstdeviceproviderfactory.h \
gstelementfactory.h \
gsterror.h \
gstevent.h \
......
......@@ -43,7 +43,7 @@
#include <gst/gstdatetime.h>
#include <gst/gstdebugutils.h>
#include <gst/gstdevice.h>
#include <gst/gstdevicemonitor.h>
#include <gst/gstdeviceprovider.h>
#include <gst/gstelement.h>
#include <gst/gstelementmetadata.h>
#include <gst/gsterror.h>
......
......@@ -54,8 +54,8 @@ extern const char g_log_domain_gstreamer[];
/* for GstElement */
#include "gstelement.h"
/* for GstDeviceMonitor */
#include "gstdevicemonitor.h"
/* for GstDeviceProvider */
#include "gstdeviceprovider.h"
/* for GstToc */
#include "gsttoc.h"
......@@ -399,19 +399,19 @@ struct _GstElementFactoryClass {
gpointer _gst_reserved[GST_PADDING];
};
struct _GstDeviceMonitorFactory {
struct _GstDeviceProviderFactory {
GstPluginFeature feature;
/* <private> */
GType type; /* unique GType the device factory or 0 if not loaded */
volatile GstDeviceMonitor *monitor;
volatile GstDeviceProvider *provider;
gpointer metadata;
gpointer _gst_reserved[GST_PADDING];
};
struct _GstDeviceMonitorFactoryClass {
struct _GstDeviceProviderFactoryClass {
GstPluginFeatureClass parent;
/* <private> */
......
......@@ -22,13 +22,13 @@
/**
* SECTION:gstdevice
* @short_description: Object representing a device
* @see_also: #GstDeviceMonitor
* @see_also: #GstDeviceProvider
*
* #GstDevice are objects representing a device, they contain
* relevant metadata about the device, such as its class and the #GstCaps
* representing the media types it can produce or handle.
*
* #GstDevice are created by #GstDeviceMonitor objects which can be
* #GstDevice are created by #GstDeviceProvider objects which can be
* aggregated by #GstGlobalDeviceMonitor objects.
*
* Since: 1.4
......@@ -239,7 +239,7 @@ gst_device_get_display_name (GstDevice * device)
*
* Gets the "class" of a device. This is a "/" separated list of
* classes that represent this device. They are a subset of the
* classes of the #GstDeviceMonitor that produced this device.
* classes of the #GstDeviceProvider that produced this device.
*
* Returns: The device class. Free with g_free() after use.
*
......
/* GStreamer
* Copyright (C) 2012 Olivier Crete <olivier.crete@collabora.com>
*
* gstdevicemonitor.c: Device probing and monitoring
* gstdeviceprovider.c: Device probing and monitoring
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Library General Public
......@@ -20,19 +20,19 @@
*/
/**
* SECTION:gstdevicemonitor
* @short_description: A device monitor and prober
* SECTION:gstdeviceprovider
* @short_description: A device provider, monitor and prober
* @see_also: #GstDevice, #GstGlobalDeviceMonitor
*
* A #GstDeviceMonitor subclass is provided by a plugin that handles devices
* A #GstDeviceProvider subclass is provided by a plugin that handles devices
* if there is a way to programatically list connected devices. It can also
* optionally provide updates to the list of connected devices.
*
* Each #GstDeviceMonitor subclass is a singleton, a plugin should
* Each #GstDeviceProvider subclass is a singleton, a plugin should
* normally provide a single subclass for all devices.
*
* Applications would normally use a #GstGlobalDeviceMonitor to monitor devices
* from all revelant monitors.
* from all relevant providers.
*
* Since: 1.4
*/
......@@ -43,12 +43,12 @@
#include "gst_private.h"
#include "gstdevicemonitor.h"
#include "gstdeviceprovider.h"
#include "gstelementmetadata.h"
#include "gstquark.h"
struct _GstDeviceMonitorPrivate
struct _GstDeviceProviderPrivate
{
GstBus *bus;
......@@ -58,51 +58,51 @@ struct _GstDeviceMonitorPrivate
};
/* this is used in gstelementfactory.c:gst_element_register() */
GQuark __gst_devicemonitorclass_factory = 0;
GQuark __gst_deviceproviderclass_factory = 0;
static void gst_device_monitor_class_init (GstDeviceMonitorClass * klass);
static void gst_device_monitor_init (GstDeviceMonitor * element);
static void gst_device_monitor_base_class_init (gpointer g_class);
static void gst_device_monitor_base_class_finalize (gpointer g_class);
static void gst_device_monitor_dispose (GObject * object);
static void gst_device_monitor_finalize (GObject * object);
static void gst_device_provider_class_init (GstDeviceProviderClass * klass);
static void gst_device_provider_init (GstDeviceProvider * element);
static void gst_device_provider_base_class_init (gpointer g_class);
static void gst_device_provider_base_class_finalize (gpointer g_class);
static void gst_device_provider_dispose (GObject * object);
static void gst_device_provider_finalize (GObject * object);
static gpointer gst_device_monitor_parent_class = NULL;
static gpointer gst_device_provider_parent_class = NULL;
GType
gst_device_monitor_get_type (void)
gst_device_provider_get_type (void)
{
static volatile gsize gst_device_monitor_type = 0;
static volatile gsize gst_device_provider_type = 0;
if (g_once_init_enter (&gst_device_monitor_type)) {
if (g_once_init_enter (&gst_device_provider_type)) {
GType _type;
static const GTypeInfo element_info = {
sizeof (GstDeviceMonitorClass),
gst_device_monitor_base_class_init,
gst_device_monitor_base_class_finalize,
(GClassInitFunc) gst_device_monitor_class_init,
sizeof (GstDeviceProviderClass),
gst_device_provider_base_class_init,
gst_device_provider_base_class_finalize,
(GClassInitFunc) gst_device_provider_class_init,
NULL,
NULL,
sizeof (GstDeviceMonitor),
sizeof (GstDeviceProvider),
0,
(GInstanceInitFunc) gst_device_monitor_init,
(GInstanceInitFunc) gst_device_provider_init,
NULL
};
_type = g_type_register_static (GST_TYPE_OBJECT, "GstDeviceMonitor",
_type = g_type_register_static (GST_TYPE_OBJECT, "GstDeviceProvider",
&element_info, G_TYPE_FLAG_ABSTRACT);
__gst_devicemonitorclass_factory =
g_quark_from_static_string ("GST_DEVICEMONITORCLASS_FACTORY");
g_once_init_leave (&gst_device_monitor_type, _type);
__gst_deviceproviderclass_factory =
g_quark_from_static_string ("GST_DEVICEPROVIDERCLASS_FACTORY");
g_once_init_leave (&gst_device_provider_type, _type);
}
return gst_device_monitor_type;
return gst_device_provider_type;
}
static void
gst_device_monitor_base_class_init (gpointer g_class)
gst_device_provider_base_class_init (gpointer g_class)
{
GstDeviceMonitorClass *klass = GST_DEVICE_MONITOR_CLASS (g_class);
GstDeviceProviderClass *klass = GST_DEVICE_PROVIDER_CLASS (g_class);
/* Copy the element details here so elements can inherit the
* details from their base class and classes only need to set
......@@ -112,70 +112,70 @@ gst_device_monitor_base_class_init (gpointer g_class)
gst_structure_new_empty ("metadata");
klass->factory = g_type_get_qdata (G_TYPE_FROM_CLASS (klass),
__gst_devicemonitorclass_factory);
__gst_deviceproviderclass_factory);
}
static void
gst_device_monitor_base_class_finalize (gpointer g_class)
gst_device_provider_base_class_finalize (gpointer g_class)
{
GstDeviceMonitorClass *klass = GST_DEVICE_MONITOR_CLASS (g_class);
GstDeviceProviderClass *klass = GST_DEVICE_PROVIDER_CLASS (g_class);
gst_structure_free (klass->metadata);
}
static void
gst_device_monitor_class_init (GstDeviceMonitorClass * klass)
gst_device_provider_class_init (GstDeviceProviderClass * klass)
{
GObjectClass *gobject_class = (GObjectClass *) klass;
gst_device_monitor_parent_class = g_type_class_peek_parent (klass);
gst_device_provider_parent_class = g_type_class_peek_parent (klass);
g_type_class_add_private (klass, sizeof (GstDeviceMonitorPrivate));
g_type_class_add_private (klass, sizeof (GstDeviceProviderPrivate));
gobject_class->dispose = gst_device_monitor_dispose;
gobject_class->finalize = gst_device_monitor_finalize;
gobject_class->dispose = gst_device_provider_dispose;
gobject_class->finalize = gst_device_provider_finalize;
}
static void
gst_device_monitor_init (GstDeviceMonitor * monitor)
gst_device_provider_init (GstDeviceProvider * provider)
{
monitor->priv = G_TYPE_INSTANCE_GET_PRIVATE (monitor,
GST_TYPE_DEVICE_MONITOR, GstDeviceMonitorPrivate);
provider->priv = G_TYPE_INSTANCE_GET_PRIVATE (provider,
GST_TYPE_DEVICE_PROVIDER, GstDeviceProviderPrivate);
g_mutex_init (&monitor->priv->start_lock);
g_mutex_init (&provider->priv->start_lock);
monitor->priv->bus = gst_bus_new ();
gst_bus_set_flushing (monitor->priv->bus, TRUE);
provider->priv->bus = gst_bus_new ();
gst_bus_set_flushing (provider->priv->bus, TRUE);
}
static void
gst_device_monitor_dispose (GObject * object)
gst_device_provider_dispose (GObject * object)
{
GstDeviceMonitor *monitor = GST_DEVICE_MONITOR (object);
GstDeviceProvider *provider = GST_DEVICE_PROVIDER (object);
gst_object_replace ((GstObject **) & monitor->priv->bus, NULL);
gst_object_replace ((GstObject **) & provider->priv->bus, NULL);
GST_OBJECT_LOCK (monitor);
g_list_free_full (monitor->devices, (GDestroyNotify) gst_object_unparent);
monitor->devices = NULL;
GST_OBJECT_UNLOCK (monitor);
GST_OBJECT_LOCK (provider);
g_list_free_full (provider->devices, (GDestroyNotify) gst_object_unparent);
provider->devices = NULL;
GST_OBJECT_UNLOCK (provider);
G_OBJECT_CLASS (gst_device_monitor_parent_class)->dispose (object);
G_OBJECT_CLASS (gst_device_provider_parent_class)->dispose (object);
}
static void
gst_device_monitor_finalize (GObject * object)
gst_device_provider_finalize (GObject * object)
{
GstDeviceMonitor *monitor = GST_DEVICE_MONITOR (object);
GstDeviceProvider *provider = GST_DEVICE_PROVIDER (object);
g_mutex_clear (&monitor->priv->start_lock);
g_mutex_clear (&provider->priv->start_lock);
G_OBJECT_CLASS (gst_device_monitor_parent_class)->finalize (object);
G_OBJECT_CLASS (gst_device_provider_parent_class)->finalize (object);
}
/**
* gst_device_monitor_class_add_metadata:
* gst_device_provider_class_add_metadata:
* @klass: class to set metadata for
* @key: the key to set
* @value: the value to set
......@@ -183,10 +183,10 @@ gst_device_monitor_finalize (GObject * object)
* Set @key with @value as metadata in @klass.
*/
void
gst_device_monitor_class_add_metadata (GstDeviceMonitorClass * klass,
gst_device_provider_class_add_metadata (GstDeviceProviderClass * klass,
const gchar * key, const gchar * value)
{
g_return_if_fail (GST_IS_DEVICE_MONITOR_CLASS (klass));
g_return_if_fail (GST_IS_DEVICE_PROVIDER_CLASS (klass));
g_return_if_fail (key != NULL);
g_return_if_fail (value != NULL);
......@@ -195,14 +195,14 @@ gst_device_monitor_class_add_metadata (GstDeviceMonitorClass * klass,
}
/**
* gst_device_monitor_class_add_static_metadata:
* gst_device_provider_class_add_static_metadata:
* @klass: class to set metadata for
* @key: the key to set
* @value: the value to set
*
* Set @key with @value as metadata in @klass.
*
* Same as gst_device_monitor_class_add_metadata(), but @value must be a static string
* Same as gst_device_provider_class_add_metadata(), but @value must be a static string
* or an inlined string, as it will not be copied. (GStreamer plugins will
* be made resident once loaded, so this function can be used even from
* dynamically loaded plugins.)
......@@ -210,12 +210,12 @@ gst_device_monitor_class_add_metadata (GstDeviceMonitorClass * klass,
* Since: 1.4
*/
void
gst_device_monitor_class_add_static_metadata (GstDeviceMonitorClass * klass,
gst_device_provider_class_add_static_metadata (GstDeviceProviderClass * klass,
const gchar * key, const gchar * value)
{
GValue val = G_VALUE_INIT;
g_return_if_fail (GST_IS_DEVICE_MONITOR_CLASS (klass));
g_return_if_fail (GST_IS_DEVICE_PROVIDER_CLASS (klass));
g_return_if_fail (key != NULL);
g_return_if_fail (value != NULL);
......@@ -225,28 +225,29 @@ gst_device_monitor_class_add_static_metadata (GstDeviceMonitorClass * klass,
}
/**
* gst_device_monitor_class_set_metadata:
* gst_device_provider_class_set_metadata:
* @klass: class to set metadata for
* @longname: The long English name of the device monitor. E.g. "File Sink"
* @classification: String describing the type of device monitor, as an unordered list
* separated with slashes ('/'). See draft-klass.txt of the design docs
* @longname: The long English name of the device provider. E.g. "File Sink"
* @classification: String describing the type of device provider, as an
* unordered list separated with slashes ('/'). See draft-klass.txt of the
* design docs
* for more details and common types. E.g: "Sink/File"
* @description: Sentence describing the purpose of the device monitor.
* @description: Sentence describing the purpose of the device provider.
* E.g: "Write stream to a file"
* @author: Name and contact details of the author(s). Use \n to separate
* multiple author metadata. E.g: "Joe Bloggs &lt;joe.blogs at foo.com&gt;"
*
* Sets the detailed information for a #GstDeviceMonitorClass.
* Sets the detailed information for a #GstDeviceProviderClass.
* <note>This function is for use in _class_init functions only.</note>
*
* Since: 1.4
*/
void
gst_device_monitor_class_set_metadata (GstDeviceMonitorClass * klass,
gst_device_provider_class_set_metadata (GstDeviceProviderClass * klass,
const gchar * longname, const gchar * classification,
const gchar * description, const gchar * author)
{
g_return_if_fail (GST_IS_DEVICE_MONITOR_CLASS (klass));
g_return_if_fail (GST_IS_DEVICE_PROVIDER_CLASS (klass));
g_return_if_fail (longname != NULL && *longname != '\0');
g_return_if_fail (classification != NULL && *classification != '\0');
g_return_if_fail (description != NULL && *description != '\0');
......@@ -260,7 +261,7 @@ gst_device_monitor_class_set_metadata (GstDeviceMonitorClass * klass,
}
/**
* gst_device_monitor_class_set_static_metadata:
* gst_device_provider_class_set_static_metadata:
* @klass: class to set metadata for
* @longname: The long English name of the element. E.g. "File Sink"
* @classification: String describing the type of element, as an unordered list
......@@ -271,10 +272,10 @@ gst_device_monitor_class_set_metadata (GstDeviceMonitorClass * klass,
* @author: Name and contact details of the author(s). Use \n to separate
* multiple author metadata. E.g: "Joe Bloggs &lt;joe.blogs at foo.com&gt;"
*
* Sets the detailed information for a #GstDeviceMonitorClass.
* Sets the detailed information for a #GstDeviceProviderClass.
* <note>This function is for use in _class_init functions only.</note>
*
* Same as gst_device_monitor_class_set_metadata(), but @longname, @classification,
* Same as gst_device_provider_class_set_metadata(), but @longname, @classification,
* @description, and @author must be static strings or inlined strings, as
* they will not be copied. (GStreamer plugins will be made resident once
* loaded, so this function can be used even from dynamically loaded plugins.)
......@@ -282,14 +283,14 @@ gst_device_monitor_class_set_metadata (GstDeviceMonitorClass * klass,
* Since: 1.4
*/
void
gst_device_monitor_class_set_static_metadata (GstDeviceMonitorClass * klass,
gst_device_provider_class_set_static_metadata (GstDeviceProviderClass * klass,
const gchar * longname, const gchar * classification,
const gchar * description, const gchar * author)
{
GstStructure *s = (GstStructure *) klass->metadata;
GValue val = G_VALUE_INIT;
g_return_if_fail (GST_IS_DEVICE_MONITOR_CLASS (klass));
g_return_if_fail (GST_IS_DEVICE_PROVIDER_CLASS (klass));
g_return_if_fail (longname != NULL && *longname != '\0');
g_return_if_fail (classification != NULL && *classification != '\0');
g_return_if_fail (description != NULL && *description != '\0');
......@@ -312,7 +313,7 @@ gst_device_monitor_class_set_static_metadata (GstDeviceMonitorClass * klass,
}
/**
* gst_device_monitor_class_get_metadata:
* gst_device_provider_class_get_metadata:
* @klass: class to get metadata for
* @key: the key to get
*
......@@ -323,21 +324,21 @@ gst_device_monitor_class_set_static_metadata (GstDeviceMonitorClass * klass,
* Since: 1.4
*/
const gchar *
gst_device_monitor_class_get_metadata (GstDeviceMonitorClass * klass,
gst_device_provider_class_get_metadata (GstDeviceProviderClass * klass,
const gchar * key)
{
g_return_val_if_fail (GST_IS_DEVICE_MONITOR_CLASS (klass), NULL);
g_return_val_if_fail (GST_IS_DEVICE_PROVIDER_CLASS (klass), NULL);
g_return_val_if_fail (key != NULL, NULL);
return gst_structure_get_string ((GstStructure *) klass->metadata, key);
}
/**
* gst_device_monitor_get_devices:
* @monitor: A #GstDeviceMonitor
* gst_device_provider_get_devices:
* @provider: A #GstDeviceProvider
*
* Gets a list of devices that this monitor understands. This may actually
* probe the hardware if the monitor is not currently started.
* Gets a list of devices that this provider understands. This may actually
* probe the hardware if the provider is not currently started.
*
* Returns: (transfer full) (element-type GstDevice): a #GList of
* #GstDevice
......@@ -346,155 +347,156 @@ gst_device_monitor_class_get_metadata (GstDeviceMonitorClass * klass,
*/
GList *
gst_device_monitor_get_devices (GstDeviceMonitor * monitor)
gst_device_provider_get_devices (GstDeviceProvider * provider)
{
GstDeviceMonitorClass *klass;
GstDeviceProviderClass *klass;
GList *devices = NULL;
gboolean started;
GList *item;
g_return_val_if_fail (GST_IS_DEVICE_MONITOR (monitor), NULL);
klass = GST_DEVICE_MONITOR_GET_CLASS (monitor);
g_return_val_if_fail (GST_IS_DEVICE_PROVIDER (provider), NULL);
klass = GST_DEVICE_PROVIDER_GET_CLASS (provider);
g_mutex_lock (&monitor->priv->start_lock);
started = (monitor->priv->started_count > 0);
g_mutex_lock (&provider->priv->start_lock);
started = (provider->priv->started_count > 0);
if (started) {
GST_OBJECT_LOCK (monitor);
for (item = monitor->devices; item; item = it