return _convert_sound_manager_error_code(__func__, MM_ERROR_INVALID_ARGUMENT);
ret = mm_sound_volume_set_value(type, volume);
- LOGI("returns : type=%d, volume=%d, ret=%p", type, volume, ret);
+ LOGI("type=%d, volume=%d", type, volume);
return _convert_sound_manager_error_code(__func__, ret);
}
if (ret == MM_ERROR_NONE)
*volume = uvolume;
- LOGI("returns : type=%d, volume=%d, ret=%p", type, *volume, ret);
+ LOGI("type=%d, volume=%d", type, *volume);
return _convert_sound_manager_error_code(__func__, ret);
}
*type = mm_sound_vol_type;
}
}
- LOGI("returns : type=%d, ret=%p", *type, ret);
+ LOGI("type=%d", *type);
return _convert_sound_manager_error_code(__func__, ret);
}
if (ret == MM_ERROR_NONE) {
*stream_info = (sound_stream_info_h)stream_h;
SM_REF_FOR_STREAM_INFO(g_stream_info_count, ret);
- LOGI("<< leave : stream_h(%p), index(%u), user_cb(%p), cnt(%d), ret(%p)", stream_h, stream_h->index, stream_h->user_cb, g_stream_info_count, ret);
+ LOGI("stream_h(%p), index(%u), user_cb(%p), cnt(%d), ret(0x%x)", stream_h, stream_h->index, stream_h->user_cb, g_stream_info_count, ret);
}
}
if (ret)
}
SM_LEAVE_CRITICAL_SECTION(&g_stream_info_count_mutex);
- LOGI("<< leave : cnt(%d), ret(%p)", g_stream_info_count, ret);
+ LOGD("cnt(%d)", g_stream_info_count);
return _convert_sound_manager_error_code(__func__, ret);
}
ret = _add_device_for_stream_routing(stream_h, device);
- LOGI("<< leave : ret(%p)", ret);
-
return _convert_sound_manager_error_code(__func__, ret);
}
ret = _remove_device_for_stream_routing(stream_h, device);
- LOGI("<< leave : ret(%p)", ret);
-
return _convert_sound_manager_error_code(__func__, ret);
}
ret = _apply_stream_routing(stream_h);
- LOGI("<< leave : ret(%p)", ret);
-
return _convert_sound_manager_error_code(__func__, ret);
}
ret = mm_sound_set_focus_reacquisition(stream_h->index, enable);
- LOGI("<< leave : ret(%p)", ret);
-
return _convert_sound_manager_error_code(__func__, ret);
}
ret = mm_sound_get_focus_reacquisition(stream_h->index, enabled);
- LOGI("<< leave : ret(%p)", ret);
-
return _convert_sound_manager_error_code(__func__, ret);
}
_update_focus_status(stream_h->index, (unsigned int)stream_h->acquired_focus);
}
- LOGI("<< leave : ret(%p)", ret);
-
return _convert_sound_manager_error_code(__func__, ret);
}
_update_focus_status(stream_h->index, (unsigned int)stream_h->acquired_focus);
}
- LOGI("<< leave : ret(%p)", ret);
-
return _convert_sound_manager_error_code(__func__, ret);
}
if (state_for_recording)
*state_for_recording = ((stream_h->acquired_focus & SOUND_STREAM_FOCUS_FOR_RECORDING) ? (SOUND_STREAM_FOCUS_STATE_ACQUIRED) : (SOUND_STREAM_FOCUS_STATE_RELEASED));
- LOGI("<< leave : acquired_focus(%p)", stream_h->acquired_focus);
+ LOGI("acquired_focus(0x%x)", stream_h->acquired_focus);
return _convert_sound_manager_error_code(__func__, ret);
}
LOGI("sound type(%d)", *sound_type);
}
- LOGI("<< leave : sound type(%d)", *sound_type);
-
return _convert_sound_manager_error_code(__func__, ret);
}
SM_LEAVE_CRITICAL_SECTION(&g_stream_info_count_mutex);
- LOGI("<< leave : cnt(%d), ret(%p)", g_stream_info_count, ret);
+ LOGD("cnt(%d)", g_stream_info_count);
return _convert_sound_manager_error_code(__func__, ret);
}
SM_LEAVE_CRITICAL_SECTION(&g_stream_info_count_mutex);
- LOGI("<< leave : cnt(%d), ret(%p)", g_stream_info_count, ret);
+ LOGD("cnt(%d)", g_stream_info_count);
return _convert_sound_manager_error_code(__func__, ret);
}
if (ret == MM_ERROR_NONE) {
if (cur_session == MM_SESSION_TYPE_MEDIA_RECORD) {
if (type > SOUND_SESSION_TYPE_MEDIA) {
- LOGE("<< leave : Could not set this type(%d) during camera/recorder/audio-io(in)/radio", type);
+ LOGE("Could not set this type(%d) during camera/recorder/audio-io(in)/radio", type);
return _convert_sound_manager_error_code(__func__, MM_ERROR_POLICY_INTERNAL);
}
}
if (g_session_interrupt_cb_table.is_registered) {
if (new_session == cur_session ||
((new_session == SOUND_SESSION_TYPE_MEDIA) && (cur_session == MM_SESSION_TYPE_MEDIA_RECORD))) {
- LOGI("<< leave : already set type=%d, ret=%p", type, ret);
+ LOGI("already set type=%d, ret=0x%x", type, ret);
return SOUND_MANAGER_ERROR_NONE;
} else {
ret = mm_session_finish();
if (ret == MM_ERROR_NONE)
g_session_interrupt_cb_table.is_registered = 1;
- LOGI("<< leave : type=%d, ret=%p", type, ret);
+ LOGI("type=%d", type);
return _convert_sound_manager_error_code(__func__, ret);
}
(cur_session != MM_SESSION_TYPE_VOIP)) {
if (g_cached_session != -1)
cur_session = g_cached_session;
- else /* will be never reach here. just prevent code */
+ else /* will be never reached here. just prevent code */
cur_session = SOUND_SESSION_TYPE_DEFAULT;
}
break;
}
- LOGI("returns : type=%d, ret=%p", *type, ret);
+ LOGI("type=%d", *type);
- return 0;
+ return SOUND_MANAGER_ERROR_NONE;
}
int sound_manager_set_media_session_option(sound_session_option_for_starting_e s_option, sound_session_option_for_during_play_e d_option)
}
if (updated)
- LOGI("<< leave : updated");
+ LOGI("updated");
else
- LOGI("<< leave : already set same option(%x), skip it", session_option);
+ LOGI("already set same option(%x), skip it", session_option);
return _convert_sound_manager_error_code(__func__, ret);
}
else
*d_option = SOUND_SESSION_OPTION_INTERRUPTIBLE_DURING_PLAY;
- LOGI("<< leave : option for starting=%d, for during play=%d", *s_option, *d_option);
+ LOGI(" option for starting=%d, for during play=%d", *s_option, *d_option);
return SOUND_MANAGER_ERROR_NONE;
}
}
if (updated)
- LOGI("<< leave : updated");
+ LOGI("updated");
else
- LOGI("<< leave : already set same option(%x), skip it", session_option);
+ LOGI("already set same option(0x%x), skip it", session_option);
return _convert_sound_manager_error_code(__func__, ret);
}
else
*option = SOUND_SESSION_OPTION_RESUMPTION_BY_SYSTEM;
- LOGI("<< leave : option for resumption=%d (0:by system, 1:by system or media paused)", *option);
+ LOGI("option for resumption=%d (0:by system, 1:by system or media paused)", *option);
return SOUND_MANAGER_ERROR_NONE;
}
}
ret = _set_session_mode((_session_mode_e)mode);
- LOGI("<< leave : session=%p, mode=%d, ret=%p", session, mode, ret);
+ LOGI("session=%d, mode=%d", session, mode);
return _convert_sound_manager_error_code(__func__, ret);
}
int session_options = 0;
if (mode == NULL) {
- LOGI("mode is null");
+ LOGE("mode is null");
return _convert_sound_manager_error_code(__func__, MM_ERROR_INVALID_ARGUMENT);
}
*mode = (sound_session_voip_mode_e)g_cached_session_mode;
- LOGI("returns : session=%p, mode=%d, ret=%p", session, *mode, ret);
+ LOGI("session=%d, mode=%d", session, *mode);
return _convert_sound_manager_error_code(__func__, ret);
}
LOGI("<ENTER>");
ret = mm_session_finish();
if (ret != MM_ERROR_NONE)
- LOGE("[%s] failed to mm_session_finish(), ret(%p)", __func__, ret);
+ LOGE("[%s] failed to mm_session_finish(), ret(0x%x)", __func__, ret);
g_session_interrupt_cb_table.is_registered = 0;
LOGI("<LEAVE>");
ret = _make_pa_connection_and_register_focus(stream_h, callback, user_data);
if (!ret) {
*stream_info = (sound_stream_info_h)stream_h;
- LOGI("<< leave : stream_h(%p), index(%u), user_cb(%p), ret(%p)", stream_h, stream_h->index, stream_h->user_cb, ret);
+ LOGI("stream_h(%p), index(%u), user_cb(%p), ret(0x%x)", stream_h, stream_h->index, stream_h->user_cb, ret);
}
}
if (ret)
return _convert_sound_manager_error_code(__func__, ret);
}
+int sound_manager_get_reason_for_current_playback_focus(sound_stream_focus_change_reason_e *acquired_by, char **additional_info)
+{
+ int ret = MM_ERROR_NONE;
+ char *stream_type_str = NULL;
+ char *additional_info_str = NULL;
+
+ LOGI(">> enter");
+
+ SM_NULL_ARG_CHECK(acquired_by);
+
+ ret = mm_sound_get_stream_type_of_acquired_focus((int)SOUND_STREAM_FOCUS_FOR_PLAYBACK, &stream_type_str, &additional_info_str);
+ if (ret == MM_ERROR_NONE) {
+ LOGI("current acquired [playback] focus: stream_type=%s", stream_type_str);
+ ret = _convert_stream_type_to_change_reason(stream_type_str, acquired_by);
+ if ((ret == MM_ERROR_NONE) && additional_info) {
+ LOGI(" : reason=%d, additional_info=%s", *acquired_by, additional_info_str);
+ *additional_info = additional_info_str;
+ }
+ }
+
+ return _convert_sound_manager_error_code(__func__, ret);
+}
+
+int sound_manager_get_reason_for_current_recording_focus(sound_stream_focus_change_reason_e *acquired_by, char **additional_info)
+{
+ int ret = MM_ERROR_NONE;
+ char *stream_type_str = NULL;
+ char *additional_info_str = NULL;
+
+ LOGI(">> enter");
+
+ SM_NULL_ARG_CHECK(acquired_by);
+
+ ret = mm_sound_get_stream_type_of_acquired_focus((int)SOUND_STREAM_FOCUS_FOR_RECORDING, &stream_type_str, &additional_info_str);
+ if (ret == MM_ERROR_NONE) {
+ LOGI("current acquired [recording] focus: stream_type=%s", stream_type_str);
+ ret = _convert_stream_type_to_change_reason(stream_type_str, acquired_by);
+ if ((ret == MM_ERROR_NONE) && additional_info) {
+ LOGI(" : reason=%d, additional_info=%s", *acquired_by, additional_info_str);
+ *additional_info = additional_info_str;
+ }
+ }
+
+ return _convert_sound_manager_error_code(__func__, ret);
+}
+
int sound_manager_create_virtual_stream(sound_stream_info_h stream_info, virtual_sound_stream_h *virtual_stream)
{
int ret = MM_ERROR_NONE;
CURRENT_STATUS_UNSET_FOCUS_WATCH_CB,
CURRENT_STATUS_SET_FOCUS_REACQUISITION,
CURRENT_STATUS_GET_FOCUS_REACQUISITION,
+ CURRENT_STATUS_GET_REASON_FOR_P_FOCUS,
+ CURRENT_STATUS_GET_REASON_FOR_R_FOCUS,
CURRENT_STATUS_CREATE_VIRTUAL_STREAM,
CURRENT_STATUS_START_VIRTUAL_STREAM,
CURRENT_STATUS_STOP_VIRTUAL_STREAM,
g_menu_state = CURRENT_STATUS_SET_FOCUS_REACQUISITION;
else if (strncmp(cmd, "gfr", 3) == 0)
g_menu_state = CURRENT_STATUS_GET_FOCUS_REACQUISITION;
+ else if (strncmp(cmd, "grp", 3) == 0)
+ g_menu_state = CURRENT_STATUS_GET_REASON_FOR_P_FOCUS;
+ else if (strncmp(cmd, "grr", 3) == 0)
+ g_menu_state = CURRENT_STATUS_GET_REASON_FOR_R_FOCUS;
else if (strncmp(cmd, "dsi", 3) == 0)
g_menu_state = CURRENT_STATUS_DESTROY_STREAM_INFO;
else if (strncmp(cmd, "vcr", 3) == 0)
g_print("ufw. Unset Focus State Watch CB\n");
g_print("sfr. Set Focus Reacquisition\t");
g_print("gfr. Get Focus Reacquisition\n");
+ g_print("grp. Get Reason for Current Acquired Playback Focus\t");
+ g_print("grr. Get Reason for Current Acquired Recording Focus\n");
g_print("sso. *Set option for stream routing\n");
g_print("vcr. *Create VStream\t");
g_print("vsr. *Start VStream\t");
g_print("*** input focus reacquisition property (1:enable, 2:disable)\n");
else if (g_menu_state == CURRENT_STATUS_GET_FOCUS_REACQUISITION)
g_print("*** press enter to get focus reacquisition property (1:enabled, 2:disabled)\n");
+ else if (g_menu_state == CURRENT_STATUS_GET_REASON_FOR_P_FOCUS)
+ g_print("*** press enter to get reason for current playback focus\n");
+ else if (g_menu_state == CURRENT_STATUS_GET_REASON_FOR_R_FOCUS)
+ g_print("*** press enter to get reason for current recording focus\n");
else if (g_menu_state == CURRENT_STATUS_CREATE_VIRTUAL_STREAM)
g_print("*** press enter to create virtual stream\n");
else if (g_menu_state == CURRENT_STATUS_START_VIRTUAL_STREAM)
focus_mask = SOUND_STREAM_FOCUS_FOR_PLAYBACK;
break;
}
- ret = sound_manager_acquire_focus(g_stream_info_h, focus_mask, NULL);
+ ret = sound_manager_acquire_focus(g_stream_info_h, focus_mask, "sound_manager_test_ac");
if (ret)
g_print("fail to sound_manager_acquire_focus(), ret(0x%x)\n", ret);
focus_mask = SOUND_STREAM_FOCUS_FOR_PLAYBACK;
break;
}
- ret = sound_manager_release_focus(g_stream_info_h, focus_mask, NULL);
+ ret = sound_manager_release_focus(g_stream_info_h, focus_mask, "sound_manager_test_rel");
if (ret)
g_print("fail to sound_manager_acquire_focus(), ret(0x%x)\n", ret);
reset_menu_state();
break;
}
+ case CURRENT_STATUS_GET_REASON_FOR_P_FOCUS: {
+ int ret = SOUND_MANAGER_ERROR_NONE;
+ char *additional_info = NULL;
+ sound_stream_focus_change_reason_e reason;
+ ret = sound_manager_get_reason_for_current_playback_focus(&reason, &additional_info);
+ if (ret)
+ g_print("fail to sound_manager_get_reason_for_current_playback_focus, ret(0x%x)\n", ret);
+ else
+ g_print("reason(%d), additional_info(%s)\n", reason, additional_info);
+ reset_menu_state();
+ break;
+ }
+ case CURRENT_STATUS_GET_REASON_FOR_R_FOCUS: {
+ int ret = SOUND_MANAGER_ERROR_NONE;
+ char *additional_info = NULL;
+ sound_stream_focus_change_reason_e reason;
+ ret = sound_manager_get_reason_for_current_recording_focus(&reason, &additional_info);
+ if (ret)
+ g_print("fail to sound_manager_get_reason_for_current_recording_focus, ret(0x%x)\n", ret);
+ else
+ g_print("reason(%d), additional_info(%s)\n", reason, additional_info);
+ reset_menu_state();
+ break;
+ }
case CURRENT_STATUS_CREATE_VIRTUAL_STREAM: {
int ret = SOUND_MANAGER_ERROR_NONE;
if (!g_stream_info_h || g_vstream_h) {