1 #ifndef foonativecommonhfoo 2 #define foonativecommonhfoo 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 <pulse/cdecl.h> 25 #include <pulse/def.h> 26 27 #include <pulsecore/pdispatch.h> 28 #include <pulsecore/pstream.h> 29 #include <pulsecore/tagstruct.h> 30 31 PA_C_DECL_BEGIN 32 33 enum { 34 /* Generic commands */ 35 PA_COMMAND_ERROR, 36 PA_COMMAND_TIMEOUT, /* pseudo command */ 37 PA_COMMAND_REPLY, 38 39 /* CLIENT->SERVER */ 40 PA_COMMAND_CREATE_PLAYBACK_STREAM, /* Payload changed in v9, v12 (0.9.0, 0.9.8) */ 41 PA_COMMAND_DELETE_PLAYBACK_STREAM, 42 PA_COMMAND_CREATE_RECORD_STREAM, /* Payload changed in v9, v12 (0.9.0, 0.9.8) */ 43 PA_COMMAND_DELETE_RECORD_STREAM, 44 PA_COMMAND_EXIT, 45 PA_COMMAND_AUTH, 46 PA_COMMAND_SET_CLIENT_NAME, 47 PA_COMMAND_LOOKUP_SINK, 48 PA_COMMAND_LOOKUP_SOURCE, 49 PA_COMMAND_DRAIN_PLAYBACK_STREAM, 50 PA_COMMAND_STAT, 51 PA_COMMAND_GET_PLAYBACK_LATENCY, 52 PA_COMMAND_CREATE_UPLOAD_STREAM, 53 PA_COMMAND_DELETE_UPLOAD_STREAM, 54 PA_COMMAND_FINISH_UPLOAD_STREAM, 55 PA_COMMAND_PLAY_SAMPLE, 56 PA_COMMAND_REMOVE_SAMPLE, 57 58 PA_COMMAND_GET_SERVER_INFO, 59 PA_COMMAND_GET_SINK_INFO, 60 PA_COMMAND_GET_SINK_INFO_LIST, 61 PA_COMMAND_GET_SOURCE_INFO, 62 PA_COMMAND_GET_SOURCE_INFO_LIST, 63 PA_COMMAND_GET_MODULE_INFO, 64 PA_COMMAND_GET_MODULE_INFO_LIST, 65 PA_COMMAND_GET_CLIENT_INFO, 66 PA_COMMAND_GET_CLIENT_INFO_LIST, 67 PA_COMMAND_GET_SINK_INPUT_INFO, /* Payload changed in v11 (0.9.7) */ 68 PA_COMMAND_GET_SINK_INPUT_INFO_LIST, /* Payload changed in v11 (0.9.7) */ 69 PA_COMMAND_GET_SOURCE_OUTPUT_INFO, 70 PA_COMMAND_GET_SOURCE_OUTPUT_INFO_LIST, 71 PA_COMMAND_GET_SAMPLE_INFO, 72 PA_COMMAND_GET_SAMPLE_INFO_LIST, 73 PA_COMMAND_SUBSCRIBE, 74 75 PA_COMMAND_SET_SINK_VOLUME, 76 PA_COMMAND_SET_SINK_INPUT_VOLUME, 77 PA_COMMAND_SET_SOURCE_VOLUME, 78 79 PA_COMMAND_SET_SINK_MUTE, 80 PA_COMMAND_SET_SOURCE_MUTE, 81 82 PA_COMMAND_CORK_PLAYBACK_STREAM, 83 PA_COMMAND_FLUSH_PLAYBACK_STREAM, 84 PA_COMMAND_TRIGGER_PLAYBACK_STREAM, 85 86 PA_COMMAND_SET_DEFAULT_SINK, 87 PA_COMMAND_SET_DEFAULT_SOURCE, 88 89 PA_COMMAND_SET_PLAYBACK_STREAM_NAME, 90 PA_COMMAND_SET_RECORD_STREAM_NAME, 91 92 PA_COMMAND_KILL_CLIENT, 93 PA_COMMAND_KILL_SINK_INPUT, 94 PA_COMMAND_KILL_SOURCE_OUTPUT, 95 96 PA_COMMAND_LOAD_MODULE, 97 PA_COMMAND_UNLOAD_MODULE, 98 99 /* Obsolete */ 100 PA_COMMAND_ADD_AUTOLOAD___OBSOLETE, 101 PA_COMMAND_REMOVE_AUTOLOAD___OBSOLETE, 102 PA_COMMAND_GET_AUTOLOAD_INFO___OBSOLETE, 103 PA_COMMAND_GET_AUTOLOAD_INFO_LIST___OBSOLETE, 104 105 PA_COMMAND_GET_RECORD_LATENCY, 106 PA_COMMAND_CORK_RECORD_STREAM, 107 PA_COMMAND_FLUSH_RECORD_STREAM, 108 PA_COMMAND_PREBUF_PLAYBACK_STREAM, 109 110 /* SERVER->CLIENT */ 111 PA_COMMAND_REQUEST, 112 PA_COMMAND_OVERFLOW, 113 PA_COMMAND_UNDERFLOW, 114 PA_COMMAND_PLAYBACK_STREAM_KILLED, 115 PA_COMMAND_RECORD_STREAM_KILLED, 116 PA_COMMAND_SUBSCRIBE_EVENT, 117 118 /* A few more client->server commands */ 119 120 /* Supported since protocol v10 (0.9.5) */ 121 PA_COMMAND_MOVE_SINK_INPUT, 122 PA_COMMAND_MOVE_SOURCE_OUTPUT, 123 124 /* Supported since protocol v11 (0.9.7) */ 125 PA_COMMAND_SET_SINK_INPUT_MUTE, 126 127 PA_COMMAND_SUSPEND_SINK, 128 PA_COMMAND_SUSPEND_SOURCE, 129 130 /* Supported since protocol v12 (0.9.8) */ 131 PA_COMMAND_SET_PLAYBACK_STREAM_BUFFER_ATTR, 132 PA_COMMAND_SET_RECORD_STREAM_BUFFER_ATTR, 133 134 PA_COMMAND_UPDATE_PLAYBACK_STREAM_SAMPLE_RATE, 135 PA_COMMAND_UPDATE_RECORD_STREAM_SAMPLE_RATE, 136 137 /* SERVER->CLIENT */ 138 PA_COMMAND_PLAYBACK_STREAM_SUSPENDED, 139 PA_COMMAND_RECORD_STREAM_SUSPENDED, 140 PA_COMMAND_PLAYBACK_STREAM_MOVED, 141 PA_COMMAND_RECORD_STREAM_MOVED, 142 143 /* Supported since protocol v13 (0.9.11) */ 144 PA_COMMAND_UPDATE_RECORD_STREAM_PROPLIST, 145 PA_COMMAND_UPDATE_PLAYBACK_STREAM_PROPLIST, 146 PA_COMMAND_UPDATE_CLIENT_PROPLIST, 147 PA_COMMAND_REMOVE_RECORD_STREAM_PROPLIST, 148 PA_COMMAND_REMOVE_PLAYBACK_STREAM_PROPLIST, 149 PA_COMMAND_REMOVE_CLIENT_PROPLIST, 150 151 /* SERVER->CLIENT */ 152 PA_COMMAND_STARTED, 153 154 /* Supported since protocol v14 (0.9.12) */ 155 PA_COMMAND_EXTENSION, 156 157 /* Supported since protocol v15 (0.9.15) */ 158 PA_COMMAND_GET_CARD_INFO, 159 PA_COMMAND_GET_CARD_INFO_LIST, 160 PA_COMMAND_SET_CARD_PROFILE, 161 162 PA_COMMAND_CLIENT_EVENT, 163 PA_COMMAND_PLAYBACK_STREAM_EVENT, 164 PA_COMMAND_RECORD_STREAM_EVENT, 165 166 /* SERVER->CLIENT */ 167 PA_COMMAND_PLAYBACK_BUFFER_ATTR_CHANGED, 168 PA_COMMAND_RECORD_BUFFER_ATTR_CHANGED, 169 170 /* Supported since protocol v16 (0.9.16) */ 171 PA_COMMAND_SET_SINK_PORT, 172 PA_COMMAND_SET_SOURCE_PORT, 173 174 /* Supported since protocol v22 (1.0) */ 175 PA_COMMAND_SET_SOURCE_OUTPUT_VOLUME, 176 PA_COMMAND_SET_SOURCE_OUTPUT_MUTE, 177 178 /* Supported since protocol v27 (3.0) */ 179 PA_COMMAND_SET_PORT_LATENCY_OFFSET, 180 181 /* Supported since protocol v30 (6.0) */ 182 /* BOTH DIRECTIONS */ 183 PA_COMMAND_ENABLE_SRBCHANNEL, 184 PA_COMMAND_DISABLE_SRBCHANNEL, 185 186 /* Supported since protocol v31 (9.0) 187 * BOTH DIRECTIONS */ 188 PA_COMMAND_REGISTER_MEMFD_SHMID, 189 190 /* Supported since protocol v34 (14.0) */ 191 PA_COMMAND_SEND_OBJECT_MESSAGE, 192 193 PA_COMMAND_MAX 194 }; 195 196 #define PA_NATIVE_COOKIE_LENGTH 256 197 #define PA_NATIVE_COOKIE_FILE "cookie" 198 #define PA_NATIVE_COOKIE_FILE_FALLBACK ".pulse-cookie" 199 200 #define PA_NATIVE_DEFAULT_PORT 4713 201 202 #define PA_NATIVE_COOKIE_PROPERTY_NAME "protocol-native-cookie" 203 #define PA_NATIVE_SERVER_PROPERTY_NAME "protocol-native-server" 204 205 #define PA_NATIVE_DEFAULT_UNIX_SOCKET "native" 206 207 int pa_common_command_register_memfd_shmid(pa_pstream *p, pa_pdispatch *pd, uint32_t version, 208 uint32_t command, pa_tagstruct *t); 209 210 PA_C_DECL_END 211 212 #endif 213