Temporary integration with ma_ap library 08/238108/2 accepted/tizen/unified/20200709.164649 submit/tizen/20200709.044120
authorJi-hoon Lee <dalton.lee@samsung.com>
Tue, 12 May 2020 09:37:20 +0000 (18:37 +0900)
committerJi-hoon Lee <dalton.lee@samsung.com>
Wed, 8 Jul 2020 13:01:33 +0000 (22:01 +0900)
Change-Id: Ib76300f7dfe19072669e43d1b33898a6ff8b5ce8

CMakeLists.txt
packaging/voice-control.spec
server/vcd_recorder.c

index 857467731a4b0591001cbc2b4a354fc842a7b999..90fc56be8f5179d514a91d209fa811108c00b155 100644 (file)
@@ -48,12 +48,12 @@ INCLUDE(FindPkgConfig)
 IF("${_TV_PRODUCT}" STREQUAL "TRUE")
 pkg_check_modules(pkgs REQUIRED
     aul buxton2 capi-appfw-app-control capi-appfw-app-manager capi-base-common capi-media-audio-io capi-media-sound-manager ecore-wl2
-    capi-network-bluetooth capi-network-bluetooth-tv capi-system-info cynara-client cynara-session dbus-1 db-util dlog ecore glib-2.0 json-glib-1.0 libgum libtzplatform-config libxml-2.0 sqlite3 vconf msfapi farfield-voice-api
+    capi-network-bluetooth capi-network-bluetooth-tv capi-system-info cynara-client cynara-session dbus-1 db-util dlog ecore glib-2.0 json-glib-1.0 libgum libtzplatform-config libxml-2.0 sqlite3 vconf msfapi farfield-voice-api multi-assistant
 )
 ELSE()
 pkg_check_modules(pkgs REQUIRED
     aul buxton2 capi-appfw-app-control capi-appfw-app-manager capi-base-common capi-media-audio-io capi-media-sound-manager ecore-wl2
-    capi-system-info cynara-client cynara-session dbus-1 db-util dlog ecore glib-2.0 json-glib-1.0 libgum libtzplatform-config libxml-2.0 sqlite3 vconf
+    capi-system-info cynara-client cynara-session dbus-1 db-util dlog ecore glib-2.0 json-glib-1.0 libgum libtzplatform-config libxml-2.0 sqlite3 vconf multi-assistant
 )
 ENDIF()
 
index 1d9f2d3c36c1dcc514d63dfccd417b09a58147c5..78801c1a97fc69d51db868efe4476a4a0f5fbe17 100644 (file)
@@ -40,6 +40,7 @@ BuildRequires:  pkgconfig(msfapi)
 BuildRequires:  pkgconfig(farfield-voice-api)
 %endif
 BuildRequires:  pkgconfig(vconf)
+BuildRequires:  pkgconfig(multi-assistant)
 BuildRequires:  cmake
 
 %description
index a2d26486bf2e36e8f4549f5b76f7efb764664939..7a48d61b7875de4d6a00b7f7fd68061f32e3c958 100644 (file)
@@ -43,6 +43,8 @@
 #include "vcd_recorder.h"
 #include "vcd_main.h"
 
+#include <multi_assistant_internal.h>
+
 #define FRAME_LENGTH 160
 #define BUFFER_LENGTH FRAME_LENGTH * 2
 
@@ -258,6 +260,25 @@ static void _ffv_audio_function_cb(void* data, unsigned int length, void* user_d
 }
 #endif
 
+void audio_streaming_cb(ma_audio_streaming_event_e event, char* buffer, int len, void* user_data)
+{
+       if (0 == g_buffer_count || 0 == g_buffer_count % 50) {
+               SLOG(LOG_INFO, TAG_VCD, "[Recorder INFO] MA_ap audio function callback is invoked");
+
+               if (100000 == g_buffer_count) {
+                       g_buffer_count = 0;
+               }
+       }
+
+       g_buffer_count++;
+
+       if (NULL != g_audio_cb) {
+               if (0 != g_audio_cb(buffer, len)) {
+                       SLOG(LOG_ERROR, TAG_VCD, "[Recorder ERROR] Fail to read audio");
+               }
+       }
+}
+
 #if 1
 static const char* __get_focus_changed_reason_code(sound_stream_focus_change_reason_e reason)
 {
@@ -504,11 +525,15 @@ int vcd_recorder_create(vcd_recoder_audio_cb audio_cb, vcd_recorder_interrupt_cb
 
        SLOG(LOG_INFO, TAG_VCD, "[Recorder] Audio type : %s", g_current_audio_type);
 
+       ma_ap_initialize();
+       ma_ap_set_audio_streaming_cb(audio_streaming_cb, NULL);
+
        return 0;
 }
 
 int vcd_recorder_destroy()
 {
+       ma_ap_deinitialize();
        if (VCD_RECORDER_STATE_RECORDING == g_recorder_state) {
                if (0 == strncmp(VCE_AUDIO_ID_BLUETOOTH, g_current_audio_type, strlen(VCE_AUDIO_ID_BLUETOOTH))) {
 #ifdef TV_BT_MODE