AEC APIs in sound-manager have been changed.
[Version] 0.4.16
[Issue Type] Feature
Change-Id: Idd9a9988b80aa47e72639e14724d40ce0a4406b7
Signed-off-by: Jaechul Lee <jcsing.lee@samsung.com>
#define SIGNALING_MESSAGE_PREFIX_ICE_CANDIDATE "ICE_CANDIDATE"
#define SIGNALING_MESSAGE_PREFIX_ERROR "ERROR"
+#define STREAM_NO_REFERENCE_DEVICE 0
+
typedef enum {
MEDIA_TYPE_AUDIO = 0x01,
MEDIA_TYPE_VIDEO = 0x02,
Name: capi-media-webrtc
Summary: A WebRTC library in Tizen Native API
-Version: 0.4.15
+Version: 0.4.16
Release: 0
Group: Multimedia/API
License: Apache-2.0
GstStructure *structure;
g_autofree gchar *prop = NULL;
g_autofree gchar *prop_with_aec = NULL;
- bool aec = (aec_ref_device_id != SOUND_MANAGER_STREAM_NO_REFERENCE_DEVICE);
+ bool aec = false;
RET_VAL_IF(element == NULL, WEBRTC_ERROR_INVALID_PARAMETER, "element is NULL");
RET_VAL_IF(stream_type == NULL, WEBRTC_ERROR_INVALID_PARAMETER, "stream_type is NULL");
WEBRTC_ERROR_INVALID_OPERATION, "could not find 'stream-properties'");
prop = g_strdup_printf("props,%s=%s, %s=%d", PA_PROP_MEDIA_ROLE, stream_type, PA_PROP_MEDIA_PARENT_ID, stream_index);
- if (aec) {
+ if (aec_ref_device_id > STREAM_NO_REFERENCE_DEVICE) {
prop_with_aec = g_strdup_printf("%s, %s=%s, %s=%d",
prop, PA_PROP_MEDIA_PREPROCESSOR_METHOD, "webrtc", PA_PROP_MEDIA_ECHO_CANCEL_REFERENCE_DEVICE, aec_ref_device_id);
+ aec = true;
}
RET_VAL_IF(!(structure = gst_structure_from_string(aec ? prop_with_aec : prop, NULL)),
if (g_object_class_find_property(G_OBJECT_GET_CLASS(G_OBJECT(audiosink)), "stream-properties")) {
if (sink->sound_stream_info.type) {
ret = _apply_stream_info(audiosink, sink->sound_stream_info.type, sink->sound_stream_info.index,
- SOUND_MANAGER_STREAM_NO_REFERENCE_DEVICE);
+ STREAM_NO_REFERENCE_DEVICE);
if (ret != WEBRTC_ERROR_NONE)
goto exit;
}
bool available = false;
char *stream_type;
int stream_index;
- int aec_ref_device_id = 0;
- sound_acoustic_echo_cancel_type_e aec_type;
+ int aec_ref_device_id = STREAM_NO_REFERENCE_DEVICE;
+ sound_effect_method_with_reference_e method;
RET_VAL_IF(webrtc == NULL, WEBRTC_ERROR_INVALID_PARAMETER, "webrtc is NULL");
RET_VAL_IF((source = _get_slot_by_id(webrtc->gst.source_slots, source_id)) == NULL, WEBRTC_ERROR_INVALID_PARAMETER, "could not find source");
sound_manager_get_type_from_stream_information(stream_info, &stream_type);
sound_manager_get_index_from_stream_information(stream_info, &stream_index);
- sound_manager_get_echo_cancel_reference_device(stream_info, &aec_ref_device_id, &aec_type);
+
+ ret = sound_manager_get_effect_method_with_reference(stream_info, &method, &aec_ref_device_id);
+ if (ret == SOUND_MANAGER_ERROR_NONE)
+ LOG_INFO("Got effect method information. method[%d], aec_ref_device_id[%d]", method, aec_ref_device_id);
ret = sound_manager_is_available_stream_information(stream_info, NATIVE_API_WEBRTC, &available);
if (ret != SOUND_MANAGER_ERROR_NONE) {
return WEBRTC_ERROR_INVALID_PARAMETER;
}
- LOG_INFO("webrtc[%p], source_id[%u], stream_info[%p, type:%s, index:%d, aec_ref_device_id:%d, aec_type:%d]",
- webrtc, source_id, stream_info, stream_type, stream_index, aec_ref_device_id, aec_type);
+ LOG_INFO("webrtc[%p], source_id[%u], stream_info[%p, type:%s, index:%d]",
+ webrtc, source_id, stream_info, stream_type, stream_index);
return _apply_stream_info(element, stream_type, stream_index, aec_ref_device_id);
}
if (g_object_class_find_property(G_OBJECT_GET_CLASS(G_OBJECT(audiosink)), "stream-properties")) {
if (source->sound_stream_info.type) {
ret = _apply_stream_info(audiosink, source->sound_stream_info.type, source->sound_stream_info.index,
- SOUND_MANAGER_STREAM_NO_REFERENCE_DEVICE);
+ STREAM_NO_REFERENCE_DEVICE);
if (ret != WEBRTC_ERROR_NONE)
goto exit;
}
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 {