From f1a15d5ca1e5fc0fb0ec116b262b29fc37be9823 Mon Sep 17 00:00:00 2001 From: Sangchul Lee Date: Wed, 8 Jul 2020 13:38:03 +0900 Subject: [PATCH] Revise logs in sound_manager.c Logs related to function arguments are added to each function. [Version] 0.6.23 [Issue Type] Log Change-Id: I6ee7f0a939837e5da59e497ed89c385b7920bc77 Signed-off-by: Sangchul Lee --- packaging/capi-media-sound-manager.spec | 2 +- src/sound_manager.c | 227 ++++++++++++++++++++++++-------- 2 files changed, 172 insertions(+), 57 deletions(-) diff --git a/packaging/capi-media-sound-manager.spec b/packaging/capi-media-sound-manager.spec index 342823d..c9c964c 100644 --- a/packaging/capi-media-sound-manager.spec +++ b/packaging/capi-media-sound-manager.spec @@ -1,6 +1,6 @@ Name: capi-media-sound-manager Summary: Sound Manager library -Version: 0.6.22 +Version: 0.6.23 Release: 0 Group: Multimedia/API License: Apache-2.0 diff --git a/src/sound_manager.c b/src/sound_manager.c index 82c3154..a6aef71 100644 --- a/src/sound_manager.c +++ b/src/sound_manager.c @@ -60,13 +60,19 @@ int sound_manager_get_max_volume(sound_type_e type, int *max) SM_ARG_CHECK(max); SM_ARG_CHECK(type < SOUND_TYPE_NUM); + LOGI("type[%d]", type); + ret = _convert_sound_type(type, &volume_type); if (ret == SOUND_MANAGER_ERROR_NONE) { ret = _get_volume_max_level(DIRECTION_OUT_STR, volume_type, &max_level); - if (ret == SOUND_MANAGER_ERROR_NONE) + if (ret == SOUND_MANAGER_ERROR_NONE) { *max = (int)max_level -1; /* actual volume step can be max step - 1 */ + LOGI("volume_type[%s] max_volume[%d]", volume_type, *max); + } } + LOGI("ret[0x%x]", ret); + return ret; } @@ -77,8 +83,9 @@ int sound_manager_set_volume(sound_type_e type, int volume) SM_ARG_CHECK(type < SOUND_TYPE_NUM); SM_ARG_CHECK(volume >= 0); + LOGI("type[%d] volume[%d]", type, volume); + ret = mm_sound_volume_set_value(type, volume); - LOGI("type=%d, volume=%d", type, volume); return _convert_sound_manager_error_code(__func__, ret); } @@ -91,11 +98,13 @@ int sound_manager_get_volume(sound_type_e type, int *volume) SM_ARG_CHECK(type < SOUND_TYPE_NUM); SM_ARG_CHECK(volume); + LOGI("type[%d]", type); + ret = mm_sound_volume_get_value(type, &uvolume); - if (ret == MM_ERROR_NONE) + if (ret == MM_ERROR_NONE) { *volume = uvolume; - - LOGI("type=%d, volume=%d", type, *volume); + LOGI("volume[%d]", *volume); + } return _convert_sound_manager_error_code(__func__, ret); } @@ -112,9 +121,11 @@ int sound_manager_get_current_sound_type(sound_type_e *type) if (ret == SOUND_MANAGER_ERROR_NONE) { ret = _convert_sound_type_to_enum((const char*)volume_type, type); if (ret == SOUND_MANAGER_ERROR_NONE) - LOGI("type=%d", *type); + LOGI("type[%d]", *type); } + LOGI("ret[0x%x]", ret); + return ret; } @@ -125,8 +136,12 @@ int sound_manager_add_volume_changed_cb(sound_manager_volume_changed_cb callback SM_ARG_CHECK(callback); SM_ARG_CHECK(id); + LOGI("callback[%p] user_data[%p]", callback, user_data); + ret = mm_sound_add_volume_changed_callback((mm_sound_volume_changed_cb)callback, user_data, (unsigned int*)id); + LOGI("id[%d]", *id); + return _convert_sound_manager_error_code(__func__, ret); } @@ -136,6 +151,8 @@ int sound_manager_remove_volume_changed_cb(int id) SM_ARG_CHECK(id >= 0); + LOGI("id[%d]", id); + ret = mm_sound_remove_volume_changed_callback(id); return _convert_sound_manager_error_code(__func__, ret); @@ -147,7 +164,7 @@ int sound_manager_create_stream_information(sound_stream_type_e stream_type, sou SM_ARG_CHECK(stream_info); - LOGI(">> enter"); + LOGI("stream_type[%d] callback[%p] user_data[%p]", stream_type, callback, user_data); sound_stream_info_s *stream_h = malloc(sizeof(sound_stream_info_s)); if (!stream_h) { @@ -161,8 +178,8 @@ int sound_manager_create_stream_information(sound_stream_type_e stream_type, sou ret = _make_pa_connection_and_register_focus(stream_h, callback, user_data); if (ret == SOUND_MANAGER_ERROR_NONE) { *stream_info = (sound_stream_info_h)stream_h; - LOGI("stream_h(%p), pa_index(%u), focus_id(%d), user_cb(%p), ret(0x%x)", - stream_h, stream_h->pa_info.index, stream_h->focus_id, stream_h->user_cb, ret); + LOGI("stream_info[%p, type:%s] pa_index[%u] focus_id[%d]", + stream_info, stream_h->stream_type, stream_h->pa_info.index, stream_h->focus_id); } } @@ -170,6 +187,8 @@ LEAVE: if (ret != SOUND_MANAGER_ERROR_NONE) SM_SAFE_FREE(stream_h); + LOGI("ret[0x%x]", ret); + return ret; } @@ -180,7 +199,7 @@ int sound_manager_destroy_stream_information(sound_stream_info_h stream_info) SM_ARG_CHECK(stream_h); - LOGI(">> enter"); + LOGI("stream_info[%p, type:%s]", stream_info, stream_h->stream_type); SM_ENTER_CRITICAL_SECTION_WITH_RETURN(&stream_h->vstream_mutex, SOUND_MANAGER_ERROR_INTERNAL); if (stream_h->vstream) { @@ -196,6 +215,8 @@ int sound_manager_destroy_stream_information(sound_stream_info_h stream_info) if (ret == SOUND_MANAGER_ERROR_NONE) SM_SAFE_FREE(stream_h); + LOGI("ret[0x%x]", ret); + return ret; } @@ -207,7 +228,7 @@ int sound_manager_get_sound_type(sound_stream_info_h stream_info, sound_type_e * SM_ARG_CHECK(stream_h); SM_ARG_CHECK(sound_type); - LOGI(">> enter"); + LOGI("stream_info[%p, type:%s]", stream_info, stream_h->stream_type); if (stream_h->stream_conf_info.volume_type == NULL) { ret = SOUND_MANAGER_ERROR_NO_DATA; @@ -219,60 +240,78 @@ int sound_manager_get_sound_type(sound_stream_info_h stream_info, sound_type_e * LOGI("sound type(%d)", *sound_type); LEAVE: + LOGI("ret[0x%x]", ret); + return ret; } int sound_manager_add_device_for_stream_routing(sound_stream_info_h stream_info, sound_device_h device) { - SM_ARG_CHECK(stream_info); + sound_stream_info_s *stream_h = (sound_stream_info_s*)stream_info; + + SM_ARG_CHECK(stream_h); SM_ARG_CHECK(device); - LOGI(">> enter"); + LOGI("stream_info[%p, type:%s] device[%p]", stream_info, stream_h->stream_type, device); - return _add_device_for_stream_routing((sound_stream_info_s*)stream_info, device); + return _add_device_for_stream_routing(stream_h, device); } int sound_manager_remove_device_for_stream_routing(sound_stream_info_h stream_info, sound_device_h device) { - SM_ARG_CHECK(stream_info); + sound_stream_info_s *stream_h = (sound_stream_info_s*)stream_info; + + SM_ARG_CHECK(stream_h); SM_ARG_CHECK(device); - LOGI(">> enter"); + LOGI("stream_info[%p, type:%s] device[%p]", stream_info, stream_h->stream_type, device); - return _remove_device_for_stream_routing((sound_stream_info_s*)stream_info, device); + return _remove_device_for_stream_routing(stream_h, device); } int sound_manager_remove_all_devices_for_stream_routing(sound_stream_info_h stream_info) { - SM_ARG_CHECK(stream_info); + sound_stream_info_s *stream_h = (sound_stream_info_s*)stream_info; - LOGI(">> enter"); + SM_ARG_CHECK(stream_h); - return _remove_all_devices_for_stream_routing((sound_stream_info_s*)stream_info); + LOGI("stream_info[%p, type:%s]", stream_info, stream_h->stream_type); + + return _remove_all_devices_for_stream_routing(stream_h); } int sound_manager_apply_stream_routing(sound_stream_info_h stream_info) { - SM_ARG_CHECK(stream_info); + sound_stream_info_s *stream_h = (sound_stream_info_s*)stream_info; + + SM_ARG_CHECK(stream_h); - LOGI(">> enter"); + LOGI("stream_info[%p, type:%s]", stream_info, stream_h->stream_type); - return _apply_stream_routing((sound_stream_info_s*)stream_info); + return _apply_stream_routing(stream_h); } int sound_manager_set_stream_preferred_device(sound_stream_info_h stream_info, sound_device_io_direction_e io_direction, sound_device_h device) { - SM_ARG_CHECK(stream_info); + sound_stream_info_s *stream_h = (sound_stream_info_s*)stream_info; + + SM_ARG_CHECK(stream_h); + + LOGI("stream_info[%p, type:%s] io_direction[%d] device[%p]", stream_info, stream_h->stream_type, io_direction, device); - return _set_preferred_device((sound_stream_info_s*)stream_info, io_direction, device); + return _set_preferred_device(stream_h, io_direction, device); } int sound_manager_get_stream_preferred_device(sound_stream_info_h stream_info, int *in_device_id, int *out_device_id) { - SM_ARG_CHECK(stream_info); + sound_stream_info_s *stream_h = (sound_stream_info_s*)stream_info; + + SM_ARG_CHECK(stream_h); SM_ARG_CHECK(in_device_id || out_device_id); - return _get_preferred_device((sound_stream_info_s*)stream_info, in_device_id, out_device_id); + LOGI("stream_info[%p, type:%s]", stream_info, stream_h->stream_type); + + return _get_preferred_device(stream_h, in_device_id, out_device_id); } int sound_manager_set_focus_reacquisition(sound_stream_info_h stream_info, bool enable) @@ -282,12 +321,10 @@ int sound_manager_set_focus_reacquisition(sound_stream_info_h stream_info, bool SM_ARG_CHECK(stream_h); - LOGI(">> enter"); + LOGI("stream_info[%p, type:%s, focus_id:%d] enable[%d]", stream_info, stream_h->stream_type, stream_h->focus_id, enable); ret = mm_sound_set_focus_reacquisition(stream_h->focus_id, enable); - LOGI("enable(%d)", enable); - return _convert_sound_manager_error_code(__func__, ret); } @@ -299,7 +336,7 @@ int sound_manager_get_focus_reacquisition(sound_stream_info_h stream_info, bool SM_ARG_CHECK(stream_h); SM_ARG_CHECK(enabled); - LOGI(">> enter"); + LOGI("stream_info[%p, type:%s, focus_id:%d]", stream_info, stream_h->stream_type, stream_h->focus_id); ret = mm_sound_get_focus_reacquisition(stream_h->focus_id, enabled); @@ -317,7 +354,8 @@ int sound_manager_acquire_focus(sound_stream_info_h stream_info, sound_stream_fo SM_ARG_CHECK(stream_h); - LOGI(">> enter"); + LOGI("stream_info[%p, type:%s, focus_id:%d] focus_mask[0x%x] sound_behavior[0x%x] extra_info[%s]", + stream_info, stream_h->stream_type, stream_h->focus_id, focus_mask, sound_behavior, extra_info); if ((ret = mm_sound_focus_is_cb_thread(&is_focus_cb_thread, &is_focus_watch_cb_thread)) != MM_ERROR_NONE) return _convert_sound_manager_error_code(__func__, ret); @@ -387,7 +425,8 @@ int sound_manager_release_focus(sound_stream_info_h stream_info, sound_stream_fo SM_ARG_CHECK(stream_h); - LOGI(">> enter"); + LOGI("stream_info[%p, type:%s, focus_id:%d] focus_mask[0x%x] sound_behavior[0x%x] extra_info[%s]", + stream_info, stream_h->stream_type, stream_h->focus_id, focus_mask, sound_behavior, extra_info); if ((ret = mm_sound_focus_is_cb_thread(&is_focus_cb_thread, &is_focus_watch_cb_thread)) != MM_ERROR_NONE) return _convert_sound_manager_error_code(__func__, ret); @@ -448,7 +487,8 @@ int sound_manager_acquire_focus_all(sound_stream_info_h stream_info, int sound_b SM_ARG_CHECK(stream_h); - LOGI(">> enter"); + LOGI("stream_info[%p, type:%s, focus_id:%d] sound_behavior[0x%x] extra_info[%s]", + stream_info, stream_h->stream_type, stream_h->focus_id, sound_behavior, extra_info); if ((ret = mm_sound_focus_is_cb_thread(&is_focus_cb_thread, &is_focus_watch_cb_thread)) != MM_ERROR_NONE) return _convert_sound_manager_error_code(__func__, ret); @@ -517,7 +557,8 @@ int sound_manager_release_focus_all(sound_stream_info_h stream_info, int sound_b SM_ARG_CHECK(stream_h); - LOGI(">> enter"); + LOGI("stream_info[%p, type:%s, focus_id:%d] sound_behavior[0x%x] extra_info[%s]", + stream_info, stream_h->stream_type, stream_h->focus_id, sound_behavior, extra_info); if ((ret = mm_sound_focus_is_cb_thread(&is_focus_cb_thread, &is_focus_watch_cb_thread)) != MM_ERROR_NONE) return _convert_sound_manager_error_code(__func__, ret); @@ -573,7 +614,7 @@ int sound_manager_get_focus_state(sound_stream_info_h stream_info, sound_stream_ SM_ARG_CHECK(stream_h); SM_ARG_CHECK(state_for_playback || state_for_recording); - LOGI(">> enter"); + LOGI("stream_info[%p, type:%s, focus_id:%d]", stream_info, stream_h->stream_type, stream_h->focus_id); SM_ENTER_CRITICAL_SECTION_WITH_RETURN(&stream_h->focus_state_mutex, SOUND_MANAGER_ERROR_INTERNAL); @@ -599,7 +640,9 @@ int sound_manager_deliver_focus(sound_stream_info_h source, sound_stream_info_h SM_ARG_CHECK(src_stream_h); SM_ARG_CHECK(dst_stream_h); - LOGI(">> enter"); + LOGI("SRC stream_info[%p, type:%s, focus_id:%d]", source, src_stream_h->stream_type, src_stream_h->focus_id); + LOGI("DST stream_info[%p, type:%s, focus_id:%d]", destination, dst_stream_h->stream_type, dst_stream_h->focus_id); + LOGI("focus_mask[0x%x]", focus_mask); if ((ret = mm_sound_focus_is_cb_thread(&is_focus_cb_thread, NULL)) != MM_ERROR_NONE) return _convert_sound_manager_error_code(__func__, ret); @@ -651,10 +694,12 @@ int sound_manager_is_stream_on_device(sound_stream_info_h stream_info, sound_dev SM_ARG_CHECK(device); SM_ARG_CHECK(is_on); - LOGI(">> enter"); + LOGI("stream_info[%p, type:%s] device[%p]", stream_info, stream_h->stream_type, device); ret = mm_sound_is_stream_on_device(stream_h->pa_info.index, device, is_on); + LOGI("is_on[%d]", *is_on); + return _convert_sound_manager_error_code(__func__, ret); } @@ -662,8 +707,6 @@ int sound_manager_get_current_media_playback_device_type(sound_device_type_e *de { SM_ARG_CHECK(device_type); - LOGI(">> enter"); - return _get_current_media_routing_path("out", device_type); } @@ -679,8 +722,6 @@ int sound_manager_get_current_playback_focus(sound_stream_focus_change_reason_e SM_ARG_CHECK(acquired_by); SM_ARG_CHECK(flags); - LOGI(">> enter"); - if ((mm_ret = mm_sound_focus_is_cb_thread(&is_focus_cb_thread, NULL)) != MM_ERROR_NONE) return _convert_sound_manager_error_code(__func__, mm_ret); @@ -719,8 +760,6 @@ int sound_manager_get_current_recording_focus(sound_stream_focus_change_reason_e SM_ARG_CHECK(acquired_by); SM_ARG_CHECK(flags); - LOGI(">> enter"); - if ((mm_ret = mm_sound_focus_is_cb_thread(&is_focus_cb_thread, NULL)) != MM_ERROR_NONE) return _convert_sound_manager_error_code(__func__, mm_ret); @@ -755,7 +794,7 @@ int sound_manager_add_focus_state_watch_cb(sound_stream_focus_mask_e focus_mask, SM_ARG_CHECK(callback); SM_ARG_CHECK(id); - LOGI(">> enter"); + LOGI("focus_mask[0x%x] callback[%p] user_data[%p]", focus_mask, callback, user_data); for (i = 0; i < SOUND_STREAM_INFO_ARR_MAX; i++) if (focus_watch_info_arr[i].id == 0) @@ -776,7 +815,7 @@ int sound_manager_add_focus_state_watch_cb(sound_stream_focus_mask_e focus_mask, } LEAVE: - LOGD("id(%d)", *id); + LOGI("id[%d]", *id); return _convert_sound_manager_error_code(__func__, ret); } @@ -786,7 +825,7 @@ int sound_manager_remove_focus_state_watch_cb(int id) int ret = MM_ERROR_NONE; int i = 0; - LOGI(">> enter"); + LOGI("id[%d]", id); for (i = 0; i < SOUND_STREAM_INFO_ARR_MAX; i++) if (focus_watch_info_arr[i].id == id) @@ -814,8 +853,12 @@ int sound_manager_get_device_list(int device_mask, sound_device_list_h *device_l SM_ARG_CHECK(device_list); + LOGI("device_mask[0x%x]", device_mask); + ret = mm_sound_get_device_list(device_mask, device_list); + LOGI("device_list[%p]", *device_list); + return _convert_sound_manager_error_code(__func__, ret); } @@ -825,6 +868,8 @@ int sound_manager_free_device_list(sound_device_list_h device_list) SM_ARG_CHECK(device_list); + LOGI("device_list[%p]", device_list); + ret = mm_sound_free_device_list(device_list); return _convert_sound_manager_error_code(__func__, ret); @@ -837,8 +882,12 @@ int sound_manager_get_next_device(sound_device_list_h device_list, sound_device_ SM_ARG_CHECK(device_list); SM_ARG_CHECK(device); + LOGI("device_list[%p]", device_list); + ret = mm_sound_get_next_device(device_list, device); + LOGI("device[%p]", *device); + return _convert_sound_manager_error_code(__func__, ret); } @@ -849,8 +898,12 @@ int sound_manager_get_prev_device(sound_device_list_h device_list, sound_device_ SM_ARG_CHECK(device_list); SM_ARG_CHECK(device); + LOGI("device_list[%p]", device_list); + ret = mm_sound_get_prev_device(device_list, device); + LOGI("device[%p]", *device); + return _convert_sound_manager_error_code(__func__, ret); } @@ -862,6 +915,8 @@ int sound_manager_get_device_type(sound_device_h device, sound_device_type_e *ty SM_ARG_CHECK(device); SM_ARG_CHECK(type); + LOGI("device[%p]", device); + if ((ret = mm_sound_get_device_type(device, &mm_sound_device_type)) != MM_ERROR_NONE) return _convert_sound_manager_error_code(__func__, ret); @@ -876,6 +931,8 @@ int sound_manager_get_device_io_direction(sound_device_h device, sound_device_io SM_ARG_CHECK(device); SM_ARG_CHECK(io_direction); + LOGI("device[%p]", device); + if ((ret = mm_sound_get_device_io_direction(device, &mm_sound_io_direction)) != MM_ERROR_NONE) return _convert_sound_manager_error_code(__func__, ret); @@ -889,8 +946,12 @@ int sound_manager_get_device_id(sound_device_h device, int *id) SM_ARG_CHECK(device); SM_ARG_CHECK(id); + LOGI("device[%p]", device); + ret = mm_sound_get_device_id(device, id); + LOGI("id[%d]", *id); + return _convert_sound_manager_error_code(__func__, ret); } @@ -901,8 +962,12 @@ int sound_manager_get_device_name(sound_device_h device, char **name) SM_ARG_CHECK(device); SM_ARG_CHECK(name); + LOGI("device[%p]", device); + ret = mm_sound_get_device_name(device, name); + LOGI("name[%s]", *name); + return _convert_sound_manager_error_code(__func__, ret); } @@ -913,10 +978,12 @@ int sound_manager_is_device_running(sound_device_h device, bool *is_running) SM_ARG_CHECK(device); SM_ARG_CHECK(is_running); - LOGI(">> enter"); + LOGI("device[%p]", device); ret = mm_sound_is_device_running(device, is_running); + LOGI("is_running[%d]", *is_running); + return _convert_sound_manager_error_code(__func__, ret); } @@ -927,9 +994,13 @@ int sound_manager_get_device_state(sound_device_h device, sound_device_state_e * SM_ARG_CHECK(device); SM_ARG_CHECK(state); + LOGI("device[%p]", device); + LOGW("DEPRECATION WARNING: %s() is deprecated and will be removed from next release.", __func__); ret = mm_sound_get_device_state(device, (mm_sound_device_state_e*)state); + LOGI("state[%d]", *state); + return _convert_sound_manager_error_code(__func__, ret); } @@ -943,6 +1014,8 @@ int sound_manager_get_supported_sample_formats(sound_device_h device, sound_samp SM_ARG_CHECK(formats); SM_ARG_CHECK(num_of_elems); + LOGI("device[%p]", device); + if ((ret = _return_val_if_not_usb_device(device, SOUND_MANAGER_ERROR_INVALID_OPERATION)) != SOUND_MANAGER_ERROR_NONE) return ret; @@ -960,6 +1033,8 @@ int sound_manager_set_sample_format(sound_device_h device, sound_sample_format_e SM_ARG_CHECK(device); + LOGI("device[%p] format[%d]", device, format); + if ((ret = _return_val_if_not_usb_device(device, SOUND_MANAGER_ERROR_INVALID_OPERATION)) != SOUND_MANAGER_ERROR_NONE) return ret; @@ -978,6 +1053,8 @@ int sound_manager_get_sample_format(sound_device_h device, sound_sample_format_e SM_ARG_CHECK(device); SM_ARG_CHECK(format); + LOGI("device[%p]", device); + if ((ret = _return_val_if_not_usb_device(device, SOUND_MANAGER_ERROR_INVALID_OPERATION)) != SOUND_MANAGER_ERROR_NONE) return ret; @@ -997,6 +1074,8 @@ int sound_manager_get_supported_sample_rates(sound_device_h device, sound_sample SM_ARG_CHECK(rates); SM_ARG_CHECK(num_of_elems); + LOGI("device[%p]", device); + if ((ret = _return_val_if_not_usb_device(device, SOUND_MANAGER_ERROR_INVALID_OPERATION)) != SOUND_MANAGER_ERROR_NONE) return ret; @@ -1014,6 +1093,8 @@ int sound_manager_set_sample_rate(sound_device_h device, sound_sample_rate_e rat SM_ARG_CHECK(device); + LOGI("device[%p] rate[%d]", device, rate); + if ((ret = _return_val_if_not_usb_device(device, SOUND_MANAGER_ERROR_INVALID_OPERATION)) != SOUND_MANAGER_ERROR_NONE) return ret; @@ -1032,6 +1113,8 @@ int sound_manager_get_sample_rate(sound_device_h device, sound_sample_rate_e *ra SM_ARG_CHECK(device); SM_ARG_CHECK(rate); + LOGI("device[%p]", device); + if ((ret = _return_val_if_not_usb_device(device, SOUND_MANAGER_ERROR_INVALID_OPERATION)) != SOUND_MANAGER_ERROR_NONE) return ret; @@ -1049,6 +1132,8 @@ int sound_manager_set_avoid_resampling(sound_device_h device, bool enable) SM_ARG_CHECK(device); + LOGI("device[%p] enable[%d]", device, enable); + if ((ret = _return_val_if_not_usb_device(device, SOUND_MANAGER_ERROR_INVALID_OPERATION)) != SOUND_MANAGER_ERROR_NONE) return ret; @@ -1067,6 +1152,8 @@ int sound_manager_get_avoid_resampling(sound_device_h device, bool *enabled) SM_ARG_CHECK(device); SM_ARG_CHECK(enabled); + LOGI("device[%p]", device); + if ((ret = _return_val_if_not_usb_device(device, SOUND_MANAGER_ERROR_INVALID_OPERATION)) != SOUND_MANAGER_ERROR_NONE) return ret; @@ -1084,6 +1171,8 @@ int sound_manager_set_media_stream_only(sound_device_h device, bool enable) SM_ARG_CHECK(device); + LOGI("device[%p] enable[%d]", device, enable); + if ((ret = _return_val_if_not_usb_device(device, SOUND_MANAGER_ERROR_INVALID_OPERATION)) != SOUND_MANAGER_ERROR_NONE) return ret; @@ -1102,6 +1191,8 @@ int sound_manager_get_media_stream_only(sound_device_h device, bool *enabled) SM_ARG_CHECK(device); SM_ARG_CHECK(enabled); + LOGI("device[%p]", device); + if ((ret = _return_val_if_not_usb_device(device, SOUND_MANAGER_ERROR_INVALID_OPERATION)) != SOUND_MANAGER_ERROR_NONE) return ret; @@ -1118,8 +1209,12 @@ int sound_manager_add_device_connection_changed_cb(int device_mask, sound_device SM_ARG_CHECK(callback); SM_ARG_CHECK(id); + LOGI("device_mask[0x%x] callback[%p] user_data[%p]", device_mask, callback, user_data); + ret = mm_sound_add_device_connected_callback((mm_sound_device_flags_e)device_mask, (mm_sound_device_connected_cb)callback, user_data, (unsigned int*)id); + LOGI("id[%d]", *id); + return _convert_sound_manager_error_code(__func__, ret); } @@ -1129,6 +1224,8 @@ int sound_manager_remove_device_connection_changed_cb(int id) SM_ARG_CHECK(id >= 0); + LOGI("id[%d]", id); + ret = mm_sound_remove_device_connected_callback((unsigned int)id); return _convert_sound_manager_error_code(__func__, ret); @@ -1141,8 +1238,12 @@ int sound_manager_add_device_running_changed_cb(int device_mask, sound_device_ru SM_ARG_CHECK(callback); SM_ARG_CHECK(id); + LOGI("device_mask[0x%x] callback[%p] user_data[%p]", device_mask, callback, user_data); + ret = mm_sound_add_device_running_changed_callback(device_mask, (mm_sound_device_running_changed_cb)callback, user_data, (unsigned int*)id); + LOGI("id[%d]", *id); + return _convert_sound_manager_error_code(__func__, ret); } @@ -1152,6 +1253,8 @@ int sound_manager_remove_device_running_changed_cb(int id) SM_ARG_CHECK(id >= 0); + LOGI("id[%d]", id); + ret = mm_sound_remove_device_running_changed_callback((unsigned int)id); return _convert_sound_manager_error_code(__func__, ret); @@ -1165,8 +1268,12 @@ int sound_manager_add_device_state_changed_cb(int device_mask, sound_device_stat SM_ARG_CHECK(callback); SM_ARG_CHECK(id); + LOGI("device_mask[0x%x] callback[%p] user_data[%p]", device_mask, callback, user_data); + ret = mm_sound_add_device_state_changed_callback(device_mask, (mm_sound_device_state_changed_cb)callback, user_data, (unsigned int*)id); + LOGI("id[%d]", *id); + return _convert_sound_manager_error_code(__func__, ret); } @@ -1177,6 +1284,8 @@ int sound_manager_remove_device_state_changed_cb(int id) LOGW("DEPRECATION WARNING: %s() is deprecated and will be removed from next release.", __func__); SM_ARG_CHECK(id >= 0); + LOGI("id[%d]", id); + ret = mm_sound_remove_device_state_changed_callback((unsigned int)id); return _convert_sound_manager_error_code(__func__, ret); @@ -1203,6 +1312,8 @@ int sound_manager_create_stream_ducking(sound_stream_type_e target_stream, sound goto LEAVE; } + LOGI("target_stream[%d] callback[%p] user_data[%p]", target_stream, callback, user_data); + new_ducking = (sound_stream_ducking_s *)calloc(1, sizeof(sound_stream_ducking_s)); if (!new_ducking) { ret = SOUND_MANAGER_ERROR_INTERNAL; @@ -1236,8 +1347,8 @@ int sound_manager_create_stream_ducking(sound_stream_type_e target_stream, sound ducking_arr[i] = new_ducking; *stream_ducking = (sound_stream_ducking_h)new_ducking; - LOGI("new stream_ducking(%p), target_stream(%s), pa_index(%u), user_cb(%p)", - new_ducking, new_ducking->target_stream, new_ducking->pa_info.index, new_ducking->user_cb); + LOGI("new stream_ducking[%p] target_stream[%s] pa_index[%u]", + new_ducking, new_ducking->target_stream, new_ducking->pa_info.index); LEAVE: if (ret != SOUND_MANAGER_ERROR_NONE) { @@ -1249,6 +1360,8 @@ LEAVE: SM_LEAVE_CRITICAL_SECTION(&ducking_mutex); + LOGI("ret[0x%x]", ret); + return ret; } @@ -1261,7 +1374,7 @@ int sound_manager_destroy_stream_ducking(sound_stream_ducking_h stream_ducking) SM_ARG_CHECK(ducking); - LOGI(">> enter %p", ducking); + LOGI("stream_ducking[%p]", ducking); ret = _get_ducking_state(&ducking->pa_info, &is_ducked); if (ret != SOUND_MANAGER_ERROR_NONE && !ducking->pa_info.is_disconnected) @@ -1272,8 +1385,6 @@ int sound_manager_destroy_stream_ducking(sound_stream_ducking_h stream_ducking) return SOUND_MANAGER_ERROR_INVALID_STATE; } - LOGI("destroy stream ducking(%p)", ducking); - SM_ENTER_CRITICAL_SECTION_WITH_RETURN(&ducking_mutex, SOUND_MANAGER_ERROR_INTERNAL); _destroy_pa_connection(&ducking->pa_info); @@ -1304,7 +1415,7 @@ int sound_manager_is_ducked(sound_stream_ducking_h stream_ducking, bool *is_duck SM_ARG_CHECK(ducking); SM_ARG_CHECK(is_ducked); - LOGI(">> enter %p", ducking); + LOGI("stream_ducking[%p]", ducking); return _get_ducking_state(&ducking->pa_info, is_ducked); } @@ -1320,7 +1431,7 @@ int sound_manager_activate_ducking(sound_stream_ducking_h stream_ducking, unsign SM_ARG_CHECK(ratio < 1.0); SM_ARG_CHECK(ratio >= 0.0); - LOGI(">> enter %p - duration(%u), ratio(%lf)", ducking, duration, ratio); + LOGI("stream_ducking[%p] duration[%u] ratio[%lf]", ducking, duration, ratio); ret = _get_ducking_state(&ducking->pa_info, &is_ducked); if (ret != SOUND_MANAGER_ERROR_NONE) @@ -1342,6 +1453,8 @@ int sound_manager_activate_ducking(sound_stream_ducking_h stream_ducking, unsign SM_LEAVE_CRITICAL_SECTION(&ducking_mutex); + LOGI("ret[0x%x]", ret); + return ret; } @@ -1353,7 +1466,7 @@ int sound_manager_deactivate_ducking(sound_stream_ducking_h stream_ducking) SM_ARG_CHECK(ducking); - LOGI(">> enter %p", ducking); + LOGI("stream_ducking[%p]", ducking); ret = _get_ducking_state(&ducking->pa_info, &is_ducked); if (ret != SOUND_MANAGER_ERROR_NONE) @@ -1371,5 +1484,7 @@ int sound_manager_deactivate_ducking(sound_stream_ducking_h stream_ducking) SM_LEAVE_CRITICAL_SECTION(&ducking_mutex); + LOGI("ret[0x%x]", ret); + return ret; } -- 2.7.4