blob: 4a9c610fd9b8cb0f634539e5258c5ef17fdfba4a [file] [log] [blame]
Shiv Maliyappanahalli34b585f2013-10-01 15:49:05 -07001/*
Shiv Maliyappanahalli3e064fd2013-12-16 15:54:40 -08002 * Copyright (c) 2013-2014, The Linux Foundation. All rights reserved.
Shiv Maliyappanahalli34b585f2013-10-01 15:49:05 -07003 * Not a contribution.
4 *
Shiv Maliyappanahalli8911f282014-01-10 15:56:19 -08005 * Copyright (C) 2013 The Android Open Source Project
Shiv Maliyappanahalli34b585f2013-10-01 15:49:05 -07006 *
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 Maliyappanahallif3b9a422013-10-22 16:38:08 -070023#ifdef MULTI_VOICE_SESSION_ENABLED
Shiv Maliyappanahalli3bb73582013-11-05 12:49:15 -080024int voice_extn_start_call(struct audio_device *adev);
25int voice_extn_stop_call(struct audio_device *adev);
Shiv Maliyappanahalli34b585f2013-10-01 15:49:05 -070026int voice_extn_get_session_from_use_case(struct audio_device *adev,
27 const audio_usecase_t usecase_id,
28 struct voice_session **session);
Shiv Maliyappanahalli3bb73582013-11-05 12:49:15 -080029void voice_extn_init(struct audio_device *adev);
Shiv Maliyappanahalli34b585f2013-10-01 15:49:05 -070030int voice_extn_set_parameters(struct audio_device *adev,
31 struct str_parms *parms);
Narsinga Rao Chella1eceff82013-12-02 19:25:28 -080032void voice_extn_get_parameters(const struct audio_device *adev,
33 struct str_parms *query,
34 struct str_parms *reply);
Shiv Maliyappanahalli34b585f2013-10-01 15:49:05 -070035int voice_extn_is_in_call(struct audio_device *adev, bool *in_call);
kunleiza1a9ee02014-04-24 18:46:22 +080036int voice_extn_is_in_call_rec_stream(struct stream_in *in, bool *in_call_rec);
Shiv Maliyappanahallida107642013-10-17 11:16:13 -070037int voice_extn_get_active_session_id(struct audio_device *adev,
38 uint32_t *session_id);
Narsinga Rao Chella05573b72013-11-15 15:21:40 -080039void voice_extn_in_get_parameters(struct stream_in *in,
40 struct str_parms *query,
41 struct str_parms *reply);
42void voice_extn_out_get_parameters(struct stream_out *out,
43 struct str_parms *query,
44 struct str_parms *reply);
Shiv Maliyappanahallif3b9a422013-10-22 16:38:08 -070045#else
Shiv Maliyappanahalli3bb73582013-11-05 12:49:15 -080046static int voice_extn_start_call(struct audio_device *adev)
47{
48 return -ENOSYS;
49}
50
51static int voice_extn_stop_call(struct audio_device *adev)
Shiv Maliyappanahalli34b585f2013-10-01 15:49:05 -070052{
53 return -ENOSYS;
54}
55
Shiv Maliyappanahallif3b9a422013-10-22 16:38:08 -070056static 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 Maliyappanahalli34b585f2013-10-01 15:49:05 -070059{
60 return -ENOSYS;
61}
62
Shiv Maliyappanahalli3bb73582013-11-05 12:49:15 -080063static void voice_extn_init(struct audio_device *adev)
Shiv Maliyappanahalli34b585f2013-10-01 15:49:05 -070064{
Shiv Maliyappanahalli34b585f2013-10-01 15:49:05 -070065}
66
Shiv Maliyappanahallif3b9a422013-10-22 16:38:08 -070067static int voice_extn_set_parameters(struct audio_device *adev,
68 struct str_parms *parms)
Shiv Maliyappanahalli34b585f2013-10-01 15:49:05 -070069{
70 return -ENOSYS;
71}
72
Narsinga Rao Chella1eceff82013-12-02 19:25:28 -080073static void voice_extn_get_parameters(const struct audio_device *adev,
74 struct str_parms *query,
75 struct str_parms *reply)
76{
77}
78
Shiv Maliyappanahallif3b9a422013-10-22 16:38:08 -070079static int voice_extn_is_in_call(struct audio_device *adev, bool *in_call)
Shiv Maliyappanahalli34b585f2013-10-01 15:49:05 -070080{
81 return -ENOSYS;
82}
Shiv Maliyappanahallif3b9a422013-10-22 16:38:08 -070083
kunleiza1a9ee02014-04-24 18:46:22 +080084static int voice_extn_is_in_call_rec_stream(struct stream_in *in, bool *in_call_rec)
85{
86 return -ENOSYS;
87}
88
Shiv Maliyappanahallif3b9a422013-10-22 16:38:08 -070089static int voice_extn_get_active_session_id(struct audio_device *adev,
90 uint32_t *session_id)
91{
92 return -ENOSYS;
93}
Narsinga Rao Chella05573b72013-11-15 15:21:40 -080094
95static void voice_extn_in_get_parameters(struct stream_in *in,
96 struct str_parms *query,
97 struct str_parms *reply)
98{
99}
100
101static void voice_extn_out_get_parameters(struct stream_out *out,
102 struct str_parms *query,
103 struct str_parms *reply)
104{
105}
Shiv Maliyappanahallif3b9a422013-10-22 16:38:08 -0700106#endif
107
Shiv Maliyappanahalli303f51d2013-10-25 16:24:27 -0700108#ifdef INCALL_MUSIC_ENABLED
Shiv Maliyappanahallif3b9a422013-10-22 16:38:08 -0700109int voice_extn_check_and_set_incall_music_usecase(struct audio_device *adev,
110 struct stream_out *out);
111#else
112static int voice_extn_check_and_set_incall_music_usecase(struct audio_device *adev,
113 struct stream_out *out)
Shiv Maliyappanahallida107642013-10-17 11:16:13 -0700114{
115 return -ENOSYS;
116}
Shiv Maliyappanahalli34b585f2013-10-01 15:49:05 -0700117#endif
118
Narsinga Rao Chella05573b72013-11-15 15:21:40 -0800119#ifdef COMPRESS_VOIP_ENABLED
120int voice_extn_compress_voip_close_output_stream(struct audio_stream *stream);
121int voice_extn_compress_voip_open_output_stream(struct stream_out *out);
122
123int voice_extn_compress_voip_close_input_stream(struct audio_stream *stream);
124int voice_extn_compress_voip_open_input_stream(struct stream_in *in);
125
126int voice_extn_compress_voip_out_get_buffer_size(struct stream_out *out);
127int voice_extn_compress_voip_in_get_buffer_size(struct stream_in *in);
128
129int voice_extn_compress_voip_start_input_stream(struct stream_in *in);
130int voice_extn_compress_voip_start_output_stream(struct stream_out *out);
131
132int voice_extn_compress_voip_set_mic_mute(struct audio_device *dev, bool state);
133int voice_extn_compress_voip_set_volume(struct audio_device *adev, float volume);
134int 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 Maliyappanahalli3e064fd2013-12-16 15:54:40 -0800137int voice_extn_compress_voip_set_parameters(struct audio_device *adev,
Narsinga Rao Chella05573b72013-11-15 15:21:40 -0800138 struct str_parms *parms);
Narsinga Rao Chella707e7512014-01-10 10:18:13 -0800139void voice_extn_compress_voip_get_parameters(const struct audio_device *adev,
140 struct str_parms *query,
141 struct str_parms *reply);
Narsinga Rao Chella05573b72013-11-15 15:21:40 -0800142
143void voice_extn_compress_voip_out_get_parameters(struct stream_out *out,
144 struct str_parms *query,
145 struct str_parms *reply);
146void voice_extn_compress_voip_in_get_parameters(struct stream_in *in,
147 struct str_parms *query,
148 struct str_parms *reply);
149bool voice_extn_compress_voip_pcm_prop_check();
150bool voice_extn_compress_voip_is_active(struct audio_device *adev);
151bool voice_extn_compress_voip_is_format_supported(audio_format_t format);
Narsinga Rao Chella1eceff82013-12-02 19:25:28 -0800152bool voice_extn_compress_voip_is_config_supported(struct audio_config *config);
Narsinga Rao Chella05573b72013-11-15 15:21:40 -0800153#else
154static 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
160static 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
166static 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
172static 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 Chella7a9e59d2014-01-06 10:36:27 -0800178static int voice_extn_compress_voip_out_get_buffer_size(struct stream_out *stream)
Narsinga Rao Chella05573b72013-11-15 15:21:40 -0800179{
180 ALOGE("%s: COMPRESS_VOIP_ENABLED is not defined", __func__);
181 return -ENOSYS;
182}
183
184static 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
190static 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
196static 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
202static 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
208static 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
214static 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 Maliyappanahalli3e064fd2013-12-16 15:54:40 -0800222static int voice_extn_compress_voip_set_parameters(struct audio_device *adev,
Narsinga Rao Chella05573b72013-11-15 15:21:40 -0800223 struct str_parms *parms)
224{
225 ALOGE("%s: COMPRESS_VOIP_ENABLED is not defined", __func__);
Shiv Maliyappanahalli3e064fd2013-12-16 15:54:40 -0800226 return -ENOSYS;
Narsinga Rao Chella05573b72013-11-15 15:21:40 -0800227}
228
Narsinga Rao Chella707e7512014-01-10 10:18:13 -0800229static 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 Chella05573b72013-11-15 15:21:40 -0800236static 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
243static 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
250static bool voice_extn_compress_voip_pcm_prop_check()
251{
252 ALOGE("%s: COMPRESS_VOIP_ENABLED is not defined", __func__);
253 return false;
254}
255
256static 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 Chella1eceff82013-12-02 19:25:28 -0800261
Narsinga Rao Chella05573b72013-11-15 15:21:40 -0800262static 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 Chella1eceff82013-12-02 19:25:28 -0800267
268static 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 Chella05573b72013-11-15 15:21:40 -0800273#endif
274
Shiv Maliyappanahalli34b585f2013-10-01 15:49:05 -0700275#endif //VOICE_EXTN_H