2 * Copyright (C) 2012 Olivier Crete <olivier.crete@collabora.com>
4 * gstdeviceprovider.h: Device probing and monitoring
6 * This library is free software; you can redistribute it and/or
7 * modify it under the terms of the GNU Library General Public
8 * License as published by the Free Software Foundation; either
9 * version 2 of the License, or (at your option) any later version.
11 * This library is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14 * Library General Public License for more details.
16 * You should have received a copy of the GNU Library General Public
17 * License along with this library; if not, write to the
18 * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
19 * Boston, MA 02111-1307, USA.
22 #include <gst/gstdeviceproviderfactory.h>
25 #ifndef __GST_DEVICE_PROVIDER_H__
26 #define __GST_DEVICE_PROVIDER_H__
28 #include <gst/gstelement.h>
32 typedef struct _GstDeviceProvider GstDeviceProvider;
33 typedef struct _GstDeviceProviderClass GstDeviceProviderClass;
34 typedef struct _GstDeviceProviderPrivate GstDeviceProviderPrivate;
36 #define GST_TYPE_DEVICE_PROVIDER (gst_device_provider_get_type())
37 #define GST_IS_DEVICE_PROVIDER(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GST_TYPE_DEVICE_PROVIDER))
38 #define GST_IS_DEVICE_PROVIDER_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GST_TYPE_DEVICE_PROVIDER))
39 #define GST_DEVICE_PROVIDER_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GST_TYPE_DEVICE_PROVIDER, GstDeviceProviderClass))
40 #define GST_DEVICE_PROVIDER(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GST_TYPE_DEVICE_PROVIDER, GstDeviceProvider))
41 #define GST_DEVICE_PROVIDER_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GST_TYPE_DEVICE_PROVIDER, GstDeviceProviderClass))
42 #define GST_DEVICE_PROVIDER_CAST(obj) ((GstDeviceProvider *)(obj))
47 * @parent: The parent #GstObject
48 * @devices: a #GList of the #GstDevice objects
50 * The structure of the base #GstDeviceProvider
54 struct _GstDeviceProvider {
57 /* Protected by the Object lock */
62 GstDeviceProviderPrivate *priv;
64 gpointer _gst_reserved[GST_PADDING];
68 * GstDeviceProviderClass:
69 * @parent_class: the parent #GstObjectClass structure
70 * @factory: a pointer to the #GstDeviceProviderFactory that creates this
72 * @probe: Returns a list of devices that are currently available.
73 * This should never block.
74 * @start: Starts monitoring for new devices. Only subclasses that can know
75 * that devices have been added or remove need to implement this method.
76 * @stop: Stops monitoring for new devices. Only subclasses that implement
77 * the start() method need to implement this method.
79 * The structure of the base #GstDeviceProviderClass
84 struct _GstDeviceProviderClass {
85 GstObjectClass parent_class;
87 GstDeviceProviderFactory *factory;
89 GList* (*probe) (GstDeviceProvider * provider);
91 gboolean (*start) (GstDeviceProvider * provider);
92 void (*stop) (GstDeviceProvider * provider);
98 gpointer _gst_reserved[GST_PADDING];
101 GType gst_device_provider_get_type (void);
104 GList * gst_device_provider_get_devices (GstDeviceProvider * provider);
106 gboolean gst_device_provider_start (GstDeviceProvider * provider);
107 void gst_device_provider_stop (GstDeviceProvider * provider);
109 gboolean gst_device_provider_can_monitor (GstDeviceProvider * provider);
111 GstBus * gst_device_provider_get_bus (GstDeviceProvider * provider);
113 void gst_device_provider_device_add (GstDeviceProvider * provider,
115 void gst_device_provider_device_remove (GstDeviceProvider * provider,
119 /* device provider class meta data */
120 void gst_device_provider_class_set_metadata (GstDeviceProviderClass *klass,
121 const gchar *longname,
122 const gchar *classification,
123 const gchar *description,
124 const gchar *author);
125 void gst_device_provider_class_set_static_metadata (GstDeviceProviderClass *klass,
126 const gchar *longname,
127 const gchar *classification,
128 const gchar *description,
129 const gchar *author);
130 void gst_device_provider_class_add_metadata (GstDeviceProviderClass * klass,
131 const gchar * key, const gchar * value);
132 void gst_device_provider_class_add_static_metadata (GstDeviceProviderClass * klass,
133 const gchar * key, const gchar * value);
134 const gchar * gst_device_provider_class_get_metadata (GstDeviceProviderClass * klass,
137 /* factory management */
138 GstDeviceProviderFactory * gst_device_provider_get_factory (GstDeviceProvider * provider);
142 #endif /* __GST_DEVICE_PROVIDER_H__ */