blob: c5cc2f5469f8d9d9b284679c3bc967676e018b9a [file] [log] [blame]
Christopher N. Hesse41c9f3d2017-02-02 20:48:56 +01001/*
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
22struct voice_session {
23 struct ril_handle ril;
24
25 struct pcm *pcm_voice_rx;
26 struct pcm *pcm_voice_tx;
27
Andreas Schneider49b9dcb2017-02-13 17:15:07 +010028 int wb_amr_type;
Christopher N. Hesse41c9f3d2017-02-02 20:48:56 +010029 bool two_mic_control;
30 bool two_mic_disabled;
31
32 /* from uc_info */
33 audio_devices_t out_device;
Christopher N. Hesse6a960022018-01-29 03:28:10 +010034
35 /* parent container */
36 struct voice_data *vdata;
Christopher N. Hesse41c9f3d2017-02-02 20:48:56 +010037};
38
Christopher N. Hesse696959d2017-02-02 20:49:55 +010039void prepare_voice_session(struct voice_session *session,
40 audio_devices_t active_out_devices);
41int start_voice_session(struct voice_session *session);
42void stop_voice_session(struct voice_session *session);
43void set_voice_session_volume(struct voice_session *session, float volume);
44void set_voice_session_audio_path(struct voice_session *session);
Andreas Schneider107a8482017-02-06 12:36:31 +010045void set_voice_session_mic_mute(struct voice_session *session, bool state);
Christopher N. Hesse696959d2017-02-02 20:49:55 +010046
stenkinevgeniy53929f72018-07-09 11:20:36 +000047void start_voice_session_bt_sco(struct audio_device *adev);
48void stop_voice_session_bt_sco(struct audio_device *adev);
Andreas Schneider05bc1882017-02-09 14:03:11 +010049
Andreas Schneider82f32482017-02-06 09:00:48 +010050bool voice_session_uses_twomic(struct voice_session *session);
Andreas Schneider59486fa2017-02-06 09:16:39 +010051bool voice_session_uses_wideband(struct voice_session *session);
Andreas Schneider82f32482017-02-06 09:00:48 +010052
Christopher N. Hesse696959d2017-02-02 20:49:55 +010053struct voice_session *voice_session_init(struct audio_device *adev);
Christopher N. Hesse41c9f3d2017-02-02 20:48:56 +010054void voice_session_deinit(struct voice_session *s);
55
56#endif /* VOICE_CALL_H */