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_PULSESRC_H__ 25 #define __GST_PULSESRC_H__ 26 27 #include <gst/gst.h> 28 #include <gst/audio/gstaudiosrc.h> 29 30 #include <pulse/pulseaudio.h> 31 #include <pulse/thread-mainloop.h> 32 33 G_BEGIN_DECLS 34 35 #define GST_TYPE_PULSESRC (gst_pulsesrc_get_type()) 36 G_DECLARE_FINAL_TYPE (GstPulseSrc, gst_pulsesrc, GST, PULSESRC, GstAudioSrc) 37 #define GST_PULSESRC_CAST(obj) ((GstPulseSrc *)(obj)) 38 39 struct _GstPulseSrc 40 { 41 GstAudioSrc src; 42 43 gchar *server, *device, *client_name; 44 45 pa_threaded_mainloop *mainloop; 46 47 pa_context *context; 48 pa_stream *stream; 49 guint32 source_output_idx; 50 51 pa_sample_spec sample_spec; 52 53 const void *read_buffer; 54 size_t read_buffer_length; 55 56 gchar *device_description; 57 58 gdouble volume; 59 gboolean volume_set:1; 60 gboolean mute:1; 61 gboolean mute_set:1; 62 guint32 current_source_idx; 63 gchar *current_source_name; 64 65 gint notify; /* atomic */ 66 67 gboolean corked:1; 68 gboolean stream_connected:1; 69 gboolean operation_success:1; 70 gboolean paused:1; 71 gboolean in_read:1; 72 73 GstStructure *properties; 74 pa_proplist *proplist; 75 }; 76 77 G_END_DECLS 78 79 #endif /* __GST_PULSESRC_H__ */ 80