[Feature][T106][VOICE] add set and get mic volume

Only Configure: Yes
Affected branch: master
Affected module: voice
Is it affected on both ZXIC and MTK: only ZXIC
Self-test: Yes
Doc Update: No

Change-Id: I8804900986b5b07d8558ef159ed4eb874ba6de8c
diff --git a/cap/zx297520v3/sources/meta-zxic-custom/recipes-lynq/lynq-qser-voice-demo/files/lynq-qser-voice-demo.cpp b/cap/zx297520v3/sources/meta-zxic-custom/recipes-lynq/lynq-qser-voice-demo/files/lynq-qser-voice-demo.cpp
index e7eebc3..e9730f1 100755
--- a/cap/zx297520v3/sources/meta-zxic-custom/recipes-lynq/lynq-qser-voice-demo/files/lynq-qser-voice-demo.cpp
+++ b/cap/zx297520v3/sources/meta-zxic-custom/recipes-lynq/lynq-qser-voice-demo/files/lynq-qser-voice-demo.cpp
@@ -31,6 +31,8 @@
 #endif

     {9,   "qser_voice_set_audio_mode"},

     {10,  "qser_voice_get_audio_mode"},

+    {11,  "qser_voice_set_mic_volume"},

+    {12,  "qser_voice_get_mic_volume"},

     {-1,    NULL}

 };

 

@@ -56,6 +58,9 @@
 int (*qser_voice_set_audio_mode)(const int audio_mode);

 int (*qser_voice_get_audio_mode)(int* audio_mode);

 

+int (*qser_voice_set_mic_volume)(const int volume);

+int (*qser_voice_get_mic_volume)(int *volume);

+

 

 #ifdef ECALL_SUPPORT

 int (*qser_voice_set_test_num)(voice_client_handle_type*       h_voice,E_QSER_VOICE_ECALL_SET_TYPE_T type, const char *test_num, int test_num_length);

@@ -252,6 +257,19 @@
         printf("qser_voice_get_audio_mode not defined or exported in %s\n", lynqLibPath_Call);

         return -1;

     }

+     qser_voice_set_mic_volume = (int (*)(const int ))dlsym(dlHandle_call,"qser_voice_set_mic_volume");

+    if(qser_voice_set_mic_volume == NULL)    

+    {

+            printf("qser_voice_set_mic_volume not defined or exported in %s\n", lynqLibPath_Call);

+            return -1;

+    }

+   

+    qser_voice_get_mic_volume = (int (*)(int* ))dlsym(dlHandle_call,"qser_voice_get_mic_volume");

+    if(qser_voice_get_mic_volume == NULL)    

+    {

+            printf("qser_voice_get_mic_volume not defined or exported in %s\n", lynqLibPath_Call);

+            return -1;

+    }

     

     

     ret = qser_voice_call_client_init(&h_voice);

@@ -419,7 +437,25 @@
                 printf("qser_voice_get_audio_mode ret = %d, audio_mode is %d\n", ret, audio_mode);

                 break;

             }            

+            case 11:

+            {

+                int volume = 0;

+                printf("Please set mic volume:0-5 level\n");

+                scanf("%d",&volume);

+                ret = qser_voice_set_mic_volume(volume);

+                printf("ret is %d\n",ret);

+                break;

 

+            }

+

+            case 12:

+            {

+                int volume = -1;

+                printf("Enter get mic volume\n");

+                ret = qser_voice_get_mic_volume(&volume);

+                printf("ret is %d,get volume is %d\n",ret,volume);

+                break;

+            }

             default:

                 print_help();

                 break;

diff --git a/cap/zx297520v3/src/lynq/lib/liblynq-qser-voice/include/lynq-qser-voice.h b/cap/zx297520v3/src/lynq/lib/liblynq-qser-voice/include/lynq-qser-voice.h
index 1c4c586..c7fa8b0 100755
--- a/cap/zx297520v3/src/lynq/lib/liblynq-qser-voice/include/lynq-qser-voice.h
+++ b/cap/zx297520v3/src/lynq/lib/liblynq-qser-voice/include/lynq-qser-voice.h
@@ -107,6 +107,10 @@
 
 int qser_voice_get_audio_mode(E_QSER_VOICE_CALL_AUDIO_MODE_T* audio_mode);
 
+int qser_voice_set_mic_volume(const int volume);
+
+int qser_voice_get_mic_volume(int *volume);
+
 
 
 /*
diff --git a/cap/zx297520v3/src/lynq/lib/liblynq-qser-voice/lynq-qser-voice.cpp b/cap/zx297520v3/src/lynq/lib/liblynq-qser-voice/lynq-qser-voice.cpp
index dfd3448..b208a2b 100755
--- a/cap/zx297520v3/src/lynq/lib/liblynq-qser-voice/lynq-qser-voice.cpp
+++ b/cap/zx297520v3/src/lynq/lib/liblynq-qser-voice/lynq-qser-voice.cpp
@@ -268,6 +268,22 @@
    return lynq_get_voice_audio_mode((LYNQ_Audio_Mode*) audio_mode );
 }
 
+int qser_voice_set_mic_volume(const int volume)
+{
+    if(volume < MIN_VOLUME || volume > MAX_VOLUME)
+    {
+        LYERRLOG("Illeage inpu volume");
+        return RESULT_ERROR;
+    }
+    return lynq_set_mic_input_volume(volume);
+}
+
+
+int qser_voice_get_mic_volume(int *volume)
+{
+    return lynq_get_mic_input_volume(volume);
+}
+
 
 
 #ifdef ECALL_SUPPORT