PLAYER_ENTER_LOG("start");
if (ad->stream_info) {
- const char *str = "music_playing";
- error = sound_manager_acquire_focus(ad->stream_info, SOUND_STREAM_FOCUS_FOR_PLAYBACK, str);
+ error = sound_manager_acquire_focus(ad->stream_info, SOUND_STREAM_FOCUS_FOR_PLAYBACK, SOUND_BEHAVIOR_NONE, NULL);
if (error != SOUND_MANAGER_ERROR_NONE) {
ERROR_TRACE("failed to acquire focus [%x]", error);
}
PLAYER_ENTER_LOG("stop");
int res = g_player_apis.stop(_player);
if (ad->stream_info) {
- int error = sound_manager_release_focus(ad->stream_info, SOUND_STREAM_FOCUS_FOR_PLAYBACK, NULL);
+ int error = sound_manager_release_focus(ad->stream_info, SOUND_STREAM_FOCUS_FOR_PLAYBACK, SOUND_BEHAVIOR_NONE, NULL);
if (error != SOUND_MANAGER_ERROR_NONE) {
ERROR_TRACE("failed to release focus error[%x]", error);
}
ERROR_TRACE("failed in sound_manager_get_focus_state");
}
if (state_for_playback != SOUND_STREAM_FOCUS_STATE_ACQUIRED) {
- const char *str = "music_playing";
- error = sound_manager_acquire_focus(ad->stream_info, SOUND_STREAM_FOCUS_FOR_PLAYBACK, str);
+ error = sound_manager_acquire_focus(ad->stream_info, SOUND_STREAM_FOCUS_FOR_PLAYBACK, SOUND_BEHAVIOR_NONE, NULL);
if (error != SOUND_MANAGER_ERROR_NONE) {
ERROR_TRACE("failed to acquire focus [%x]", error);
return error;
PLAYER_ENTER_LOG("pause");
err = g_player_apis.pause(_player);
if (ad->stream_info) {
- error = sound_manager_release_focus(ad->stream_info, SOUND_STREAM_FOCUS_FOR_PLAYBACK, NULL);
+ error = sound_manager_release_focus(ad->stream_info, SOUND_STREAM_FOCUS_FOR_PLAYBACK, SOUND_BEHAVIOR_NONE, NULL);
if (error != SOUND_MANAGER_ERROR_NONE) {
ERROR_TRACE("failed to release focus error[%x]", error);
}
return 0;
}
-void mp_player_focus_callback(sound_stream_info_h stream_info, sound_stream_focus_change_reason_e reason_for_change,
- const char *additional_info, void *user_data)
+void mp_player_focus_callback(sound_stream_info_h stream_info, sound_stream_focus_mask_e focus_mask,
+ sound_stream_focus_state_e focus_state, sound_stream_focus_change_reason_e reason_for_change,
+ int sound_behaviors, const char *extra_info, void *user_data)
{
startfunc;
struct appdata *ad = user_data;
ERROR_TRACE("failed in sound_manager_get_focus_state");
}
- int req_flag = SOUND_BEHAVIOR_NONE;
- sound_manager_focus_get_requested_behavior(ad->stream_info, &req_flag);
-
if (state_for_playback == SOUND_STREAM_FOCUS_STATE_RELEASED) {
mp_player_mgr_pause(ad);
sound_manager_set_focus_reacquisition(ad->stream_info, EINA_TRUE);
} else if (reason_for_change != SOUND_STREAM_FOCUS_CHANGED_BY_ALARM &&
reason_for_change != SOUND_STREAM_FOCUS_CHANGED_BY_NOTIFICATION) {
- if (!g_strcmp0(additional_info, "music_playing")) {
- sound_manager_set_focus_reacquisition(ad->stream_info, EINA_FALSE);
- } else if (reacquire_state == EINA_TRUE) {
+ if (reacquire_state == EINA_TRUE) {
sound_manager_set_focus_reacquisition(ad->stream_info, EINA_FALSE);
}
- } else if (req_flag & SOUND_BEHAVIOR_NO_RESUME) {
+ } else if (sound_behaviors & SOUND_BEHAVIOR_NO_RESUME) {
sound_manager_set_focus_reacquisition(ad->stream_info, EINA_FALSE);
}
} else {
ret = sound_manager_create_stream_information(SOUND_STREAM_TYPE_MEDIA, mp_player_focus_callback, ad, &ad->stream_info);
if (ret != SOUND_MANAGER_ERROR_NONE) {
- EVENT_TRACE("failed to create_stream_information %x", ret);
+ EVENT_TRACE("failed to create_stream_information [%x]", ret);
return FALSE;
}
}