[Feature][ZXW-452]merge P54U02 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: I17e6795ab66e2b9d1cbbfec4b7c0028d666e177d
diff --git a/ap/lib/libatext/ext_audio_func.c b/ap/lib/libatext/ext_audio_func.c
index 143a6d2..d12ed7d 100755
--- a/ap/lib/libatext/ext_audio_func.c
+++ b/ap/lib/libatext/ext_audio_func.c
@@ -14,9 +14,13 @@
#include "ext_cmux_func.h"
#ifdef _USE_VOICE_ALSA
#include "tinyalsa/audio_mixer_ctrl.h"
-#include "voice_lib.h"
+//#include "voice_lib.h"
#include "voice_ipc.h"
#endif
+#if (defined _USE_VOICE_ALSA) || (defined _VBUFF_IN_SINGLE_CORE)
+#include "voice_lib.h"
+#endif
+
//#include "ext_regist.h"
//#include "softap_api.h"
//#include "at_utils.h"
@@ -519,7 +523,47 @@
return AT_END;
}
+#endif
+#ifdef _VBUFF_IN_SINGLE_CORE
+int extAt_VBUFFER_act_func (int at_fd, char * at_paras, void * *res_msg, int * res_msglen)
+{
+ char *at_str = NULL;
+ UINT32 ret = DRV_SUCCESS;
+
+ int mode = 0;
+ int enable = 0;
+
+ UINT16 onOff = 0;
+ at_str = at_paras;
+ printf("extAt_VBUFFER_act_func, at_paras:%s \n", at_paras);
+
+ ret = sscanf (at_str, "%d", &enable);
+ onOff = enable;
+ printf("extAt_VBUFFER_act_func enable=%d,ret=%d\n",enable,ret);
+
+ if (ret == 1) {
+ if(onOff == 1)
+ {
+ ret = vbuffer_stream_start();
+ printf("extAt_VBUFFER_act_func vbuffer_stream_start,ret=%d\n",ret);
+ }
+ else
+ {
+ ret = vbuffer_stream_stop();
+ printf("extAt_VBUFFER_act_func vbuffer_stream_stop,ret=%d\n",ret);
+ }
+ if (ret == DRV_SUCCESS) {
+ *res_msg = at_ok_build();
+ *res_msglen = strlen (*res_msg);
+ return AT_END;
+ }
+ }
+ *res_msg = at_err_build(ATERR_PROC_FAILED);
+ *res_msglen = strlen (*res_msg);
+
+ return AT_END;
+}
#endif
void ext_audio_regist_init(void)
@@ -545,6 +589,11 @@
register_serv_func2("CAP_VALSA=", 0, 0, 0, extAt_CAP_VALSA_act_func, NULL);
#endif
+
+#ifdef _VBUFF_IN_SINGLE_CORE
+ register_serv_func2("VBUFFER=", 0, 0, 0, extAt_VBUFFER_act_func, NULL);
+#endif
+
}
#endif