~diwic/ubuntu/lucid/pulseaudio/bugfixes

« back to all changes in this revision

Viewing changes to src/pulse/internal.h

  • Committer: Bazaar Package Importer
  • Author(s): Luke Yelavich
  • Date: 2009-05-05 14:18:20 UTC
  • mfrom: (1.2.4 upstream) (1.1.8 squeeze)
  • Revision ID: james.westby@ubuntu.com-20090505141820-rrr2mtdd1jkllvr8
Tags: 1:0.9.15-1ubuntu1
* Merge from unreleased Debian pulseaudio git, remaining changes:
  - epoch (my stupid fault :S)
  - Don't build against, and create jack package. Jack is not in main
  - use linear resampler to work better with lack of PREEMPT in jaunty's
    -generic kernel config, also change buffer size
  - Add alsa configuration files to route alsa applications via pulseaudio
  - Move libasound2-plugins from Recommends to Depends
  - Add pm-utils sleep hook to suspend (and resume) users' pulseaudio
    daemons
  - patch to fix source/sink and suspend-on-idle race
  - Make initscript more informative in the default case of per-user
    sessions
  - create /var/run/pulse, and make restart more robust
  - add status check for system wide pulseaudio instance
  - LSB {Required-*,Should-*} should specify hal instead of dbus,
    since hal is required (and already requires dbus)
  - indicate that the system pulseaudio instance is being started from the init
    script
  - Install more upstream man pages
  - Link to pacat for parec man page
  - check whether pulseaudio is running before preloading the padsp library
  - Add DEB_OPT_FLAG = -O3 as per recommendation from
    pulseaudio-discuss/2007-December/001017.html
  - cache /usr/share/sounds/ubuntu/stereo/ wav files on pulseaudio load
  - disable glitch free (use tsched=0)
  - Generate a PO template on build
  - add special case to disable pulseaudio loading if accessibility/speech
    is being used
  - the sd wrapper script should not load pulseaudio if pulseaudio is being
    used as a system service
  - add a pulseaudio apport hook
  - fix some typos in README.Debian
  - demote paprefs to suggests
  - drop padevchooser(Recommends) and pavucontrol (Suggests)
  - drop libasyncns-dev build dependency, its in universe
* add libudev-dev as a build-dependency

Show diffs side-by-side

added added

removed removed

Lines of Context:
9
9
 
10
10
  PulseAudio is free software; you can redistribute it and/or modify
11
11
  it under the terms of the GNU Lesser General Public License as published
12
 
  by the Free Software Foundation; either version 2 of the License,
 
12
  by the Free Software Foundation; either version 2.1 of the License,
13
13
  or (at your option) any later version.
14
14
 
15
15
  PulseAudio is distributed in the hope that it will be useful, but
42
42
#include <pulsecore/hashmap.h>
43
43
#include <pulsecore/refcnt.h>
44
44
#include <pulsecore/time-smoother.h>
 
45
#ifdef HAVE_DBUS
 
46
#include <pulsecore/dbus-util.h>
 
47
#endif
45
48
 
46
49
#include "client-conf.h"
47
50
 
50
53
struct pa_context {
51
54
    PA_REFCNT_DECLARE;
52
55
 
 
56
#ifdef HAVE_DBUS
 
57
    pa_dbus_wrap_connection *system_bus;
 
58
    pa_dbus_wrap_connection *session_bus;
 
59
#endif
 
60
 
53
61
    pa_proplist *proplist;
54
62
    pa_mainloop_api* mainloop;
55
63
 
71
79
    void *state_userdata;
72
80
    pa_context_subscribe_cb_t subscribe_callback;
73
81
    void *subscribe_userdata;
 
82
    pa_context_event_cb_t event_callback;
 
83
    void *event_userdata;
74
84
 
75
85
    pa_mempool *mempool;
76
86
 
77
87
    pa_bool_t is_local:1;
78
88
    pa_bool_t do_shm:1;
79
 
 
 
89
    pa_bool_t server_specified:1;
 
90
    pa_bool_t no_fail:1;
80
91
    pa_bool_t do_autospawn:1;
81
92
    pa_spawn_api spawn_api;
82
93
 
133
144
    uint32_t syncid;
134
145
    uint32_t stream_index;
135
146
 
136
 
    uint32_t requested_bytes;
 
147
    int64_t requested_bytes;
137
148
    pa_buffer_attr buffer_attr;
138
149
 
139
150
    uint32_t device_index;
153
164
    uint32_t write_index_not_before;
154
165
    uint32_t read_index_not_before;
155
166
 
156
 
    /* Data about individual timing update correctoins */
 
167
    /* Data about individual timing update corrections */
157
168
    pa_index_correction write_index_corrections[PA_MAX_WRITE_INDEX_CORRECTIONS];
158
169
    int current_write_index_correction;
159
170
 
160
171
    /* Latency interpolation stuff */
161
172
    pa_time_event *auto_timing_update_event;
 
173
    pa_usec_t auto_timing_interval_usec;
162
174
 
163
175
    pa_smoother *smoother;
164
176
 
181
193
    void *suspended_userdata;
182
194
    pa_stream_notify_cb_t started_callback;
183
195
    void *started_userdata;
 
196
    pa_stream_event_cb_t event_callback;
 
197
    void *event_userdata;
 
198
    pa_stream_notify_cb_t buffer_attr_callback;
 
199
    void *buffer_attr_userdata;
184
200
};
185
201
 
186
202
typedef void (*pa_operation_cb_t)(void);
207
223
void pa_command_stream_suspended(pa_pdispatch *pd, uint32_t command, uint32_t tag, pa_tagstruct *t, void *userdata);
208
224
void pa_command_stream_moved(pa_pdispatch *pd, uint32_t command, uint32_t tag, pa_tagstruct *t, void *userdata);
209
225
void pa_command_stream_started(pa_pdispatch *pd, uint32_t command, uint32_t tag, pa_tagstruct *t, void *userdata);
 
226
void pa_command_stream_event(pa_pdispatch *pd, uint32_t command, uint32_t tag, pa_tagstruct *t, void *userdata);
 
227
void pa_command_client_event(pa_pdispatch *pd, uint32_t command, uint32_t tag, pa_tagstruct *t, void *userdata);
 
228
void pa_command_stream_buffer_attr(pa_pdispatch *pd, uint32_t command, uint32_t tag, pa_tagstruct *t, void *userdata);
 
229
 
210
230
pa_operation *pa_operation_new(pa_context *c, pa_stream *s, pa_operation_cb_t callback, void *userdata);
211
231
void pa_operation_done(pa_operation *o);
212
232
 
225
245
 
226
246
pa_tagstruct *pa_tagstruct_command(pa_context *c, uint32_t command, uint32_t *tag);
227
247
 
228
 
#define PA_CHECK_VALIDITY(context, expression, error) do { \
229
 
        if (!(expression)) \
 
248
#define PA_CHECK_VALIDITY(context, expression, error)         \
 
249
    do {                                                      \
 
250
        if (!(expression))                                    \
230
251
            return -pa_context_set_error((context), (error)); \
231
 
} while(0)
232
 
 
233
 
 
234
 
#define PA_CHECK_VALIDITY_RETURN_ANY(context, expression, error, value) do { \
235
 
        if (!(expression)) { \
236
 
            pa_context_set_error((context), (error)); \
237
 
            return value; \
238
 
        } \
239
 
} while(0)
240
 
 
241
 
#define PA_CHECK_VALIDITY_RETURN_NULL(context, expression, error) PA_CHECK_VALIDITY_RETURN_ANY(context, expression, error, NULL)
 
252
    } while(FALSE)
 
253
 
 
254
 
 
255
#define PA_CHECK_VALIDITY_RETURN_ANY(context, expression, error, value) \
 
256
    do {                                                                \
 
257
        if (!(expression)) {                                            \
 
258
            pa_context_set_error((context), (error));                   \
 
259
            return value;                                               \
 
260
        }                                                               \
 
261
    } while(FALSE)
 
262
 
 
263
#define PA_CHECK_VALIDITY_RETURN_NULL(context, expression, error)       \
 
264
    PA_CHECK_VALIDITY_RETURN_ANY(context, expression, error, NULL)
 
265
 
 
266
#define PA_FAIL(context, error)                                 \
 
267
    do {                                                        \
 
268
        return -pa_context_set_error((context), (error));       \
 
269
    } while(FALSE)
 
270
 
 
271
#define PA_FAIL_RETURN_ANY(context, error, value)      \
 
272
    do {                                               \
 
273
        pa_context_set_error((context), (error));      \
 
274
        return value;                                  \
 
275
    } while(FALSE)
 
276
 
 
277
#define PA_FAIL_RETURN_NULL(context, error)     \
 
278
    PA_FAIL_RETURN_ANY(context, error, NULL)
242
279
 
243
280
void pa_ext_stream_restore_command(pa_context *c, uint32_t tag, pa_tagstruct *t);
244
281