• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
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 #define GST_TYPE_PULSE_DEVICE_PROVIDER (gst_pulse_device_provider_get_type())
38 G_DECLARE_FINAL_TYPE (GstPulseDeviceProvider, gst_pulse_device_provider,
39     GST, PULSE_DEVICE_PROVIDER, GstDeviceProvider)
40 #define GST_PULSE_DEVICE_PROVIDER_CAST(obj) ((GstPulseDeviceProvider *)(obj))
41 
42 struct _GstPulseDeviceProvider {
43   GstDeviceProvider         parent;
44 
45   gchar *server;
46   gchar *client_name;
47   gchar *default_source_name;
48   gchar *default_sink_name;
49 
50   pa_threaded_mainloop *mainloop;
51   pa_context *context;
52 };
53 
54 typedef enum {
55   GST_PULSE_DEVICE_TYPE_SOURCE,
56   GST_PULSE_DEVICE_TYPE_SINK
57 } GstPulseDeviceType;
58 
59 
60 #define GST_TYPE_PULSE_DEVICE (gst_pulse_device_get_type())
61 G_DECLARE_FINAL_TYPE (GstPulseDevice, gst_pulse_device, GST, PULSE_DEVICE,
62     GstDevice)
63 #define GST_PULSE_DEVICE_CAST(obj) ((GstPulseDevice *)(obj))
64 
65 struct _GstPulseDevice {
66   GstDevice         parent;
67 
68   GstPulseDeviceType type;
69   guint             device_index;
70   gchar            *internal_name;
71   gboolean         is_default;
72   const gchar      *element;
73 };
74 
75 G_END_DECLS
76 
77 #endif /* __GST_PULSE_DEVICE_PROVIDER_H__ */
78