~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: 2008-11-04 15:46:00 UTC
  • mfrom: (1.2.1 upstream) (1.1.6 lenny)
  • Revision ID: james.westby@ubuntu.com-20081104154600-hlzknpcazaam0nxm
Tags: 0.9.13-1ubuntu1
* Merge from Debian unstable, remaining changes:
  - Don't build against, and create jack package. Jack is not in main.
  - Remove --disable-per-user-esound-socket from configure flags, as we still
    want per user esound sockets.
  - Remove stop links from rc0 and rc6.
  - Change default resample algorithm and bubffer size.
  - Add alsa configuration files to route alsa applications via pulseaudio.
  - Move libasound2-plugins from Recommends to Depends.
* debian/pulseaudio.preinst: When upgrading from intrepid, remove
  /etc/X11/Xsession.d/70pulseaudio, as this was used to minimize a race
  condition when starting GNOME in intrepid. This race should not exist in
  jaunty once libcanberra is built to use pulseaudio as a backend.
* Do not spawn a pulseaudio server if clients fail to find a running server.
* Remove explicit version dependency for libspeex-dev to allow the package
  to be built for now.
* Regenerate autotools files to work with Ubuntu's newer libtool/libltdl.
* debian/control: libpulsecore5 -> libpulsecore8 to match the library
  soname.

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
1
#ifndef foointernalhfoo
2
2
#define foointernalhfoo
3
3
 
4
 
/* $Id: internal.h 2067 2007-11-21 01:30:40Z lennart $ */
5
 
 
6
4
/***
7
5
  This file is part of PulseAudio.
8
6
 
30
28
#include <pulse/stream.h>
31
29
#include <pulse/operation.h>
32
30
#include <pulse/subscribe.h>
 
31
#include <pulse/ext-stream-restore.h>
33
32
 
34
33
#include <pulsecore/socket-client.h>
35
34
#include <pulsecore/pstream.h>
42
41
#include <pulsecore/memblockq.h>
43
42
#include <pulsecore/hashmap.h>
44
43
#include <pulsecore/refcnt.h>
 
44
#include <pulsecore/time-smoother.h>
45
45
 
46
46
#include "client-conf.h"
47
47
 
50
50
struct pa_context {
51
51
    PA_REFCNT_DECLARE;
52
52
 
53
 
    char *name;
 
53
    pa_proplist *proplist;
54
54
    pa_mainloop_api* mainloop;
55
55
 
56
56
    pa_socket_client *client;
64
64
    uint32_t version;
65
65
    uint32_t ctag;
66
66
    uint32_t csyncid;
67
 
    uint32_t error;
 
67
    int error;
68
68
    pa_context_state_t state;
69
69
 
70
70
    pa_context_notify_cb_t state_callback;
71
71
    void *state_userdata;
72
 
 
73
72
    pa_context_subscribe_cb_t subscribe_callback;
74
73
    void *subscribe_userdata;
75
74
 
76
75
    pa_mempool *mempool;
77
76
 
78
 
    int is_local;
79
 
    int do_autospawn;
80
 
    int autospawn_lock_fd;
 
77
    pa_bool_t is_local:1;
 
78
    pa_bool_t do_shm:1;
 
79
 
 
80
    pa_bool_t do_autospawn:1;
81
81
    pa_spawn_api spawn_api;
82
82
 
83
83
    pa_strlist *server_list;
85
85
    char *server;
86
86
 
87
87
    pa_client_conf *conf;
 
88
 
 
89
    uint32_t client_index;
 
90
 
 
91
    /* Extension specific data */
 
92
    struct {
 
93
        pa_ext_stream_restore_subscribe_cb_t callback;
 
94
        void *userdata;
 
95
    } ext_stream_restore;
88
96
};
89
97
 
90
 
#define PA_MAX_WRITE_INDEX_CORRECTIONS 10
 
98
#define PA_MAX_WRITE_INDEX_CORRECTIONS 32
91
99
 
92
100
typedef struct pa_index_correction {
93
101
    uint32_t tag;
94
 
    int valid;
95
102
    int64_t value;
96
 
    int absolute, corrupt;
 
103
    pa_bool_t valid:1;
 
104
    pa_bool_t absolute:1;
 
105
    pa_bool_t corrupt:1;
97
106
} pa_index_correction;
98
107
 
99
108
struct pa_stream {
100
109
    PA_REFCNT_DECLARE;
 
110
    PA_LLIST_FIELDS(pa_stream);
 
111
 
101
112
    pa_context *context;
102
113
    pa_mainloop_api *mainloop;
103
 
    PA_LLIST_FIELDS(pa_stream);
104
 
 
105
 
    char *name;
106
 
    pa_bool_t manual_buffer_attr;
107
 
    pa_buffer_attr buffer_attr;
 
114
 
 
115
    uint32_t direct_on_input;
 
116
 
 
117
    pa_stream_direction_t direction;
 
118
    pa_stream_state_t state;
 
119
    pa_stream_flags_t flags;
 
120
 
108
121
    pa_sample_spec sample_spec;
109
122
    pa_channel_map channel_map;
110
 
    pa_stream_flags_t flags;
 
123
 
 
124
    pa_proplist *proplist;
 
125
 
 
126
    pa_bool_t channel_valid:1;
 
127
    pa_bool_t suspended:1;
 
128
    pa_bool_t corked:1;
 
129
    pa_bool_t timing_info_valid:1;
 
130
    pa_bool_t auto_timing_update_requested:1;
 
131
 
111
132
    uint32_t channel;
112
133
    uint32_t syncid;
113
 
    int channel_valid;
114
134
    uint32_t stream_index;
115
 
    pa_stream_direction_t direction;
116
 
    pa_stream_state_t state;
117
 
    pa_bool_t buffer_attr_not_ready, timing_info_not_ready;
118
135
 
119
136
    uint32_t requested_bytes;
 
137
    pa_buffer_attr buffer_attr;
120
138
 
121
139
    uint32_t device_index;
122
140
    char *device_name;
123
 
    pa_bool_t suspended;
124
141
 
125
142
    pa_memchunk peek_memchunk;
126
143
    void *peek_data;
127
144
    pa_memblockq *record_memblockq;
128
145
 
129
 
    int corked;
130
 
 
131
146
    /* Store latest latency info */
132
147
    pa_timing_info timing_info;
133
 
    int timing_info_valid;
134
148
 
135
149
    /* Use to make sure that time advances monotonically */
136
150
    pa_usec_t previous_time;
145
159
 
146
160
    /* Latency interpolation stuff */
147
161
    pa_time_event *auto_timing_update_event;
148
 
    int auto_timing_update_requested;
149
162
 
150
 
    pa_usec_t cached_time;
151
 
    int cached_time_valid;
 
163
    pa_smoother *smoother;
152
164
 
153
165
    /* Callbacks */
154
166
    pa_stream_notify_cb_t state_callback;
167
179
    void *moved_userdata;
168
180
    pa_stream_notify_cb_t suspended_callback;
169
181
    void *suspended_userdata;
 
182
    pa_stream_notify_cb_t started_callback;
 
183
    void *started_userdata;
170
184
};
171
185
 
172
186
typedef void (*pa_operation_cb_t)(void);
192
206
void pa_command_overflow_or_underflow(pa_pdispatch *pd, uint32_t command, uint32_t tag, pa_tagstruct *t, void *userdata);
193
207
void pa_command_stream_suspended(pa_pdispatch *pd, uint32_t command, uint32_t tag, pa_tagstruct *t, void *userdata);
194
208
void pa_command_stream_moved(pa_pdispatch *pd, uint32_t command, uint32_t tag, pa_tagstruct *t, void *userdata);
195
 
 
 
209
void pa_command_stream_started(pa_pdispatch *pd, uint32_t command, uint32_t tag, pa_tagstruct *t, void *userdata);
196
210
pa_operation *pa_operation_new(pa_context *c, pa_stream *s, pa_operation_cb_t callback, void *userdata);
197
211
void pa_operation_done(pa_operation *o);
198
212
 
204
218
void pa_context_fail(pa_context *c, int error);
205
219
int pa_context_set_error(pa_context *c, int error);
206
220
void pa_context_set_state(pa_context *c, pa_context_state_t st);
207
 
int pa_context_handle_error(pa_context *c, uint32_t command, pa_tagstruct *t);
 
221
int pa_context_handle_error(pa_context *c, uint32_t command, pa_tagstruct *t, pa_bool_t fail);
208
222
pa_operation* pa_context_send_simple_command(pa_context *c, uint32_t command, void (*internal_callback)(pa_pdispatch *pd, uint32_t command, uint32_t tag, pa_tagstruct *t, void *userdata), void (*cb)(void), void *userdata);
209
223
 
210
224
void pa_stream_set_state(pa_stream *s, pa_stream_state_t st);
226
240
 
227
241
#define PA_CHECK_VALIDITY_RETURN_NULL(context, expression, error) PA_CHECK_VALIDITY_RETURN_ANY(context, expression, error, NULL)
228
242
 
 
243
void pa_ext_stream_restore_command(pa_context *c, uint32_t tag, pa_tagstruct *t);
229
244
 
230
245
#endif