[Feature][ZXW-285]merge P56U05 version
Only Configure: No
Affected branch: master
Affected module: unknow
Is it affected on both ZXIC and MTK: only ZXIC
Self-test: Yes
Doc Update: No
Change-Id: Ied657102425a179a89ef41847170152e8a5d437c
diff --git a/ap/lib/libvoice/voiceipc.c b/ap/lib/libvoice/voiceipc.c
index a3f5569..33561f0 100755
--- a/ap/lib/libvoice/voiceipc.c
+++ b/ap/lib/libvoice/voiceipc.c
@@ -23,6 +23,10 @@
extern int sc_audio_get_tx_voice_mute_state(int *p_mute);
extern int sc_audio_set_rx_voice_mute_state(int mute);
extern int sc_audio_get_rx_voice_mute_state(int *p_mute);
+extern int sc_audio_set_rx_voice_vol_gain(int gain);
+extern int sc_audio_get_rx_voice_vol_gain(int * p_gain);
+extern int sc_audio_set_tx_voice_vol_gain(int gain);
+extern int sc_audio_get_tx_voice_vol_gain(int * p_gain);
//extern int sc_audio_set_loopback_enable_state(int enable);
//extern int sc_audio_get_loopback_enable_state(int *p_enable);
int ap_audio_set_loopback_enable(int dev_mode,int enable);
@@ -262,6 +266,98 @@
}
}
+void ipc_set_rx_voice_vol_gain_rcv(voice_ipc_control_msg msg)
+{
+ int ret = VOICEIPC_OK;
+ int msg_len = 0;
+ int gain = 0;
+
+ //memcpy(&dev_mode, msg.param, msg.param_len);
+ gain = *((int *)msg.param);
+ ret = sc_audio_set_rx_voice_vol_gain(gain);
+
+ //msg.func_id不变
+ msg.param_len = sizeof(int);
+ memcpy(msg.param, &ret, msg.param_len);
+ msg_len = VOICE_HEAD_LEN + msg.param_len;
+
+ ret = write(voice_ipc_fd, &msg, msg_len);
+
+ if (0 >= ret){
+ printf("%s: write error(%d)!\n", __func__, ret);
+ }
+}
+
+void ipc_get_rx_voice_vol_gain_rcv(voice_ipc_control_msg msg)
+{
+ int ret = VOICEIPC_OK;
+ int msg_len = 0;
+ int *p_vol = NULL;
+
+ p_vol = (int *)msg.param;
+ ret = sc_audio_get_rx_voice_vol_gain(p_vol);
+
+ //msg.func_id不变
+ msg.param_len = sizeof(int);
+ if(0 == ret)
+ memcpy(msg.param, p_vol, msg.param_len);
+ else
+ memcpy(msg.param, &ret, msg.param_len);
+ msg_len = VOICE_HEAD_LEN + msg.param_len;
+
+ ret = write(voice_ipc_fd, &msg, msg_len);
+
+ if (0 >= ret){
+ printf("%s: write error(%d)!\n", __func__, ret);
+ }
+}
+
+void ipc_set_tx_voice_vol_gain_rcv(voice_ipc_control_msg msg)
+{
+ int ret = VOICEIPC_OK;
+ int msg_len = 0;
+ int gain = 0;
+
+ //memcpy(&dev_mode, msg.param, msg.param_len);
+ gain = *((int *)msg.param);
+ ret = sc_audio_set_tx_voice_vol_gain(gain);
+
+ //msg.func_id不变
+ msg.param_len = sizeof(int);
+ memcpy(msg.param, &ret, msg.param_len);
+ msg_len = VOICE_HEAD_LEN + msg.param_len;
+
+ ret = write(voice_ipc_fd, &msg, msg_len);
+
+ if (0 >= ret){
+ printf("%s: write error(%d)!\n", __func__, ret);
+ }
+}
+
+void ipc_get_tx_voice_vol_gain_rcv(voice_ipc_control_msg msg)
+{
+ int ret = VOICEIPC_OK;
+ int msg_len = 0;
+ int *p_vol = NULL;
+
+ p_vol = (int *)msg.param;
+ ret = sc_audio_get_tx_voice_vol_gain(p_vol);
+
+ //msg.func_id不变
+ msg.param_len = sizeof(int);
+ if(0 == ret)
+ memcpy(msg.param, p_vol, msg.param_len);
+ else
+ memcpy(msg.param, &ret, msg.param_len);
+ msg_len = VOICE_HEAD_LEN + msg.param_len;
+
+ ret = write(voice_ipc_fd, &msg, msg_len);
+
+ if (0 >= ret){
+ printf("%s: write error(%d)!\n", __func__, ret);
+ }
+}
+
void ipc_set_tx_voice_vol_rcv(voice_ipc_control_msg msg)
{
int ret = VOICEIPC_OK;
@@ -509,6 +605,18 @@
case IPC_GET_RX_VOICE_VOL:
ipc_get_rx_voice_vol_rcv(voice_ctrl_recvmsg[msg.func_id]);
break;
+ case IPC_SET_RX_VOICE_VOL_GAIN:
+ ipc_set_rx_voice_vol_gain_rcv(voice_ctrl_recvmsg[msg.func_id]);
+ break;
+ case IPC_GET_RX_VOICE_VOL_GAIN:
+ ipc_get_rx_voice_vol_gain_rcv(voice_ctrl_recvmsg[msg.func_id]);
+ break;
+ case IPC_SET_TX_VOICE_VOL_GAIN:
+ ipc_set_tx_voice_vol_gain_rcv(voice_ctrl_recvmsg[msg.func_id]);
+ break;
+ case IPC_GET_TX_VOICE_VOL_GAIN:
+ ipc_get_tx_voice_vol_gain_rcv(voice_ctrl_recvmsg[msg.func_id]);
+ break;
case IPC_SET_TX_VOICE_VOL:
ipc_set_tx_voice_vol_rcv(voice_ctrl_recvmsg[msg.func_id]);
break;