Release 1.12.0
[platform/upstream/gst-plugins-good.git] / ext / pulse / pulsedeviceprovider.h
1 /* GStreamer
2  * Copyright (C) 2012 Olivier Crete <olivier.crete@collabora.com>
3  *
4  * pulsedeviceprovider.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_PROVIDER_H__
24 #define __GST_PULSE_DEVICE_PROVIDER_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 _GstPulseDeviceProvider GstPulseDeviceProvider;
38 typedef struct _GstPulseDeviceProviderClass GstPulseDeviceProviderClass;
39
40 #define GST_TYPE_PULSE_DEVICE_PROVIDER                 (gst_pulse_device_provider_get_type())
41 #define GST_IS_PULSE_DEVICE_PROVIDER(obj)              (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GST_TYPE_PULSE_DEVICE_PROVIDER))
42 #define GST_IS_PULSE_DEVICE_PROVIDER_CLASS(klass)      (G_TYPE_CHECK_CLASS_TYPE ((klass), GST_TYPE_PULSE_DEVICE_PROVIDER))
43 #define GST_PULSE_DEVICE_PROVIDER_GET_CLASS(obj)       (G_TYPE_INSTANCE_GET_CLASS ((obj), GST_TYPE_PULSE_DEVICE_PROVIDER, GstPulseDeviceProviderClass))
44 #define GST_PULSE_DEVICE_PROVIDER(obj)                 (G_TYPE_CHECK_INSTANCE_CAST ((obj), GST_TYPE_PULSE_DEVICE_PROVIDER, GstPulseDeviceProvider))
45 #define GST_PULSE_DEVICE_PROVIDER_CLASS(klass)         (G_TYPE_CHECK_CLASS_CAST ((klass), GST_TYPE_DEVICE_PROVIDER, GstPulseDeviceProviderClass))
46 #define GST_PULSE_DEVICE_PROVIDER_CAST(obj)            ((GstPulseDeviceProvider *)(obj))
47
48 struct _GstPulseDeviceProvider {
49   GstDeviceProvider         parent;
50
51   gchar *server;
52   gchar *client_name;
53
54   pa_threaded_mainloop *mainloop;
55   pa_context *context;
56 };
57
58 typedef enum {
59   GST_PULSE_DEVICE_TYPE_SOURCE,
60   GST_PULSE_DEVICE_TYPE_SINK
61 } GstPulseDeviceType;
62
63 struct _GstPulseDeviceProviderClass {
64   GstDeviceProviderClass    parent_class;
65 };
66
67 GType        gst_pulse_device_provider_get_type (void);
68
69
70 typedef struct _GstPulseDevice GstPulseDevice;
71 typedef struct _GstPulseDeviceClass GstPulseDeviceClass;
72
73 #define GST_TYPE_PULSE_DEVICE                 (gst_pulse_device_get_type())
74 #define GST_IS_PULSE_DEVICE(obj)              (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GST_TYPE_PULSE_DEVICE))
75 #define GST_IS_PULSE_DEVICE_CLASS(klass)      (G_TYPE_CHECK_CLASS_TYPE ((klass), GST_TYPE_PULSE_DEVICE))
76 #define GST_PULSE_DEVICE_GET_CLASS(obj)       (G_TYPE_INSTANCE_GET_CLASS ((obj), GST_TYPE_PULSE_DEVICE, GstPulseDeviceClass))
77 #define GST_PULSE_DEVICE(obj)                 (G_TYPE_CHECK_INSTANCE_CAST ((obj), GST_TYPE_PULSE_DEVICE, GstPulseDevice))
78 #define GST_PULSE_DEVICE_CLASS(klass)         (G_TYPE_CHECK_CLASS_CAST ((klass), GST_TYPE_DEVICE, GstPulseDeviceClass))
79 #define GST_PULSE_DEVICE_CAST(obj)            ((GstPulseDevice *)(obj))
80
81 struct _GstPulseDevice {
82   GstDevice         parent;
83
84   GstPulseDeviceType type;
85   guint             device_index;
86   gchar            *internal_name;
87   const gchar      *element;
88 };
89
90 struct _GstPulseDeviceClass {
91   GstDeviceClass    parent_class;
92 };
93
94 GType        gst_pulse_device_get_type (void);
95
96 G_END_DECLS
97
98 #endif /* __GST_PULSE_DEVICE_PROVIDER_H__ */