• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 /*-*- Mode: C; c-basic-offset: 2 -*-*/
2 
3 /*
4  *  GStreamer pulseaudio plugin
5  *
6  *  Copyright (c) 2004-2008 Lennart Poettering
7  *
8  *  gst-pulse is free software; you can redistribute it and/or modify
9  *  it under the terms of the GNU Lesser General Public License as
10  *  published by the Free Software Foundation; either version 2.1 of the
11  *  License, or (at your option) any later version.
12  *
13  *  gst-pulse is distributed in the hope that it will be useful, but
14  *  WITHOUT ANY WARRANTY; without even the implied warranty of
15  *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
16  *  Lesser General Public License for more details.
17  *
18  *  You should have received a copy of the GNU Lesser General Public
19  *  License along with gst-pulse; if not, write to the Free Software
20  *  Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301
21  *  USA.
22  */
23 
24 #ifndef __GST_PULSESINK_H__
25 #define __GST_PULSESINK_H__
26 
27 #ifdef HAVE_CONFIG_H
28 #include "config.h"
29 #endif
30 
31 #include <gst/gst.h>
32 #include <gst/audio/audio.h>
33 #include <gst/audio/gstaudiosink.h>
34 
35 #include <pulse/pulseaudio.h>
36 #include <pulse/thread-mainloop.h>
37 
38 #include "pulseutil.h"
39 
40 G_BEGIN_DECLS
41 
42 #define GST_TYPE_PULSESINK (gst_pulsesink_get_type())
43 G_DECLARE_FINAL_TYPE (GstPulseSink, gst_pulsesink, GST, PULSESINK,
44     GstAudioBaseSink)
45 #define GST_PULSESINK_CAST(obj) ((GstPulseSink *)(obj))
46 
47 typedef struct _GstPulseDeviceInfo {
48   gchar *description;
49   GList *formats;
50 } GstPulseDeviceInfo;
51 
52 struct _GstPulseSink
53 {
54   GstAudioBaseSink sink;
55 
56   gchar *server, *device, *stream_name, *client_name;
57   GstPulseDeviceInfo device_info;
58 
59   gdouble volume;
60   gboolean volume_set:1;
61   gboolean mute:1;
62   gboolean mute_set:1;
63   guint32 current_sink_idx;
64   gchar *current_sink_name;
65 
66   guint defer_pending;
67 
68   gint notify; /* atomic */
69 
70   const gchar *pa_version;
71 
72   GstStructure *properties;
73   pa_proplist *proplist;
74 
75   gint format_lost;
76   GstClockTime format_lost_time;
77 };
78 
79 #define PULSE_SINK_TEMPLATE_CAPS \
80   _PULSE_CAPS_PCM \
81   _PULSE_CAPS_AC3 \
82   _PULSE_CAPS_EAC3 \
83   _PULSE_CAPS_DTS \
84   _PULSE_CAPS_MP3 \
85   _PULSE_CAPS_AAC
86 
87 G_END_DECLS
88 
89 #endif /* __GST_PULSESINK_H__ */
90