153a5a1b3Sopenharmony_ci#ifndef foodefhfoo 253a5a1b3Sopenharmony_ci#define foodefhfoo 353a5a1b3Sopenharmony_ci 453a5a1b3Sopenharmony_ci/*** 553a5a1b3Sopenharmony_ci This file is part of PulseAudio. 653a5a1b3Sopenharmony_ci 753a5a1b3Sopenharmony_ci Copyright 2004-2006 Lennart Poettering 853a5a1b3Sopenharmony_ci Copyright 2006 Pierre Ossman <ossman@cendio.se> for Cendio AB 953a5a1b3Sopenharmony_ci 1053a5a1b3Sopenharmony_ci PulseAudio is free software; you can redistribute it and/or modify 1153a5a1b3Sopenharmony_ci it under the terms of the GNU Lesser General Public License as 1253a5a1b3Sopenharmony_ci published by the Free Software Foundation; either version 2.1 of the 1353a5a1b3Sopenharmony_ci License, or (at your option) any later version. 1453a5a1b3Sopenharmony_ci 1553a5a1b3Sopenharmony_ci PulseAudio is distributed in the hope that it will be useful, but 1653a5a1b3Sopenharmony_ci WITHOUT ANY WARRANTY; without even the implied warranty of 1753a5a1b3Sopenharmony_ci MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 1853a5a1b3Sopenharmony_ci Lesser General Public License for more details. 1953a5a1b3Sopenharmony_ci 2053a5a1b3Sopenharmony_ci You should have received a copy of the GNU Lesser General Public 2153a5a1b3Sopenharmony_ci License along with PulseAudio; if not, see <http://www.gnu.org/licenses/>. 2253a5a1b3Sopenharmony_ci***/ 2353a5a1b3Sopenharmony_ci 2453a5a1b3Sopenharmony_ci#include <inttypes.h> 2553a5a1b3Sopenharmony_ci#include <sys/time.h> 2653a5a1b3Sopenharmony_ci 2753a5a1b3Sopenharmony_ci#include <pulse/cdecl.h> 2853a5a1b3Sopenharmony_ci#include <pulse/sample.h> 2953a5a1b3Sopenharmony_ci#include <pulse/version.h> 3053a5a1b3Sopenharmony_ci 3153a5a1b3Sopenharmony_ci/** \file 3253a5a1b3Sopenharmony_ci * Global definitions */ 3353a5a1b3Sopenharmony_ci 3453a5a1b3Sopenharmony_ciPA_C_DECL_BEGIN 3553a5a1b3Sopenharmony_ci 3653a5a1b3Sopenharmony_ci/** The state of a connection context */ 3753a5a1b3Sopenharmony_citypedef enum pa_context_state { 3853a5a1b3Sopenharmony_ci PA_CONTEXT_UNCONNECTED, /**< The context hasn't been connected yet */ 3953a5a1b3Sopenharmony_ci PA_CONTEXT_CONNECTING, /**< A connection is being established */ 4053a5a1b3Sopenharmony_ci PA_CONTEXT_AUTHORIZING, /**< The client is authorizing itself to the daemon */ 4153a5a1b3Sopenharmony_ci PA_CONTEXT_SETTING_NAME, /**< The client is passing its application name to the daemon */ 4253a5a1b3Sopenharmony_ci PA_CONTEXT_READY, /**< The connection is established, the context is ready to execute operations */ 4353a5a1b3Sopenharmony_ci PA_CONTEXT_FAILED, /**< The connection failed or was disconnected */ 4453a5a1b3Sopenharmony_ci PA_CONTEXT_TERMINATED /**< The connection was terminated cleanly */ 4553a5a1b3Sopenharmony_ci} pa_context_state_t; 4653a5a1b3Sopenharmony_ci 4753a5a1b3Sopenharmony_ci/** Return non-zero if the passed state is one of the connected states. \since 0.9.11 */ 4853a5a1b3Sopenharmony_cistatic inline int PA_CONTEXT_IS_GOOD(pa_context_state_t x) { 4953a5a1b3Sopenharmony_ci return 5053a5a1b3Sopenharmony_ci x == PA_CONTEXT_CONNECTING || 5153a5a1b3Sopenharmony_ci x == PA_CONTEXT_AUTHORIZING || 5253a5a1b3Sopenharmony_ci x == PA_CONTEXT_SETTING_NAME || 5353a5a1b3Sopenharmony_ci x == PA_CONTEXT_READY; 5453a5a1b3Sopenharmony_ci} 5553a5a1b3Sopenharmony_ci 5653a5a1b3Sopenharmony_ci/** \cond fulldocs */ 5753a5a1b3Sopenharmony_ci#define PA_CONTEXT_UNCONNECTED PA_CONTEXT_UNCONNECTED 5853a5a1b3Sopenharmony_ci#define PA_CONTEXT_CONNECTING PA_CONTEXT_CONNECTING 5953a5a1b3Sopenharmony_ci#define PA_CONTEXT_AUTHORIZING PA_CONTEXT_AUTHORIZING 6053a5a1b3Sopenharmony_ci#define PA_CONTEXT_SETTING_NAME PA_CONTEXT_SETTING_NAME 6153a5a1b3Sopenharmony_ci#define PA_CONTEXT_READY PA_CONTEXT_READY 6253a5a1b3Sopenharmony_ci#define PA_CONTEXT_FAILED PA_CONTEXT_FAILED 6353a5a1b3Sopenharmony_ci#define PA_CONTEXT_TERMINATED PA_CONTEXT_TERMINATED 6453a5a1b3Sopenharmony_ci#define PA_CONTEXT_IS_GOOD PA_CONTEXT_IS_GOOD 6553a5a1b3Sopenharmony_ci/** \endcond */ 6653a5a1b3Sopenharmony_ci 6753a5a1b3Sopenharmony_ci/** The state of a stream */ 6853a5a1b3Sopenharmony_citypedef enum pa_stream_state { 6953a5a1b3Sopenharmony_ci PA_STREAM_UNCONNECTED, /**< The stream is not yet connected to any sink or source */ 7053a5a1b3Sopenharmony_ci PA_STREAM_CREATING, /**< The stream is being created */ 7153a5a1b3Sopenharmony_ci PA_STREAM_READY, /**< The stream is established, you may pass audio data to it now */ 7253a5a1b3Sopenharmony_ci PA_STREAM_FAILED, /**< An error occurred that made the stream invalid */ 7353a5a1b3Sopenharmony_ci PA_STREAM_TERMINATED /**< The stream has been terminated cleanly */ 7453a5a1b3Sopenharmony_ci} pa_stream_state_t; 7553a5a1b3Sopenharmony_ci 7653a5a1b3Sopenharmony_ci/** Return non-zero if the passed state is one of the connected states. \since 0.9.11 */ 7753a5a1b3Sopenharmony_cistatic inline int PA_STREAM_IS_GOOD(pa_stream_state_t x) { 7853a5a1b3Sopenharmony_ci return 7953a5a1b3Sopenharmony_ci x == PA_STREAM_CREATING || 8053a5a1b3Sopenharmony_ci x == PA_STREAM_READY; 8153a5a1b3Sopenharmony_ci} 8253a5a1b3Sopenharmony_ci 8353a5a1b3Sopenharmony_ci/** \cond fulldocs */ 8453a5a1b3Sopenharmony_ci#define PA_STREAM_UNCONNECTED PA_STREAM_UNCONNECTED 8553a5a1b3Sopenharmony_ci#define PA_STREAM_CREATING PA_STREAM_CREATING 8653a5a1b3Sopenharmony_ci#define PA_STREAM_READY PA_STREAM_READY 8753a5a1b3Sopenharmony_ci#define PA_STREAM_FAILED PA_STREAM_FAILED 8853a5a1b3Sopenharmony_ci#define PA_STREAM_TERMINATED PA_STREAM_TERMINATED 8953a5a1b3Sopenharmony_ci#define PA_STREAM_IS_GOOD PA_STREAM_IS_GOOD 9053a5a1b3Sopenharmony_ci/** \endcond */ 9153a5a1b3Sopenharmony_ci 9253a5a1b3Sopenharmony_ci/** The state of an operation */ 9353a5a1b3Sopenharmony_citypedef enum pa_operation_state { 9453a5a1b3Sopenharmony_ci PA_OPERATION_RUNNING, 9553a5a1b3Sopenharmony_ci /**< The operation is still running */ 9653a5a1b3Sopenharmony_ci PA_OPERATION_DONE, 9753a5a1b3Sopenharmony_ci /**< The operation has completed */ 9853a5a1b3Sopenharmony_ci PA_OPERATION_CANCELLED 9953a5a1b3Sopenharmony_ci /**< The operation has been cancelled. Operations may get cancelled by the 10053a5a1b3Sopenharmony_ci * application, or as a result of the context getting disconnected while the 10153a5a1b3Sopenharmony_ci * operation is pending. */ 10253a5a1b3Sopenharmony_ci} pa_operation_state_t; 10353a5a1b3Sopenharmony_ci 10453a5a1b3Sopenharmony_ci/** \cond fulldocs */ 10553a5a1b3Sopenharmony_ci#define PA_OPERATION_RUNNING PA_OPERATION_RUNNING 10653a5a1b3Sopenharmony_ci#define PA_OPERATION_DONE PA_OPERATION_DONE 10753a5a1b3Sopenharmony_ci#define PA_OPERATION_CANCELED PA_OPERATION_CANCELLED 10853a5a1b3Sopenharmony_ci#define PA_OPERATION_CANCELLED PA_OPERATION_CANCELLED 10953a5a1b3Sopenharmony_ci/** \endcond */ 11053a5a1b3Sopenharmony_ci 11153a5a1b3Sopenharmony_ci/** An invalid index */ 11253a5a1b3Sopenharmony_ci#define PA_INVALID_INDEX ((uint32_t) -1) 11353a5a1b3Sopenharmony_ci 11453a5a1b3Sopenharmony_ci/** Some special flags for contexts. */ 11553a5a1b3Sopenharmony_citypedef enum pa_context_flags { 11653a5a1b3Sopenharmony_ci PA_CONTEXT_NOFLAGS = 0x0000U, 11753a5a1b3Sopenharmony_ci /**< Flag to pass when no specific options are needed (used to avoid casting) \since 0.9.19 */ 11853a5a1b3Sopenharmony_ci PA_CONTEXT_NOAUTOSPAWN = 0x0001U, 11953a5a1b3Sopenharmony_ci /**< Disabled autospawning of the PulseAudio daemon if required */ 12053a5a1b3Sopenharmony_ci PA_CONTEXT_NOFAIL = 0x0002U 12153a5a1b3Sopenharmony_ci /**< Don't fail if the daemon is not available when pa_context_connect() is 12253a5a1b3Sopenharmony_ci * called, instead enter PA_CONTEXT_CONNECTING state and wait for the daemon 12353a5a1b3Sopenharmony_ci * to appear. \since 0.9.15 */ 12453a5a1b3Sopenharmony_ci} pa_context_flags_t; 12553a5a1b3Sopenharmony_ci 12653a5a1b3Sopenharmony_ci/** \cond fulldocs */ 12753a5a1b3Sopenharmony_ci/* Allow clients to check with #ifdef for those flags */ 12853a5a1b3Sopenharmony_ci#define PA_CONTEXT_NOAUTOSPAWN PA_CONTEXT_NOAUTOSPAWN 12953a5a1b3Sopenharmony_ci#define PA_CONTEXT_NOFAIL PA_CONTEXT_NOFAIL 13053a5a1b3Sopenharmony_ci/** \endcond */ 13153a5a1b3Sopenharmony_ci 13253a5a1b3Sopenharmony_ci/** Direction bitfield - while we currently do not expose anything bidirectional, 13353a5a1b3Sopenharmony_ci one should test against the bit instead of the value (e.g.\ if (d & PA_DIRECTION_OUTPUT)), 13453a5a1b3Sopenharmony_ci because we might add bidirectional stuff in the future. \since 2.0 13553a5a1b3Sopenharmony_ci*/ 13653a5a1b3Sopenharmony_citypedef enum pa_direction { 13753a5a1b3Sopenharmony_ci PA_DIRECTION_OUTPUT = 0x0001U, /**< Output direction */ 13853a5a1b3Sopenharmony_ci PA_DIRECTION_INPUT = 0x0002U /**< Input direction */ 13953a5a1b3Sopenharmony_ci} pa_direction_t; 14053a5a1b3Sopenharmony_ci 14153a5a1b3Sopenharmony_ci/** \cond fulldocs */ 14253a5a1b3Sopenharmony_ci#define PA_DIRECTION_OUTPUT PA_DIRECTION_OUTPUT 14353a5a1b3Sopenharmony_ci#define PA_DIRECTION_INPUT PA_DIRECTION_INPUT 14453a5a1b3Sopenharmony_ci/** \endcond */ 14553a5a1b3Sopenharmony_ci 14653a5a1b3Sopenharmony_ci/** The type of device we are dealing with */ 14753a5a1b3Sopenharmony_citypedef enum pa_device_type { 14853a5a1b3Sopenharmony_ci PA_DEVICE_TYPE_SINK, /**< Playback device */ 14953a5a1b3Sopenharmony_ci PA_DEVICE_TYPE_SOURCE /**< Recording device */ 15053a5a1b3Sopenharmony_ci} pa_device_type_t; 15153a5a1b3Sopenharmony_ci 15253a5a1b3Sopenharmony_ci/** \cond fulldocs */ 15353a5a1b3Sopenharmony_ci#define PA_DEVICE_TYPE_SINK PA_DEVICE_TYPE_SINK 15453a5a1b3Sopenharmony_ci#define PA_DEVICE_TYPE_SOURCE PA_DEVICE_TYPE_SOURCE 15553a5a1b3Sopenharmony_ci/** \endcond */ 15653a5a1b3Sopenharmony_ci 15753a5a1b3Sopenharmony_ci/** The direction of a pa_stream object */ 15853a5a1b3Sopenharmony_citypedef enum pa_stream_direction { 15953a5a1b3Sopenharmony_ci PA_STREAM_NODIRECTION, /**< Invalid direction */ 16053a5a1b3Sopenharmony_ci PA_STREAM_PLAYBACK, /**< Playback stream */ 16153a5a1b3Sopenharmony_ci PA_STREAM_RECORD, /**< Record stream */ 16253a5a1b3Sopenharmony_ci PA_STREAM_UPLOAD /**< Sample upload stream */ 16353a5a1b3Sopenharmony_ci} pa_stream_direction_t; 16453a5a1b3Sopenharmony_ci 16553a5a1b3Sopenharmony_ci/** \cond fulldocs */ 16653a5a1b3Sopenharmony_ci#define PA_STREAM_NODIRECTION PA_STREAM_NODIRECTION 16753a5a1b3Sopenharmony_ci#define PA_STREAM_PLAYBACK PA_STREAM_PLAYBACK 16853a5a1b3Sopenharmony_ci#define PA_STREAM_RECORD PA_STREAM_RECORD 16953a5a1b3Sopenharmony_ci#define PA_STREAM_UPLOAD PA_STREAM_UPLOAD 17053a5a1b3Sopenharmony_ci/** \endcond */ 17153a5a1b3Sopenharmony_ci 17253a5a1b3Sopenharmony_ci/** Some special flags for stream connections. */ 17353a5a1b3Sopenharmony_citypedef enum pa_stream_flags { 17453a5a1b3Sopenharmony_ci 17553a5a1b3Sopenharmony_ci PA_STREAM_NOFLAGS = 0x0000U, 17653a5a1b3Sopenharmony_ci /**< Flag to pass when no specific options are needed (used to avoid casting) \since 0.9.19 */ 17753a5a1b3Sopenharmony_ci 17853a5a1b3Sopenharmony_ci PA_STREAM_START_CORKED = 0x0001U, 17953a5a1b3Sopenharmony_ci /**< Create the stream corked, requiring an explicit 18053a5a1b3Sopenharmony_ci * pa_stream_cork() call to uncork it. */ 18153a5a1b3Sopenharmony_ci 18253a5a1b3Sopenharmony_ci PA_STREAM_INTERPOLATE_TIMING = 0x0002U, 18353a5a1b3Sopenharmony_ci /**< Interpolate the latency for this stream. When enabled, 18453a5a1b3Sopenharmony_ci * pa_stream_get_latency() and pa_stream_get_time() will try to 18553a5a1b3Sopenharmony_ci * estimate the current record/playback time based on the local 18653a5a1b3Sopenharmony_ci * time that passed since the last timing info update. Using this 18753a5a1b3Sopenharmony_ci * option has the advantage of not requiring a whole roundtrip 18853a5a1b3Sopenharmony_ci * when the current playback/recording time is needed. Consider 18953a5a1b3Sopenharmony_ci * using this option when requesting latency information 19053a5a1b3Sopenharmony_ci * frequently. This is especially useful on long latency network 19153a5a1b3Sopenharmony_ci * connections. It makes a lot of sense to combine this option 19253a5a1b3Sopenharmony_ci * with PA_STREAM_AUTO_TIMING_UPDATE. */ 19353a5a1b3Sopenharmony_ci 19453a5a1b3Sopenharmony_ci PA_STREAM_NOT_MONOTONIC = 0x0004U, 19553a5a1b3Sopenharmony_ci /**< Don't force the time to increase monotonically. If this 19653a5a1b3Sopenharmony_ci * option is enabled, pa_stream_get_time() will not necessarily 19753a5a1b3Sopenharmony_ci * return always monotonically increasing time values on each 19853a5a1b3Sopenharmony_ci * call. This may confuse applications which cannot deal with time 19953a5a1b3Sopenharmony_ci * going 'backwards', but has the advantage that bad transport 20053a5a1b3Sopenharmony_ci * latency estimations that caused the time to jump ahead can 20153a5a1b3Sopenharmony_ci * be corrected quickly, without the need to wait. (Please note 20253a5a1b3Sopenharmony_ci * that this flag was named PA_STREAM_NOT_MONOTONOUS in releases 20353a5a1b3Sopenharmony_ci * prior to 0.9.11. The old name is still defined too, for 20453a5a1b3Sopenharmony_ci * compatibility reasons. */ 20553a5a1b3Sopenharmony_ci 20653a5a1b3Sopenharmony_ci PA_STREAM_AUTO_TIMING_UPDATE = 0x0008U, 20753a5a1b3Sopenharmony_ci /**< If set timing update requests are issued periodically 20853a5a1b3Sopenharmony_ci * automatically. Combined with PA_STREAM_INTERPOLATE_TIMING you 20953a5a1b3Sopenharmony_ci * will be able to query the current time and latency with 21053a5a1b3Sopenharmony_ci * pa_stream_get_time() and pa_stream_get_latency() at all times 21153a5a1b3Sopenharmony_ci * without a packet round trip.*/ 21253a5a1b3Sopenharmony_ci 21353a5a1b3Sopenharmony_ci PA_STREAM_NO_REMAP_CHANNELS = 0x0010U, 21453a5a1b3Sopenharmony_ci /**< Don't remap channels by their name, instead map them simply 21553a5a1b3Sopenharmony_ci * by their index. Implies PA_STREAM_NO_REMIX_CHANNELS. Only 21653a5a1b3Sopenharmony_ci * supported when the server is at least PA 0.9.8. It is ignored 21753a5a1b3Sopenharmony_ci * on older servers.\since 0.9.8 */ 21853a5a1b3Sopenharmony_ci 21953a5a1b3Sopenharmony_ci PA_STREAM_NO_REMIX_CHANNELS = 0x0020U, 22053a5a1b3Sopenharmony_ci /**< When remapping channels by name, don't upmix or downmix them 22153a5a1b3Sopenharmony_ci * to related channels. Copy them into matching channels of the 22253a5a1b3Sopenharmony_ci * device 1:1. Only supported when the server is at least PA 22353a5a1b3Sopenharmony_ci * 0.9.8. It is ignored on older servers. \since 0.9.8 */ 22453a5a1b3Sopenharmony_ci 22553a5a1b3Sopenharmony_ci PA_STREAM_FIX_FORMAT = 0x0040U, 22653a5a1b3Sopenharmony_ci /**< Use the sample format of the sink/device this stream is being 22753a5a1b3Sopenharmony_ci * connected to, and possibly ignore the format the sample spec 22853a5a1b3Sopenharmony_ci * contains -- but you still have to pass a valid value in it as a 22953a5a1b3Sopenharmony_ci * hint to PulseAudio what would suit your stream best. If this is 23053a5a1b3Sopenharmony_ci * used you should query the used sample format after creating the 23153a5a1b3Sopenharmony_ci * stream by using pa_stream_get_sample_spec(). Also, if you 23253a5a1b3Sopenharmony_ci * specified manual buffer metrics it is recommended to update 23353a5a1b3Sopenharmony_ci * them with pa_stream_set_buffer_attr() to compensate for the 23453a5a1b3Sopenharmony_ci * changed frame sizes. Only supported when the server is at least 23553a5a1b3Sopenharmony_ci * PA 0.9.8. It is ignored on older servers. 23653a5a1b3Sopenharmony_ci * 23753a5a1b3Sopenharmony_ci * When creating streams with pa_stream_new_extended(), this flag has no 23853a5a1b3Sopenharmony_ci * effect. If you specify a format with PCM encoding, and you want the 23953a5a1b3Sopenharmony_ci * server to choose the sample format, then you should leave the sample 24053a5a1b3Sopenharmony_ci * format unspecified in the pa_format_info object. This also means that 24153a5a1b3Sopenharmony_ci * you can't use pa_format_info_from_sample_spec(), because that function 24253a5a1b3Sopenharmony_ci * always sets the sample format. 24353a5a1b3Sopenharmony_ci * 24453a5a1b3Sopenharmony_ci * \since 0.9.8 */ 24553a5a1b3Sopenharmony_ci 24653a5a1b3Sopenharmony_ci PA_STREAM_FIX_RATE = 0x0080U, 24753a5a1b3Sopenharmony_ci /**< Use the sample rate of the sink, and possibly ignore the rate 24853a5a1b3Sopenharmony_ci * the sample spec contains. Usage similar to 24953a5a1b3Sopenharmony_ci * PA_STREAM_FIX_FORMAT. Only supported when the server is at least 25053a5a1b3Sopenharmony_ci * PA 0.9.8. It is ignored on older servers. 25153a5a1b3Sopenharmony_ci * 25253a5a1b3Sopenharmony_ci * When creating streams with pa_stream_new_extended(), this flag has no 25353a5a1b3Sopenharmony_ci * effect. If you specify a format with PCM encoding, and you want the 25453a5a1b3Sopenharmony_ci * server to choose the sample rate, then you should leave the rate 25553a5a1b3Sopenharmony_ci * unspecified in the pa_format_info object. This also means that you can't 25653a5a1b3Sopenharmony_ci * use pa_format_info_from_sample_spec(), because that function always sets 25753a5a1b3Sopenharmony_ci * the sample rate. 25853a5a1b3Sopenharmony_ci * 25953a5a1b3Sopenharmony_ci * \since 0.9.8 */ 26053a5a1b3Sopenharmony_ci 26153a5a1b3Sopenharmony_ci PA_STREAM_FIX_CHANNELS = 0x0100, 26253a5a1b3Sopenharmony_ci /**< Use the number of channels and the channel map of the sink, 26353a5a1b3Sopenharmony_ci * and possibly ignore the number of channels and the map the 26453a5a1b3Sopenharmony_ci * sample spec and the passed channel map contain. Usage similar 26553a5a1b3Sopenharmony_ci * to PA_STREAM_FIX_FORMAT. Only supported when the server is at 26653a5a1b3Sopenharmony_ci * least PA 0.9.8. It is ignored on older servers. 26753a5a1b3Sopenharmony_ci * 26853a5a1b3Sopenharmony_ci * When creating streams with pa_stream_new_extended(), this flag has no 26953a5a1b3Sopenharmony_ci * effect. If you specify a format with PCM encoding, and you want the 27053a5a1b3Sopenharmony_ci * server to choose the channel count and/or channel map, then you should 27153a5a1b3Sopenharmony_ci * leave the channels and/or the channel map unspecified in the 27253a5a1b3Sopenharmony_ci * pa_format_info object. This also means that you can't use 27353a5a1b3Sopenharmony_ci * pa_format_info_from_sample_spec(), because that function always sets 27453a5a1b3Sopenharmony_ci * the channel count (but if you only want to leave the channel map 27553a5a1b3Sopenharmony_ci * unspecified, then pa_format_info_from_sample_spec() works, because it 27653a5a1b3Sopenharmony_ci * accepts a NULL channel map). 27753a5a1b3Sopenharmony_ci * 27853a5a1b3Sopenharmony_ci * \since 0.9.8 */ 27953a5a1b3Sopenharmony_ci 28053a5a1b3Sopenharmony_ci PA_STREAM_DONT_MOVE = 0x0200U, 28153a5a1b3Sopenharmony_ci /**< Don't allow moving of this stream to another 28253a5a1b3Sopenharmony_ci * sink/device. Useful if you use any of the PA_STREAM_FIX_ flags 28353a5a1b3Sopenharmony_ci * and want to make sure that resampling never takes place -- 28453a5a1b3Sopenharmony_ci * which might happen if the stream is moved to another 28553a5a1b3Sopenharmony_ci * sink/source with a different sample spec/channel map. Only 28653a5a1b3Sopenharmony_ci * supported when the server is at least PA 0.9.8. It is ignored 28753a5a1b3Sopenharmony_ci * on older servers. \since 0.9.8 */ 28853a5a1b3Sopenharmony_ci 28953a5a1b3Sopenharmony_ci PA_STREAM_VARIABLE_RATE = 0x0400U, 29053a5a1b3Sopenharmony_ci /**< Allow dynamic changing of the sampling rate during playback 29153a5a1b3Sopenharmony_ci * with pa_stream_update_sample_rate(). Only supported when the 29253a5a1b3Sopenharmony_ci * server is at least PA 0.9.8. It is ignored on older 29353a5a1b3Sopenharmony_ci * servers. \since 0.9.8 */ 29453a5a1b3Sopenharmony_ci 29553a5a1b3Sopenharmony_ci PA_STREAM_PEAK_DETECT = 0x0800U, 29653a5a1b3Sopenharmony_ci /**< Find peaks instead of resampling. \since 0.9.11 */ 29753a5a1b3Sopenharmony_ci 29853a5a1b3Sopenharmony_ci PA_STREAM_START_MUTED = 0x1000U, 29953a5a1b3Sopenharmony_ci /**< Create in muted state. If neither PA_STREAM_START_UNMUTED nor 30053a5a1b3Sopenharmony_ci * PA_STREAM_START_MUTED are set, it is left to the server to decide 30153a5a1b3Sopenharmony_ci * whether to create the stream in muted or in unmuted 30253a5a1b3Sopenharmony_ci * state. \since 0.9.11 */ 30353a5a1b3Sopenharmony_ci 30453a5a1b3Sopenharmony_ci PA_STREAM_ADJUST_LATENCY = 0x2000U, 30553a5a1b3Sopenharmony_ci /**< Try to adjust the latency of the sink/source based on the 30653a5a1b3Sopenharmony_ci * requested buffer metrics and adjust buffer metrics 30753a5a1b3Sopenharmony_ci * accordingly. Also see pa_buffer_attr. This option may not be 30853a5a1b3Sopenharmony_ci * specified at the same time as PA_STREAM_EARLY_REQUESTS. \since 30953a5a1b3Sopenharmony_ci * 0.9.11 */ 31053a5a1b3Sopenharmony_ci 31153a5a1b3Sopenharmony_ci PA_STREAM_EARLY_REQUESTS = 0x4000U, 31253a5a1b3Sopenharmony_ci /**< Enable compatibility mode for legacy clients that rely on a 31353a5a1b3Sopenharmony_ci * "classic" hardware device fragment-style playback model. If 31453a5a1b3Sopenharmony_ci * this option is set, the minreq value of the buffer metrics gets 31553a5a1b3Sopenharmony_ci * a new meaning: instead of just specifying that no requests 31653a5a1b3Sopenharmony_ci * asking for less new data than this value will be made to the 31753a5a1b3Sopenharmony_ci * client it will also guarantee that requests are generated as 31853a5a1b3Sopenharmony_ci * early as this limit is reached. This flag should only be set in 31953a5a1b3Sopenharmony_ci * very few situations where compatibility with a fragment-based 32053a5a1b3Sopenharmony_ci * playback model needs to be kept and the client applications 32153a5a1b3Sopenharmony_ci * cannot deal with data requests that are delayed to the latest 32253a5a1b3Sopenharmony_ci * moment possible. (Usually these are programs that use usleep() 32353a5a1b3Sopenharmony_ci * or a similar call in their playback loops instead of sleeping 32453a5a1b3Sopenharmony_ci * on the device itself.) Also see pa_buffer_attr. This option may 32553a5a1b3Sopenharmony_ci * not be specified at the same time as 32653a5a1b3Sopenharmony_ci * PA_STREAM_ADJUST_LATENCY. \since 0.9.12 */ 32753a5a1b3Sopenharmony_ci 32853a5a1b3Sopenharmony_ci PA_STREAM_DONT_INHIBIT_AUTO_SUSPEND = 0x8000U, 32953a5a1b3Sopenharmony_ci /**< If set this stream won't be taken into account when it is 33053a5a1b3Sopenharmony_ci * checked whether the device this stream is connected to should 33153a5a1b3Sopenharmony_ci * auto-suspend. \since 0.9.15 */ 33253a5a1b3Sopenharmony_ci 33353a5a1b3Sopenharmony_ci PA_STREAM_START_UNMUTED = 0x10000U, 33453a5a1b3Sopenharmony_ci /**< Create in unmuted state. If neither PA_STREAM_START_UNMUTED 33553a5a1b3Sopenharmony_ci * nor PA_STREAM_START_MUTED are set it is left to the server to decide 33653a5a1b3Sopenharmony_ci * whether to create the stream in muted or in unmuted 33753a5a1b3Sopenharmony_ci * state. \since 0.9.15 */ 33853a5a1b3Sopenharmony_ci 33953a5a1b3Sopenharmony_ci PA_STREAM_FAIL_ON_SUSPEND = 0x20000U, 34053a5a1b3Sopenharmony_ci /**< If the sink/source this stream is connected to is suspended 34153a5a1b3Sopenharmony_ci * during the creation of this stream, cause it to fail. If the 34253a5a1b3Sopenharmony_ci * sink/source is being suspended during creation of this stream, 34353a5a1b3Sopenharmony_ci * make sure this stream is terminated. \since 0.9.15 */ 34453a5a1b3Sopenharmony_ci 34553a5a1b3Sopenharmony_ci PA_STREAM_RELATIVE_VOLUME = 0x40000U, 34653a5a1b3Sopenharmony_ci /**< If a volume is passed when this stream is created, consider 34753a5a1b3Sopenharmony_ci * it relative to the sink's current volume, never as absolute 34853a5a1b3Sopenharmony_ci * device volume. If this is not specified the volume will be 34953a5a1b3Sopenharmony_ci * consider absolute when the sink is in flat volume mode, 35053a5a1b3Sopenharmony_ci * relative otherwise. \since 0.9.20 */ 35153a5a1b3Sopenharmony_ci 35253a5a1b3Sopenharmony_ci PA_STREAM_PASSTHROUGH = 0x80000U 35353a5a1b3Sopenharmony_ci /**< Used to tag content that will be rendered by passthrough sinks. 35453a5a1b3Sopenharmony_ci * The data will be left as is and not reformatted, resampled. 35553a5a1b3Sopenharmony_ci * \since 1.0 */ 35653a5a1b3Sopenharmony_ci 35753a5a1b3Sopenharmony_ci} pa_stream_flags_t; 35853a5a1b3Sopenharmony_ci 35953a5a1b3Sopenharmony_ci/** \cond fulldocs */ 36053a5a1b3Sopenharmony_ci 36153a5a1b3Sopenharmony_ci/* English is an evil language */ 36253a5a1b3Sopenharmony_ci#define PA_STREAM_NOT_MONOTONOUS PA_STREAM_NOT_MONOTONIC 36353a5a1b3Sopenharmony_ci 36453a5a1b3Sopenharmony_ci/* Allow clients to check with #ifdef for those flags */ 36553a5a1b3Sopenharmony_ci#define PA_STREAM_START_CORKED PA_STREAM_START_CORKED 36653a5a1b3Sopenharmony_ci#define PA_STREAM_INTERPOLATE_TIMING PA_STREAM_INTERPOLATE_TIMING 36753a5a1b3Sopenharmony_ci#define PA_STREAM_NOT_MONOTONIC PA_STREAM_NOT_MONOTONIC 36853a5a1b3Sopenharmony_ci#define PA_STREAM_AUTO_TIMING_UPDATE PA_STREAM_AUTO_TIMING_UPDATE 36953a5a1b3Sopenharmony_ci#define PA_STREAM_NO_REMAP_CHANNELS PA_STREAM_NO_REMAP_CHANNELS 37053a5a1b3Sopenharmony_ci#define PA_STREAM_NO_REMIX_CHANNELS PA_STREAM_NO_REMIX_CHANNELS 37153a5a1b3Sopenharmony_ci#define PA_STREAM_FIX_FORMAT PA_STREAM_FIX_FORMAT 37253a5a1b3Sopenharmony_ci#define PA_STREAM_FIX_RATE PA_STREAM_FIX_RATE 37353a5a1b3Sopenharmony_ci#define PA_STREAM_FIX_CHANNELS PA_STREAM_FIX_CHANNELS 37453a5a1b3Sopenharmony_ci#define PA_STREAM_DONT_MOVE PA_STREAM_DONT_MOVE 37553a5a1b3Sopenharmony_ci#define PA_STREAM_VARIABLE_RATE PA_STREAM_VARIABLE_RATE 37653a5a1b3Sopenharmony_ci#define PA_STREAM_PEAK_DETECT PA_STREAM_PEAK_DETECT 37753a5a1b3Sopenharmony_ci#define PA_STREAM_START_MUTED PA_STREAM_START_MUTED 37853a5a1b3Sopenharmony_ci#define PA_STREAM_ADJUST_LATENCY PA_STREAM_ADJUST_LATENCY 37953a5a1b3Sopenharmony_ci#define PA_STREAM_EARLY_REQUESTS PA_STREAM_EARLY_REQUESTS 38053a5a1b3Sopenharmony_ci#define PA_STREAM_DONT_INHIBIT_AUTO_SUSPEND PA_STREAM_DONT_INHIBIT_AUTO_SUSPEND 38153a5a1b3Sopenharmony_ci#define PA_STREAM_START_UNMUTED PA_STREAM_START_UNMUTED 38253a5a1b3Sopenharmony_ci#define PA_STREAM_FAIL_ON_SUSPEND PA_STREAM_FAIL_ON_SUSPEND 38353a5a1b3Sopenharmony_ci#define PA_STREAM_RELATIVE_VOLUME PA_STREAM_RELATIVE_VOLUME 38453a5a1b3Sopenharmony_ci#define PA_STREAM_PASSTHROUGH PA_STREAM_PASSTHROUGH 38553a5a1b3Sopenharmony_ci 38653a5a1b3Sopenharmony_ci/** \endcond */ 38753a5a1b3Sopenharmony_ci 38853a5a1b3Sopenharmony_ci/** Playback and record buffer metrics */ 38953a5a1b3Sopenharmony_citypedef struct pa_buffer_attr { 39053a5a1b3Sopenharmony_ci uint32_t maxlength; 39153a5a1b3Sopenharmony_ci /**< Maximum length of the buffer in bytes. Setting this to (uint32_t) -1 39253a5a1b3Sopenharmony_ci * will initialize this to the maximum value supported by server, 39353a5a1b3Sopenharmony_ci * which is recommended. 39453a5a1b3Sopenharmony_ci * 39553a5a1b3Sopenharmony_ci * In strict low-latency playback scenarios you might want to set this to 39653a5a1b3Sopenharmony_ci * a lower value, likely together with the PA_STREAM_ADJUST_LATENCY flag. 39753a5a1b3Sopenharmony_ci * If you do so, you ensure that the latency doesn't grow beyond what is 39853a5a1b3Sopenharmony_ci * acceptable for the use case, at the cost of getting more underruns if 39953a5a1b3Sopenharmony_ci * the latency is lower than what the server can reliably handle. */ 40053a5a1b3Sopenharmony_ci 40153a5a1b3Sopenharmony_ci uint32_t tlength; 40253a5a1b3Sopenharmony_ci /**< Playback only: target length of the buffer. The server tries 40353a5a1b3Sopenharmony_ci * to assure that at least tlength bytes are always available in 40453a5a1b3Sopenharmony_ci * the per-stream server-side playback buffer. The server will 40553a5a1b3Sopenharmony_ci * only send requests for more data as long as the buffer has 40653a5a1b3Sopenharmony_ci * less than this number of bytes of data. 40753a5a1b3Sopenharmony_ci * 40853a5a1b3Sopenharmony_ci * It is recommended to set this to (uint32_t) -1, which will 40953a5a1b3Sopenharmony_ci * initialize this to a value that is deemed sensible by the 41053a5a1b3Sopenharmony_ci * server. However, this value will default to something like 2s; 41153a5a1b3Sopenharmony_ci * for applications that have specific latency requirements 41253a5a1b3Sopenharmony_ci * this value should be set to the maximum latency that the 41353a5a1b3Sopenharmony_ci * application can deal with. 41453a5a1b3Sopenharmony_ci * 41553a5a1b3Sopenharmony_ci * When PA_STREAM_ADJUST_LATENCY is not set this value will 41653a5a1b3Sopenharmony_ci * influence only the per-stream playback buffer size. When 41753a5a1b3Sopenharmony_ci * PA_STREAM_ADJUST_LATENCY is set the overall latency of the sink 41853a5a1b3Sopenharmony_ci * plus the playback buffer size is configured to this value. Set 41953a5a1b3Sopenharmony_ci * PA_STREAM_ADJUST_LATENCY if you are interested in adjusting the 42053a5a1b3Sopenharmony_ci * overall latency. Don't set it if you are interested in 42153a5a1b3Sopenharmony_ci * configuring the server-side per-stream playback buffer 42253a5a1b3Sopenharmony_ci * size. */ 42353a5a1b3Sopenharmony_ci 42453a5a1b3Sopenharmony_ci uint32_t prebuf; 42553a5a1b3Sopenharmony_ci /**< Playback only: pre-buffering. The server does not start with 42653a5a1b3Sopenharmony_ci * playback before at least prebuf bytes are available in the 42753a5a1b3Sopenharmony_ci * buffer. It is recommended to set this to (uint32_t) -1, which 42853a5a1b3Sopenharmony_ci * will initialize this to the same value as tlength, whatever 42953a5a1b3Sopenharmony_ci * that may be. 43053a5a1b3Sopenharmony_ci * 43153a5a1b3Sopenharmony_ci * Initialize to 0 to enable manual start/stop control of the stream. 43253a5a1b3Sopenharmony_ci * This means that playback will not stop on underrun and playback 43353a5a1b3Sopenharmony_ci * will not start automatically, instead pa_stream_cork() needs to 43453a5a1b3Sopenharmony_ci * be called explicitly. If you set this value to 0 you should also 43553a5a1b3Sopenharmony_ci * set PA_STREAM_START_CORKED. Should underrun occur, the read index 43653a5a1b3Sopenharmony_ci * of the output buffer overtakes the write index, and hence the 43753a5a1b3Sopenharmony_ci * fill level of the buffer is negative. 43853a5a1b3Sopenharmony_ci * 43953a5a1b3Sopenharmony_ci * Start of playback can be forced using pa_stream_trigger() even 44053a5a1b3Sopenharmony_ci * though the prebuffer size hasn't been reached. If a buffer 44153a5a1b3Sopenharmony_ci * underrun occurs, this prebuffering will be again enabled. */ 44253a5a1b3Sopenharmony_ci 44353a5a1b3Sopenharmony_ci uint32_t minreq; 44453a5a1b3Sopenharmony_ci /**< Playback only: minimum request. The server does not request 44553a5a1b3Sopenharmony_ci * less than minreq bytes from the client, instead waits until the 44653a5a1b3Sopenharmony_ci * buffer is free enough to request more bytes at once. It is 44753a5a1b3Sopenharmony_ci * recommended to set this to (uint32_t) -1, which will initialize 44853a5a1b3Sopenharmony_ci * this to a value that is deemed sensible by the server. This 44953a5a1b3Sopenharmony_ci * should be set to a value that gives PulseAudio enough time to 45053a5a1b3Sopenharmony_ci * move the data from the per-stream playback buffer into the 45153a5a1b3Sopenharmony_ci * hardware playback buffer. */ 45253a5a1b3Sopenharmony_ci 45353a5a1b3Sopenharmony_ci uint32_t fragsize; 45453a5a1b3Sopenharmony_ci /**< Recording only: fragment size. The server sends data in 45553a5a1b3Sopenharmony_ci * blocks of fragsize bytes size. Large values diminish 45653a5a1b3Sopenharmony_ci * interactivity with other operations on the connection context 45753a5a1b3Sopenharmony_ci * but decrease control overhead. It is recommended to set this to 45853a5a1b3Sopenharmony_ci * (uint32_t) -1, which will initialize this to a value that is 45953a5a1b3Sopenharmony_ci * deemed sensible by the server. However, this value will default 46053a5a1b3Sopenharmony_ci * to something like 2s; For applications that have specific 46153a5a1b3Sopenharmony_ci * latency requirements this value should be set to the maximum 46253a5a1b3Sopenharmony_ci * latency that the application can deal with. 46353a5a1b3Sopenharmony_ci * 46453a5a1b3Sopenharmony_ci * If PA_STREAM_ADJUST_LATENCY is set the overall source latency 46553a5a1b3Sopenharmony_ci * will be adjusted according to this value. If it is not set the 46653a5a1b3Sopenharmony_ci * source latency is left unmodified. */ 46753a5a1b3Sopenharmony_ci 46853a5a1b3Sopenharmony_ci} pa_buffer_attr; 46953a5a1b3Sopenharmony_ci 47053a5a1b3Sopenharmony_ci/** Error values as used by pa_context_errno(). Use pa_strerror() to convert these values to human readable strings */ 47153a5a1b3Sopenharmony_citypedef enum pa_error_code { 47253a5a1b3Sopenharmony_ci PA_OK = 0, /**< No error */ 47353a5a1b3Sopenharmony_ci PA_ERR_ACCESS, /**< Access failure */ 47453a5a1b3Sopenharmony_ci PA_ERR_COMMAND, /**< Unknown command */ 47553a5a1b3Sopenharmony_ci PA_ERR_INVALID, /**< Invalid argument */ 47653a5a1b3Sopenharmony_ci PA_ERR_EXIST, /**< Entity exists */ 47753a5a1b3Sopenharmony_ci PA_ERR_NOENTITY, /**< No such entity */ 47853a5a1b3Sopenharmony_ci PA_ERR_CONNECTIONREFUSED, /**< Connection refused */ 47953a5a1b3Sopenharmony_ci PA_ERR_PROTOCOL, /**< Protocol error */ 48053a5a1b3Sopenharmony_ci PA_ERR_TIMEOUT, /**< Timeout */ 48153a5a1b3Sopenharmony_ci PA_ERR_AUTHKEY, /**< No authentication key */ 48253a5a1b3Sopenharmony_ci PA_ERR_INTERNAL, /**< Internal error */ 48353a5a1b3Sopenharmony_ci PA_ERR_CONNECTIONTERMINATED, /**< Connection terminated */ 48453a5a1b3Sopenharmony_ci PA_ERR_KILLED, /**< Entity killed */ 48553a5a1b3Sopenharmony_ci PA_ERR_INVALIDSERVER, /**< Invalid server */ 48653a5a1b3Sopenharmony_ci PA_ERR_MODINITFAILED, /**< Module initialization failed */ 48753a5a1b3Sopenharmony_ci PA_ERR_BADSTATE, /**< Bad state */ 48853a5a1b3Sopenharmony_ci PA_ERR_NODATA, /**< No data */ 48953a5a1b3Sopenharmony_ci PA_ERR_VERSION, /**< Incompatible protocol version */ 49053a5a1b3Sopenharmony_ci PA_ERR_TOOLARGE, /**< Data too large */ 49153a5a1b3Sopenharmony_ci PA_ERR_NOTSUPPORTED, /**< Operation not supported \since 0.9.5 */ 49253a5a1b3Sopenharmony_ci PA_ERR_UNKNOWN, /**< The error code was unknown to the client */ 49353a5a1b3Sopenharmony_ci PA_ERR_NOEXTENSION, /**< Extension does not exist. \since 0.9.12 */ 49453a5a1b3Sopenharmony_ci PA_ERR_OBSOLETE, /**< Obsolete functionality. \since 0.9.15 */ 49553a5a1b3Sopenharmony_ci PA_ERR_NOTIMPLEMENTED, /**< Missing implementation. \since 0.9.15 */ 49653a5a1b3Sopenharmony_ci PA_ERR_FORKED, /**< The caller forked without calling execve() and tried to reuse the context. \since 0.9.15 */ 49753a5a1b3Sopenharmony_ci PA_ERR_IO, /**< An IO error happened. \since 0.9.16 */ 49853a5a1b3Sopenharmony_ci PA_ERR_BUSY, /**< Device or resource busy. \since 0.9.17 */ 49953a5a1b3Sopenharmony_ci PA_ERR_MAX /**< Not really an error but the first invalid error code */ 50053a5a1b3Sopenharmony_ci} pa_error_code_t; 50153a5a1b3Sopenharmony_ci 50253a5a1b3Sopenharmony_ci/** \cond fulldocs */ 50353a5a1b3Sopenharmony_ci#define PA_OK PA_OK 50453a5a1b3Sopenharmony_ci#define PA_ERR_ACCESS PA_ERR_ACCESS 50553a5a1b3Sopenharmony_ci#define PA_ERR_COMMAND PA_ERR_COMMAND 50653a5a1b3Sopenharmony_ci#define PA_ERR_INVALID PA_ERR_INVALID 50753a5a1b3Sopenharmony_ci#define PA_ERR_EXIST PA_ERR_EXIST 50853a5a1b3Sopenharmony_ci#define PA_ERR_NOENTITY PA_ERR_NOENTITY 50953a5a1b3Sopenharmony_ci#define PA_ERR_CONNECTIONREFUSED PA_ERR_CONNECTIONREFUSED 51053a5a1b3Sopenharmony_ci#define PA_ERR_PROTOCOL PA_ERR_PROTOCOL 51153a5a1b3Sopenharmony_ci#define PA_ERR_TIMEOUT PA_ERR_TIMEOUT 51253a5a1b3Sopenharmony_ci#define PA_ERR_AUTHKEY PA_ERR_AUTHKEY 51353a5a1b3Sopenharmony_ci#define PA_ERR_INTERNAL PA_ERR_INTERNAL 51453a5a1b3Sopenharmony_ci#define PA_ERR_CONNECTIONTERMINATED PA_ERR_CONNECTIONTERMINATED 51553a5a1b3Sopenharmony_ci#define PA_ERR_KILLED PA_ERR_KILLED 51653a5a1b3Sopenharmony_ci#define PA_ERR_INVALIDSERVER PA_ERR_INVALIDSERVER 51753a5a1b3Sopenharmony_ci#define PA_ERR_MODINITFAILED PA_ERR_MODINITFAILED 51853a5a1b3Sopenharmony_ci#define PA_ERR_BADSTATE PA_ERR_BADSTATE 51953a5a1b3Sopenharmony_ci#define PA_ERR_NODATA PA_ERR_NODATA 52053a5a1b3Sopenharmony_ci#define PA_ERR_VERSION PA_ERR_VERSION 52153a5a1b3Sopenharmony_ci#define PA_ERR_TOOLARGE PA_ERR_TOOLARGE 52253a5a1b3Sopenharmony_ci#define PA_ERR_NOTSUPPORTED PA_ERR_NOTSUPPORTED 52353a5a1b3Sopenharmony_ci#define PA_ERR_UNKNOWN PA_ERR_UNKNOWN 52453a5a1b3Sopenharmony_ci#define PA_ERR_NOEXTENSION PA_ERR_NOEXTENSION 52553a5a1b3Sopenharmony_ci#define PA_ERR_OBSOLETE PA_ERR_OBSOLETE 52653a5a1b3Sopenharmony_ci#define PA_ERR_NOTIMPLEMENTED PA_ERR_NOTIMPLEMENTED 52753a5a1b3Sopenharmony_ci#define PA_ERR_FORKED PA_ERR_FORKED 52853a5a1b3Sopenharmony_ci#define PA_ERR_MAX PA_ERR_MAX 52953a5a1b3Sopenharmony_ci/** \endcond */ 53053a5a1b3Sopenharmony_ci 53153a5a1b3Sopenharmony_ci/** Subscription event mask, as used by pa_context_subscribe() */ 53253a5a1b3Sopenharmony_citypedef enum pa_subscription_mask { 53353a5a1b3Sopenharmony_ci PA_SUBSCRIPTION_MASK_NULL = 0x0000U, 53453a5a1b3Sopenharmony_ci /**< No events */ 53553a5a1b3Sopenharmony_ci 53653a5a1b3Sopenharmony_ci PA_SUBSCRIPTION_MASK_SINK = 0x0001U, 53753a5a1b3Sopenharmony_ci /**< Sink events */ 53853a5a1b3Sopenharmony_ci 53953a5a1b3Sopenharmony_ci PA_SUBSCRIPTION_MASK_SOURCE = 0x0002U, 54053a5a1b3Sopenharmony_ci /**< Source events */ 54153a5a1b3Sopenharmony_ci 54253a5a1b3Sopenharmony_ci PA_SUBSCRIPTION_MASK_SINK_INPUT = 0x0004U, 54353a5a1b3Sopenharmony_ci /**< Sink input events */ 54453a5a1b3Sopenharmony_ci 54553a5a1b3Sopenharmony_ci PA_SUBSCRIPTION_MASK_SOURCE_OUTPUT = 0x0008U, 54653a5a1b3Sopenharmony_ci /**< Source output events */ 54753a5a1b3Sopenharmony_ci 54853a5a1b3Sopenharmony_ci PA_SUBSCRIPTION_MASK_MODULE = 0x0010U, 54953a5a1b3Sopenharmony_ci /**< Module events */ 55053a5a1b3Sopenharmony_ci 55153a5a1b3Sopenharmony_ci PA_SUBSCRIPTION_MASK_CLIENT = 0x0020U, 55253a5a1b3Sopenharmony_ci /**< Client events */ 55353a5a1b3Sopenharmony_ci 55453a5a1b3Sopenharmony_ci PA_SUBSCRIPTION_MASK_SAMPLE_CACHE = 0x0040U, 55553a5a1b3Sopenharmony_ci /**< Sample cache events */ 55653a5a1b3Sopenharmony_ci 55753a5a1b3Sopenharmony_ci PA_SUBSCRIPTION_MASK_SERVER = 0x0080U, 55853a5a1b3Sopenharmony_ci /**< Other global server changes. */ 55953a5a1b3Sopenharmony_ci 56053a5a1b3Sopenharmony_ci/** \cond fulldocs */ 56153a5a1b3Sopenharmony_ci PA_SUBSCRIPTION_MASK_AUTOLOAD = 0x0100U, 56253a5a1b3Sopenharmony_ci /**< \deprecated Autoload table events. */ 56353a5a1b3Sopenharmony_ci/** \endcond */ 56453a5a1b3Sopenharmony_ci 56553a5a1b3Sopenharmony_ci PA_SUBSCRIPTION_MASK_CARD = 0x0200U, 56653a5a1b3Sopenharmony_ci /**< Card events. \since 0.9.15 */ 56753a5a1b3Sopenharmony_ci 56853a5a1b3Sopenharmony_ci PA_SUBSCRIPTION_MASK_ALL = 0x02ffU 56953a5a1b3Sopenharmony_ci /**< Catch all events */ 57053a5a1b3Sopenharmony_ci} pa_subscription_mask_t; 57153a5a1b3Sopenharmony_ci 57253a5a1b3Sopenharmony_ci/** Subscription event types, as used by pa_context_subscribe() */ 57353a5a1b3Sopenharmony_citypedef enum pa_subscription_event_type { 57453a5a1b3Sopenharmony_ci PA_SUBSCRIPTION_EVENT_SINK = 0x0000U, 57553a5a1b3Sopenharmony_ci /**< Event type: Sink */ 57653a5a1b3Sopenharmony_ci 57753a5a1b3Sopenharmony_ci PA_SUBSCRIPTION_EVENT_SOURCE = 0x0001U, 57853a5a1b3Sopenharmony_ci /**< Event type: Source */ 57953a5a1b3Sopenharmony_ci 58053a5a1b3Sopenharmony_ci PA_SUBSCRIPTION_EVENT_SINK_INPUT = 0x0002U, 58153a5a1b3Sopenharmony_ci /**< Event type: Sink input */ 58253a5a1b3Sopenharmony_ci 58353a5a1b3Sopenharmony_ci PA_SUBSCRIPTION_EVENT_SOURCE_OUTPUT = 0x0003U, 58453a5a1b3Sopenharmony_ci /**< Event type: Source output */ 58553a5a1b3Sopenharmony_ci 58653a5a1b3Sopenharmony_ci PA_SUBSCRIPTION_EVENT_MODULE = 0x0004U, 58753a5a1b3Sopenharmony_ci /**< Event type: Module */ 58853a5a1b3Sopenharmony_ci 58953a5a1b3Sopenharmony_ci PA_SUBSCRIPTION_EVENT_CLIENT = 0x0005U, 59053a5a1b3Sopenharmony_ci /**< Event type: Client */ 59153a5a1b3Sopenharmony_ci 59253a5a1b3Sopenharmony_ci PA_SUBSCRIPTION_EVENT_SAMPLE_CACHE = 0x0006U, 59353a5a1b3Sopenharmony_ci /**< Event type: Sample cache item */ 59453a5a1b3Sopenharmony_ci 59553a5a1b3Sopenharmony_ci PA_SUBSCRIPTION_EVENT_SERVER = 0x0007U, 59653a5a1b3Sopenharmony_ci /**< Event type: Global server change, only occurring with PA_SUBSCRIPTION_EVENT_CHANGE. */ 59753a5a1b3Sopenharmony_ci 59853a5a1b3Sopenharmony_ci/** \cond fulldocs */ 59953a5a1b3Sopenharmony_ci PA_SUBSCRIPTION_EVENT_AUTOLOAD = 0x0008U, 60053a5a1b3Sopenharmony_ci /**< \deprecated Event type: Autoload table changes. */ 60153a5a1b3Sopenharmony_ci/** \endcond */ 60253a5a1b3Sopenharmony_ci 60353a5a1b3Sopenharmony_ci PA_SUBSCRIPTION_EVENT_CARD = 0x0009U, 60453a5a1b3Sopenharmony_ci /**< Event type: Card \since 0.9.15 */ 60553a5a1b3Sopenharmony_ci 60653a5a1b3Sopenharmony_ci PA_SUBSCRIPTION_EVENT_FACILITY_MASK = 0x000FU, 60753a5a1b3Sopenharmony_ci /**< A mask to extract the event type from an event value */ 60853a5a1b3Sopenharmony_ci 60953a5a1b3Sopenharmony_ci PA_SUBSCRIPTION_EVENT_NEW = 0x0000U, 61053a5a1b3Sopenharmony_ci /**< A new object was created */ 61153a5a1b3Sopenharmony_ci 61253a5a1b3Sopenharmony_ci PA_SUBSCRIPTION_EVENT_CHANGE = 0x0010U, 61353a5a1b3Sopenharmony_ci /**< A property of the object was modified */ 61453a5a1b3Sopenharmony_ci 61553a5a1b3Sopenharmony_ci PA_SUBSCRIPTION_EVENT_REMOVE = 0x0020U, 61653a5a1b3Sopenharmony_ci /**< An object was removed */ 61753a5a1b3Sopenharmony_ci 61853a5a1b3Sopenharmony_ci PA_SUBSCRIPTION_EVENT_TYPE_MASK = 0x0030U 61953a5a1b3Sopenharmony_ci /**< A mask to extract the event operation from an event value */ 62053a5a1b3Sopenharmony_ci 62153a5a1b3Sopenharmony_ci} pa_subscription_event_type_t; 62253a5a1b3Sopenharmony_ci 62353a5a1b3Sopenharmony_ci/** Return one if an event type t matches an event mask bitfield */ 62453a5a1b3Sopenharmony_ci#define pa_subscription_match_flags(m, t) (!!((m) & (1 << ((t) & PA_SUBSCRIPTION_EVENT_FACILITY_MASK)))) 62553a5a1b3Sopenharmony_ci 62653a5a1b3Sopenharmony_ci/** \cond fulldocs */ 62753a5a1b3Sopenharmony_ci#define PA_SUBSCRIPTION_MASK_NULL PA_SUBSCRIPTION_MASK_NULL 62853a5a1b3Sopenharmony_ci#define PA_SUBSCRIPTION_MASK_SINK PA_SUBSCRIPTION_MASK_SINK 62953a5a1b3Sopenharmony_ci#define PA_SUBSCRIPTION_MASK_SOURCE PA_SUBSCRIPTION_MASK_SOURCE 63053a5a1b3Sopenharmony_ci#define PA_SUBSCRIPTION_MASK_SINK_INPUT PA_SUBSCRIPTION_MASK_SINK_INPUT 63153a5a1b3Sopenharmony_ci#define PA_SUBSCRIPTION_MASK_SOURCE_OUTPUT PA_SUBSCRIPTION_MASK_SOURCE_OUTPUT 63253a5a1b3Sopenharmony_ci#define PA_SUBSCRIPTION_MASK_MODULE PA_SUBSCRIPTION_MASK_MODULE 63353a5a1b3Sopenharmony_ci#define PA_SUBSCRIPTION_MASK_CLIENT PA_SUBSCRIPTION_MASK_CLIENT 63453a5a1b3Sopenharmony_ci#define PA_SUBSCRIPTION_MASK_SAMPLE_CACHE PA_SUBSCRIPTION_MASK_SAMPLE_CACHE 63553a5a1b3Sopenharmony_ci#define PA_SUBSCRIPTION_MASK_SERVER PA_SUBSCRIPTION_MASK_SERVER 63653a5a1b3Sopenharmony_ci#define PA_SUBSCRIPTION_MASK_AUTOLOAD PA_SUBSCRIPTION_MASK_AUTOLOAD 63753a5a1b3Sopenharmony_ci#define PA_SUBSCRIPTION_MASK_CARD PA_SUBSCRIPTION_MASK_CARD 63853a5a1b3Sopenharmony_ci#define PA_SUBSCRIPTION_MASK_ALL PA_SUBSCRIPTION_MASK_ALL 63953a5a1b3Sopenharmony_ci#define PA_SUBSCRIPTION_EVENT_SINK PA_SUBSCRIPTION_EVENT_SINK 64053a5a1b3Sopenharmony_ci#define PA_SUBSCRIPTION_EVENT_SOURCE PA_SUBSCRIPTION_EVENT_SOURCE 64153a5a1b3Sopenharmony_ci#define PA_SUBSCRIPTION_EVENT_SINK_INPUT PA_SUBSCRIPTION_EVENT_SINK_INPUT 64253a5a1b3Sopenharmony_ci#define PA_SUBSCRIPTION_EVENT_SOURCE_OUTPUT PA_SUBSCRIPTION_EVENT_SOURCE_OUTPUT 64353a5a1b3Sopenharmony_ci#define PA_SUBSCRIPTION_EVENT_MODULE PA_SUBSCRIPTION_EVENT_MODULE 64453a5a1b3Sopenharmony_ci#define PA_SUBSCRIPTION_EVENT_CLIENT PA_SUBSCRIPTION_EVENT_CLIENT 64553a5a1b3Sopenharmony_ci#define PA_SUBSCRIPTION_EVENT_SAMPLE_CACHE PA_SUBSCRIPTION_EVENT_SAMPLE_CACHE 64653a5a1b3Sopenharmony_ci#define PA_SUBSCRIPTION_EVENT_SERVER PA_SUBSCRIPTION_EVENT_SERVER 64753a5a1b3Sopenharmony_ci#define PA_SUBSCRIPTION_EVENT_AUTOLOAD PA_SUBSCRIPTION_EVENT_AUTOLOAD 64853a5a1b3Sopenharmony_ci#define PA_SUBSCRIPTION_EVENT_CARD PA_SUBSCRIPTION_EVENT_CARD 64953a5a1b3Sopenharmony_ci#define PA_SUBSCRIPTION_EVENT_FACILITY_MASK PA_SUBSCRIPTION_EVENT_FACILITY_MASK 65053a5a1b3Sopenharmony_ci#define PA_SUBSCRIPTION_EVENT_NEW PA_SUBSCRIPTION_EVENT_NEW 65153a5a1b3Sopenharmony_ci#define PA_SUBSCRIPTION_EVENT_CHANGE PA_SUBSCRIPTION_EVENT_CHANGE 65253a5a1b3Sopenharmony_ci#define PA_SUBSCRIPTION_EVENT_REMOVE PA_SUBSCRIPTION_EVENT_REMOVE 65353a5a1b3Sopenharmony_ci#define PA_SUBSCRIPTION_EVENT_TYPE_MASK PA_SUBSCRIPTION_EVENT_TYPE_MASK 65453a5a1b3Sopenharmony_ci/** \endcond */ 65553a5a1b3Sopenharmony_ci 65653a5a1b3Sopenharmony_ci/** A structure for all kinds of timing information of a stream. See 65753a5a1b3Sopenharmony_ci * pa_stream_update_timing_info() and pa_stream_get_timing_info(). The 65853a5a1b3Sopenharmony_ci * total output latency a sample that is written with 65953a5a1b3Sopenharmony_ci * pa_stream_write() takes to be played may be estimated by 66053a5a1b3Sopenharmony_ci * sink_usec+buffer_usec+transport_usec (where buffer_usec is defined 66153a5a1b3Sopenharmony_ci * as pa_bytes_to_usec(write_index-read_index)). The output buffer 66253a5a1b3Sopenharmony_ci * which buffer_usec relates to may be manipulated freely (with 66353a5a1b3Sopenharmony_ci * pa_stream_write()'s seek argument, pa_stream_flush() and friends), 66453a5a1b3Sopenharmony_ci * the buffers sink_usec and source_usec relate to are first-in 66553a5a1b3Sopenharmony_ci * first-out (FIFO) buffers which cannot be flushed or manipulated in 66653a5a1b3Sopenharmony_ci * any way. The total input latency a sample that is recorded takes to 66753a5a1b3Sopenharmony_ci * be delivered to the application is: 66853a5a1b3Sopenharmony_ci * source_usec+buffer_usec+transport_usec-sink_usec. (Take care of 66953a5a1b3Sopenharmony_ci * sign issues!) When connected to a monitor source sink_usec contains 67053a5a1b3Sopenharmony_ci * the latency of the owning sink. The two latency estimations 67153a5a1b3Sopenharmony_ci * described here are implemented in pa_stream_get_latency(). 67253a5a1b3Sopenharmony_ci * 67353a5a1b3Sopenharmony_ci * All time values are in the sound card clock domain, unless noted 67453a5a1b3Sopenharmony_ci * otherwise. The sound card clock usually runs at a slightly different 67553a5a1b3Sopenharmony_ci * rate than the system clock. 67653a5a1b3Sopenharmony_ci * 67753a5a1b3Sopenharmony_ci * Please note that this structure can be extended as part of evolutionary 67853a5a1b3Sopenharmony_ci * API updates at any time in any new release. 67953a5a1b3Sopenharmony_ci * */ 68053a5a1b3Sopenharmony_citypedef struct pa_timing_info { 68153a5a1b3Sopenharmony_ci struct timeval timestamp; 68253a5a1b3Sopenharmony_ci /**< The system clock time when this timing info structure was 68353a5a1b3Sopenharmony_ci * current. */ 68453a5a1b3Sopenharmony_ci 68553a5a1b3Sopenharmony_ci int synchronized_clocks; 68653a5a1b3Sopenharmony_ci /**< Non-zero if the local and the remote machine have 68753a5a1b3Sopenharmony_ci * synchronized clocks. If synchronized clocks are detected 68853a5a1b3Sopenharmony_ci * transport_usec becomes much more reliable. However, the code 68953a5a1b3Sopenharmony_ci * that detects synchronized clocks is very limited and unreliable 69053a5a1b3Sopenharmony_ci * itself. */ 69153a5a1b3Sopenharmony_ci 69253a5a1b3Sopenharmony_ci pa_usec_t sink_usec; 69353a5a1b3Sopenharmony_ci /**< Time in usecs a sample takes to be played on the sink. For 69453a5a1b3Sopenharmony_ci * playback streams and record streams connected to a monitor 69553a5a1b3Sopenharmony_ci * source. */ 69653a5a1b3Sopenharmony_ci 69753a5a1b3Sopenharmony_ci pa_usec_t source_usec; 69853a5a1b3Sopenharmony_ci /**< Time in usecs a sample takes from being recorded to being 69953a5a1b3Sopenharmony_ci * delivered to the application. Only for record streams. */ 70053a5a1b3Sopenharmony_ci 70153a5a1b3Sopenharmony_ci pa_usec_t transport_usec; 70253a5a1b3Sopenharmony_ci /**< Estimated time in usecs a sample takes to be transferred 70353a5a1b3Sopenharmony_ci * to/from the daemon. For both playback and record streams. */ 70453a5a1b3Sopenharmony_ci 70553a5a1b3Sopenharmony_ci int playing; 70653a5a1b3Sopenharmony_ci /**< Non-zero when the stream is currently not underrun and data 70753a5a1b3Sopenharmony_ci * is being passed on to the device. Only for playback 70853a5a1b3Sopenharmony_ci * streams. This field does not say whether the data is actually 70953a5a1b3Sopenharmony_ci * already being played. To determine this check whether 71053a5a1b3Sopenharmony_ci * since_underrun (converted to usec) is larger than sink_usec.*/ 71153a5a1b3Sopenharmony_ci 71253a5a1b3Sopenharmony_ci int write_index_corrupt; 71353a5a1b3Sopenharmony_ci /**< Non-zero if write_index is not up-to-date because a local 71453a5a1b3Sopenharmony_ci * write command that corrupted it has been issued in the time 71553a5a1b3Sopenharmony_ci * since this latency info was current . Only write commands with 71653a5a1b3Sopenharmony_ci * SEEK_RELATIVE_ON_READ and SEEK_RELATIVE_END can corrupt 71753a5a1b3Sopenharmony_ci * write_index. */ 71853a5a1b3Sopenharmony_ci 71953a5a1b3Sopenharmony_ci int64_t write_index; 72053a5a1b3Sopenharmony_ci /**< Current write index into the playback buffer in bytes. Think 72153a5a1b3Sopenharmony_ci * twice before using this for seeking purposes: it might be out 72253a5a1b3Sopenharmony_ci * of date at the time you want to use it. Consider using 72353a5a1b3Sopenharmony_ci * PA_SEEK_RELATIVE instead. */ 72453a5a1b3Sopenharmony_ci 72553a5a1b3Sopenharmony_ci int read_index_corrupt; 72653a5a1b3Sopenharmony_ci /**< Non-zero if read_index is not up-to-date because a local 72753a5a1b3Sopenharmony_ci * pause or flush request that corrupted it has been issued in the 72853a5a1b3Sopenharmony_ci * time since this latency info was current. */ 72953a5a1b3Sopenharmony_ci 73053a5a1b3Sopenharmony_ci int64_t read_index; 73153a5a1b3Sopenharmony_ci /**< Current read index into the playback buffer in bytes. Think 73253a5a1b3Sopenharmony_ci * twice before using this for seeking purposes: it might be out 73353a5a1b3Sopenharmony_ci * of date at the time you want to use it. Consider using 73453a5a1b3Sopenharmony_ci * PA_SEEK_RELATIVE_ON_READ instead. */ 73553a5a1b3Sopenharmony_ci 73653a5a1b3Sopenharmony_ci pa_usec_t configured_sink_usec; 73753a5a1b3Sopenharmony_ci /**< The configured latency for the sink. \since 0.9.11 */ 73853a5a1b3Sopenharmony_ci 73953a5a1b3Sopenharmony_ci pa_usec_t configured_source_usec; 74053a5a1b3Sopenharmony_ci /**< The configured latency for the source. \since 0.9.11 */ 74153a5a1b3Sopenharmony_ci 74253a5a1b3Sopenharmony_ci int64_t since_underrun; 74353a5a1b3Sopenharmony_ci /**< Bytes that were handed to the sink since the last underrun 74453a5a1b3Sopenharmony_ci * happened, or since playback started again after the last 74553a5a1b3Sopenharmony_ci * underrun. playing will tell you which case it is. \since 74653a5a1b3Sopenharmony_ci * 0.9.11 */ 74753a5a1b3Sopenharmony_ci 74853a5a1b3Sopenharmony_ci} pa_timing_info; 74953a5a1b3Sopenharmony_ci 75053a5a1b3Sopenharmony_ci/** A structure for the spawn api. This may be used to integrate auto 75153a5a1b3Sopenharmony_ci * spawned daemons into your application. For more information see 75253a5a1b3Sopenharmony_ci * pa_context_connect(). When spawning a new child process the 75353a5a1b3Sopenharmony_ci * waitpid() is used on the child's PID. The spawn routine will not 75453a5a1b3Sopenharmony_ci * block or ignore SIGCHLD signals, since this cannot be done in a 75553a5a1b3Sopenharmony_ci * thread compatible way. You might have to do this in 75653a5a1b3Sopenharmony_ci * prefork/postfork. */ 75753a5a1b3Sopenharmony_citypedef struct pa_spawn_api { 75853a5a1b3Sopenharmony_ci void (*prefork)(void); 75953a5a1b3Sopenharmony_ci /**< Is called just before the fork in the parent process. May be 76053a5a1b3Sopenharmony_ci * NULL. */ 76153a5a1b3Sopenharmony_ci 76253a5a1b3Sopenharmony_ci void (*postfork)(void); 76353a5a1b3Sopenharmony_ci /**< Is called immediately after the fork in the parent 76453a5a1b3Sopenharmony_ci * process. May be NULL.*/ 76553a5a1b3Sopenharmony_ci 76653a5a1b3Sopenharmony_ci void (*atfork)(void); 76753a5a1b3Sopenharmony_ci /**< Is called immediately after the fork in the child 76853a5a1b3Sopenharmony_ci * process. May be NULL. It is not safe to close all file 76953a5a1b3Sopenharmony_ci * descriptors in this function unconditionally, since a UNIX 77053a5a1b3Sopenharmony_ci * socket (created using socketpair()) is passed to the new 77153a5a1b3Sopenharmony_ci * process. */ 77253a5a1b3Sopenharmony_ci} pa_spawn_api; 77353a5a1b3Sopenharmony_ci 77453a5a1b3Sopenharmony_ci/** Seek type for pa_stream_write(). */ 77553a5a1b3Sopenharmony_citypedef enum pa_seek_mode { 77653a5a1b3Sopenharmony_ci PA_SEEK_RELATIVE = 0, 77753a5a1b3Sopenharmony_ci /**< Seek relative to the write index. */ 77853a5a1b3Sopenharmony_ci 77953a5a1b3Sopenharmony_ci PA_SEEK_ABSOLUTE = 1, 78053a5a1b3Sopenharmony_ci /**< Seek relative to the start of the buffer queue. */ 78153a5a1b3Sopenharmony_ci 78253a5a1b3Sopenharmony_ci PA_SEEK_RELATIVE_ON_READ = 2, 78353a5a1b3Sopenharmony_ci /**< Seek relative to the read index. */ 78453a5a1b3Sopenharmony_ci 78553a5a1b3Sopenharmony_ci PA_SEEK_RELATIVE_END = 3 78653a5a1b3Sopenharmony_ci /**< Seek relative to the current end of the buffer queue. */ 78753a5a1b3Sopenharmony_ci} pa_seek_mode_t; 78853a5a1b3Sopenharmony_ci 78953a5a1b3Sopenharmony_ci/** \cond fulldocs */ 79053a5a1b3Sopenharmony_ci#define PA_SEEK_RELATIVE PA_SEEK_RELATIVE 79153a5a1b3Sopenharmony_ci#define PA_SEEK_ABSOLUTE PA_SEEK_ABSOLUTE 79253a5a1b3Sopenharmony_ci#define PA_SEEK_RELATIVE_ON_READ PA_SEEK_RELATIVE_ON_READ 79353a5a1b3Sopenharmony_ci#define PA_SEEK_RELATIVE_END PA_SEEK_RELATIVE_END 79453a5a1b3Sopenharmony_ci/** \endcond */ 79553a5a1b3Sopenharmony_ci 79653a5a1b3Sopenharmony_ci/** Special sink flags. */ 79753a5a1b3Sopenharmony_citypedef enum pa_sink_flags { 79853a5a1b3Sopenharmony_ci PA_SINK_NOFLAGS = 0x0000U, 79953a5a1b3Sopenharmony_ci /**< Flag to pass when no specific options are needed (used to avoid casting) \since 0.9.19 */ 80053a5a1b3Sopenharmony_ci 80153a5a1b3Sopenharmony_ci PA_SINK_HW_VOLUME_CTRL = 0x0001U, 80253a5a1b3Sopenharmony_ci /**< Supports hardware volume control. This is a dynamic flag and may 80353a5a1b3Sopenharmony_ci * change at runtime after the sink has initialized */ 80453a5a1b3Sopenharmony_ci 80553a5a1b3Sopenharmony_ci PA_SINK_LATENCY = 0x0002U, 80653a5a1b3Sopenharmony_ci /**< Supports latency querying */ 80753a5a1b3Sopenharmony_ci 80853a5a1b3Sopenharmony_ci PA_SINK_HARDWARE = 0x0004U, 80953a5a1b3Sopenharmony_ci /**< Is a hardware sink of some kind, in contrast to 81053a5a1b3Sopenharmony_ci * "virtual"/software sinks \since 0.9.3 */ 81153a5a1b3Sopenharmony_ci 81253a5a1b3Sopenharmony_ci PA_SINK_NETWORK = 0x0008U, 81353a5a1b3Sopenharmony_ci /**< Is a networked sink of some kind. \since 0.9.7 */ 81453a5a1b3Sopenharmony_ci 81553a5a1b3Sopenharmony_ci PA_SINK_HW_MUTE_CTRL = 0x0010U, 81653a5a1b3Sopenharmony_ci /**< Supports hardware mute control. This is a dynamic flag and may 81753a5a1b3Sopenharmony_ci * change at runtime after the sink has initialized \since 0.9.11 */ 81853a5a1b3Sopenharmony_ci 81953a5a1b3Sopenharmony_ci PA_SINK_DECIBEL_VOLUME = 0x0020U, 82053a5a1b3Sopenharmony_ci /**< Volume can be translated to dB with pa_sw_volume_to_dB(). This is a 82153a5a1b3Sopenharmony_ci * dynamic flag and may change at runtime after the sink has initialized 82253a5a1b3Sopenharmony_ci * \since 0.9.11 */ 82353a5a1b3Sopenharmony_ci 82453a5a1b3Sopenharmony_ci PA_SINK_FLAT_VOLUME = 0x0040U, 82553a5a1b3Sopenharmony_ci /**< This sink is in flat volume mode, i.e.\ always the maximum of 82653a5a1b3Sopenharmony_ci * the volume of all connected inputs. \since 0.9.15 */ 82753a5a1b3Sopenharmony_ci 82853a5a1b3Sopenharmony_ci PA_SINK_DYNAMIC_LATENCY = 0x0080U, 82953a5a1b3Sopenharmony_ci /**< The latency can be adjusted dynamically depending on the 83053a5a1b3Sopenharmony_ci * needs of the connected streams. \since 0.9.15 */ 83153a5a1b3Sopenharmony_ci 83253a5a1b3Sopenharmony_ci PA_SINK_SET_FORMATS = 0x0100U, 83353a5a1b3Sopenharmony_ci /**< The sink allows setting what formats are supported by the connected 83453a5a1b3Sopenharmony_ci * hardware. The actual functionality to do this might be provided by an 83553a5a1b3Sopenharmony_ci * extension. \since 1.0 */ 83653a5a1b3Sopenharmony_ci 83753a5a1b3Sopenharmony_ci#ifdef __INCLUDED_FROM_PULSE_AUDIO 83853a5a1b3Sopenharmony_ci/** \cond fulldocs */ 83953a5a1b3Sopenharmony_ci /* PRIVATE: Server-side values -- do not try to use these at client-side. 84053a5a1b3Sopenharmony_ci * The server will filter out these flags anyway, so you should never see 84153a5a1b3Sopenharmony_ci * these flags in sinks. */ 84253a5a1b3Sopenharmony_ci 84353a5a1b3Sopenharmony_ci PA_SINK_SHARE_VOLUME_WITH_MASTER = 0x1000000U, 84453a5a1b3Sopenharmony_ci /**< This sink shares the volume with the master sink (used by some filter 84553a5a1b3Sopenharmony_ci * sinks). */ 84653a5a1b3Sopenharmony_ci 84753a5a1b3Sopenharmony_ci PA_SINK_DEFERRED_VOLUME = 0x2000000U, 84853a5a1b3Sopenharmony_ci /**< The HW volume changes are syncronized with SW volume. */ 84953a5a1b3Sopenharmony_ci/** \endcond */ 85053a5a1b3Sopenharmony_ci#endif 85153a5a1b3Sopenharmony_ci 85253a5a1b3Sopenharmony_ci} pa_sink_flags_t; 85353a5a1b3Sopenharmony_ci 85453a5a1b3Sopenharmony_ci/** \cond fulldocs */ 85553a5a1b3Sopenharmony_ci#define PA_SINK_HW_VOLUME_CTRL PA_SINK_HW_VOLUME_CTRL 85653a5a1b3Sopenharmony_ci#define PA_SINK_LATENCY PA_SINK_LATENCY 85753a5a1b3Sopenharmony_ci#define PA_SINK_HARDWARE PA_SINK_HARDWARE 85853a5a1b3Sopenharmony_ci#define PA_SINK_NETWORK PA_SINK_NETWORK 85953a5a1b3Sopenharmony_ci#define PA_SINK_HW_MUTE_CTRL PA_SINK_HW_MUTE_CTRL 86053a5a1b3Sopenharmony_ci#define PA_SINK_DECIBEL_VOLUME PA_SINK_DECIBEL_VOLUME 86153a5a1b3Sopenharmony_ci#define PA_SINK_FLAT_VOLUME PA_SINK_FLAT_VOLUME 86253a5a1b3Sopenharmony_ci#define PA_SINK_DYNAMIC_LATENCY PA_SINK_DYNAMIC_LATENCY 86353a5a1b3Sopenharmony_ci#define PA_SINK_SET_FORMATS PA_SINK_SET_FORMATS 86453a5a1b3Sopenharmony_ci#ifdef __INCLUDED_FROM_PULSE_AUDIO 86553a5a1b3Sopenharmony_ci#define PA_SINK_CLIENT_FLAGS_MASK 0xFFFFFF 86653a5a1b3Sopenharmony_ci#endif 86753a5a1b3Sopenharmony_ci 86853a5a1b3Sopenharmony_ci/** \endcond */ 86953a5a1b3Sopenharmony_ci 87053a5a1b3Sopenharmony_ci/** Sink state. \since 0.9.15 */ 87153a5a1b3Sopenharmony_citypedef enum pa_sink_state { /* enum serialized in u8 */ 87253a5a1b3Sopenharmony_ci PA_SINK_INVALID_STATE = -1, 87353a5a1b3Sopenharmony_ci /**< This state is used when the server does not support sink state introspection \since 0.9.15 */ 87453a5a1b3Sopenharmony_ci 87553a5a1b3Sopenharmony_ci PA_SINK_RUNNING = 0, 87653a5a1b3Sopenharmony_ci /**< Running, sink is playing and used by at least one non-corked sink-input \since 0.9.15 */ 87753a5a1b3Sopenharmony_ci 87853a5a1b3Sopenharmony_ci PA_SINK_IDLE = 1, 87953a5a1b3Sopenharmony_ci /**< When idle, the sink is playing but there is no non-corked sink-input attached to it \since 0.9.15 */ 88053a5a1b3Sopenharmony_ci 88153a5a1b3Sopenharmony_ci PA_SINK_SUSPENDED = 2, 88253a5a1b3Sopenharmony_ci /**< When suspended, actual sink access can be closed, for instance \since 0.9.15 */ 88353a5a1b3Sopenharmony_ci 88453a5a1b3Sopenharmony_ci/** \cond fulldocs */ 88553a5a1b3Sopenharmony_ci /* PRIVATE: Server-side values -- DO NOT USE THIS ON THE CLIENT 88653a5a1b3Sopenharmony_ci * SIDE! These values are *not* considered part of the official PA 88753a5a1b3Sopenharmony_ci * API/ABI. If you use them your application might break when PA 88853a5a1b3Sopenharmony_ci * is upgraded. Also, please note that these values are not useful 88953a5a1b3Sopenharmony_ci * on the client side anyway. */ 89053a5a1b3Sopenharmony_ci 89153a5a1b3Sopenharmony_ci PA_SINK_INIT = -2, 89253a5a1b3Sopenharmony_ci /**< Initialization state */ 89353a5a1b3Sopenharmony_ci 89453a5a1b3Sopenharmony_ci PA_SINK_UNLINKED = -3 89553a5a1b3Sopenharmony_ci /**< The state when the sink is getting unregistered and removed from client access */ 89653a5a1b3Sopenharmony_ci/** \endcond */ 89753a5a1b3Sopenharmony_ci 89853a5a1b3Sopenharmony_ci} pa_sink_state_t; 89953a5a1b3Sopenharmony_ci 90053a5a1b3Sopenharmony_ci/** Returns non-zero if sink is playing: running or idle. \since 0.9.15 */ 90153a5a1b3Sopenharmony_cistatic inline int PA_SINK_IS_OPENED(pa_sink_state_t x) { 90253a5a1b3Sopenharmony_ci return x == PA_SINK_RUNNING || x == PA_SINK_IDLE; 90353a5a1b3Sopenharmony_ci} 90453a5a1b3Sopenharmony_ci 90553a5a1b3Sopenharmony_ci/** Returns non-zero if sink is running. \since 1.0 */ 90653a5a1b3Sopenharmony_cistatic inline int PA_SINK_IS_RUNNING(pa_sink_state_t x) { 90753a5a1b3Sopenharmony_ci return x == PA_SINK_RUNNING; 90853a5a1b3Sopenharmony_ci} 90953a5a1b3Sopenharmony_ci 91053a5a1b3Sopenharmony_ci/** \cond fulldocs */ 91153a5a1b3Sopenharmony_ci#define PA_SINK_INVALID_STATE PA_SINK_INVALID_STATE 91253a5a1b3Sopenharmony_ci#define PA_SINK_RUNNING PA_SINK_RUNNING 91353a5a1b3Sopenharmony_ci#define PA_SINK_IDLE PA_SINK_IDLE 91453a5a1b3Sopenharmony_ci#define PA_SINK_SUSPENDED PA_SINK_SUSPENDED 91553a5a1b3Sopenharmony_ci#define PA_SINK_INIT PA_SINK_INIT 91653a5a1b3Sopenharmony_ci#define PA_SINK_UNLINKED PA_SINK_UNLINKED 91753a5a1b3Sopenharmony_ci#define PA_SINK_IS_OPENED PA_SINK_IS_OPENED 91853a5a1b3Sopenharmony_ci/** \endcond */ 91953a5a1b3Sopenharmony_ci 92053a5a1b3Sopenharmony_ci/** Special source flags. */ 92153a5a1b3Sopenharmony_citypedef enum pa_source_flags { 92253a5a1b3Sopenharmony_ci PA_SOURCE_NOFLAGS = 0x0000U, 92353a5a1b3Sopenharmony_ci /**< Flag to pass when no specific options are needed (used to avoid casting) \since 0.9.19 */ 92453a5a1b3Sopenharmony_ci 92553a5a1b3Sopenharmony_ci PA_SOURCE_HW_VOLUME_CTRL = 0x0001U, 92653a5a1b3Sopenharmony_ci /**< Supports hardware volume control. This is a dynamic flag and may 92753a5a1b3Sopenharmony_ci * change at runtime after the source has initialized */ 92853a5a1b3Sopenharmony_ci 92953a5a1b3Sopenharmony_ci PA_SOURCE_LATENCY = 0x0002U, 93053a5a1b3Sopenharmony_ci /**< Supports latency querying */ 93153a5a1b3Sopenharmony_ci 93253a5a1b3Sopenharmony_ci PA_SOURCE_HARDWARE = 0x0004U, 93353a5a1b3Sopenharmony_ci /**< Is a hardware source of some kind, in contrast to 93453a5a1b3Sopenharmony_ci * "virtual"/software source \since 0.9.3 */ 93553a5a1b3Sopenharmony_ci 93653a5a1b3Sopenharmony_ci PA_SOURCE_NETWORK = 0x0008U, 93753a5a1b3Sopenharmony_ci /**< Is a networked source of some kind. \since 0.9.7 */ 93853a5a1b3Sopenharmony_ci 93953a5a1b3Sopenharmony_ci PA_SOURCE_HW_MUTE_CTRL = 0x0010U, 94053a5a1b3Sopenharmony_ci /**< Supports hardware mute control. This is a dynamic flag and may 94153a5a1b3Sopenharmony_ci * change at runtime after the source has initialized \since 0.9.11 */ 94253a5a1b3Sopenharmony_ci 94353a5a1b3Sopenharmony_ci PA_SOURCE_DECIBEL_VOLUME = 0x0020U, 94453a5a1b3Sopenharmony_ci /**< Volume can be translated to dB with pa_sw_volume_to_dB(). This is a 94553a5a1b3Sopenharmony_ci * dynamic flag and may change at runtime after the source has initialized 94653a5a1b3Sopenharmony_ci * \since 0.9.11 */ 94753a5a1b3Sopenharmony_ci 94853a5a1b3Sopenharmony_ci PA_SOURCE_DYNAMIC_LATENCY = 0x0040U, 94953a5a1b3Sopenharmony_ci /**< The latency can be adjusted dynamically depending on the 95053a5a1b3Sopenharmony_ci * needs of the connected streams. \since 0.9.15 */ 95153a5a1b3Sopenharmony_ci 95253a5a1b3Sopenharmony_ci PA_SOURCE_FLAT_VOLUME = 0x0080U, 95353a5a1b3Sopenharmony_ci /**< This source is in flat volume mode, i.e.\ always the maximum of 95453a5a1b3Sopenharmony_ci * the volume of all connected outputs. \since 1.0 */ 95553a5a1b3Sopenharmony_ci 95653a5a1b3Sopenharmony_ci#ifdef __INCLUDED_FROM_PULSE_AUDIO 95753a5a1b3Sopenharmony_ci/** \cond fulldocs */ 95853a5a1b3Sopenharmony_ci /* PRIVATE: Server-side values -- do not try to use these at client-side. 95953a5a1b3Sopenharmony_ci * The server will filter out these flags anyway, so you should never see 96053a5a1b3Sopenharmony_ci * these flags in sources. */ 96153a5a1b3Sopenharmony_ci 96253a5a1b3Sopenharmony_ci PA_SOURCE_SHARE_VOLUME_WITH_MASTER = 0x1000000U, 96353a5a1b3Sopenharmony_ci /**< This source shares the volume with the master source (used by some filter 96453a5a1b3Sopenharmony_ci * sources). */ 96553a5a1b3Sopenharmony_ci 96653a5a1b3Sopenharmony_ci PA_SOURCE_DEFERRED_VOLUME = 0x2000000U, 96753a5a1b3Sopenharmony_ci /**< The HW volume changes are syncronized with SW volume. */ 96853a5a1b3Sopenharmony_ci#endif 96953a5a1b3Sopenharmony_ci} pa_source_flags_t; 97053a5a1b3Sopenharmony_ci 97153a5a1b3Sopenharmony_ci/** \cond fulldocs */ 97253a5a1b3Sopenharmony_ci#define PA_SOURCE_HW_VOLUME_CTRL PA_SOURCE_HW_VOLUME_CTRL 97353a5a1b3Sopenharmony_ci#define PA_SOURCE_LATENCY PA_SOURCE_LATENCY 97453a5a1b3Sopenharmony_ci#define PA_SOURCE_HARDWARE PA_SOURCE_HARDWARE 97553a5a1b3Sopenharmony_ci#define PA_SOURCE_NETWORK PA_SOURCE_NETWORK 97653a5a1b3Sopenharmony_ci#define PA_SOURCE_HW_MUTE_CTRL PA_SOURCE_HW_MUTE_CTRL 97753a5a1b3Sopenharmony_ci#define PA_SOURCE_DECIBEL_VOLUME PA_SOURCE_DECIBEL_VOLUME 97853a5a1b3Sopenharmony_ci#define PA_SOURCE_DYNAMIC_LATENCY PA_SOURCE_DYNAMIC_LATENCY 97953a5a1b3Sopenharmony_ci#define PA_SOURCE_FLAT_VOLUME PA_SOURCE_FLAT_VOLUME 98053a5a1b3Sopenharmony_ci#ifdef __INCLUDED_FROM_PULSE_AUDIO 98153a5a1b3Sopenharmony_ci#define PA_SOURCE_CLIENT_FLAGS_MASK 0xFFFFFF 98253a5a1b3Sopenharmony_ci#endif 98353a5a1b3Sopenharmony_ci 98453a5a1b3Sopenharmony_ci/** \endcond */ 98553a5a1b3Sopenharmony_ci 98653a5a1b3Sopenharmony_ci/** Source state. \since 0.9.15 */ 98753a5a1b3Sopenharmony_citypedef enum pa_source_state { 98853a5a1b3Sopenharmony_ci PA_SOURCE_INVALID_STATE = -1, 98953a5a1b3Sopenharmony_ci /**< This state is used when the server does not support source state introspection \since 0.9.15 */ 99053a5a1b3Sopenharmony_ci 99153a5a1b3Sopenharmony_ci PA_SOURCE_RUNNING = 0, 99253a5a1b3Sopenharmony_ci /**< Running, source is recording and used by at least one non-corked source-output \since 0.9.15 */ 99353a5a1b3Sopenharmony_ci 99453a5a1b3Sopenharmony_ci PA_SOURCE_IDLE = 1, 99553a5a1b3Sopenharmony_ci /**< When idle, the source is still recording but there is no non-corked source-output \since 0.9.15 */ 99653a5a1b3Sopenharmony_ci 99753a5a1b3Sopenharmony_ci PA_SOURCE_SUSPENDED = 2, 99853a5a1b3Sopenharmony_ci /**< When suspended, actual source access can be closed, for instance \since 0.9.15 */ 99953a5a1b3Sopenharmony_ci 100053a5a1b3Sopenharmony_ci/** \cond fulldocs */ 100153a5a1b3Sopenharmony_ci /* PRIVATE: Server-side values -- DO NOT USE THIS ON THE CLIENT 100253a5a1b3Sopenharmony_ci * SIDE! These values are *not* considered part of the official PA 100353a5a1b3Sopenharmony_ci * API/ABI. If you use them your application might break when PA 100453a5a1b3Sopenharmony_ci * is upgraded. Also, please note that these values are not useful 100553a5a1b3Sopenharmony_ci * on the client side anyway. */ 100653a5a1b3Sopenharmony_ci 100753a5a1b3Sopenharmony_ci PA_SOURCE_INIT = -2, 100853a5a1b3Sopenharmony_ci /**< Initialization state */ 100953a5a1b3Sopenharmony_ci 101053a5a1b3Sopenharmony_ci PA_SOURCE_UNLINKED = -3 101153a5a1b3Sopenharmony_ci /**< The state when the source is getting unregistered and removed from client access */ 101253a5a1b3Sopenharmony_ci/** \endcond */ 101353a5a1b3Sopenharmony_ci 101453a5a1b3Sopenharmony_ci} pa_source_state_t; 101553a5a1b3Sopenharmony_ci 101653a5a1b3Sopenharmony_ci/** Returns non-zero if source is recording: running or idle. \since 0.9.15 */ 101753a5a1b3Sopenharmony_cistatic inline int PA_SOURCE_IS_OPENED(pa_source_state_t x) { 101853a5a1b3Sopenharmony_ci return x == PA_SOURCE_RUNNING || x == PA_SOURCE_IDLE; 101953a5a1b3Sopenharmony_ci} 102053a5a1b3Sopenharmony_ci 102153a5a1b3Sopenharmony_ci/** Returns non-zero if source is running \since 1.0 */ 102253a5a1b3Sopenharmony_cistatic inline int PA_SOURCE_IS_RUNNING(pa_source_state_t x) { 102353a5a1b3Sopenharmony_ci return x == PA_SOURCE_RUNNING; 102453a5a1b3Sopenharmony_ci} 102553a5a1b3Sopenharmony_ci 102653a5a1b3Sopenharmony_ci/** \cond fulldocs */ 102753a5a1b3Sopenharmony_ci#define PA_SOURCE_INVALID_STATE PA_SOURCE_INVALID_STATE 102853a5a1b3Sopenharmony_ci#define PA_SOURCE_RUNNING PA_SOURCE_RUNNING 102953a5a1b3Sopenharmony_ci#define PA_SOURCE_IDLE PA_SOURCE_IDLE 103053a5a1b3Sopenharmony_ci#define PA_SOURCE_SUSPENDED PA_SOURCE_SUSPENDED 103153a5a1b3Sopenharmony_ci#define PA_SOURCE_INIT PA_SOURCE_INIT 103253a5a1b3Sopenharmony_ci#define PA_SOURCE_UNLINKED PA_SOURCE_UNLINKED 103353a5a1b3Sopenharmony_ci#define PA_SOURCE_IS_OPENED PA_SOURCE_IS_OPENED 103453a5a1b3Sopenharmony_ci/** \endcond */ 103553a5a1b3Sopenharmony_ci 103653a5a1b3Sopenharmony_ci/** A generic free() like callback prototype */ 103753a5a1b3Sopenharmony_citypedef void (*pa_free_cb_t)(void *p); 103853a5a1b3Sopenharmony_ci 103953a5a1b3Sopenharmony_ci/** A stream policy/meta event requesting that an application should 104053a5a1b3Sopenharmony_ci * cork a specific stream. See pa_stream_event_cb_t for more 104153a5a1b3Sopenharmony_ci * information. \since 0.9.15 */ 104253a5a1b3Sopenharmony_ci#define PA_STREAM_EVENT_REQUEST_CORK "request-cork" 104353a5a1b3Sopenharmony_ci 104453a5a1b3Sopenharmony_ci/** A stream policy/meta event requesting that an application should 104553a5a1b3Sopenharmony_ci * cork a specific stream. See pa_stream_event_cb_t for more 104653a5a1b3Sopenharmony_ci * information, \since 0.9.15 */ 104753a5a1b3Sopenharmony_ci#define PA_STREAM_EVENT_REQUEST_UNCORK "request-uncork" 104853a5a1b3Sopenharmony_ci 104953a5a1b3Sopenharmony_ci/** A stream event notifying that the stream is going to be 105053a5a1b3Sopenharmony_ci * disconnected because the underlying sink changed and no longer 105153a5a1b3Sopenharmony_ci * supports the format that was originally negotiated. Clients need 105253a5a1b3Sopenharmony_ci * to connect a new stream to renegotiate a format and continue 105353a5a1b3Sopenharmony_ci * playback. \since 1.0 */ 105453a5a1b3Sopenharmony_ci#define PA_STREAM_EVENT_FORMAT_LOST "format-lost" 105553a5a1b3Sopenharmony_ci 105653a5a1b3Sopenharmony_ci#ifndef __INCLUDED_FROM_PULSE_AUDIO 105753a5a1b3Sopenharmony_ci/** Port availability / jack detection status 105853a5a1b3Sopenharmony_ci * \since 2.0 */ 105953a5a1b3Sopenharmony_citypedef enum pa_port_available { 106053a5a1b3Sopenharmony_ci PA_PORT_AVAILABLE_UNKNOWN = 0, /**< This port does not support jack detection \since 2.0 */ 106153a5a1b3Sopenharmony_ci PA_PORT_AVAILABLE_NO = 1, /**< This port is not available, likely because the jack is not plugged in. \since 2.0 */ 106253a5a1b3Sopenharmony_ci PA_PORT_AVAILABLE_YES = 2, /**< This port is available, likely because the jack is plugged in. \since 2.0 */ 106353a5a1b3Sopenharmony_ci} pa_port_available_t; 106453a5a1b3Sopenharmony_ci 106553a5a1b3Sopenharmony_ci/** \cond fulldocs */ 106653a5a1b3Sopenharmony_ci#define PA_PORT_AVAILABLE_UNKNOWN PA_PORT_AVAILABLE_UNKNOWN 106753a5a1b3Sopenharmony_ci#define PA_PORT_AVAILABLE_NO PA_PORT_AVAILABLE_NO 106853a5a1b3Sopenharmony_ci#define PA_PORT_AVAILABLE_YES PA_PORT_AVAILABLE_YES 106953a5a1b3Sopenharmony_ci 107053a5a1b3Sopenharmony_ci/** \endcond */ 107153a5a1b3Sopenharmony_ci#endif 107253a5a1b3Sopenharmony_ci 107353a5a1b3Sopenharmony_ci/** Port type. New types can be added in the future, so applications should 107453a5a1b3Sopenharmony_ci * gracefully handle situations where a type identifier doesn't match any item 107553a5a1b3Sopenharmony_ci * in this enumeration. \since 14.0 */ 107653a5a1b3Sopenharmony_citypedef enum pa_device_port_type { 107753a5a1b3Sopenharmony_ci PA_DEVICE_PORT_TYPE_UNKNOWN = 0, 107853a5a1b3Sopenharmony_ci PA_DEVICE_PORT_TYPE_AUX = 1, 107953a5a1b3Sopenharmony_ci PA_DEVICE_PORT_TYPE_SPEAKER = 2, 108053a5a1b3Sopenharmony_ci PA_DEVICE_PORT_TYPE_HEADPHONES = 3, 108153a5a1b3Sopenharmony_ci PA_DEVICE_PORT_TYPE_LINE = 4, 108253a5a1b3Sopenharmony_ci PA_DEVICE_PORT_TYPE_MIC = 5, 108353a5a1b3Sopenharmony_ci PA_DEVICE_PORT_TYPE_HEADSET = 6, 108453a5a1b3Sopenharmony_ci PA_DEVICE_PORT_TYPE_HANDSET = 7, 108553a5a1b3Sopenharmony_ci PA_DEVICE_PORT_TYPE_EARPIECE = 8, 108653a5a1b3Sopenharmony_ci PA_DEVICE_PORT_TYPE_SPDIF = 9, 108753a5a1b3Sopenharmony_ci PA_DEVICE_PORT_TYPE_HDMI = 10, 108853a5a1b3Sopenharmony_ci PA_DEVICE_PORT_TYPE_TV = 11, 108953a5a1b3Sopenharmony_ci PA_DEVICE_PORT_TYPE_RADIO = 12, 109053a5a1b3Sopenharmony_ci PA_DEVICE_PORT_TYPE_VIDEO = 13, 109153a5a1b3Sopenharmony_ci PA_DEVICE_PORT_TYPE_USB = 14, 109253a5a1b3Sopenharmony_ci PA_DEVICE_PORT_TYPE_BLUETOOTH = 15, 109353a5a1b3Sopenharmony_ci PA_DEVICE_PORT_TYPE_PORTABLE = 16, 109453a5a1b3Sopenharmony_ci PA_DEVICE_PORT_TYPE_HANDSFREE = 17, 109553a5a1b3Sopenharmony_ci PA_DEVICE_PORT_TYPE_CAR = 18, 109653a5a1b3Sopenharmony_ci PA_DEVICE_PORT_TYPE_HIFI = 19, 109753a5a1b3Sopenharmony_ci PA_DEVICE_PORT_TYPE_PHONE = 20, 109853a5a1b3Sopenharmony_ci PA_DEVICE_PORT_TYPE_NETWORK = 21, 109953a5a1b3Sopenharmony_ci PA_DEVICE_PORT_TYPE_ANALOG = 22, 110053a5a1b3Sopenharmony_ci} pa_device_port_type_t; 110153a5a1b3Sopenharmony_ci 110253a5a1b3Sopenharmony_ciPA_C_DECL_END 110353a5a1b3Sopenharmony_ci 110453a5a1b3Sopenharmony_ci#endif 1105