Home | History | Annotate | Download | only in voice_extn
      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
     21 int voice_extn_start_call(struct audio_device *adev);
     22 int voice_extn_stop_call(struct audio_device *adev);
     23 int voice_extn_get_session_from_use_case(struct audio_device *adev,
     24                                          const audio_usecase_t usecase_id,
     25                                          struct voice_session **session);
     26 void voice_extn_init(struct audio_device *adev);
     27 int voice_extn_set_parameters(struct audio_device *adev,
     28                               struct str_parms *parms);
     29 void voice_extn_get_parameters(const struct audio_device *adev,
     30                                struct str_parms *query,
     31                                struct str_parms *reply);
     32 int voice_extn_is_in_call_rec_stream(struct stream_in *in, bool *in_call_rec);
     33 int voice_extn_get_active_session_id(struct audio_device *adev,
     34                                      uint32_t *session_id);
     35 int voice_extn_is_call_state_active(struct audio_device *adev,
     36                                     bool *is_call_active);
     37 #else
     38 static int voice_extn_start_call(struct audio_device *adev __unused)
     39 {
     40     return -ENOSYS;
     41 }
     42 
     43 static int voice_extn_stop_call(struct audio_device *adev __unused)
     44 {
     45     return -ENOSYS;
     46 }
     47 
     48 static 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 
     55 static void voice_extn_init(struct audio_device *adev __unused)
     56 {
     57 }
     58 
     59 static int voice_extn_set_parameters(struct audio_device *adev __unused,
     60                                      struct str_parms *parms __unused)
     61 {
     62     return -ENOSYS;
     63 }
     64 
     65 static 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 
     71 static int voice_extn_is_call_state_active(struct audio_device *adev __unused,
     72                                            bool *is_call_active __unused)
     73 {
     74     return -ENOSYS;
     75 }
     76 
     77 static int voice_extn_is_in_call_rec_stream(struct stream_in *in __unused, bool *in_call_rec __unused)
     78 {
     79     return -ENOSYS;
     80 }
     81 
     82 static 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
     91 int voice_extn_check_and_set_incall_music_usecase(struct audio_device *adev,
     92                                                   struct stream_out *out);
     93 #else
     94 static 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