2 * Copyright (C) 2012 Olivier Crete <olivier.crete@collabora.com>
4 * gstdevicemonitor.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/gstdevicemonitorfactory.h>
25 #ifndef __GST_DEVICE_MONITOR_H__
26 #define __GST_DEVICE_MONITOR_H__
28 #include <gst/gstelement.h>
32 typedef struct _GstDeviceMonitor GstDeviceMonitor;
33 typedef struct _GstDeviceMonitorClass GstDeviceMonitorClass;
34 typedef struct _GstDeviceMonitorPrivate GstDeviceMonitorPrivate;
36 #define GST_TYPE_DEVICE_MONITOR (gst_device_monitor_get_type())
37 #define GST_IS_DEVICE_MONITOR(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GST_TYPE_DEVICE_MONITOR))
38 #define GST_IS_DEVICE_MONITOR_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GST_TYPE_DEVICE_MONITOR))
39 #define GST_DEVICE_MONITOR_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GST_TYPE_DEVICE_MONITOR, GstDeviceMonitorClass))
40 #define GST_DEVICE_MONITOR(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GST_TYPE_DEVICE_MONITOR, GstDeviceMonitor))
41 #define GST_DEVICE_MONITOR_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GST_TYPE_DEVICE_MONITOR, GstDeviceMonitorClass))
42 #define GST_DEVICE_MONITOR_CAST(obj) ((GstDeviceMonitor *)(obj))
47 * @parent: The parent #GstObject
48 * @devices: a #GList of the #GstDevice objects
50 * The structure of the base #GstDeviceMonitor
54 struct _GstDeviceMonitor {
57 /* Protected by the Object lock */
62 GstDeviceMonitorPrivate *priv;
64 gpointer _gst_reserved[GST_PADDING];
68 * GstDeviceMonitorClass:
69 * @parent_class: the parent #GstObjectClass structure
70 * @factory: a pointer to the #GstDeviceMonitorFactory 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 #GstDeviceMonitorClass
84 struct _GstDeviceMonitorClass {
85 GstObjectClass parent_class;
87 GstDeviceMonitorFactory *factory;
89 GList* (*probe) (GstDeviceMonitor * monitor);
91 gboolean (*start) (GstDeviceMonitor * monitor);
92 void (*stop) (GstDeviceMonitor * monitor);
98 gpointer _gst_reserved[GST_PADDING];
101 GType gst_device_monitor_get_type (void);
104 GList * gst_device_monitor_get_devices (GstDeviceMonitor * monitor);
106 gboolean gst_device_monitor_start (GstDeviceMonitor * monitor);
107 void gst_device_monitor_stop (GstDeviceMonitor * monitor);
109 gboolean gst_device_monitor_can_monitor (GstDeviceMonitor * monitor);
111 GstBus * gst_device_monitor_get_bus (GstDeviceMonitor * monitor);
113 void gst_device_monitor_device_add (GstDeviceMonitor * monitor,
115 void gst_device_monitor_device_remove (GstDeviceMonitor * monitor,
119 /* device monitor class meta data */
120 void gst_device_monitor_class_set_metadata (GstDeviceMonitorClass *klass,
121 const gchar *longname,
122 const gchar *classification,
123 const gchar *description,
124 const gchar *author);
125 void gst_device_monitor_class_set_static_metadata (GstDeviceMonitorClass *klass,
126 const gchar *longname,
127 const gchar *classification,
128 const gchar *description,
129 const gchar *author);
130 void gst_device_monitor_class_add_metadata (GstDeviceMonitorClass * klass,
131 const gchar * key, const gchar * value);
132 void gst_device_monitor_class_add_static_metadata (GstDeviceMonitorClass * klass,
133 const gchar * key, const gchar * value);
134 const gchar * gst_device_monitor_class_get_metadata (GstDeviceMonitorClass * klass,
137 /* factory management */
138 GstDeviceMonitorFactory * gst_device_monitor_get_factory (GstDeviceMonitor * monitor);
142 #endif /* __GST_DEVICE_MONITOR_H__ */