Shiv Maliyappanahalli | 34b585f | 2013-10-01 15:49:05 -0700 | [diff] [blame] | 1 | /* |
Shiv Maliyappanahalli | 3e064fd | 2013-12-16 15:54:40 -0800 | [diff] [blame] | 2 | * Copyright (c) 2013-2014, The Linux Foundation. All rights reserved. |
Shiv Maliyappanahalli | 34b585f | 2013-10-01 15:49:05 -0700 | [diff] [blame] | 3 | * Not a contribution. |
| 4 | * |
Shiv Maliyappanahalli | 8911f28 | 2014-01-10 15:56:19 -0800 | [diff] [blame] | 5 | * Copyright (C) 2013 The Android Open Source Project |
Shiv Maliyappanahalli | 34b585f | 2013-10-01 15:49:05 -0700 | [diff] [blame] | 6 | * |
| 7 | * Licensed under the Apache License, Version 2.0 (the "License"); |
| 8 | * you may not use this file except in compliance with the License. |
| 9 | * You may obtain a copy of the License at |
| 10 | * |
| 11 | * http://www.apache.org/licenses/LICENSE-2.0 |
| 12 | * |
| 13 | * Unless required by applicable law or agreed to in writing, software |
| 14 | * distributed under the License is distributed on an "AS IS" BASIS, |
| 15 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| 16 | * See the License for the specific language governing permissions and |
| 17 | * limitations under the License. |
| 18 | */ |
| 19 | |
| 20 | #ifndef VOICE_EXTN_H |
| 21 | #define VOICE_EXTN_H |
| 22 | |
Shiv Maliyappanahalli | f3b9a42 | 2013-10-22 16:38:08 -0700 | [diff] [blame] | 23 | #ifdef MULTI_VOICE_SESSION_ENABLED |
Shiv Maliyappanahalli | 3bb7358 | 2013-11-05 12:49:15 -0800 | [diff] [blame] | 24 | int voice_extn_start_call(struct audio_device *adev); |
| 25 | int voice_extn_stop_call(struct audio_device *adev); |
Shiv Maliyappanahalli | 34b585f | 2013-10-01 15:49:05 -0700 | [diff] [blame] | 26 | int voice_extn_get_session_from_use_case(struct audio_device *adev, |
| 27 | const audio_usecase_t usecase_id, |
| 28 | struct voice_session **session); |
Shiv Maliyappanahalli | 3bb7358 | 2013-11-05 12:49:15 -0800 | [diff] [blame] | 29 | void voice_extn_init(struct audio_device *adev); |
Shiv Maliyappanahalli | 34b585f | 2013-10-01 15:49:05 -0700 | [diff] [blame] | 30 | int voice_extn_set_parameters(struct audio_device *adev, |
| 31 | struct str_parms *parms); |
Narsinga Rao Chella | 1eceff8 | 2013-12-02 19:25:28 -0800 | [diff] [blame] | 32 | void voice_extn_get_parameters(const struct audio_device *adev, |
| 33 | struct str_parms *query, |
| 34 | struct str_parms *reply); |
Shiv Maliyappanahalli | 34b585f | 2013-10-01 15:49:05 -0700 | [diff] [blame] | 35 | int voice_extn_is_in_call(struct audio_device *adev, bool *in_call); |
kunleiz | a1a9ee0 | 2014-04-24 18:46:22 +0800 | [diff] [blame^] | 36 | int voice_extn_is_in_call_rec_stream(struct stream_in *in, bool *in_call_rec); |
Shiv Maliyappanahalli | da10764 | 2013-10-17 11:16:13 -0700 | [diff] [blame] | 37 | int voice_extn_get_active_session_id(struct audio_device *adev, |
| 38 | uint32_t *session_id); |
Narsinga Rao Chella | 05573b7 | 2013-11-15 15:21:40 -0800 | [diff] [blame] | 39 | void voice_extn_in_get_parameters(struct stream_in *in, |
| 40 | struct str_parms *query, |
| 41 | struct str_parms *reply); |
| 42 | void voice_extn_out_get_parameters(struct stream_out *out, |
| 43 | struct str_parms *query, |
| 44 | struct str_parms *reply); |
Shiv Maliyappanahalli | f3b9a42 | 2013-10-22 16:38:08 -0700 | [diff] [blame] | 45 | #else |
Shiv Maliyappanahalli | 3bb7358 | 2013-11-05 12:49:15 -0800 | [diff] [blame] | 46 | static int voice_extn_start_call(struct audio_device *adev) |
| 47 | { |
| 48 | return -ENOSYS; |
| 49 | } |
| 50 | |
| 51 | static int voice_extn_stop_call(struct audio_device *adev) |
Shiv Maliyappanahalli | 34b585f | 2013-10-01 15:49:05 -0700 | [diff] [blame] | 52 | { |
| 53 | return -ENOSYS; |
| 54 | } |
| 55 | |
Shiv Maliyappanahalli | f3b9a42 | 2013-10-22 16:38:08 -0700 | [diff] [blame] | 56 | static int voice_extn_get_session_from_use_case(struct audio_device *adev, |
| 57 | const audio_usecase_t usecase_id, |
| 58 | struct voice_session **session) |
Shiv Maliyappanahalli | 34b585f | 2013-10-01 15:49:05 -0700 | [diff] [blame] | 59 | { |
| 60 | return -ENOSYS; |
| 61 | } |
| 62 | |
Shiv Maliyappanahalli | 3bb7358 | 2013-11-05 12:49:15 -0800 | [diff] [blame] | 63 | static void voice_extn_init(struct audio_device *adev) |
Shiv Maliyappanahalli | 34b585f | 2013-10-01 15:49:05 -0700 | [diff] [blame] | 64 | { |
Shiv Maliyappanahalli | 34b585f | 2013-10-01 15:49:05 -0700 | [diff] [blame] | 65 | } |
| 66 | |
Shiv Maliyappanahalli | f3b9a42 | 2013-10-22 16:38:08 -0700 | [diff] [blame] | 67 | static int voice_extn_set_parameters(struct audio_device *adev, |
| 68 | struct str_parms *parms) |
Shiv Maliyappanahalli | 34b585f | 2013-10-01 15:49:05 -0700 | [diff] [blame] | 69 | { |
| 70 | return -ENOSYS; |
| 71 | } |
| 72 | |
Narsinga Rao Chella | 1eceff8 | 2013-12-02 19:25:28 -0800 | [diff] [blame] | 73 | static void voice_extn_get_parameters(const struct audio_device *adev, |
| 74 | struct str_parms *query, |
| 75 | struct str_parms *reply) |
| 76 | { |
| 77 | } |
| 78 | |
Shiv Maliyappanahalli | f3b9a42 | 2013-10-22 16:38:08 -0700 | [diff] [blame] | 79 | static int voice_extn_is_in_call(struct audio_device *adev, bool *in_call) |
Shiv Maliyappanahalli | 34b585f | 2013-10-01 15:49:05 -0700 | [diff] [blame] | 80 | { |
| 81 | return -ENOSYS; |
| 82 | } |
Shiv Maliyappanahalli | f3b9a42 | 2013-10-22 16:38:08 -0700 | [diff] [blame] | 83 | |
kunleiz | a1a9ee0 | 2014-04-24 18:46:22 +0800 | [diff] [blame^] | 84 | static int voice_extn_is_in_call_rec_stream(struct stream_in *in, bool *in_call_rec) |
| 85 | { |
| 86 | return -ENOSYS; |
| 87 | } |
| 88 | |
Shiv Maliyappanahalli | f3b9a42 | 2013-10-22 16:38:08 -0700 | [diff] [blame] | 89 | static int voice_extn_get_active_session_id(struct audio_device *adev, |
| 90 | uint32_t *session_id) |
| 91 | { |
| 92 | return -ENOSYS; |
| 93 | } |
Narsinga Rao Chella | 05573b7 | 2013-11-15 15:21:40 -0800 | [diff] [blame] | 94 | |
| 95 | static void voice_extn_in_get_parameters(struct stream_in *in, |
| 96 | struct str_parms *query, |
| 97 | struct str_parms *reply) |
| 98 | { |
| 99 | } |
| 100 | |
| 101 | static void voice_extn_out_get_parameters(struct stream_out *out, |
| 102 | struct str_parms *query, |
| 103 | struct str_parms *reply) |
| 104 | { |
| 105 | } |
Shiv Maliyappanahalli | f3b9a42 | 2013-10-22 16:38:08 -0700 | [diff] [blame] | 106 | #endif |
| 107 | |
Shiv Maliyappanahalli | 303f51d | 2013-10-25 16:24:27 -0700 | [diff] [blame] | 108 | #ifdef INCALL_MUSIC_ENABLED |
Shiv Maliyappanahalli | f3b9a42 | 2013-10-22 16:38:08 -0700 | [diff] [blame] | 109 | int voice_extn_check_and_set_incall_music_usecase(struct audio_device *adev, |
| 110 | struct stream_out *out); |
| 111 | #else |
| 112 | static int voice_extn_check_and_set_incall_music_usecase(struct audio_device *adev, |
| 113 | struct stream_out *out) |
Shiv Maliyappanahalli | da10764 | 2013-10-17 11:16:13 -0700 | [diff] [blame] | 114 | { |
| 115 | return -ENOSYS; |
| 116 | } |
Shiv Maliyappanahalli | 34b585f | 2013-10-01 15:49:05 -0700 | [diff] [blame] | 117 | #endif |
| 118 | |
Narsinga Rao Chella | 05573b7 | 2013-11-15 15:21:40 -0800 | [diff] [blame] | 119 | #ifdef COMPRESS_VOIP_ENABLED |
| 120 | int voice_extn_compress_voip_close_output_stream(struct audio_stream *stream); |
| 121 | int voice_extn_compress_voip_open_output_stream(struct stream_out *out); |
| 122 | |
| 123 | int voice_extn_compress_voip_close_input_stream(struct audio_stream *stream); |
| 124 | int voice_extn_compress_voip_open_input_stream(struct stream_in *in); |
| 125 | |
| 126 | int voice_extn_compress_voip_out_get_buffer_size(struct stream_out *out); |
| 127 | int voice_extn_compress_voip_in_get_buffer_size(struct stream_in *in); |
| 128 | |
| 129 | int voice_extn_compress_voip_start_input_stream(struct stream_in *in); |
| 130 | int voice_extn_compress_voip_start_output_stream(struct stream_out *out); |
| 131 | |
| 132 | int voice_extn_compress_voip_set_mic_mute(struct audio_device *dev, bool state); |
| 133 | int voice_extn_compress_voip_set_volume(struct audio_device *adev, float volume); |
| 134 | int voice_extn_compress_voip_select_devices(struct audio_device *adev, |
| 135 | snd_device_t *out_snd_device, |
| 136 | snd_device_t *in_snd_device); |
Shiv Maliyappanahalli | 3e064fd | 2013-12-16 15:54:40 -0800 | [diff] [blame] | 137 | int voice_extn_compress_voip_set_parameters(struct audio_device *adev, |
Narsinga Rao Chella | 05573b7 | 2013-11-15 15:21:40 -0800 | [diff] [blame] | 138 | struct str_parms *parms); |
Narsinga Rao Chella | 707e751 | 2014-01-10 10:18:13 -0800 | [diff] [blame] | 139 | void voice_extn_compress_voip_get_parameters(const struct audio_device *adev, |
| 140 | struct str_parms *query, |
| 141 | struct str_parms *reply); |
Narsinga Rao Chella | 05573b7 | 2013-11-15 15:21:40 -0800 | [diff] [blame] | 142 | |
| 143 | void voice_extn_compress_voip_out_get_parameters(struct stream_out *out, |
| 144 | struct str_parms *query, |
| 145 | struct str_parms *reply); |
| 146 | void voice_extn_compress_voip_in_get_parameters(struct stream_in *in, |
| 147 | struct str_parms *query, |
| 148 | struct str_parms *reply); |
| 149 | bool voice_extn_compress_voip_pcm_prop_check(); |
| 150 | bool voice_extn_compress_voip_is_active(struct audio_device *adev); |
| 151 | bool voice_extn_compress_voip_is_format_supported(audio_format_t format); |
Narsinga Rao Chella | 1eceff8 | 2013-12-02 19:25:28 -0800 | [diff] [blame] | 152 | bool voice_extn_compress_voip_is_config_supported(struct audio_config *config); |
Narsinga Rao Chella | 05573b7 | 2013-11-15 15:21:40 -0800 | [diff] [blame] | 153 | #else |
| 154 | static int voice_extn_compress_voip_close_output_stream(struct audio_stream *stream) |
| 155 | { |
| 156 | ALOGE("%s: COMPRESS_VOIP_ENABLED is not defined", __func__); |
| 157 | return -ENOSYS; |
| 158 | } |
| 159 | |
| 160 | static int voice_extn_compress_voip_open_output_stream(struct stream_out *out) |
| 161 | { |
| 162 | ALOGE("%s: COMPRESS_VOIP_ENABLED is not defined", __func__); |
| 163 | return -ENOSYS; |
| 164 | } |
| 165 | |
| 166 | static int voice_extn_compress_voip_close_input_stream(struct audio_stream *stream) |
| 167 | { |
| 168 | ALOGE("%s: COMPRESS_VOIP_ENABLED is not defined", __func__); |
| 169 | return -ENOSYS; |
| 170 | } |
| 171 | |
| 172 | static int voice_extn_compress_voip_open_input_stream(struct stream_in *in) |
| 173 | { |
| 174 | ALOGE("%s: COMPRESS_VOIP_ENABLED is not defined", __func__); |
| 175 | return -ENOSYS; |
| 176 | } |
| 177 | |
Narsinga Rao Chella | 7a9e59d | 2014-01-06 10:36:27 -0800 | [diff] [blame] | 178 | static int voice_extn_compress_voip_out_get_buffer_size(struct stream_out *stream) |
Narsinga Rao Chella | 05573b7 | 2013-11-15 15:21:40 -0800 | [diff] [blame] | 179 | { |
| 180 | ALOGE("%s: COMPRESS_VOIP_ENABLED is not defined", __func__); |
| 181 | return -ENOSYS; |
| 182 | } |
| 183 | |
| 184 | static int voice_extn_compress_voip_in_get_buffer_size(struct stream_in *in) |
| 185 | { |
| 186 | ALOGE("%s: COMPRESS_VOIP_ENABLED is not defined", __func__); |
| 187 | return -ENOSYS; |
| 188 | } |
| 189 | |
| 190 | static int voice_extn_compress_voip_start_input_stream(struct stream_in *in) |
| 191 | { |
| 192 | ALOGE("%s: COMPRESS_VOIP_ENABLED is not defined", __func__); |
| 193 | return -ENOSYS; |
| 194 | } |
| 195 | |
| 196 | static int voice_extn_compress_voip_start_output_stream(struct stream_out *out) |
| 197 | { |
| 198 | ALOGE("%s: COMPRESS_VOIP_ENABLED is not defined", __func__); |
| 199 | return -ENOSYS; |
| 200 | } |
| 201 | |
| 202 | static int voice_extn_compress_voip_set_mic_mute(struct audio_device *adev, bool state) |
| 203 | { |
| 204 | ALOGE("%s: COMPRESS_VOIP_ENABLED is not defined", __func__); |
| 205 | return 0; |
| 206 | } |
| 207 | |
| 208 | static int voice_extn_compress_voip_set_volume(struct audio_device *adev, float volume) |
| 209 | { |
| 210 | ALOGE("%s: COMPRESS_VOIP_ENABLED is not defined", __func__); |
| 211 | return 0; |
| 212 | } |
| 213 | |
| 214 | static int voice_extn_compress_voip_select_devices(struct audio_device *adev, |
| 215 | snd_device_t *out_snd_device, |
| 216 | snd_device_t *in_snd_device) |
| 217 | { |
| 218 | ALOGE("%s: COMPRESS_VOIP_ENABLED is not defined", __func__); |
| 219 | return -ENOSYS; |
| 220 | } |
| 221 | |
Shiv Maliyappanahalli | 3e064fd | 2013-12-16 15:54:40 -0800 | [diff] [blame] | 222 | static int voice_extn_compress_voip_set_parameters(struct audio_device *adev, |
Narsinga Rao Chella | 05573b7 | 2013-11-15 15:21:40 -0800 | [diff] [blame] | 223 | struct str_parms *parms) |
| 224 | { |
| 225 | ALOGE("%s: COMPRESS_VOIP_ENABLED is not defined", __func__); |
Shiv Maliyappanahalli | 3e064fd | 2013-12-16 15:54:40 -0800 | [diff] [blame] | 226 | return -ENOSYS; |
Narsinga Rao Chella | 05573b7 | 2013-11-15 15:21:40 -0800 | [diff] [blame] | 227 | } |
| 228 | |
Narsinga Rao Chella | 707e751 | 2014-01-10 10:18:13 -0800 | [diff] [blame] | 229 | static void voice_extn_compress_voip_get_parameters(const struct audio_device *adev, |
| 230 | struct str_parms *query, |
| 231 | struct str_parms *reply) |
| 232 | { |
| 233 | ALOGE("%s: COMPRESS_VOIP_ENABLED is not defined", __func__); |
| 234 | } |
| 235 | |
Narsinga Rao Chella | 05573b7 | 2013-11-15 15:21:40 -0800 | [diff] [blame] | 236 | static void voice_extn_compress_voip_out_get_parameters(struct stream_out *out, |
| 237 | struct str_parms *query, |
| 238 | struct str_parms *reply) |
| 239 | { |
| 240 | ALOGE("%s: COMPRESS_VOIP_ENABLED is not defined", __func__); |
| 241 | } |
| 242 | |
| 243 | static void voice_extn_compress_voip_in_get_parameters(struct stream_in *in, |
| 244 | struct str_parms *query, |
| 245 | struct str_parms *reply) |
| 246 | { |
| 247 | ALOGE("%s: COMPRESS_VOIP_ENABLED is not defined", __func__); |
| 248 | } |
| 249 | |
| 250 | static bool voice_extn_compress_voip_pcm_prop_check() |
| 251 | { |
| 252 | ALOGE("%s: COMPRESS_VOIP_ENABLED is not defined", __func__); |
| 253 | return false; |
| 254 | } |
| 255 | |
| 256 | static bool voice_extn_compress_voip_is_active(struct audio_device *adev) |
| 257 | { |
| 258 | ALOGE("%s: COMPRESS_VOIP_ENABLED is not defined", __func__); |
| 259 | return false; |
| 260 | } |
Narsinga Rao Chella | 1eceff8 | 2013-12-02 19:25:28 -0800 | [diff] [blame] | 261 | |
Narsinga Rao Chella | 05573b7 | 2013-11-15 15:21:40 -0800 | [diff] [blame] | 262 | static bool voice_extn_compress_voip_is_format_supported(audio_format_t format) |
| 263 | { |
| 264 | ALOGE("%s: COMPRESS_VOIP_ENABLED is not defined", __func__); |
| 265 | return true; |
| 266 | } |
Narsinga Rao Chella | 1eceff8 | 2013-12-02 19:25:28 -0800 | [diff] [blame] | 267 | |
| 268 | static bool voice_extn_compress_voip_is_config_supported(struct audio_config *config) |
| 269 | { |
| 270 | ALOGE("%s: COMPRESS_VOIP_ENABLED is not defined", __func__); |
| 271 | return true; |
| 272 | } |
Narsinga Rao Chella | 05573b7 | 2013-11-15 15:21:40 -0800 | [diff] [blame] | 273 | #endif |
| 274 | |
Shiv Maliyappanahalli | 34b585f | 2013-10-01 15:49:05 -0700 | [diff] [blame] | 275 | #endif //VOICE_EXTN_H |