devicemonitor: some docs additions and fixes
[platform/upstream/gstreamer.git] / gst / gstdevicemonitor.h
1 /* GStreamer
2  * Copyright (C) 2012 Olivier Crete <olivier.crete@collabora.com>
3  *
4  * gstdevicemonitor.h: Device probing and monitoring
5  *
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.
10  *
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.
15  *
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.
20  */
21
22 #include <gst/gstdevicemonitorfactory.h>
23
24
25 #ifndef __GST_DEVICE_MONITOR_H__
26 #define __GST_DEVICE_MONITOR_H__
27
28 #include <gst/gstelement.h>
29
30 G_BEGIN_DECLS
31
32 typedef struct _GstDeviceMonitor GstDeviceMonitor;
33 typedef struct _GstDeviceMonitorClass GstDeviceMonitorClass;
34 typedef struct _GstDeviceMonitorPrivate GstDeviceMonitorPrivate;
35
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))
43
44
45 /**
46  * GstDeviceMonitor:
47  *
48  * Since: 1.4
49  */
50 struct _GstDeviceMonitor {
51   GstObject         parent;
52
53   /*< private >*/
54
55   /* Protected by the Object lock */
56   GList *devices;
57
58   GstDeviceMonitorPrivate *priv;
59
60   gpointer _gst_reserved[GST_PADDING];
61 };
62
63 /**
64  * GstDeviceMonitorClass:
65  * @factory: a pointer to the #GstDeviceMonitorFactory that creates this
66  *  monitor
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
71  *
72  * The structure of the base #GstDeviceMonitorClass
73  *
74  * Since: 1.4
75  */
76
77 struct _GstDeviceMonitorClass {
78   GstObjectClass    parent_class;
79
80   GstDeviceMonitorFactory     *factory;
81
82   GList*      (*probe) (GstDeviceMonitor * monitor);
83
84   gboolean    (*start) (GstDeviceMonitor * monitor);
85   void        (*stop)  (GstDeviceMonitor * monitor);
86
87   /*< private >*/
88   gpointer metadata;
89
90   /*< private >*/
91   gpointer _gst_reserved[GST_PADDING];
92 };
93
94 GType       gst_device_monitor_get_type (void);
95
96
97 GList *     gst_device_monitor_get_devices    (GstDeviceMonitor * monitor);
98
99 gboolean    gst_device_monitor_start          (GstDeviceMonitor * monitor);
100 void        gst_device_monitor_stop           (GstDeviceMonitor * monitor);
101
102 gboolean    gst_device_monitor_can_monitor    (GstDeviceMonitor * monitor);
103
104 GstBus *    gst_device_monitor_get_bus        (GstDeviceMonitor * monitor);
105
106 void        gst_device_monitor_device_add     (GstDeviceMonitor * monitor,
107                                                GstDevice * device);
108 void        gst_device_monitor_device_remove  (GstDeviceMonitor * monitor,
109                                                GstDevice * device);
110
111
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,
128                                                               const gchar * key);
129
130 /* factory management */
131 GstDeviceMonitorFactory * gst_device_monitor_get_factory   (GstDeviceMonitor * monitor);
132
133 G_END_DECLS
134
135 #endif /* __GST_DEVICE_MONITOR_H__ */