Christopher N. Hesse | 41c9f3d | 2017-02-02 20:48:56 +0100 | [diff] [blame] | 1 | /* |
| 2 | * Copyright (C) 2017 Christopher N. Hesse <raymanfx@gmail.com> |
| 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_CALL_H |
| 18 | #define VOICE_CALL_H |
| 19 | |
| 20 | #include "ril_interface.h" |
| 21 | |
| 22 | struct voice_session { |
| 23 | struct ril_handle ril; |
| 24 | |
| 25 | struct pcm *pcm_voice_rx; |
| 26 | struct pcm *pcm_voice_tx; |
| 27 | |
Andreas Schneider | 05bc188 | 2017-02-09 14:03:11 +0100 | [diff] [blame] | 28 | struct pcm *pcm_sco_rx; |
| 29 | struct pcm *pcm_sco_tx; |
| 30 | |
Andreas Schneider | 49b9dcb | 2017-02-13 17:15:07 +0100 | [diff] [blame] | 31 | int wb_amr_type; |
Christopher N. Hesse | 41c9f3d | 2017-02-02 20:48:56 +0100 | [diff] [blame] | 32 | bool two_mic_control; |
| 33 | bool two_mic_disabled; |
| 34 | |
| 35 | /* from uc_info */ |
| 36 | audio_devices_t out_device; |
Christopher N. Hesse | 6a96002 | 2018-01-29 03:28:10 +0100 | [diff] [blame] | 37 | |
| 38 | /* parent container */ |
| 39 | struct voice_data *vdata; |
Christopher N. Hesse | 41c9f3d | 2017-02-02 20:48:56 +0100 | [diff] [blame] | 40 | }; |
| 41 | |
Christopher N. Hesse | 696959d | 2017-02-02 20:49:55 +0100 | [diff] [blame] | 42 | void prepare_voice_session(struct voice_session *session, |
| 43 | audio_devices_t active_out_devices); |
| 44 | int start_voice_session(struct voice_session *session); |
| 45 | void stop_voice_session(struct voice_session *session); |
| 46 | void set_voice_session_volume(struct voice_session *session, float volume); |
| 47 | void set_voice_session_audio_path(struct voice_session *session); |
Andreas Schneider | 107a848 | 2017-02-06 12:36:31 +0100 | [diff] [blame] | 48 | void set_voice_session_mic_mute(struct voice_session *session, bool state); |
Christopher N. Hesse | 696959d | 2017-02-02 20:49:55 +0100 | [diff] [blame] | 49 | |
Andreas Schneider | 05bc188 | 2017-02-09 14:03:11 +0100 | [diff] [blame] | 50 | void start_voice_session_bt_sco(struct voice_session *session); |
| 51 | |
Andreas Schneider | 82f3248 | 2017-02-06 09:00:48 +0100 | [diff] [blame] | 52 | bool voice_session_uses_twomic(struct voice_session *session); |
Andreas Schneider | 59486fa | 2017-02-06 09:16:39 +0100 | [diff] [blame] | 53 | bool voice_session_uses_wideband(struct voice_session *session); |
Andreas Schneider | 82f3248 | 2017-02-06 09:00:48 +0100 | [diff] [blame] | 54 | |
Christopher N. Hesse | 696959d | 2017-02-02 20:49:55 +0100 | [diff] [blame] | 55 | struct voice_session *voice_session_init(struct audio_device *adev); |
Christopher N. Hesse | 41c9f3d | 2017-02-02 20:48:56 +0100 | [diff] [blame] | 56 | void voice_session_deinit(struct voice_session *s); |
| 57 | |
| 58 | #endif /* VOICE_CALL_H */ |