]> code.delx.au - pulseaudio/blob - src/pulse/def.h
386ea2b1889c9c3e4ae87940b938cdbcfde7b93a
[pulseaudio] / src / pulse / def.h
1 #ifndef foodefhfoo
2 #define foodefhfoo
3
4 /***
5 This file is part of PulseAudio.
6
7 Copyright 2004-2006 Lennart Poettering
8 Copyright 2006 Pierre Ossman <ossman@cendio.se> for Cendio AB
9
10 PulseAudio is free software; you can redistribute it and/or modify
11 it under the terms of the GNU Lesser General Public License as
12 published by the Free Software Foundation; either version 2.1 of the
13 License, or (at your option) any later version.
14
15 PulseAudio is distributed in the hope that it will be useful, but
16 WITHOUT ANY WARRANTY; without even the implied warranty of
17 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
18 Lesser General Public License for more details.
19
20 You should have received a copy of the GNU Lesser General Public
21 License along with PulseAudio; if not, write to the Free Software
22 Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
23 USA.
24 ***/
25
26 #include <inttypes.h>
27 #include <sys/time.h>
28
29 #include <pulse/cdecl.h>
30 #include <pulse/sample.h>
31 #include <pulse/version.h>
32
33 /** \file
34 * Global definitions */
35
36 PA_C_DECL_BEGIN
37
38 /** The state of a connection context */
39 typedef enum pa_context_state {
40 PA_CONTEXT_UNCONNECTED, /**< The context hasn't been connected yet */
41 PA_CONTEXT_CONNECTING, /**< A connection is being established */
42 PA_CONTEXT_AUTHORIZING, /**< The client is authorizing itself to the daemon */
43 PA_CONTEXT_SETTING_NAME, /**< The client is passing its application name to the daemon */
44 PA_CONTEXT_READY, /**< The connection is established, the context is ready to execute operations */
45 PA_CONTEXT_FAILED, /**< The connection failed or was disconnected */
46 PA_CONTEXT_TERMINATED /**< The connection was terminated cleanly */
47 } pa_context_state_t;
48
49 /** Return non-zero if the passed state is one of the connected states. \since 0.9.11 */
50 static inline int PA_CONTEXT_IS_GOOD(pa_context_state_t x) {
51 return
52 x == PA_CONTEXT_CONNECTING ||
53 x == PA_CONTEXT_AUTHORIZING ||
54 x == PA_CONTEXT_SETTING_NAME ||
55 x == PA_CONTEXT_READY;
56 }
57
58 /** \cond fulldocs */
59 #define PA_CONTEXT_UNCONNECTED PA_CONTEXT_UNCONNECTED
60 #define PA_CONTEXT_CONNECTING PA_CONTEXT_CONNECTING
61 #define PA_CONTEXT_AUTHORIZING PA_CONTEXT_AUTHORIZING
62 #define PA_CONTEXT_SETTING_NAME PA_CONTEXT_SETTING_NAME
63 #define PA_CONTEXT_READY PA_CONTEXT_READY
64 #define PA_CONTEXT_FAILED PA_CONTEXT_FAILED
65 #define PA_CONTEXT_TERMINATED PA_CONTEXT_TERMINATED
66 #define PA_CONTEXT_IS_GOOD PA_CONTEXT_IS_GOOD
67 /** \endcond */
68
69 /** The state of a stream */
70 typedef enum pa_stream_state {
71 PA_STREAM_UNCONNECTED, /**< The stream is not yet connected to any sink or source */
72 PA_STREAM_CREATING, /**< The stream is being created */
73 PA_STREAM_READY, /**< The stream is established, you may pass audio data to it now */
74 PA_STREAM_FAILED, /**< An error occurred that made the stream invalid */
75 PA_STREAM_TERMINATED /**< The stream has been terminated cleanly */
76 } pa_stream_state_t;
77
78 /** Return non-zero if the passed state is one of the connected states. \since 0.9.11 */
79 static inline int PA_STREAM_IS_GOOD(pa_stream_state_t x) {
80 return
81 x == PA_STREAM_CREATING ||
82 x == PA_STREAM_READY;
83 }
84
85 /** \cond fulldocs */
86 #define PA_STREAM_UNCONNECTED PA_STREAM_UNCONNECTED
87 #define PA_STREAM_CREATING PA_STREAM_CREATING
88 #define PA_STREAM_READY PA_STREAM_READY
89 #define PA_STREAM_FAILED PA_STREAM_FAILED
90 #define PA_STREAM_TERMINATED PA_STREAM_TERMINATED
91 #define PA_STREAM_IS_GOOD PA_STREAM_IS_GOOD
92 /** \endcond */
93
94 /** The state of an operation */
95 typedef enum pa_operation_state {
96 PA_OPERATION_RUNNING, /**< The operation is still running */
97 PA_OPERATION_DONE, /**< The operation has been completed */
98 PA_OPERATION_CANCELLED /**< The operation has been cancelled. Before 0.9.18 this was called PA_OPERATION_CANCELED. That name is still available for compatibility. */
99 } pa_operation_state_t;
100
101 /** \cond fulldocs */
102 #define PA_OPERATION_RUNNING PA_OPERATION_RUNNING
103 #define PA_OPERATION_DONE PA_OPERATION_DONE
104 #define PA_OPERATION_CANCELED PA_OPERATION_CANCELLED
105 #define PA_OPERATION_CANCELLED PA_OPERATION_CANCELLED
106 /** \endcond */
107
108 /** An invalid index */
109 #define PA_INVALID_INDEX ((uint32_t) -1)
110
111 /** Some special flags for contexts. */
112 typedef enum pa_context_flags {
113 PA_CONTEXT_NOFLAGS = 0x0000U,
114 /**< Flag to pass when no specific options are needed (used to avoid casting) \since 0.9.19 */
115 PA_CONTEXT_NOAUTOSPAWN = 0x0001U,
116 /**< Disabled autospawning of the PulseAudio daemon if required */
117 PA_CONTEXT_NOFAIL = 0x0002U
118 /**< Don't fail if the daemon is not available when pa_context_connect() is called, instead enter PA_CONTEXT_CONNECTING state and wait for the daemon to appear. \since 0.9.15 */
119 } pa_context_flags_t;
120
121 /** \cond fulldocs */
122 /* Allow clients to check with #ifdef for those flags */
123 #define PA_CONTEXT_NOAUTOSPAWN PA_CONTEXT_NOAUTOSPAWN
124 #define PA_CONTEXT_NOFAIL PA_CONTEXT_NOFAIL
125 /** \endcond */
126
127 /** The type of device we are dealing with */
128 typedef enum pa_device_type {
129 PA_DEVICE_TYPE_SINK, /**< Playback device */
130 PA_DEVICE_TYPE_SOURCE /**< Recording device */
131 } pa_device_type_t;
132
133 /** \cond fulldocs */
134 #define PA_DEVICE_TYPE_SINK PA_DEVICE_TYPE_SINK
135 #define PA_DEVICE_TYPE_SOURCE PA_DEVICE_TYPE_SOURCE
136 /** \endcond */
137
138 /** The direction of a pa_stream object */
139 typedef enum pa_stream_direction {
140 PA_STREAM_NODIRECTION, /**< Invalid direction */
141 PA_STREAM_PLAYBACK, /**< Playback stream */
142 PA_STREAM_RECORD, /**< Record stream */
143 PA_STREAM_UPLOAD /**< Sample upload stream */
144 } pa_stream_direction_t;
145
146 /** \cond fulldocs */
147 #define PA_STREAM_NODIRECTION PA_STREAM_NODIRECTION
148 #define PA_STREAM_PLAYBACK PA_STREAM_PLAYBACK
149 #define PA_STREAM_RECORD PA_STREAM_RECORD
150 #define PA_STREAM_UPLOAD PA_STREAM_UPLOAD
151 /** \endcond */
152
153 /** Some special flags for stream connections. */
154 typedef enum pa_stream_flags {
155
156 PA_STREAM_NOFLAGS = 0x0000U,
157 /**< Flag to pass when no specific options are needed (used to avoid casting) \since 0.9.19 */
158
159 PA_STREAM_START_CORKED = 0x0001U,
160 /**< Create the stream corked, requiring an explicit
161 * pa_stream_cork() call to uncork it. */
162
163 PA_STREAM_INTERPOLATE_TIMING = 0x0002U,
164 /**< Interpolate the latency for this stream. When enabled,
165 * pa_stream_get_latency() and pa_stream_get_time() will try to
166 * estimate the current record/playback time based on the local
167 * time that passed since the last timing info update. Using this
168 * option has the advantage of not requiring a whole roundtrip
169 * when the current playback/recording time is needed. Consider
170 * using this option when requesting latency information
171 * frequently. This is especially useful on long latency network
172 * connections. It makes a lot of sense to combine this option
173 * with PA_STREAM_AUTO_TIMING_UPDATE. */
174
175 PA_STREAM_NOT_MONOTONIC = 0x0004U,
176 /**< Don't force the time to increase monotonically. If this
177 * option is enabled, pa_stream_get_time() will not necessarily
178 * return always monotonically increasing time values on each
179 * call. This may confuse applications which cannot deal with time
180 * going 'backwards', but has the advantage that bad transport
181 * latency estimations that caused the time to to jump ahead can
182 * be corrected quickly, without the need to wait. (Please note
183 * that this flag was named PA_STREAM_NOT_MONOTONOUS in releases
184 * prior to 0.9.11. The old name is still defined too, for
185 * compatibility reasons. */
186
187 PA_STREAM_AUTO_TIMING_UPDATE = 0x0008U,
188 /**< If set timing update requests are issued periodically
189 * automatically. Combined with PA_STREAM_INTERPOLATE_TIMING you
190 * will be able to query the current time and latency with
191 * pa_stream_get_time() and pa_stream_get_latency() at all times
192 * without a packet round trip.*/
193
194 PA_STREAM_NO_REMAP_CHANNELS = 0x0010U,
195 /**< Don't remap channels by their name, instead map them simply
196 * by their index. Implies PA_STREAM_NO_REMIX_CHANNELS. Only
197 * supported when the server is at least PA 0.9.8. It is ignored
198 * on older servers.\since 0.9.8 */
199
200 PA_STREAM_NO_REMIX_CHANNELS = 0x0020U,
201 /**< When remapping channels by name, don't upmix or downmix them
202 * to related channels. Copy them into matching channels of the
203 * device 1:1. Only supported when the server is at least PA
204 * 0.9.8. It is ignored on older servers. \since 0.9.8 */
205
206 PA_STREAM_FIX_FORMAT = 0x0040U,
207 /**< Use the sample format of the sink/device this stream is being
208 * connected to, and possibly ignore the format the sample spec
209 * contains -- but you still have to pass a valid value in it as a
210 * hint to PulseAudio what would suit your stream best. If this is
211 * used you should query the used sample format after creating the
212 * stream by using pa_stream_get_sample_spec(). Also, if you
213 * specified manual buffer metrics it is recommended to update
214 * them with pa_stream_set_buffer_attr() to compensate for the
215 * changed frame sizes. Only supported when the server is at least
216 * PA 0.9.8. It is ignored on older servers. \since 0.9.8 */
217
218 PA_STREAM_FIX_RATE = 0x0080U,
219 /**< Use the sample rate of the sink, and possibly ignore the rate
220 * the sample spec contains. Usage similar to
221 * PA_STREAM_FIX_FORMAT.Only supported when the server is at least
222 * PA 0.9.8. It is ignored on older servers. \since 0.9.8 */
223
224 PA_STREAM_FIX_CHANNELS = 0x0100,
225 /**< Use the number of channels and the channel map of the sink,
226 * and possibly ignore the number of channels and the map the
227 * sample spec and the passed channel map contains. Usage similar
228 * to PA_STREAM_FIX_FORMAT. Only supported when the server is at
229 * least PA 0.9.8. It is ignored on older servers. \since 0.9.8 */
230
231 PA_STREAM_DONT_MOVE = 0x0200U,
232 /**< Don't allow moving of this stream to another
233 * sink/device. Useful if you use any of the PA_STREAM_FIX_ flags
234 * and want to make sure that resampling never takes place --
235 * which might happen if the stream is moved to another
236 * sink/source with a different sample spec/channel map. Only
237 * supported when the server is at least PA 0.9.8. It is ignored
238 * on older servers. \since 0.9.8 */
239
240 PA_STREAM_VARIABLE_RATE = 0x0400U,
241 /**< Allow dynamic changing of the sampling rate during playback
242 * with pa_stream_update_sample_rate(). Only supported when the
243 * server is at least PA 0.9.8. It is ignored on older
244 * servers. \since 0.9.8 */
245
246 PA_STREAM_PEAK_DETECT = 0x0800U,
247 /**< Find peaks instead of resampling. \since 0.9.11 */
248
249 PA_STREAM_START_MUTED = 0x1000U,
250 /**< Create in muted state. If neither PA_STREAM_START_UNMUTED nor
251 * PA_STREAM_START_MUTED it is left to the server to decide
252 * whether to create the stream in muted or in unmuted
253 * state. \since 0.9.11 */
254
255 PA_STREAM_ADJUST_LATENCY = 0x2000U,
256 /**< Try to adjust the latency of the sink/source based on the
257 * requested buffer metrics and adjust buffer metrics
258 * accordingly. Also see pa_buffer_attr. This option may not be
259 * specified at the same time as PA_STREAM_EARLY_REQUESTS. \since
260 * 0.9.11 */
261
262 PA_STREAM_EARLY_REQUESTS = 0x4000U,
263 /**< Enable compatibility mode for legacy clients that rely on a
264 * "classic" hardware device fragment-style playback model. If
265 * this option is set, the minreq value of the buffer metrics gets
266 * a new meaning: instead of just specifying that no requests
267 * asking for less new data than this value will be made to the
268 * client it will also guarantee that requests are generated as
269 * early as this limit is reached. This flag should only be set in
270 * very few situations where compatibility with a fragment-based
271 * playback model needs to be kept and the client applications
272 * cannot deal with data requests that are delayed to the latest
273 * moment possible. (Usually these are programs that use usleep()
274 * or a similar call in their playback loops instead of sleeping
275 * on the device itself.) Also see pa_buffer_attr. This option may
276 * not be specified at the same time as
277 * PA_STREAM_ADJUST_LATENCY. \since 0.9.12 */
278
279 PA_STREAM_DONT_INHIBIT_AUTO_SUSPEND = 0x8000U,
280 /**< If set this stream won't be taken into account when we it is
281 * checked whether the device this stream is connected to should
282 * auto-suspend. \since 0.9.15 */
283
284 PA_STREAM_START_UNMUTED = 0x10000U,
285 /**< Create in unmuted state. If neither PA_STREAM_START_UNMUTED
286 * nor PA_STREAM_START_MUTED it is left to the server to decide
287 * whether to create the stream in muted or in unmuted
288 * state. \since 0.9.15 */
289
290 PA_STREAM_FAIL_ON_SUSPEND = 0x20000U,
291 /**< If the sink/source this stream is connected to is suspended
292 * during the creation of this stream, cause it to fail. If the
293 * sink/source is being suspended during creation of this stream,
294 * make sure this stream is terminated. \since 0.9.15 */
295
296 PA_STREAM_RELATIVE_VOLUME = 0x40000U,
297 /**< If a volume is passed when this stream is created, consider
298 * it relative to the sink's current volume, never as absolute
299 * device volume. If this is not specified the volume will be
300 * consider absolute when the sink is in flat volume mode,
301 * relative otherwise. \since 0.9.20 */
302
303 PA_STREAM_PASSTHROUGH = 0x80000U
304 /**< Used to tag content that will be rendered by passthrough sinks.
305 * The data will be left as is and not reformatted, resampled.
306 * \since 1.0 */
307
308 } pa_stream_flags_t;
309
310 /** \cond fulldocs */
311
312 /* English is an evil language */
313 #define PA_STREAM_NOT_MONOTONOUS PA_STREAM_NOT_MONOTONIC
314
315 /* Allow clients to check with #ifdef for those flags */
316 #define PA_STREAM_START_CORKED PA_STREAM_START_CORKED
317 #define PA_STREAM_INTERPOLATE_TIMING PA_STREAM_INTERPOLATE_TIMING
318 #define PA_STREAM_NOT_MONOTONIC PA_STREAM_NOT_MONOTONIC
319 #define PA_STREAM_AUTO_TIMING_UPDATE PA_STREAM_AUTO_TIMING_UPDATE
320 #define PA_STREAM_NO_REMAP_CHANNELS PA_STREAM_NO_REMAP_CHANNELS
321 #define PA_STREAM_NO_REMIX_CHANNELS PA_STREAM_NO_REMIX_CHANNELS
322 #define PA_STREAM_FIX_FORMAT PA_STREAM_FIX_FORMAT
323 #define PA_STREAM_FIX_RATE PA_STREAM_FIX_RATE
324 #define PA_STREAM_FIX_CHANNELS PA_STREAM_FIX_CHANNELS
325 #define PA_STREAM_DONT_MOVE PA_STREAM_DONT_MOVE
326 #define PA_STREAM_VARIABLE_RATE PA_STREAM_VARIABLE_RATE
327 #define PA_STREAM_PEAK_DETECT PA_STREAM_PEAK_DETECT
328 #define PA_STREAM_START_MUTED PA_STREAM_START_MUTED
329 #define PA_STREAM_ADJUST_LATENCY PA_STREAM_ADJUST_LATENCY
330 #define PA_STREAM_EARLY_REQUESTS PA_STREAM_EARLY_REQUESTS
331 #define PA_STREAM_DONT_INHIBIT_AUTO_SUSPEND PA_STREAM_DONT_INHIBIT_AUTO_SUSPEND
332 #define PA_STREAM_START_UNMUTED PA_STREAM_START_UNMUTED
333 #define PA_STREAM_FAIL_ON_SUSPEND PA_STREAM_FAIL_ON_SUSPEND
334 #define PA_STREAM_RELATIVE_VOLUME PA_STREAM_RELATIVE_VOLUME
335 #define PA_STREAM_PASSTHROUGH PA_STREAM_PASSTHROUGH
336
337 /** \endcond */
338
339 /** Playback and record buffer metrics */
340 typedef struct pa_buffer_attr {
341 uint32_t maxlength;
342 /**< Maximum length of the buffer. Setting this to (uint32_t) -1
343 * will initialize this to the maximum value supported by server,
344 * which is recommended. */
345
346 uint32_t tlength;
347 /**< Playback only: target length of the buffer. The server tries
348 * to assure that at least tlength bytes are always available in
349 * the per-stream server-side playback buffer. It is recommended
350 * to set this to (uint32_t) -1, which will initialize this to a
351 * value that is deemed sensible by the server. However, this
352 * value will default to something like 2s, i.e. for applications
353 * that have specific latency requirements this value should be
354 * set to the maximum latency that the application can deal
355 * with. When PA_STREAM_ADJUST_LATENCY is not set this value will
356 * influence only the per-stream playback buffer size. When
357 * PA_STREAM_ADJUST_LATENCY is set the overall latency of the sink
358 * plus the playback buffer size is configured to this value. Set
359 * PA_STREAM_ADJUST_LATENCY if you are interested in adjusting the
360 * overall latency. Don't set it if you are interested in
361 * configuring the server-side per-stream playback buffer
362 * size. */
363
364 uint32_t prebuf;
365 /**< Playback only: pre-buffering. The server does not start with
366 * playback before at least prebuf bytes are available in the
367 * buffer. It is recommended to set this to (uint32_t) -1, which
368 * will initialize this to the same value as tlength, whatever
369 * that may be. Initialize to 0 to enable manual start/stop
370 * control of the stream. This means that playback will not stop
371 * on underrun and playback will not start automatically. Instead
372 * pa_stream_cork() needs to be called explicitly. If you set
373 * this value to 0 you should also set PA_STREAM_START_CORKED. */
374
375 uint32_t minreq;
376 /**< Playback only: minimum request. The server does not request
377 * less than minreq bytes from the client, instead waits until the
378 * buffer is free enough to request more bytes at once. It is
379 * recommended to set this to (uint32_t) -1, which will initialize
380 * this to a value that is deemed sensible by the server. This
381 * should be set to a value that gives PulseAudio enough time to
382 * move the data from the per-stream playback buffer into the
383 * hardware playback buffer. */
384
385 uint32_t fragsize;
386 /**< Recording only: fragment size. The server sends data in
387 * blocks of fragsize bytes size. Large values diminish
388 * interactivity with other operations on the connection context
389 * but decrease control overhead. It is recommended to set this to
390 * (uint32_t) -1, which will initialize this to a value that is
391 * deemed sensible by the server. However, this value will default
392 * to something like 2s, i.e. for applications that have specific
393 * latency requirements this value should be set to the maximum
394 * latency that the application can deal with. If
395 * PA_STREAM_ADJUST_LATENCY is set the overall source latency will
396 * be adjusted according to this value. If it is not set the
397 * source latency is left unmodified. */
398
399 } pa_buffer_attr;
400
401 /** Error values as used by pa_context_errno(). Use pa_strerror() to convert these values to human readable strings */
402 enum {
403 PA_OK = 0, /**< No error */
404 PA_ERR_ACCESS, /**< Access failure */
405 PA_ERR_COMMAND, /**< Unknown command */
406 PA_ERR_INVALID, /**< Invalid argument */
407 PA_ERR_EXIST, /**< Entity exists */
408 PA_ERR_NOENTITY, /**< No such entity */
409 PA_ERR_CONNECTIONREFUSED, /**< Connection refused */
410 PA_ERR_PROTOCOL, /**< Protocol error */
411 PA_ERR_TIMEOUT, /**< Timeout */
412 PA_ERR_AUTHKEY, /**< No authorization key */
413 PA_ERR_INTERNAL, /**< Internal error */
414 PA_ERR_CONNECTIONTERMINATED, /**< Connection terminated */
415 PA_ERR_KILLED, /**< Entity killed */
416 PA_ERR_INVALIDSERVER, /**< Invalid server */
417 PA_ERR_MODINITFAILED, /**< Module initialization failed */
418 PA_ERR_BADSTATE, /**< Bad state */
419 PA_ERR_NODATA, /**< No data */
420 PA_ERR_VERSION, /**< Incompatible protocol version */
421 PA_ERR_TOOLARGE, /**< Data too large */
422 PA_ERR_NOTSUPPORTED, /**< Operation not supported \since 0.9.5 */
423 PA_ERR_UNKNOWN, /**< The error code was unknown to the client */
424 PA_ERR_NOEXTENSION, /**< Extension does not exist. \since 0.9.12 */
425 PA_ERR_OBSOLETE, /**< Obsolete functionality. \since 0.9.15 */
426 PA_ERR_NOTIMPLEMENTED, /**< Missing implementation. \since 0.9.15 */
427 PA_ERR_FORKED, /**< The caller forked without calling execve() and tried to reuse the context. \since 0.9.15 */
428 PA_ERR_IO, /**< An IO error happened. \since 0.9.16 */
429 PA_ERR_BUSY, /**< Device or resource busy. \since 0.9.17 */
430 PA_ERR_MAX /**< Not really an error but the first invalid error code */
431 };
432
433 /** \cond fulldocs */
434 #define PA_OK PA_OK
435 #define PA_ERR_ACCESS PA_ERR_ACCESS
436 #define PA_ERR_COMMAND PA_ERR_COMMAND
437 #define PA_ERR_INVALID PA_ERR_INVALID
438 #define PA_ERR_EXIST PA_ERR_EXIST
439 #define PA_ERR_NOENTITY PA_ERR_NOENTITY
440 #define PA_ERR_CONNECTIONREFUSED PA_ERR_CONNECTIONREFUSED
441 #define PA_ERR_PROTOCOL PA_ERR_PROTOCOL
442 #define PA_ERR_TIMEOUT PA_ERR_TIMEOUT
443 #define PA_ERR_AUTHKEY PA_ERR_AUTHKEY
444 #define PA_ERR_INTERNAL PA_ERR_INTERNAL
445 #define PA_ERR_CONNECTIONTERMINATED PA_ERR_CONNECTIONTERMINATED
446 #define PA_ERR_KILLED PA_ERR_KILLED
447 #define PA_ERR_INVALIDSERVER PA_ERR_INVALIDSERVER
448 #define PA_ERR_MODINITFAILED PA_ERR_MODINITFAILED
449 #define PA_ERR_BADSTATE PA_ERR_BADSTATE
450 #define PA_ERR_NODATA PA_ERR_NODATA
451 #define PA_ERR_VERSION PA_ERR_VERSION
452 #define PA_ERR_TOOLARGE PA_ERR_TOOLARGE
453 #define PA_ERR_NOTSUPPORTED PA_ERR_NOTSUPPORTED
454 #define PA_ERR_UNKNOWN PA_ERR_UNKNOWN
455 #define PA_ERR_NOEXTENSION PA_ERR_NOEXTENSION
456 #define PA_ERR_OBSOLETE PA_ERR_OBSOLETE
457 #define PA_ERR_NOTIMPLEMENTED PA_ERR_NOTIMPLEMENTED
458 #define PA_ERR_FORKED PA_ERR_FORKED
459 #define PA_ERR_MAX PA_ERR_MAX
460 /** \endcond */
461
462 /** Subscription event mask, as used by pa_context_subscribe() */
463 typedef enum pa_subscription_mask {
464 PA_SUBSCRIPTION_MASK_NULL = 0x0000U,
465 /**< No events */
466
467 PA_SUBSCRIPTION_MASK_SINK = 0x0001U,
468 /**< Sink events */
469
470 PA_SUBSCRIPTION_MASK_SOURCE = 0x0002U,
471 /**< Source events */
472
473 PA_SUBSCRIPTION_MASK_SINK_INPUT = 0x0004U,
474 /**< Sink input events */
475
476 PA_SUBSCRIPTION_MASK_SOURCE_OUTPUT = 0x0008U,
477 /**< Source output events */
478
479 PA_SUBSCRIPTION_MASK_MODULE = 0x0010U,
480 /**< Module events */
481
482 PA_SUBSCRIPTION_MASK_CLIENT = 0x0020U,
483 /**< Client events */
484
485 PA_SUBSCRIPTION_MASK_SAMPLE_CACHE = 0x0040U,
486 /**< Sample cache events */
487
488 PA_SUBSCRIPTION_MASK_SERVER = 0x0080U,
489 /**< Other global server changes. */
490
491 /** \cond fulldocs */
492 PA_SUBSCRIPTION_MASK_AUTOLOAD = 0x0100U,
493 /**< \deprecated Autoload table events. */
494 /** \endcond */
495
496 PA_SUBSCRIPTION_MASK_CARD = 0x0200U,
497 /**< Card events. \since 0.9.15 */
498
499 PA_SUBSCRIPTION_MASK_ALL = 0x02ffU
500 /**< Catch all events */
501 } pa_subscription_mask_t;
502
503 /** Subscription event types, as used by pa_context_subscribe() */
504 typedef enum pa_subscription_event_type {
505 PA_SUBSCRIPTION_EVENT_SINK = 0x0000U,
506 /**< Event type: Sink */
507
508 PA_SUBSCRIPTION_EVENT_SOURCE = 0x0001U,
509 /**< Event type: Source */
510
511 PA_SUBSCRIPTION_EVENT_SINK_INPUT = 0x0002U,
512 /**< Event type: Sink input */
513
514 PA_SUBSCRIPTION_EVENT_SOURCE_OUTPUT = 0x0003U,
515 /**< Event type: Source output */
516
517 PA_SUBSCRIPTION_EVENT_MODULE = 0x0004U,
518 /**< Event type: Module */
519
520 PA_SUBSCRIPTION_EVENT_CLIENT = 0x0005U,
521 /**< Event type: Client */
522
523 PA_SUBSCRIPTION_EVENT_SAMPLE_CACHE = 0x0006U,
524 /**< Event type: Sample cache item */
525
526 PA_SUBSCRIPTION_EVENT_SERVER = 0x0007U,
527 /**< Event type: Global server change, only occurring with PA_SUBSCRIPTION_EVENT_CHANGE. */
528
529 /** \cond fulldocs */
530 PA_SUBSCRIPTION_EVENT_AUTOLOAD = 0x0008U,
531 /**< \deprecated Event type: Autoload table changes. */
532 /** \endcond */
533
534 PA_SUBSCRIPTION_EVENT_CARD = 0x0009U,
535 /**< Event type: Card \since 0.9.15 */
536
537 PA_SUBSCRIPTION_EVENT_FACILITY_MASK = 0x000FU,
538 /**< A mask to extract the event type from an event value */
539
540 PA_SUBSCRIPTION_EVENT_NEW = 0x0000U,
541 /**< A new object was created */
542
543 PA_SUBSCRIPTION_EVENT_CHANGE = 0x0010U,
544 /**< A property of the object was modified */
545
546 PA_SUBSCRIPTION_EVENT_REMOVE = 0x0020U,
547 /**< An object was removed */
548
549 PA_SUBSCRIPTION_EVENT_TYPE_MASK = 0x0030U
550 /**< A mask to extract the event operation from an event value */
551
552 } pa_subscription_event_type_t;
553
554 /** Return one if an event type t matches an event mask bitfield */
555 #define pa_subscription_match_flags(m, t) (!!((m) & (1 << ((t) & PA_SUBSCRIPTION_EVENT_FACILITY_MASK))))
556
557 /** \cond fulldocs */
558 #define PA_SUBSCRIPTION_MASK_NULL PA_SUBSCRIPTION_MASK_NULL
559 #define PA_SUBSCRIPTION_MASK_SINK PA_SUBSCRIPTION_MASK_SINK
560 #define PA_SUBSCRIPTION_MASK_SOURCE PA_SUBSCRIPTION_MASK_SOURCE
561 #define PA_SUBSCRIPTION_MASK_SINK_INPUT PA_SUBSCRIPTION_MASK_SINK_INPUT
562 #define PA_SUBSCRIPTION_MASK_SOURCE_OUTPUT PA_SUBSCRIPTION_MASK_SOURCE_OUTPUT
563 #define PA_SUBSCRIPTION_MASK_MODULE PA_SUBSCRIPTION_MASK_MODULE
564 #define PA_SUBSCRIPTION_MASK_CLIENT PA_SUBSCRIPTION_MASK_CLIENT
565 #define PA_SUBSCRIPTION_MASK_SAMPLE_CACHE PA_SUBSCRIPTION_MASK_SAMPLE_CACHE
566 #define PA_SUBSCRIPTION_MASK_SERVER PA_SUBSCRIPTION_MASK_SERVER
567 #define PA_SUBSCRIPTION_MASK_AUTOLOAD PA_SUBSCRIPTION_MASK_AUTOLOAD
568 #define PA_SUBSCRIPTION_MASK_CARD PA_SUBSCRIPTION_MASK_CARD
569 #define PA_SUBSCRIPTION_MASK_ALL PA_SUBSCRIPTION_MASK_ALL
570 #define PA_SUBSCRIPTION_EVENT_SINK PA_SUBSCRIPTION_EVENT_SINK
571 #define PA_SUBSCRIPTION_EVENT_SOURCE PA_SUBSCRIPTION_EVENT_SOURCE
572 #define PA_SUBSCRIPTION_EVENT_SINK_INPUT PA_SUBSCRIPTION_EVENT_SINK_INPUT
573 #define PA_SUBSCRIPTION_EVENT_SOURCE_OUTPUT PA_SUBSCRIPTION_EVENT_SOURCE_OUTPUT
574 #define PA_SUBSCRIPTION_EVENT_MODULE PA_SUBSCRIPTION_EVENT_MODULE
575 #define PA_SUBSCRIPTION_EVENT_CLIENT PA_SUBSCRIPTION_EVENT_CLIENT
576 #define PA_SUBSCRIPTION_EVENT_SAMPLE_CACHE PA_SUBSCRIPTION_EVENT_SAMPLE_CACHE
577 #define PA_SUBSCRIPTION_EVENT_SERVER PA_SUBSCRIPTION_EVENT_SERVER
578 #define PA_SUBSCRIPTION_EVENT_AUTOLOAD PA_SUBSCRIPTION_EVENT_AUTOLOAD
579 #define PA_SUBSCRIPTION_EVENT_CARD PA_SUBSCRIPTION_EVENT_CARD
580 #define PA_SUBSCRIPTION_EVENT_FACILITY_MASK PA_SUBSCRIPTION_EVENT_FACILITY_MASK
581 #define PA_SUBSCRIPTION_EVENT_NEW PA_SUBSCRIPTION_EVENT_NEW
582 #define PA_SUBSCRIPTION_EVENT_CHANGE PA_SUBSCRIPTION_EVENT_CHANGE
583 #define PA_SUBSCRIPTION_EVENT_REMOVE PA_SUBSCRIPTION_EVENT_REMOVE
584 #define PA_SUBSCRIPTION_EVENT_TYPE_MASK PA_SUBSCRIPTION_EVENT_TYPE_MASK
585 /** \endcond */
586
587 /** A structure for all kinds of timing information of a stream. See
588 * pa_stream_update_timing_info() and pa_stream_get_timing_info(). The
589 * total output latency a sample that is written with
590 * pa_stream_write() takes to be played may be estimated by
591 * sink_usec+buffer_usec+transport_usec. (where buffer_usec is defined
592 * as pa_bytes_to_usec(write_index-read_index)) The output buffer
593 * which buffer_usec relates to may be manipulated freely (with
594 * pa_stream_write()'s seek argument, pa_stream_flush() and friends),
595 * the buffers sink_usec and source_usec relate to are first-in
596 * first-out (FIFO) buffers which cannot be flushed or manipulated in
597 * any way. The total input latency a sample that is recorded takes to
598 * be delivered to the application is:
599 * source_usec+buffer_usec+transport_usec-sink_usec. (Take care of
600 * sign issues!) When connected to a monitor source sink_usec contains
601 * the latency of the owning sink. The two latency estimations
602 * described here are implemented in pa_stream_get_latency(). Please
603 * note that this structure can be extended as part of evolutionary
604 * API updates at any time in any new release.*/
605 typedef struct pa_timing_info {
606 struct timeval timestamp;
607 /**< The time when this timing info structure was current */
608
609 int synchronized_clocks;
610 /**< Non-zero if the local and the remote machine have
611 * synchronized clocks. If synchronized clocks are detected
612 * transport_usec becomes much more reliable. However, the code
613 * that detects synchronized clocks is very limited and unreliable
614 * itself. */
615
616 pa_usec_t sink_usec;
617 /**< Time in usecs a sample takes to be played on the sink. For
618 * playback streams and record streams connected to a monitor
619 * source. */
620
621 pa_usec_t source_usec;
622 /**< Time in usecs a sample takes from being recorded to being
623 * delivered to the application. Only for record streams. */
624
625 pa_usec_t transport_usec;
626 /**< Estimated time in usecs a sample takes to be transferred
627 * to/from the daemon. For both playback and record streams. */
628
629 int playing;
630 /**< Non-zero when the stream is currently not underrun and data
631 * is being passed on to the device. Only for playback
632 * streams. This field does not say whether the data is actually
633 * already being played. To determine this check whether
634 * since_underrun (converted to usec) is larger than sink_usec.*/
635
636 int write_index_corrupt;
637 /**< Non-zero if write_index is not up-to-date because a local
638 * write command that corrupted it has been issued in the time
639 * since this latency info was current . Only write commands with
640 * SEEK_RELATIVE_ON_READ and SEEK_RELATIVE_END can corrupt
641 * write_index. */
642
643 int64_t write_index;
644 /**< Current write index into the playback buffer in bytes. Think
645 * twice before using this for seeking purposes: it might be out
646 * of date a the time you want to use it. Consider using
647 * PA_SEEK_RELATIVE instead. */
648
649 int read_index_corrupt;
650 /**< Non-zero if read_index is not up-to-date because a local
651 * pause or flush request that corrupted it has been issued in the
652 * time since this latency info was current. */
653
654 int64_t read_index;
655 /**< Current read index into the playback buffer in bytes. Think
656 * twice before using this for seeking purposes: it might be out
657 * of date a the time you want to use it. Consider using
658 * PA_SEEK_RELATIVE_ON_READ instead. */
659
660 pa_usec_t configured_sink_usec;
661 /**< The configured latency for the sink. \since 0.9.11 */
662
663 pa_usec_t configured_source_usec;
664 /**< The configured latency for the source. \since 0.9.11 */
665
666 int64_t since_underrun;
667 /**< Bytes that were handed to the sink since the last underrun
668 * happened, or since playback started again after the last
669 * underrun. playing will tell you which case it is. \since
670 * 0.9.11 */
671
672 } pa_timing_info;
673
674 /** A structure for the spawn api. This may be used to integrate auto
675 * spawned daemons into your application. For more information see
676 * pa_context_connect(). When spawning a new child process the
677 * waitpid() is used on the child's PID. The spawn routine will not
678 * block or ignore SIGCHLD signals, since this cannot be done in a
679 * thread compatible way. You might have to do this in
680 * prefork/postfork. */
681 typedef struct pa_spawn_api {
682 void (*prefork)(void);
683 /**< Is called just before the fork in the parent process. May be
684 * NULL. */
685
686 void (*postfork)(void);
687 /**< Is called immediately after the fork in the parent
688 * process. May be NULL.*/
689
690 void (*atfork)(void);
691 /**< Is called immediately after the fork in the child
692 * process. May be NULL. It is not safe to close all file
693 * descriptors in this function unconditionally, since a UNIX
694 * socket (created using socketpair()) is passed to the new
695 * process. */
696 } pa_spawn_api;
697
698 /** Seek type for pa_stream_write(). */
699 typedef enum pa_seek_mode {
700 PA_SEEK_RELATIVE = 0,
701 /**< Seek relatively to the write index */
702
703 PA_SEEK_ABSOLUTE = 1,
704 /**< Seek relatively to the start of the buffer queue */
705
706 PA_SEEK_RELATIVE_ON_READ = 2,
707 /**< Seek relatively to the read index. */
708
709 PA_SEEK_RELATIVE_END = 3
710 /**< Seek relatively to the current end of the buffer queue. */
711 } pa_seek_mode_t;
712
713 /** \cond fulldocs */
714 #define PA_SEEK_RELATIVE PA_SEEK_RELATIVE
715 #define PA_SEEK_ABSOLUTE PA_SEEK_ABSOLUTE
716 #define PA_SEEK_RELATIVE_ON_READ PA_SEEK_RELATIVE_ON_READ
717 #define PA_SEEK_RELATIVE_END PA_SEEK_RELATIVE_END
718 /** \endcond */
719
720 /** Special sink flags. */
721 typedef enum pa_sink_flags {
722 PA_SINK_NOFLAGS = 0x0000U,
723 /**< Flag to pass when no specific options are needed (used to avoid casting) \since 0.9.19 */
724
725 PA_SINK_HW_VOLUME_CTRL = 0x0001U,
726 /**< Supports hardware volume control. This is a dynamic flag and may
727 * change at runtime after the sink has initialized */
728
729 PA_SINK_LATENCY = 0x0002U,
730 /**< Supports latency querying */
731
732 PA_SINK_HARDWARE = 0x0004U,
733 /**< Is a hardware sink of some kind, in contrast to
734 * "virtual"/software sinks \since 0.9.3 */
735
736 PA_SINK_NETWORK = 0x0008U,
737 /**< Is a networked sink of some kind. \since 0.9.7 */
738
739 PA_SINK_HW_MUTE_CTRL = 0x0010U,
740 /**< Supports hardware mute control. This is a dynamic flag and may
741 * change at runtime after the sink has initialized \since 0.9.11 */
742
743 PA_SINK_DECIBEL_VOLUME = 0x0020U,
744 /**< Volume can be translated to dB with pa_sw_volume_to_dB(). This is a
745 * dynamic flag and may change at runtime after the sink has initialized
746 * \since 0.9.11 */
747
748 PA_SINK_FLAT_VOLUME = 0x0040U,
749 /**< This sink is in flat volume mode, i.e. always the maximum of
750 * the volume of all connected inputs. \since 0.9.15 */
751
752 PA_SINK_DYNAMIC_LATENCY = 0x0080U,
753 /**< The latency can be adjusted dynamically depending on the
754 * needs of the connected streams. \since 0.9.15 */
755
756 PA_SINK_SYNC_VOLUME = 0x0100U,
757 /**< The HW volume changes are syncronized with SW volume.
758 * \since 1.0 */
759
760 /** \cond fulldocs */
761 /* PRIVATE: Server-side values -- do not try to use these at client-side.
762 * The server will filter out these flags anyway, so you should never see
763 * these flags in sinks. */
764
765 PA_SINK_SHARE_VOLUME_WITH_MASTER = 0x0200U,
766 /**< This sink shares the volume with the master sink (used by some filter
767 * sinks). */
768 /** \endcond */
769
770 PA_SINK_SET_FORMATS = 0x0400U,
771 /**< The sink allows setting what formats are supported by the connected
772 * hardware. The actual functionality to do this might be provided by an
773 * extension. \since 1.0 */
774 } pa_sink_flags_t;
775
776 /** \cond fulldocs */
777 #define PA_SINK_HW_VOLUME_CTRL PA_SINK_HW_VOLUME_CTRL
778 #define PA_SINK_LATENCY PA_SINK_LATENCY
779 #define PA_SINK_HARDWARE PA_SINK_HARDWARE
780 #define PA_SINK_NETWORK PA_SINK_NETWORK
781 #define PA_SINK_HW_MUTE_CTRL PA_SINK_HW_MUTE_CTRL
782 #define PA_SINK_DECIBEL_VOLUME PA_SINK_DECIBEL_VOLUME
783 #define PA_SINK_FLAT_VOLUME PA_SINK_FLAT_VOLUME
784 #define PA_SINK_DYNAMIC_LATENCY PA_SINK_DYNAMIC_LATENCY
785 #define PA_SINK_SYNC_VOLUME PA_SINK_SYNC_VOLUME
786 #define PA_SINK_SHARE_VOLUME_WITH_MASTER PA_SINK_SHARE_VOLUME_WITH_MASTER
787 #define PA_SINK_SET_FORMATS PA_SINK_SET_FORMATS
788
789 /** \endcond */
790
791 /** Sink state. \since 0.9.15 */
792 typedef enum pa_sink_state { /* enum serialized in u8 */
793 PA_SINK_INVALID_STATE = -1,
794 /**< This state is used when the server does not support sink state introspection \since 0.9.15 */
795
796 PA_SINK_RUNNING = 0,
797 /**< Running, sink is playing and used by at least one non-corked sink-input \since 0.9.15 */
798
799 PA_SINK_IDLE = 1,
800 /**< When idle, the sink is playing but there is no non-corked sink-input attached to it \since 0.9.15 */
801
802 PA_SINK_SUSPENDED = 2,
803 /**< When suspended, actual sink access can be closed, for instance \since 0.9.15 */
804
805 /** \cond fulldocs */
806 /* PRIVATE: Server-side values -- DO NOT USE THIS ON THE CLIENT
807 * SIDE! These values are *not* considered part of the official PA
808 * API/ABI. If you use them your application might break when PA
809 * is upgraded. Also, please note that these values are not useful
810 * on the client side anyway. */
811
812 PA_SINK_INIT = -2,
813 /**< Initialization state */
814
815 PA_SINK_UNLINKED = -3
816 /**< The state when the sink is getting unregistered and removed from client access */
817 /** \endcond */
818
819 } pa_sink_state_t;
820
821 /** Returns non-zero if sink is playing: running or idle. \since 0.9.15 */
822 static inline int PA_SINK_IS_OPENED(pa_sink_state_t x) {
823 return x == PA_SINK_RUNNING || x == PA_SINK_IDLE;
824 }
825
826 /** \cond fulldocs */
827 #define PA_SINK_INVALID_STATE PA_SINK_INVALID_STATE
828 #define PA_SINK_RUNNING PA_SINK_RUNNING
829 #define PA_SINK_IDLE PA_SINK_IDLE
830 #define PA_SINK_SUSPENDED PA_SINK_SUSPENDED
831 #define PA_SINK_INIT PA_SINK_INIT
832 #define PA_SINK_UNLINKED PA_SINK_UNLINKED
833 #define PA_SINK_IS_OPENED PA_SINK_IS_OPENED
834 /** \endcond */
835
836 /** Special source flags. */
837 typedef enum pa_source_flags {
838 PA_SOURCE_NOFLAGS = 0x0000U,
839 /**< Flag to pass when no specific options are needed (used to avoid casting) \since 0.9.19 */
840
841 PA_SOURCE_HW_VOLUME_CTRL = 0x0001U,
842 /**< Supports hardware volume control. This is a dynamic flag and may
843 * change at runtime after the source has initialized */
844
845 PA_SOURCE_LATENCY = 0x0002U,
846 /**< Supports latency querying */
847
848 PA_SOURCE_HARDWARE = 0x0004U,
849 /**< Is a hardware source of some kind, in contrast to
850 * "virtual"/software source \since 0.9.3 */
851
852 PA_SOURCE_NETWORK = 0x0008U,
853 /**< Is a networked source of some kind. \since 0.9.7 */
854
855 PA_SOURCE_HW_MUTE_CTRL = 0x0010U,
856 /**< Supports hardware mute control. This is a dynamic flag and may
857 * change at runtime after the source has initialized \since 0.9.11 */
858
859 PA_SOURCE_DECIBEL_VOLUME = 0x0020U,
860 /**< Volume can be translated to dB with pa_sw_volume_to_dB(). This is a
861 * dynamic flag and may change at runtime after the source has initialized
862 * \since 0.9.11 */
863
864 PA_SOURCE_DYNAMIC_LATENCY = 0x0040U,
865 /**< The latency can be adjusted dynamically depending on the
866 * needs of the connected streams. \since 0.9.15 */
867
868 PA_SOURCE_FLAT_VOLUME = 0x0080U,
869 /**< This source is in flat volume mode, i.e. always the maximum of
870 * the volume of all connected outputs. \since 1.0 */
871
872 PA_SOURCE_SYNC_VOLUME = 0x0100U,
873 /**< The HW volume changes are syncronized with SW volume.
874 * \since 1.0 */
875
876 /** \cond fulldocs */
877 /* PRIVATE: Server-side values -- do not try to use these at client-side.
878 * The server will filter out these flags anyway, so you should never see
879 * these flags in sources. */
880
881 PA_SOURCE_SHARE_VOLUME_WITH_MASTER = 0x0200U,
882 /**< This source shares the volume with the master source (used by some filter
883 * sources). */
884 } pa_source_flags_t;
885
886 /** \cond fulldocs */
887 #define PA_SOURCE_HW_VOLUME_CTRL PA_SOURCE_HW_VOLUME_CTRL
888 #define PA_SOURCE_LATENCY PA_SOURCE_LATENCY
889 #define PA_SOURCE_HARDWARE PA_SOURCE_HARDWARE
890 #define PA_SOURCE_NETWORK PA_SOURCE_NETWORK
891 #define PA_SOURCE_HW_MUTE_CTRL PA_SOURCE_HW_MUTE_CTRL
892 #define PA_SOURCE_DECIBEL_VOLUME PA_SOURCE_DECIBEL_VOLUME
893 #define PA_SOURCE_DYNAMIC_LATENCY PA_SOURCE_DYNAMIC_LATENCY
894 #define PA_SOURCE_FLAT_VOLUME PA_SOURCE_FLAT_VOLUME
895 #define PA_SOURCE_SYNC_VOLUME PA_SOURCE_SYNC_VOLUME
896 #define PA_SOURCE_SHARE_VOLUME_WITH_MASTER PA_SOURCE_SHARE_VOLUME_WITH_MASTER
897
898 /** \endcond */
899
900 /** Source state. \since 0.9.15 */
901 typedef enum pa_source_state {
902 PA_SOURCE_INVALID_STATE = -1,
903 /**< This state is used when the server does not support source state introspection \since 0.9.15 */
904
905 PA_SOURCE_RUNNING = 0,
906 /**< Running, source is recording and used by at least one non-corked source-output \since 0.9.15 */
907
908 PA_SOURCE_IDLE = 1,
909 /**< When idle, the source is still recording but there is no non-corked source-output \since 0.9.15 */
910
911 PA_SOURCE_SUSPENDED = 2,
912 /**< When suspended, actual source access can be closed, for instance \since 0.9.15 */
913
914 /** \cond fulldocs */
915 /* PRIVATE: Server-side values -- DO NOT USE THIS ON THE CLIENT
916 * SIDE! These values are *not* considered part of the official PA
917 * API/ABI. If you use them your application might break when PA
918 * is upgraded. Also, please note that these values are not useful
919 * on the client side anyway. */
920
921 PA_SOURCE_INIT = -2,
922 /**< Initialization state */
923
924 PA_SOURCE_UNLINKED = -3
925 /**< The state when the source is getting unregistered and removed from client access */
926 /** \endcond */
927
928 } pa_source_state_t;
929
930 /** Returns non-zero if source is recording: running or idle. \since 0.9.15 */
931 static inline int PA_SOURCE_IS_OPENED(pa_source_state_t x) {
932 return x == PA_SOURCE_RUNNING || x == PA_SOURCE_IDLE;
933 }
934
935 /** \cond fulldocs */
936 #define PA_SOURCE_INVALID_STATE PA_SOURCE_INVALID_STATE
937 #define PA_SOURCE_RUNNING PA_SOURCE_RUNNING
938 #define PA_SOURCE_IDLE PA_SOURCE_IDLE
939 #define PA_SOURCE_SUSPENDED PA_SOURCE_SUSPENDED
940 #define PA_SOURCE_INIT PA_SOURCE_INIT
941 #define PA_SOURCE_UNLINKED PA_SOURCE_UNLINKED
942 #define PA_SOURCE_IS_OPENED PA_SOURCE_IS_OPENED
943 /** \endcond */
944
945 /** A generic free() like callback prototype */
946 typedef void (*pa_free_cb_t)(void *p);
947
948 /** A stream policy/meta event requesting that an application should
949 * cork a specific stream. See pa_stream_event_cb_t for more
950 * information, \since 0.9.15 */
951 #define PA_STREAM_EVENT_REQUEST_CORK "request-cork"
952
953 /** A stream policy/meta event requesting that an application should
954 * cork a specific stream. See pa_stream_event_cb_t for more
955 * information, \since 0.9.15 */
956 #define PA_STREAM_EVENT_REQUEST_UNCORK "request-uncork"
957
958 /** A stream event notifying that the stream is going to be
959 * disconnected because the underlying sink changed and no longer
960 * supports the format that was originally negotiated. Clients need
961 * to connect a new stream to renegotiate a format and continue
962 * playback, \since 1.0 */
963 #define PA_STREAM_EVENT_FORMAT_LOST "format-lost"
964
965 PA_C_DECL_END
966
967 #endif