PulseAudio  16.0
def.h
Go to the documentation of this file.
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, see <http://www.gnu.org/licenses/>.
22 ***/
23 
24 #include <inttypes.h>
25 #include <sys/time.h>
26 
27 #include <pulse/cdecl.h>
28 #include <pulse/sample.h>
29 #include <pulse/version.h>
30 
34 PA_C_DECL_BEGIN
35 
37 typedef enum pa_context_state {
46 
48 static inline int PA_CONTEXT_IS_GOOD(pa_context_state_t x) {
49  return
50  x == PA_CONTEXT_CONNECTING ||
53  x == PA_CONTEXT_READY;
54 }
55 
57 #define PA_CONTEXT_UNCONNECTED PA_CONTEXT_UNCONNECTED
58 #define PA_CONTEXT_CONNECTING PA_CONTEXT_CONNECTING
59 #define PA_CONTEXT_AUTHORIZING PA_CONTEXT_AUTHORIZING
60 #define PA_CONTEXT_SETTING_NAME PA_CONTEXT_SETTING_NAME
61 #define PA_CONTEXT_READY PA_CONTEXT_READY
62 #define PA_CONTEXT_FAILED PA_CONTEXT_FAILED
63 #define PA_CONTEXT_TERMINATED PA_CONTEXT_TERMINATED
64 #define PA_CONTEXT_IS_GOOD PA_CONTEXT_IS_GOOD
68 typedef enum pa_stream_state {
75 
77 static inline int PA_STREAM_IS_GOOD(pa_stream_state_t x) {
78  return
79  x == PA_STREAM_CREATING ||
80  x == PA_STREAM_READY;
81 }
82 
84 #define PA_STREAM_UNCONNECTED PA_STREAM_UNCONNECTED
85 #define PA_STREAM_CREATING PA_STREAM_CREATING
86 #define PA_STREAM_READY PA_STREAM_READY
87 #define PA_STREAM_FAILED PA_STREAM_FAILED
88 #define PA_STREAM_TERMINATED PA_STREAM_TERMINATED
89 #define PA_STREAM_IS_GOOD PA_STREAM_IS_GOOD
93 typedef enum pa_operation_state {
103 
105 #define PA_OPERATION_RUNNING PA_OPERATION_RUNNING
106 #define PA_OPERATION_DONE PA_OPERATION_DONE
107 #define PA_OPERATION_CANCELED PA_OPERATION_CANCELLED
108 #define PA_OPERATION_CANCELLED PA_OPERATION_CANCELLED
112 #define PA_INVALID_INDEX ((uint32_t) -1)
113 
115 typedef enum pa_context_flags {
116  PA_CONTEXT_NOFLAGS = 0x0000U,
118  PA_CONTEXT_NOAUTOSPAWN = 0x0001U,
120  PA_CONTEXT_NOFAIL = 0x0002U
125 
127 /* Allow clients to check with #ifdef for those flags */
128 #define PA_CONTEXT_NOAUTOSPAWN PA_CONTEXT_NOAUTOSPAWN
129 #define PA_CONTEXT_NOFAIL PA_CONTEXT_NOFAIL
136 typedef enum pa_direction {
138  PA_DIRECTION_INPUT = 0x0002U
140 
142 #define PA_DIRECTION_OUTPUT PA_DIRECTION_OUTPUT
143 #define PA_DIRECTION_INPUT PA_DIRECTION_INPUT
147 typedef enum pa_device_type {
151 
153 #define PA_DEVICE_TYPE_SINK PA_DEVICE_TYPE_SINK
154 #define PA_DEVICE_TYPE_SOURCE PA_DEVICE_TYPE_SOURCE
158 typedef enum pa_stream_direction {
164 
166 #define PA_STREAM_NODIRECTION PA_STREAM_NODIRECTION
167 #define PA_STREAM_PLAYBACK PA_STREAM_PLAYBACK
168 #define PA_STREAM_RECORD PA_STREAM_RECORD
169 #define PA_STREAM_UPLOAD PA_STREAM_UPLOAD
173 typedef enum pa_stream_flags {
174 
175  PA_STREAM_NOFLAGS = 0x0000U,
178  PA_STREAM_START_CORKED = 0x0001U,
194  PA_STREAM_NOT_MONOTONIC = 0x0004U,
213  PA_STREAM_NO_REMAP_CHANNELS = 0x0010U,
219  PA_STREAM_NO_REMIX_CHANNELS = 0x0020U,
225  PA_STREAM_FIX_FORMAT = 0x0040U,
246  PA_STREAM_FIX_RATE = 0x0080U,
261  PA_STREAM_FIX_CHANNELS = 0x0100,
280  PA_STREAM_DONT_MOVE = 0x0200U,
289  PA_STREAM_VARIABLE_RATE = 0x0400U,
295  PA_STREAM_PEAK_DETECT = 0x0800U,
298  PA_STREAM_START_MUTED = 0x1000U,
304  PA_STREAM_ADJUST_LATENCY = 0x2000U,
311  PA_STREAM_EARLY_REQUESTS = 0x4000U,
333  PA_STREAM_START_UNMUTED = 0x10000U,
339  PA_STREAM_FAIL_ON_SUSPEND = 0x20000U,
345  PA_STREAM_RELATIVE_VOLUME = 0x40000U,
352  PA_STREAM_PASSTHROUGH = 0x80000U
358 
361 /* English is an evil language */
362 #define PA_STREAM_NOT_MONOTONOUS PA_STREAM_NOT_MONOTONIC
363 
364 /* Allow clients to check with #ifdef for those flags */
365 #define PA_STREAM_START_CORKED PA_STREAM_START_CORKED
366 #define PA_STREAM_INTERPOLATE_TIMING PA_STREAM_INTERPOLATE_TIMING
367 #define PA_STREAM_NOT_MONOTONIC PA_STREAM_NOT_MONOTONIC
368 #define PA_STREAM_AUTO_TIMING_UPDATE PA_STREAM_AUTO_TIMING_UPDATE
369 #define PA_STREAM_NO_REMAP_CHANNELS PA_STREAM_NO_REMAP_CHANNELS
370 #define PA_STREAM_NO_REMIX_CHANNELS PA_STREAM_NO_REMIX_CHANNELS
371 #define PA_STREAM_FIX_FORMAT PA_STREAM_FIX_FORMAT
372 #define PA_STREAM_FIX_RATE PA_STREAM_FIX_RATE
373 #define PA_STREAM_FIX_CHANNELS PA_STREAM_FIX_CHANNELS
374 #define PA_STREAM_DONT_MOVE PA_STREAM_DONT_MOVE
375 #define PA_STREAM_VARIABLE_RATE PA_STREAM_VARIABLE_RATE
376 #define PA_STREAM_PEAK_DETECT PA_STREAM_PEAK_DETECT
377 #define PA_STREAM_START_MUTED PA_STREAM_START_MUTED
378 #define PA_STREAM_ADJUST_LATENCY PA_STREAM_ADJUST_LATENCY
379 #define PA_STREAM_EARLY_REQUESTS PA_STREAM_EARLY_REQUESTS
380 #define PA_STREAM_DONT_INHIBIT_AUTO_SUSPEND PA_STREAM_DONT_INHIBIT_AUTO_SUSPEND
381 #define PA_STREAM_START_UNMUTED PA_STREAM_START_UNMUTED
382 #define PA_STREAM_FAIL_ON_SUSPEND PA_STREAM_FAIL_ON_SUSPEND
383 #define PA_STREAM_RELATIVE_VOLUME PA_STREAM_RELATIVE_VOLUME
384 #define PA_STREAM_PASSTHROUGH PA_STREAM_PASSTHROUGH
385 
389 typedef struct pa_buffer_attr {
390  uint32_t maxlength;
401  uint32_t tlength;
424  uint32_t prebuf;
443  uint32_t minreq;
453  uint32_t fragsize;
469 
471 typedef enum pa_error_code {
472  PA_OK = 0,
499  PA_ERR_MAX
501 
503 #define PA_OK PA_OK
504 #define PA_ERR_ACCESS PA_ERR_ACCESS
505 #define PA_ERR_COMMAND PA_ERR_COMMAND
506 #define PA_ERR_INVALID PA_ERR_INVALID
507 #define PA_ERR_EXIST PA_ERR_EXIST
508 #define PA_ERR_NOENTITY PA_ERR_NOENTITY
509 #define PA_ERR_CONNECTIONREFUSED PA_ERR_CONNECTIONREFUSED
510 #define PA_ERR_PROTOCOL PA_ERR_PROTOCOL
511 #define PA_ERR_TIMEOUT PA_ERR_TIMEOUT
512 #define PA_ERR_AUTHKEY PA_ERR_AUTHKEY
513 #define PA_ERR_INTERNAL PA_ERR_INTERNAL
514 #define PA_ERR_CONNECTIONTERMINATED PA_ERR_CONNECTIONTERMINATED
515 #define PA_ERR_KILLED PA_ERR_KILLED
516 #define PA_ERR_INVALIDSERVER PA_ERR_INVALIDSERVER
517 #define PA_ERR_MODINITFAILED PA_ERR_MODINITFAILED
518 #define PA_ERR_BADSTATE PA_ERR_BADSTATE
519 #define PA_ERR_NODATA PA_ERR_NODATA
520 #define PA_ERR_VERSION PA_ERR_VERSION
521 #define PA_ERR_TOOLARGE PA_ERR_TOOLARGE
522 #define PA_ERR_NOTSUPPORTED PA_ERR_NOTSUPPORTED
523 #define PA_ERR_UNKNOWN PA_ERR_UNKNOWN
524 #define PA_ERR_NOEXTENSION PA_ERR_NOEXTENSION
525 #define PA_ERR_OBSOLETE PA_ERR_OBSOLETE
526 #define PA_ERR_NOTIMPLEMENTED PA_ERR_NOTIMPLEMENTED
527 #define PA_ERR_FORKED PA_ERR_FORKED
528 #define PA_ERR_MAX PA_ERR_MAX
532 typedef enum pa_subscription_mask {
533  PA_SUBSCRIPTION_MASK_NULL = 0x0000U,
536  PA_SUBSCRIPTION_MASK_SINK = 0x0001U,
539  PA_SUBSCRIPTION_MASK_SOURCE = 0x0002U,
548  PA_SUBSCRIPTION_MASK_MODULE = 0x0010U,
551  PA_SUBSCRIPTION_MASK_CLIENT = 0x0020U,
557  PA_SUBSCRIPTION_MASK_SERVER = 0x0080U,
561  PA_SUBSCRIPTION_MASK_AUTOLOAD = 0x0100U,
565  PA_SUBSCRIPTION_MASK_CARD = 0x0200U,
568  PA_SUBSCRIPTION_MASK_ALL = 0x02ffU
571 
574  PA_SUBSCRIPTION_EVENT_SINK = 0x0000U,
599  PA_SUBSCRIPTION_EVENT_AUTOLOAD = 0x0008U,
603  PA_SUBSCRIPTION_EVENT_CARD = 0x0009U,
609  PA_SUBSCRIPTION_EVENT_NEW = 0x0000U,
622 
624 #define pa_subscription_match_flags(m, t) (!!((m) & (1 << ((t) & PA_SUBSCRIPTION_EVENT_FACILITY_MASK))))
625 
627 #define PA_SUBSCRIPTION_MASK_NULL PA_SUBSCRIPTION_MASK_NULL
628 #define PA_SUBSCRIPTION_MASK_SINK PA_SUBSCRIPTION_MASK_SINK
629 #define PA_SUBSCRIPTION_MASK_SOURCE PA_SUBSCRIPTION_MASK_SOURCE
630 #define PA_SUBSCRIPTION_MASK_SINK_INPUT PA_SUBSCRIPTION_MASK_SINK_INPUT
631 #define PA_SUBSCRIPTION_MASK_SOURCE_OUTPUT PA_SUBSCRIPTION_MASK_SOURCE_OUTPUT
632 #define PA_SUBSCRIPTION_MASK_MODULE PA_SUBSCRIPTION_MASK_MODULE
633 #define PA_SUBSCRIPTION_MASK_CLIENT PA_SUBSCRIPTION_MASK_CLIENT
634 #define PA_SUBSCRIPTION_MASK_SAMPLE_CACHE PA_SUBSCRIPTION_MASK_SAMPLE_CACHE
635 #define PA_SUBSCRIPTION_MASK_SERVER PA_SUBSCRIPTION_MASK_SERVER
636 #define PA_SUBSCRIPTION_MASK_AUTOLOAD PA_SUBSCRIPTION_MASK_AUTOLOAD
637 #define PA_SUBSCRIPTION_MASK_CARD PA_SUBSCRIPTION_MASK_CARD
638 #define PA_SUBSCRIPTION_MASK_ALL PA_SUBSCRIPTION_MASK_ALL
639 #define PA_SUBSCRIPTION_EVENT_SINK PA_SUBSCRIPTION_EVENT_SINK
640 #define PA_SUBSCRIPTION_EVENT_SOURCE PA_SUBSCRIPTION_EVENT_SOURCE
641 #define PA_SUBSCRIPTION_EVENT_SINK_INPUT PA_SUBSCRIPTION_EVENT_SINK_INPUT
642 #define PA_SUBSCRIPTION_EVENT_SOURCE_OUTPUT PA_SUBSCRIPTION_EVENT_SOURCE_OUTPUT
643 #define PA_SUBSCRIPTION_EVENT_MODULE PA_SUBSCRIPTION_EVENT_MODULE
644 #define PA_SUBSCRIPTION_EVENT_CLIENT PA_SUBSCRIPTION_EVENT_CLIENT
645 #define PA_SUBSCRIPTION_EVENT_SAMPLE_CACHE PA_SUBSCRIPTION_EVENT_SAMPLE_CACHE
646 #define PA_SUBSCRIPTION_EVENT_SERVER PA_SUBSCRIPTION_EVENT_SERVER
647 #define PA_SUBSCRIPTION_EVENT_AUTOLOAD PA_SUBSCRIPTION_EVENT_AUTOLOAD
648 #define PA_SUBSCRIPTION_EVENT_CARD PA_SUBSCRIPTION_EVENT_CARD
649 #define PA_SUBSCRIPTION_EVENT_FACILITY_MASK PA_SUBSCRIPTION_EVENT_FACILITY_MASK
650 #define PA_SUBSCRIPTION_EVENT_NEW PA_SUBSCRIPTION_EVENT_NEW
651 #define PA_SUBSCRIPTION_EVENT_CHANGE PA_SUBSCRIPTION_EVENT_CHANGE
652 #define PA_SUBSCRIPTION_EVENT_REMOVE PA_SUBSCRIPTION_EVENT_REMOVE
653 #define PA_SUBSCRIPTION_EVENT_TYPE_MASK PA_SUBSCRIPTION_EVENT_TYPE_MASK
680 typedef struct pa_timing_info {
681  struct timeval timestamp;
705  int playing;
719  int64_t write_index;
730  int64_t read_index;
742  int64_t since_underrun;
749 
757 typedef struct pa_spawn_api {
758  void (*prefork)(void);
762  void (*postfork)(void);
766  void (*atfork)(void);
773 
775 typedef enum pa_seek_mode {
776  PA_SEEK_RELATIVE = 0,
779  PA_SEEK_ABSOLUTE = 1,
788 
790 #define PA_SEEK_RELATIVE PA_SEEK_RELATIVE
791 #define PA_SEEK_ABSOLUTE PA_SEEK_ABSOLUTE
792 #define PA_SEEK_RELATIVE_ON_READ PA_SEEK_RELATIVE_ON_READ
793 #define PA_SEEK_RELATIVE_END PA_SEEK_RELATIVE_END
797 typedef enum pa_sink_flags {
798  PA_SINK_NOFLAGS = 0x0000U,
801  PA_SINK_HW_VOLUME_CTRL = 0x0001U,
805  PA_SINK_LATENCY = 0x0002U,
808  PA_SINK_HARDWARE = 0x0004U,
812  PA_SINK_NETWORK = 0x0008U,
815  PA_SINK_HW_MUTE_CTRL = 0x0010U,
819  PA_SINK_DECIBEL_VOLUME = 0x0020U,
824  PA_SINK_FLAT_VOLUME = 0x0040U,
828  PA_SINK_DYNAMIC_LATENCY = 0x0080U,
832  PA_SINK_SET_FORMATS = 0x0100U,
837 #ifdef __INCLUDED_FROM_PULSE_AUDIO
839  /* PRIVATE: Server-side values -- do not try to use these at client-side.
840  * The server will filter out these flags anyway, so you should never see
841  * these flags in sinks. */
842 
843  PA_SINK_SHARE_VOLUME_WITH_MASTER = 0x1000000U,
847  PA_SINK_DEFERRED_VOLUME = 0x2000000U,
850 #endif
851 
853 
855 #define PA_SINK_HW_VOLUME_CTRL PA_SINK_HW_VOLUME_CTRL
856 #define PA_SINK_LATENCY PA_SINK_LATENCY
857 #define PA_SINK_HARDWARE PA_SINK_HARDWARE
858 #define PA_SINK_NETWORK PA_SINK_NETWORK
859 #define PA_SINK_HW_MUTE_CTRL PA_SINK_HW_MUTE_CTRL
860 #define PA_SINK_DECIBEL_VOLUME PA_SINK_DECIBEL_VOLUME
861 #define PA_SINK_FLAT_VOLUME PA_SINK_FLAT_VOLUME
862 #define PA_SINK_DYNAMIC_LATENCY PA_SINK_DYNAMIC_LATENCY
863 #define PA_SINK_SET_FORMATS PA_SINK_SET_FORMATS
864 #ifdef __INCLUDED_FROM_PULSE_AUDIO
865 #define PA_SINK_CLIENT_FLAGS_MASK 0xFFFFFF
866 #endif
867 
871 typedef enum pa_sink_state { /* enum serialized in u8 */
875  PA_SINK_RUNNING = 0,
878  PA_SINK_IDLE = 1,
881  PA_SINK_SUSPENDED = 2,
885  /* PRIVATE: Server-side values -- DO NOT USE THIS ON THE CLIENT
886  * SIDE! These values are *not* considered part of the official PA
887  * API/ABI. If you use them your application might break when PA
888  * is upgraded. Also, please note that these values are not useful
889  * on the client side anyway. */
890 
891  PA_SINK_INIT = -2,
894  PA_SINK_UNLINKED = -3
899 
901 static inline int PA_SINK_IS_OPENED(pa_sink_state_t x) {
902  return x == PA_SINK_RUNNING || x == PA_SINK_IDLE;
903 }
904 
906 static inline int PA_SINK_IS_RUNNING(pa_sink_state_t x) {
907  return x == PA_SINK_RUNNING;
908 }
909 
911 #define PA_SINK_INVALID_STATE PA_SINK_INVALID_STATE
912 #define PA_SINK_RUNNING PA_SINK_RUNNING
913 #define PA_SINK_IDLE PA_SINK_IDLE
914 #define PA_SINK_SUSPENDED PA_SINK_SUSPENDED
915 #define PA_SINK_INIT PA_SINK_INIT
916 #define PA_SINK_UNLINKED PA_SINK_UNLINKED
917 #define PA_SINK_IS_OPENED PA_SINK_IS_OPENED
921 typedef enum pa_source_flags {
922  PA_SOURCE_NOFLAGS = 0x0000U,
925  PA_SOURCE_HW_VOLUME_CTRL = 0x0001U,
929  PA_SOURCE_LATENCY = 0x0002U,
932  PA_SOURCE_HARDWARE = 0x0004U,
936  PA_SOURCE_NETWORK = 0x0008U,
939  PA_SOURCE_HW_MUTE_CTRL = 0x0010U,
943  PA_SOURCE_DECIBEL_VOLUME = 0x0020U,
948  PA_SOURCE_DYNAMIC_LATENCY = 0x0040U,
952  PA_SOURCE_FLAT_VOLUME = 0x0080U,
956 #ifdef __INCLUDED_FROM_PULSE_AUDIO
958  /* PRIVATE: Server-side values -- do not try to use these at client-side.
959  * The server will filter out these flags anyway, so you should never see
960  * these flags in sources. */
961 
962  PA_SOURCE_SHARE_VOLUME_WITH_MASTER = 0x1000000U,
966  PA_SOURCE_DEFERRED_VOLUME = 0x2000000U,
968 #endif
970 
972 #define PA_SOURCE_HW_VOLUME_CTRL PA_SOURCE_HW_VOLUME_CTRL
973 #define PA_SOURCE_LATENCY PA_SOURCE_LATENCY
974 #define PA_SOURCE_HARDWARE PA_SOURCE_HARDWARE
975 #define PA_SOURCE_NETWORK PA_SOURCE_NETWORK
976 #define PA_SOURCE_HW_MUTE_CTRL PA_SOURCE_HW_MUTE_CTRL
977 #define PA_SOURCE_DECIBEL_VOLUME PA_SOURCE_DECIBEL_VOLUME
978 #define PA_SOURCE_DYNAMIC_LATENCY PA_SOURCE_DYNAMIC_LATENCY
979 #define PA_SOURCE_FLAT_VOLUME PA_SOURCE_FLAT_VOLUME
980 #ifdef __INCLUDED_FROM_PULSE_AUDIO
981 #define PA_SOURCE_CLIENT_FLAGS_MASK 0xFFFFFF
982 #endif
983 
987 typedef enum pa_source_state {
991  PA_SOURCE_RUNNING = 0,
994  PA_SOURCE_IDLE = 1,
1001  /* PRIVATE: Server-side values -- DO NOT USE THIS ON THE CLIENT
1002  * SIDE! These values are *not* considered part of the official PA
1003  * API/ABI. If you use them your application might break when PA
1004  * is upgraded. Also, please note that these values are not useful
1005  * on the client side anyway. */
1006 
1007  PA_SOURCE_INIT = -2,
1010  PA_SOURCE_UNLINKED = -3
1015 
1017 static inline int PA_SOURCE_IS_OPENED(pa_source_state_t x) {
1018  return x == PA_SOURCE_RUNNING || x == PA_SOURCE_IDLE;
1019 }
1020 
1022 static inline int PA_SOURCE_IS_RUNNING(pa_source_state_t x) {
1023  return x == PA_SOURCE_RUNNING;
1024 }
1025 
1027 #define PA_SOURCE_INVALID_STATE PA_SOURCE_INVALID_STATE
1028 #define PA_SOURCE_RUNNING PA_SOURCE_RUNNING
1029 #define PA_SOURCE_IDLE PA_SOURCE_IDLE
1030 #define PA_SOURCE_SUSPENDED PA_SOURCE_SUSPENDED
1031 #define PA_SOURCE_INIT PA_SOURCE_INIT
1032 #define PA_SOURCE_UNLINKED PA_SOURCE_UNLINKED
1033 #define PA_SOURCE_IS_OPENED PA_SOURCE_IS_OPENED
1037 typedef void (*pa_free_cb_t)(void *p);
1038 
1042 #define PA_STREAM_EVENT_REQUEST_CORK "request-cork"
1043 
1047 #define PA_STREAM_EVENT_REQUEST_UNCORK "request-uncork"
1048 
1054 #define PA_STREAM_EVENT_FORMAT_LOST "format-lost"
1055 
1056 #ifndef __INCLUDED_FROM_PULSE_AUDIO
1059 typedef enum pa_port_available {
1064 
1066 #define PA_PORT_AVAILABLE_UNKNOWN PA_PORT_AVAILABLE_UNKNOWN
1067 #define PA_PORT_AVAILABLE_NO PA_PORT_AVAILABLE_NO
1068 #define PA_PORT_AVAILABLE_YES PA_PORT_AVAILABLE_YES
1069 
1071 #endif
1072 
1076 typedef enum pa_device_port_type {
1101 
1102 PA_C_DECL_END
1103 
1104 #endif
enum pa_device_type pa_device_type_t
The type of device we are dealing with.
pa_sink_flags
Special sink flags.
Definition: def.h:797
@ PA_SINK_HW_MUTE_CTRL
Supports hardware mute control.
Definition: def.h:815
@ PA_SINK_LATENCY
Supports latency querying.
Definition: def.h:805
@ PA_SINK_DECIBEL_VOLUME
Volume can be translated to dB with pa_sw_volume_to_dB().
Definition: def.h:819
@ PA_SINK_DYNAMIC_LATENCY
The latency can be adjusted dynamically depending on the needs of the connected streams.
Definition: def.h:828
@ PA_SINK_FLAT_VOLUME
This sink is in flat volume mode, i.e. always the maximum of the volume of all connected inputs.
Definition: def.h:824
@ PA_SINK_NOFLAGS
Flag to pass when no specific options are needed (used to avoid casting)
Definition: def.h:798
@ PA_SINK_SET_FORMATS
The sink allows setting what formats are supported by the connected hardware.
Definition: def.h:832
@ PA_SINK_NETWORK
Is a networked sink of some kind.
Definition: def.h:812
@ PA_SINK_HARDWARE
Is a hardware sink of some kind, in contrast to "virtual"/software sinks.
Definition: def.h:808
@ PA_SINK_HW_VOLUME_CTRL
Supports hardware volume control.
Definition: def.h:801
struct pa_timing_info pa_timing_info
A structure for all kinds of timing information of a stream.
enum pa_subscription_event_type pa_subscription_event_type_t
Subscription event types, as used by pa_context_subscribe()
struct pa_buffer_attr pa_buffer_attr
Playback and record buffer metrics.
enum pa_sink_flags pa_sink_flags_t
Special sink flags.
struct pa_spawn_api pa_spawn_api
A structure for the spawn api.
enum pa_error_code pa_error_code_t
Error values as used by pa_context_errno().
void(* pa_free_cb_t)(void *p)
A generic free() like callback prototype.
Definition: def.h:1037
pa_source_flags
Special source flags.
Definition: def.h:921
@ PA_SOURCE_DYNAMIC_LATENCY
The latency can be adjusted dynamically depending on the needs of the connected streams.
Definition: def.h:948
@ PA_SOURCE_HW_MUTE_CTRL
Supports hardware mute control.
Definition: def.h:939
@ PA_SOURCE_NETWORK
Is a networked source of some kind.
Definition: def.h:936
@ PA_SOURCE_HARDWARE
Is a hardware source of some kind, in contrast to "virtual"/software source.
Definition: def.h:932
@ PA_SOURCE_LATENCY
Supports latency querying.
Definition: def.h:929
@ PA_SOURCE_NOFLAGS
Flag to pass when no specific options are needed (used to avoid casting)
Definition: def.h:922
@ PA_SOURCE_HW_VOLUME_CTRL
Supports hardware volume control.
Definition: def.h:925
@ PA_SOURCE_FLAT_VOLUME
This source is in flat volume mode, i.e. always the maximum of the volume of all connected outputs.
Definition: def.h:952
@ PA_SOURCE_DECIBEL_VOLUME
Volume can be translated to dB with pa_sw_volume_to_dB().
Definition: def.h:943
enum pa_stream_flags pa_stream_flags_t
Some special flags for stream connections.
pa_direction
Direction bitfield - while we currently do not expose anything bidirectional, one should test against...
Definition: def.h:136
@ PA_DIRECTION_OUTPUT
Output direction.
Definition: def.h:137
@ PA_DIRECTION_INPUT
Input direction.
Definition: def.h:138
pa_stream_flags
Some special flags for stream connections.
Definition: def.h:173
@ PA_STREAM_FIX_CHANNELS
Use the number of channels and the channel map of the sink, and possibly ignore the number of channel...
Definition: def.h:261
@ PA_STREAM_START_CORKED
Create the stream corked, requiring an explicit pa_stream_cork() call to uncork it.
Definition: def.h:178
@ PA_STREAM_DONT_INHIBIT_AUTO_SUSPEND
If set this stream won't be taken into account when it is checked whether the device this stream is c...
Definition: def.h:328
@ PA_STREAM_DONT_MOVE
Don't allow moving of this stream to another sink/device.
Definition: def.h:280
@ PA_STREAM_NO_REMIX_CHANNELS
When remapping channels by name, don't upmix or downmix them to related channels.
Definition: def.h:219
@ PA_STREAM_INTERPOLATE_TIMING
Interpolate the latency for this stream.
Definition: def.h:182
@ PA_STREAM_START_UNMUTED
Create in unmuted state.
Definition: def.h:333
@ PA_STREAM_NOT_MONOTONIC
Don't force the time to increase monotonically.
Definition: def.h:194
@ PA_STREAM_FIX_FORMAT
Use the sample format of the sink/device this stream is being connected to, and possibly ignore the f...
Definition: def.h:225
@ PA_STREAM_NOFLAGS
Flag to pass when no specific options are needed (used to avoid casting)
Definition: def.h:175
@ PA_STREAM_EARLY_REQUESTS
Enable compatibility mode for legacy clients that rely on a "classic" hardware device fragment-style ...
Definition: def.h:311
@ PA_STREAM_RELATIVE_VOLUME
If a volume is passed when this stream is created, consider it relative to the sink's current volume,...
Definition: def.h:345
@ PA_STREAM_AUTO_TIMING_UPDATE
If set timing update requests are issued periodically automatically.
Definition: def.h:206
@ PA_STREAM_NO_REMAP_CHANNELS
Don't remap channels by their name, instead map them simply by their index.
Definition: def.h:213
@ PA_STREAM_ADJUST_LATENCY
Try to adjust the latency of the sink/source based on the requested buffer metrics and adjust buffer ...
Definition: def.h:304
@ PA_STREAM_FAIL_ON_SUSPEND
If the sink/source this stream is connected to is suspended during the creation of this stream,...
Definition: def.h:339
@ PA_STREAM_FIX_RATE
Use the sample rate of the sink, and possibly ignore the rate the sample spec contains.
Definition: def.h:246
@ PA_STREAM_VARIABLE_RATE
Allow dynamic changing of the sampling rate during playback with pa_stream_update_sample_rate().
Definition: def.h:289
@ PA_STREAM_PASSTHROUGH
Used to tag content that will be rendered by passthrough sinks.
Definition: def.h:352
@ PA_STREAM_PEAK_DETECT
Find peaks instead of resampling.
Definition: def.h:295
@ PA_STREAM_START_MUTED
Create in muted state.
Definition: def.h:298
pa_device_port_type
Port type.
Definition: def.h:1076
@ PA_DEVICE_PORT_TYPE_LINE
Definition: def.h:1081
@ PA_DEVICE_PORT_TYPE_NETWORK
Definition: def.h:1098
@ PA_DEVICE_PORT_TYPE_BLUETOOTH
Definition: def.h:1092
@ PA_DEVICE_PORT_TYPE_HANDSFREE
Definition: def.h:1094
@ PA_DEVICE_PORT_TYPE_HIFI
Definition: def.h:1096
@ PA_DEVICE_PORT_TYPE_VIDEO
Definition: def.h:1090
@ PA_DEVICE_PORT_TYPE_TV
Definition: def.h:1088
@ PA_DEVICE_PORT_TYPE_ANALOG
Definition: def.h:1099
@ PA_DEVICE_PORT_TYPE_HEADPHONES
Definition: def.h:1080
@ PA_DEVICE_PORT_TYPE_AUX
Definition: def.h:1078
@ PA_DEVICE_PORT_TYPE_HDMI
Definition: def.h:1087
@ PA_DEVICE_PORT_TYPE_EARPIECE
Definition: def.h:1085
@ PA_DEVICE_PORT_TYPE_PORTABLE
Definition: def.h:1093
@ PA_DEVICE_PORT_TYPE_CAR
Definition: def.h:1095
@ PA_DEVICE_PORT_TYPE_UNKNOWN
Definition: def.h:1077
@ PA_DEVICE_PORT_TYPE_MIC
Definition: def.h:1082
@ PA_DEVICE_PORT_TYPE_HEADSET
Definition: def.h:1083
@ PA_DEVICE_PORT_TYPE_PHONE
Definition: def.h:1097
@ PA_DEVICE_PORT_TYPE_SPEAKER
Definition: def.h:1079
@ PA_DEVICE_PORT_TYPE_SPDIF
Definition: def.h:1086
@ PA_DEVICE_PORT_TYPE_HANDSET
Definition: def.h:1084
@ PA_DEVICE_PORT_TYPE_RADIO
Definition: def.h:1089
@ PA_DEVICE_PORT_TYPE_USB
Definition: def.h:1091
pa_subscription_event_type
Subscription event types, as used by pa_context_subscribe()
Definition: def.h:573
@ PA_SUBSCRIPTION_EVENT_SOURCE_OUTPUT
Event type: Source output.
Definition: def.h:583
@ PA_SUBSCRIPTION_EVENT_CLIENT
Event type: Client.
Definition: def.h:589
@ PA_SUBSCRIPTION_EVENT_CARD
Event type: Card.
Definition: def.h:603
@ PA_SUBSCRIPTION_EVENT_CHANGE
A property of the object was modified.
Definition: def.h:612
@ PA_SUBSCRIPTION_EVENT_FACILITY_MASK
A mask to extract the event type from an event value.
Definition: def.h:606
@ PA_SUBSCRIPTION_EVENT_SINK
Event type: Sink.
Definition: def.h:574
@ PA_SUBSCRIPTION_EVENT_TYPE_MASK
A mask to extract the event operation from an event value.
Definition: def.h:618
@ PA_SUBSCRIPTION_EVENT_SINK_INPUT
Event type: Sink input.
Definition: def.h:580
@ PA_SUBSCRIPTION_EVENT_SOURCE
Event type: Source.
Definition: def.h:577
@ PA_SUBSCRIPTION_EVENT_SAMPLE_CACHE
Event type: Sample cache item.
Definition: def.h:592
@ PA_SUBSCRIPTION_EVENT_MODULE
Event type: Module.
Definition: def.h:586
@ PA_SUBSCRIPTION_EVENT_SERVER
Event type: Global server change, only occurring with PA_SUBSCRIPTION_EVENT_CHANGE.
Definition: def.h:595
@ PA_SUBSCRIPTION_EVENT_REMOVE
An object was removed.
Definition: def.h:615
@ PA_SUBSCRIPTION_EVENT_NEW
A new object was created.
Definition: def.h:609
pa_stream_state
The state of a stream.
Definition: def.h:68
@ PA_STREAM_FAILED
An error occurred that made the stream invalid.
Definition: def.h:72
@ PA_STREAM_READY
The stream is established, you may pass audio data to it now.
Definition: def.h:71
@ PA_STREAM_CREATING
The stream is being created.
Definition: def.h:70
@ PA_STREAM_UNCONNECTED
The stream is not yet connected to any sink or source.
Definition: def.h:69
@ PA_STREAM_TERMINATED
The stream has been terminated cleanly.
Definition: def.h:73
enum pa_context_flags pa_context_flags_t
Some special flags for contexts.
pa_port_available
Port availability / jack detection status.
Definition: def.h:1059
@ PA_PORT_AVAILABLE_UNKNOWN
This port does not support jack detection.
Definition: def.h:1060
@ PA_PORT_AVAILABLE_NO
This port is not available, likely because the jack is not plugged in.
Definition: def.h:1061
@ PA_PORT_AVAILABLE_YES
This port is available, likely because the jack is plugged in.
Definition: def.h:1062
pa_stream_direction
The direction of a pa_stream object.
Definition: def.h:158
@ PA_STREAM_RECORD
Record stream.
Definition: def.h:161
@ PA_STREAM_NODIRECTION
Invalid direction.
Definition: def.h:159
@ PA_STREAM_UPLOAD
Sample upload stream.
Definition: def.h:162
@ PA_STREAM_PLAYBACK
Playback stream.
Definition: def.h:160
pa_error_code
Error values as used by pa_context_errno().
Definition: def.h:471
@ PA_ERR_BADSTATE
Bad state.
Definition: def.h:487
@ PA_ERR_NOTSUPPORTED
Operation not supported.
Definition: def.h:491
@ PA_ERR_VERSION
Incompatible protocol version.
Definition: def.h:489
@ PA_ERR_INVALID
Invalid argument.
Definition: def.h:475
@ PA_ERR_CONNECTIONREFUSED
Connection refused.
Definition: def.h:478
@ PA_ERR_KILLED
Entity killed.
Definition: def.h:484
@ PA_ERR_PROTOCOL
Protocol error.
Definition: def.h:479
@ PA_ERR_TIMEOUT
Timeout.
Definition: def.h:480
@ PA_ERR_TOOLARGE
Data too large.
Definition: def.h:490
@ PA_ERR_MAX
Not really an error but the first invalid error code.
Definition: def.h:499
@ PA_ERR_UNKNOWN
The error code was unknown to the client.
Definition: def.h:492
@ PA_ERR_FORKED
The caller forked without calling execve() and tried to reuse the context.
Definition: def.h:496
@ PA_ERR_NODATA
No data.
Definition: def.h:488
@ PA_ERR_NOTIMPLEMENTED
Missing implementation.
Definition: def.h:495
@ PA_ERR_MODINITFAILED
Module initialization failed.
Definition: def.h:486
@ PA_ERR_BUSY
Device or resource busy.
Definition: def.h:498
@ PA_ERR_INVALIDSERVER
Invalid server.
Definition: def.h:485
@ PA_ERR_CONNECTIONTERMINATED
Connection terminated.
Definition: def.h:483
@ PA_ERR_EXIST
Entity exists.
Definition: def.h:476
@ PA_ERR_ACCESS
Access failure.
Definition: def.h:473
@ PA_ERR_OBSOLETE
Obsolete functionality.
Definition: def.h:494
@ PA_ERR_NOENTITY
No such entity.
Definition: def.h:477
@ PA_ERR_AUTHKEY
No authentication key.
Definition: def.h:481
@ PA_ERR_NOEXTENSION
Extension does not exist.
Definition: def.h:493
@ PA_ERR_IO
An IO error happened.
Definition: def.h:497
@ PA_OK
No error.
Definition: def.h:472
@ PA_ERR_COMMAND
Unknown command.
Definition: def.h:474
@ PA_ERR_INTERNAL
Internal error.
Definition: def.h:482
enum pa_stream_state pa_stream_state_t
The state of a stream.
enum pa_source_state pa_source_state_t
Source state.
pa_context_state
The state of a connection context.
Definition: def.h:37
@ PA_CONTEXT_FAILED
The connection failed or was disconnected.
Definition: def.h:43
@ PA_CONTEXT_SETTING_NAME
The client is passing its application name to the daemon.
Definition: def.h:41
@ PA_CONTEXT_UNCONNECTED
The context hasn't been connected yet.
Definition: def.h:38
@ PA_CONTEXT_READY
The connection is established, the context is ready to execute operations.
Definition: def.h:42
@ PA_CONTEXT_TERMINATED
The connection was terminated cleanly.
Definition: def.h:44
@ PA_CONTEXT_CONNECTING
A connection is being established.
Definition: def.h:39
@ PA_CONTEXT_AUTHORIZING
The client is authorizing itself to the daemon.
Definition: def.h:40
enum pa_direction pa_direction_t
Direction bitfield - while we currently do not expose anything bidirectional, one should test against...
enum pa_source_flags pa_source_flags_t
Special source flags.
enum pa_subscription_mask pa_subscription_mask_t
Subscription event mask, as used by pa_context_subscribe()
enum pa_sink_state pa_sink_state_t
Sink state.
enum pa_stream_direction pa_stream_direction_t
The direction of a pa_stream object.
enum pa_operation_state pa_operation_state_t
The state of an operation.
pa_source_state
Source state.
Definition: def.h:987
@ PA_SOURCE_INVALID_STATE
This state is used when the server does not support source state introspection.
Definition: def.h:988
@ PA_SOURCE_RUNNING
Running, source is recording and used by at least one non-corked source-output.
Definition: def.h:991
@ PA_SOURCE_IDLE
When idle, the source is still recording but there is no non-corked source-output.
Definition: def.h:994
@ PA_SOURCE_SUSPENDED
When suspended, actual source access can be closed, for instance.
Definition: def.h:997
pa_context_flags
Some special flags for contexts.
Definition: def.h:115
@ PA_CONTEXT_NOAUTOSPAWN
Disabled autospawning of the PulseAudio daemon if required.
Definition: def.h:118
@ PA_CONTEXT_NOFLAGS
Flag to pass when no specific options are needed (used to avoid casting)
Definition: def.h:116
@ PA_CONTEXT_NOFAIL
Don't fail if the daemon is not available when pa_context_connect() is called, instead enter PA_CONTE...
Definition: def.h:120
pa_operation_state
The state of an operation.
Definition: def.h:93
@ PA_OPERATION_CANCELLED
The operation has been cancelled.
Definition: def.h:98
@ PA_OPERATION_DONE
The operation has completed.
Definition: def.h:96
@ PA_OPERATION_RUNNING
The operation is still running.
Definition: def.h:94
pa_device_type
The type of device we are dealing with.
Definition: def.h:147
@ PA_DEVICE_TYPE_SOURCE
Recording device.
Definition: def.h:149
@ PA_DEVICE_TYPE_SINK
Playback device.
Definition: def.h:148
pa_subscription_mask
Subscription event mask, as used by pa_context_subscribe()
Definition: def.h:532
@ PA_SUBSCRIPTION_MASK_NULL
No events.
Definition: def.h:533
@ PA_SUBSCRIPTION_MASK_MODULE
Module events.
Definition: def.h:548
@ PA_SUBSCRIPTION_MASK_SOURCE_OUTPUT
Source output events.
Definition: def.h:545
@ PA_SUBSCRIPTION_MASK_CARD
Card events.
Definition: def.h:565
@ PA_SUBSCRIPTION_MASK_SERVER
Other global server changes.
Definition: def.h:557
@ PA_SUBSCRIPTION_MASK_SINK_INPUT
Sink input events.
Definition: def.h:542
@ PA_SUBSCRIPTION_MASK_CLIENT
Client events.
Definition: def.h:551
@ PA_SUBSCRIPTION_MASK_ALL
Catch all events.
Definition: def.h:568
@ PA_SUBSCRIPTION_MASK_SAMPLE_CACHE
Sample cache events.
Definition: def.h:554
@ PA_SUBSCRIPTION_MASK_SOURCE
Source events.
Definition: def.h:539
@ PA_SUBSCRIPTION_MASK_SINK
Sink events.
Definition: def.h:536
enum pa_context_state pa_context_state_t
The state of a connection context.
enum pa_device_port_type pa_device_port_type_t
Port type.
pa_sink_state
Sink state.
Definition: def.h:871
@ PA_SINK_SUSPENDED
When suspended, actual sink access can be closed, for instance.
Definition: def.h:881
@ PA_SINK_RUNNING
Running, sink is playing and used by at least one non-corked sink-input.
Definition: def.h:875
@ PA_SINK_IDLE
When idle, the sink is playing but there is no non-corked sink-input attached to it.
Definition: def.h:878
@ PA_SINK_INVALID_STATE
This state is used when the server does not support sink state introspection.
Definition: def.h:872
pa_seek_mode
Seek type for pa_stream_write().
Definition: def.h:775
@ PA_SEEK_ABSOLUTE
Seek relative to the start of the buffer queue.
Definition: def.h:779
@ PA_SEEK_RELATIVE_ON_READ
Seek relative to the read index.
Definition: def.h:782
@ PA_SEEK_RELATIVE
Seek relative to the write index.
Definition: def.h:776
@ PA_SEEK_RELATIVE_END
Seek relative to the current end of the buffer queue.
Definition: def.h:785
enum pa_seek_mode pa_seek_mode_t
Seek type for pa_stream_write().
enum pa_port_available pa_port_available_t
Port availability / jack detection status.
Constants and routines for sample type handling.
uint64_t pa_usec_t
Type for usec specifications (unsigned).
Definition: sample.h:264
Playback and record buffer metrics.
Definition: def.h:389
uint32_t fragsize
Recording only: fragment size.
Definition: def.h:453
uint32_t minreq
Playback only: minimum request.
Definition: def.h:443
uint32_t tlength
Playback only: target length of the buffer.
Definition: def.h:401
uint32_t maxlength
Maximum length of the buffer in bytes.
Definition: def.h:390
uint32_t prebuf
Playback only: pre-buffering.
Definition: def.h:424
A structure for the spawn api.
Definition: def.h:757
void(* atfork)(void)
Is called immediately after the fork in the child process.
Definition: def.h:766
void(* prefork)(void)
Is called just before the fork in the parent process.
Definition: def.h:758
void(* postfork)(void)
Is called immediately after the fork in the parent process.
Definition: def.h:762
A structure for all kinds of timing information of a stream.
Definition: def.h:680
struct timeval timestamp
The system clock time when this timing info structure was current.
Definition: def.h:681
pa_usec_t sink_usec
Time in usecs a sample takes to be played on the sink.
Definition: def.h:692
int write_index_corrupt
Non-zero if write_index is not up-to-date because a local write command that corrupted it has been is...
Definition: def.h:712
int64_t write_index
Current write index into the playback buffer in bytes.
Definition: def.h:719
int64_t read_index
Current read index into the playback buffer in bytes.
Definition: def.h:730
int playing
Non-zero when the stream is currently not underrun and data is being passed on to the device.
Definition: def.h:705
pa_usec_t configured_sink_usec
The configured latency for the sink.
Definition: def.h:736
int synchronized_clocks
Non-zero if the local and the remote machine have synchronized clocks.
Definition: def.h:685
int read_index_corrupt
Non-zero if read_index is not up-to-date because a local pause or flush request that corrupted it has...
Definition: def.h:725
pa_usec_t transport_usec
Estimated time in usecs a sample takes to be transferred to/from the daemon.
Definition: def.h:701
int64_t since_underrun
Bytes that were handed to the sink since the last underrun happened, or since playback started again ...
Definition: def.h:742
pa_usec_t source_usec
Time in usecs a sample takes from being recorded to being delivered to the application.
Definition: def.h:697
pa_usec_t configured_source_usec
The configured latency for the source.
Definition: def.h:739