7 #ifdef HAVE_PULSE_AUDIO
9 #include <pulse/context.h>
10 #include <pulse/thread-mainloop.h>
11 #include <pulse/introspect.h>
12 #include <pulse/stream.h>
13 #include <pulse/proplist.h>
14 #include <pulse/error.h>
19 #define PULSE_MAX_OUTPUT_CHANS PA_CHANNEL_POSITION_MAX
21 #define LIVES_PA_BUFF_MAXLEN 16384
22 #define LIVES_PA_BUFF_TARGET 1024
32 pa_threaded_mainloop *mloop;
35 pa_proplist *pa_props;
41 pa_context_state_t state;
53 uint64_t out_chans_available;
63 audio_buffer_t* aPlayPtr;
68 float volume[PULSE_MAX_OUTPUT_CHANS];
76 volatile uint64_t frames_written;
80 volatile gint64 audio_ticks;
84 volatile off_t seek_pos;
87 gboolean reverse_endian;
94 struct timeval last_reconnect_attempt;
101 volatile gint read_abuf;
105 volatile int astream_fd;
113 gboolean lives_pulse_init (
short startup_phase);
115 int pulse_audio_init(
void);
116 int pulse_audio_read_init(
void);
118 pulse_driver_t *pulse_get_driver(gboolean is_output);
120 int pulse_driver_activate(pulse_driver_t *);
121 void pulse_close_client(pulse_driver_t *);
123 void pulse_shutdown(
void);
125 void pulse_aud_pb_ready(gint fileno);
127 size_t pulse_flush_read_data(pulse_driver_t *pulsed,
int fileno,
size_t rbytes, gboolean rev_endian,
void *data);
129 void pulse_driver_uncork(pulse_driver_t *);
131 gboolean pulse_try_reconnect(
void);
136 int64_t pulse_audio_seek_bytes (pulse_driver_t *, int64_t bytes);
138 gint64 lives_pulse_get_time(pulse_driver_t *, gboolean absolute);
140 gdouble lives_pulse_get_pos(pulse_driver_t *);
145 gboolean pulse_audio_seek_frame (pulse_driver_t *, gint frame);
147 void pulse_get_rec_avals(pulse_driver_t *);