videobox: Add unit test
[platform/upstream/gst-plugins-good.git] / ext / pulse / pulsedevicemonitor.h
1 /* GStreamer
2  * Copyright (C) 2012 Olivier Crete <olivier.crete@collabora.com>
3  *
4  * pulsedevicemonitor.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
23 #ifndef __GST_PULSE_DEVICE_MONITOR_H__
24 #define __GST_PULSE_DEVICE_MONITOR_H__
25
26 #ifdef HAVE_CONFIG_H
27 #include "config.h"
28 #endif
29
30 #include <pulse/pulseaudio.h>
31 #include <pulse/thread-mainloop.h>
32
33 #include <gst/gst.h>
34
35 G_BEGIN_DECLS
36
37 typedef struct _GstPulseDeviceMonitor GstPulseDeviceMonitor;
38 typedef struct _GstPulseDeviceMonitorPrivate GstPulseDeviceMonitorPrivate;
39 typedef struct _GstPulseDeviceMonitorClass GstPulseDeviceMonitorClass;
40
41 #define GST_TYPE_PULSE_DEVICE_MONITOR                 (gst_pulse_device_monitor_get_type())
42 #define GST_IS_PULSE_DEVICE_MONITOR(obj)              (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GST_TYPE_PULSE_DEVICE_MONITOR))
43 #define GST_IS_PULSE_DEVICE_MONITOR_CLASS(klass)      (G_TYPE_CHECK_CLASS_TYPE ((klass), GST_TYPE_PULSE_DEVICE_MONITOR))
44 #define GST_PULSE_DEVICE_MONITOR_GET_CLASS(obj)       (G_TYPE_INSTANCE_GET_CLASS ((obj), GST_TYPE_PULSE_DEVICE_MONITOR, GstPulseDeviceMonitorClass))
45 #define GST_PULSE_DEVICE_MONITOR(obj)                 (G_TYPE_CHECK_INSTANCE_CAST ((obj), GST_TYPE_PULSE_DEVICE_MONITOR, GstPulseDeviceMonitor))
46 #define GST_PULSE_DEVICE_MONITOR_CLASS(klass)         (G_TYPE_CHECK_CLASS_CAST ((klass), GST_TYPE_DEVICE_MONITOR, GstPulseDeviceMonitorClass))
47 #define GST_PULSE_DEVICE_MONITOR_CAST(obj)            ((GstPulseDeviceMonitor *)(obj))
48
49 struct _GstPulseDeviceMonitor {
50   GstDeviceMonitor         parent;
51
52   gchar *server;
53   gchar *client_name;
54
55   pa_threaded_mainloop *mainloop;
56   pa_context *context;
57 };
58
59 typedef enum {
60   GST_PULSE_DEVICE_TYPE_SOURCE,
61   GST_PULSE_DEVICE_TYPE_SINK
62 } GstPulseDeviceType;
63
64 struct _GstPulseDeviceMonitorClass {
65   GstDeviceMonitorClass    parent_class;
66 };
67
68 GType        gst_pulse_device_monitor_get_type (void);
69
70
71 typedef struct _GstPulseDevice GstPulseDevice;
72 typedef struct _GstPulseDevicePrivate GstPulseDevicePrivate;
73 typedef struct _GstPulseDeviceClass GstPulseDeviceClass;
74
75 #define GST_TYPE_PULSE_DEVICE                 (gst_pulse_device_get_type())
76 #define GST_IS_PULSE_DEVICE(obj)              (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GST_TYPE_PULSE_DEVICE))
77 #define GST_IS_PULSE_DEVICE_CLASS(klass)      (G_TYPE_CHECK_CLASS_TYPE ((klass), GST_TYPE_PULSE_DEVICE))
78 #define GST_PULSE_DEVICE_GET_CLASS(obj)       (G_TYPE_INSTANCE_GET_CLASS ((obj), GST_TYPE_PULSE_DEVICE, GstPulseDeviceClass))
79 #define GST_PULSE_DEVICE(obj)                 (G_TYPE_CHECK_INSTANCE_CAST ((obj), GST_TYPE_PULSE_DEVICE, GstPulseDevice))
80 #define GST_PULSE_DEVICE_CLASS(klass)         (G_TYPE_CHECK_CLASS_CAST ((klass), GST_TYPE_DEVICE, GstPulseDeviceClass))
81 #define GST_PULSE_DEVICE_CAST(obj)            ((GstPulseDevice *)(obj))
82
83 struct _GstPulseDevice {
84   GstDevice         parent;
85
86   GstPulseDeviceType type;
87   guint             device_index;
88   gchar            *internal_name;
89   const gchar      *element;
90 };
91
92 struct _GstPulseDeviceClass {
93   GstDeviceClass    parent_class;
94 };
95
96 GType        gst_pulse_device_get_type (void);
97
98 #endif /* __GST_PULSE_DEVICE_MONITOR_H__ */