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))
50 struct _GstDeviceMonitor {
55 /* Protected by the Object lock */
58 GstDeviceMonitorPrivate *priv;
60 gpointer _gst_reserved[GST_PADDING];
64 * GstDeviceMonitorClass:
65 * @factory: a pointer to the #GstDeviceMonitorFactory that creates this
67 * @probe: Returns a list of devices that are currently available.
68 * This should never block.
69 * @start: Starts monitoring for new devices.
70 * @stop: Stops monitoring for new devices
72 * The structure of the base #GstDeviceMonitorClass
77 struct _GstDeviceMonitorClass {
78 GstObjectClass parent_class;
80 GstDeviceMonitorFactory *factory;
82 GList* (*probe) (GstDeviceMonitor * monitor);
84 gboolean (*start) (GstDeviceMonitor * monitor);
85 void (*stop) (GstDeviceMonitor * monitor);
91 gpointer _gst_reserved[GST_PADDING];
94 GType gst_device_monitor_get_type (void);
97 GList * gst_device_monitor_get_devices (GstDeviceMonitor * monitor);
99 gboolean gst_device_monitor_start (GstDeviceMonitor * monitor);
100 void gst_device_monitor_stop (GstDeviceMonitor * monitor);
102 gboolean gst_device_monitor_can_monitor (GstDeviceMonitor * monitor);
104 GstBus * gst_device_monitor_get_bus (GstDeviceMonitor * monitor);
106 void gst_device_monitor_device_add (GstDeviceMonitor * monitor,
108 void gst_device_monitor_device_remove (GstDeviceMonitor * monitor,
112 /* device monitor class meta data */
113 void gst_device_monitor_class_set_metadata (GstDeviceMonitorClass *klass,
114 const gchar *longname,
115 const gchar *classification,
116 const gchar *description,
117 const gchar *author);
118 void gst_device_monitor_class_set_static_metadata (GstDeviceMonitorClass *klass,
119 const gchar *longname,
120 const gchar *classification,
121 const gchar *description,
122 const gchar *author);
123 void gst_device_monitor_class_add_metadata (GstDeviceMonitorClass * klass,
124 const gchar * key, const gchar * value);
125 void gst_device_monitor_class_add_static_metadata (GstDeviceMonitorClass * klass,
126 const gchar * key, const gchar * value);
127 const gchar * gst_device_monitor_class_get_metadata (GstDeviceMonitorClass * klass,
130 /* factory management */
131 GstDeviceMonitorFactory * gst_device_monitor_get_factory (GstDeviceMonitor * monitor);
135 #endif /* __GST_DEVICE_MONITOR_H__ */