[1.0.26] Change to use effect_method API 26/296226/4 accepted/tizen/unified/20230727.173032
authorJaechul Lee <jcsing.lee@samsung.com>
Mon, 24 Jul 2023 05:41:01 +0000 (14:41 +0900)
committerJaechul Lee <jcsing.lee@samsung.com>
Tue, 25 Jul 2023 06:55:22 +0000 (15:55 +0900)
- AEC APIs in sound-manager have been changed.

Change-Id: I499202b4d380c547c0132d0269beab50af0ecadc
Signed-off-by: Jaechul Lee <jcsing.lee@samsung.com>
packaging/capi-media-transporter.spec
src/MediaSourceBinMic.cpp
test/mtpr_test.c

index d3ea673..3cf03e4 100644 (file)
@@ -1,6 +1,6 @@
 Name:       capi-media-transporter
 Summary:    A Media Transporter library in Tizen Native API
-Version:    1.0.25
+Version:    1.0.26
 Release:    0
 Group:      Multimedia/API
 License:    Apache-2.0
index dc0ec0e..80646ae 100644 (file)
@@ -26,6 +26,7 @@
 #include <pulse/proplist.h>
 #include <algorithm>
 #include <sstream>
+#include <cassert>
 
 using namespace tizen_media_transporter;
 
@@ -100,7 +101,7 @@ void MediaSourceBinMic::setSoundStreamInfo(sound_stream_info_h streamInfo)
        char *stream_type;
        int stream_index;
        int aec_ref_device_id = 0;
-       sound_acoustic_echo_cancel_type_e aec_type;
+       sound_effect_method_with_reference_e method;
 
        // bool available = false;
 
@@ -108,7 +109,6 @@ void MediaSourceBinMic::setSoundStreamInfo(sound_stream_info_h streamInfo)
 
        sound_manager_get_type_from_stream_information(streamInfo, &stream_type);
        sound_manager_get_index_from_stream_information(streamInfo, &stream_index);
-       sound_manager_get_echo_cancel_reference_device(streamInfo, &aec_ref_device_id, &aec_type);
 
        /* FIXEME: need to add NATIVE_API_MEDIATRANSPORTER in sound-manager */
        // ret = sound_manager_is_available_stream_information(stream_info, NATIVE_API_MEDIATRANSPORTER, &available);
@@ -124,15 +124,21 @@ void MediaSourceBinMic::setSoundStreamInfo(sound_stream_info_h streamInfo)
 
        RET_IF(!stream_type, "stream_type is NULL");
 
-       LOG_INFO("stream_info[%p, type:%s, index:%d, aec_ref_device_id:%d, aec_type:%d]",
-               streamInfo, stream_type, stream_index, aec_ref_device_id, aec_type);
-
        std::ostringstream stringStream;
        stringStream << "props," << PA_PROP_MEDIA_ROLE << "=" <<
                stream_type << ", " << PA_PROP_MEDIA_PARENT_ID << "=" << stream_index;
-       if (aec_ref_device_id != SOUND_MANAGER_STREAM_NO_REFERENCE_DEVICE)
+
+       if (sound_manager_get_effect_method_with_reference(streamInfo, &method, &aec_ref_device_id) == SOUND_MANAGER_ERROR_NONE) {
+               assert(method == SOUND_EFFECT_ACOUSTIC_ECHO_CANCEL_WEBRTC);
                stringStream << ", " << PA_PROP_MEDIA_PREPROCESSOR_METHOD << "webrtc, "
                 << PA_PROP_MEDIA_ECHO_CANCEL_REFERENCE_DEVICE << aec_ref_device_id;
 
+               LOG_INFO("stream_info[%p, type:%s, index:%d, method:0x%x, aec_ref_device_id:%d]",
+               streamInfo, stream_type, stream_index, method, aec_ref_device_id);
+       } else {
+               LOG_INFO("stream_info[%p, type:%s, index:%d]",
+               streamInfo, stream_type, stream_index);
+       }
+
        _streamInfo = stringStream.str();
 }
index 74a09c4..ba8df71 100644 (file)
@@ -599,7 +599,7 @@ static void __set_aec_reference_device(sound_stream_info_h stream_info)
 
                found = true;
 
-               ret = sound_manager_set_echo_cancel_reference_device(stream_info, device, SOUND_ACOUSTIC_ECHO_CANCEL_VOICE_CALL);
+               ret = sound_manager_set_effect_method_with_reference(stream_info, SOUND_EFFECT_ACOUSTIC_ECHO_CANCEL_WEBRTC, device);
                if (ret != SOUND_MANAGER_ERROR_NONE) {
                        g_printerr("failed to sound_manager_set_echo_cancel_reference_device()\n");
                } else {