int sound_manager_get_focus_state(sound_stream_info_h stream_info, sound_stream_focus_state_e *state_for_playback, sound_stream_focus_state_e *state_for_recording)
{
- int ret = MM_ERROR_NONE;
sound_stream_info_s *stream_h = (sound_stream_info_s*)stream_info;
SM_ARG_CHECK(stream_h);
SM_LEAVE_CRITICAL_SECTION(&stream_h->focus_state_mutex);
- return _convert_sound_manager_error_code(__func__, ret);
+ return SOUND_MANAGER_ERROR_NONE;
}
int sound_manager_deliver_focus(sound_stream_info_h source, sound_stream_info_h destination, sound_stream_focus_mask_e focus_mask)
int sound_manager_get_current_playback_focus(sound_stream_focus_change_reason_e *acquired_by, int *flags, char **extra_info)
{
- int ret = MM_ERROR_NONE;
+ int ret = SOUND_MANAGER_ERROR_NONE;
+ int mm_ret = MM_ERROR_NONE;
char *stream_type_str = NULL;
char *extra_info_str = NULL;
int option = 0;
LOGI(">> enter");
- if ((ret = mm_sound_focus_is_cb_thread(&is_focus_cb_thread, NULL)))
- return _convert_sound_manager_error_code(__func__, ret);
+ if ((mm_ret = mm_sound_focus_is_cb_thread(&is_focus_cb_thread, NULL)))
+ return _convert_sound_manager_error_code(__func__, mm_ret);
if (is_focus_cb_thread) {
LOGE("this API should not be called in focus callback");
return SOUND_MANAGER_ERROR_INVALID_OPERATION;
}
- ret = mm_sound_get_stream_type_of_acquired_focus((int)SOUND_STREAM_FOCUS_FOR_PLAYBACK, &stream_type_str, &option, &extra_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) {
- LOGI(" : reason[%d], flags[0x%x], extra_info[%s]", *acquired_by, option, extra_info_str);
- *flags = option;
- if (extra_info)
- *extra_info = strdup(extra_info_str);
- }
- SM_SAFE_FREE(stream_type_str);
- SM_SAFE_FREE(extra_info_str);
+ mm_ret = mm_sound_get_stream_type_of_acquired_focus((int)SOUND_STREAM_FOCUS_FOR_PLAYBACK, &stream_type_str, &option, &extra_info_str);
+ if (mm_ret)
+ return _convert_sound_manager_error_code(__func__, mm_ret);
+
+ 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 == SOUND_MANAGER_ERROR_NONE) {
+ LOGI(" : reason[%d], flags[0x%x], extra_info[%s]", *acquired_by, option, extra_info_str);
+ *flags = option;
+ if (extra_info)
+ *extra_info = strdup(extra_info_str);
}
+ SM_SAFE_FREE(stream_type_str);
+ SM_SAFE_FREE(extra_info_str);
- return _convert_sound_manager_error_code(__func__, ret);
+ return ret;
}
int sound_manager_get_current_recording_focus(sound_stream_focus_change_reason_e *acquired_by, int *flags, char **extra_info)
{
- int ret = MM_ERROR_NONE;
+ int ret = SOUND_MANAGER_ERROR_NONE;
+ int mm_ret = MM_ERROR_NONE;
char *stream_type_str = NULL;
char *extra_info_str = NULL;
int option = 0;
LOGI(">> enter");
- if ((ret = mm_sound_focus_is_cb_thread(&is_focus_cb_thread, NULL)))
- return _convert_sound_manager_error_code(__func__, ret);
+ if ((mm_ret = mm_sound_focus_is_cb_thread(&is_focus_cb_thread, NULL)))
+ return _convert_sound_manager_error_code(__func__, mm_ret);
if (is_focus_cb_thread) {
LOGE("this API should not be called in focus callback");
return SOUND_MANAGER_ERROR_INVALID_OPERATION;
}
- ret = mm_sound_get_stream_type_of_acquired_focus((int)SOUND_STREAM_FOCUS_FOR_RECORDING, &stream_type_str, &option, &extra_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) {
- LOGI(" : reason[%d], flags[0x%x], extra_info[%s]", *acquired_by, option, extra_info_str);
- *flags = option;
- if (extra_info)
- *extra_info = strdup(extra_info_str);
- }
- SM_SAFE_FREE(stream_type_str);
- SM_SAFE_FREE(extra_info_str);
+ mm_ret = mm_sound_get_stream_type_of_acquired_focus((int)SOUND_STREAM_FOCUS_FOR_RECORDING, &stream_type_str, &option, &extra_info_str);
+ if (mm_ret)
+ return _convert_sound_manager_error_code(__func__, mm_ret);
+
+ 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 == SOUND_MANAGER_ERROR_NONE) {
+ LOGI(" : reason[%d], flags[0x%x], extra_info[%s]", *acquired_by, option, extra_info_str);
+ *flags = option;
+ if (extra_info)
+ *extra_info = strdup(extra_info_str);
}
+ SM_SAFE_FREE(stream_type_str);
+ SM_SAFE_FREE(extra_info_str);
- return _convert_sound_manager_error_code(__func__, ret);
+ return ret;
}
int sound_manager_add_focus_state_watch_cb(sound_stream_focus_mask_e focus_mask, sound_stream_focus_state_watch_cb callback, void *user_data, int *id)
int ret = MM_ERROR_NONE;
int i = 0;
- LOGI(">> enter");
-
SM_ARG_CHECK(callback);
SM_ARG_CHECK(id);
+ LOGI(">> enter");
+
for (i = 0; i < SOUND_STREAM_INFO_ARR_MAX; i++)
if (focus_watch_info_arr[i].id == 0)
break;