voice_extn.h revision f1819247a21f755757a28ea313678faff73ef349
1/*
2 * Copyright (C) 2014 The Android Open Source Project
3 *
4 * Licensed under the Apache License, Version 2.0 (the "License");
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at
7 *
8 *      http://www.apache.org/licenses/LICENSE-2.0
9 *
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an "AS IS" BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
15 */
16
17#ifndef VOICE_EXTN_H
18#define VOICE_EXTN_H
19
20#ifdef MULTI_VOICE_SESSION_ENABLED
21int voice_extn_start_call(struct audio_device *adev);
22int voice_extn_stop_call(struct audio_device *adev);
23int voice_extn_get_session_from_use_case(struct audio_device *adev,
24                                         const audio_usecase_t usecase_id,
25                                         struct voice_session **session);
26void voice_extn_init(struct audio_device *adev);
27int voice_extn_set_parameters(struct audio_device *adev,
28                              struct str_parms *parms);
29void voice_extn_get_parameters(const struct audio_device *adev,
30                               struct str_parms *query,
31                               struct str_parms *reply);
32int voice_extn_is_in_call_rec_stream(struct stream_in *in, bool *in_call_rec);
33int voice_extn_get_active_session_id(struct audio_device *adev,
34                                     uint32_t *session_id);
35int voice_extn_is_call_state_active(struct audio_device *adev,
36                                    bool *is_call_active);
37#else
38static int voice_extn_start_call(struct audio_device *adev __unused)
39{
40    return -ENOSYS;
41}
42
43static int voice_extn_stop_call(struct audio_device *adev __unused)
44{
45    return -ENOSYS;
46}
47
48static int voice_extn_get_session_from_use_case(struct audio_device *adev __unused,
49                                                const audio_usecase_t usecase_id __unused,
50                                                struct voice_session **session __unused)
51{
52    return -ENOSYS;
53}
54
55static void voice_extn_init(struct audio_device *adev __unused)
56{
57}
58
59static int voice_extn_set_parameters(struct audio_device *adev __unused,
60                                     struct str_parms *parms __unused)
61{
62    return -ENOSYS;
63}
64
65static void voice_extn_get_parameters(const struct audio_device *adev __unused,
66                                      struct str_parms *query __unused,
67                                      struct str_parms *reply __unused)
68{
69}
70
71static int voice_extn_is_call_state_active(struct audio_device *adev __unused,
72                                           bool *is_call_active __unused)
73{
74    return -ENOSYS;
75}
76
77static int voice_extn_is_in_call_rec_stream(struct stream_in *in __unused, bool *in_call_rec __unused)
78{
79    return -ENOSYS;
80}
81
82static int voice_extn_get_active_session_id(struct audio_device *adev __unused,
83                                            uint32_t *session_id __unused)
84{
85    return -ENOSYS;
86}
87
88#endif
89
90#ifdef INCALL_MUSIC_ENABLED
91int voice_extn_check_and_set_incall_music_usecase(struct audio_device *adev,
92                                                  struct stream_out *out);
93#else
94static int voice_extn_check_and_set_incall_music_usecase(struct audio_device *adev __unused,
95                                                         struct stream_out *out __unused)
96{
97    return -ENOSYS;
98}
99#endif
100
101#endif //VOICE_EXTN_H
102