vp_mm_player_rotate_t nRotate;
vp_mm_player_state_t nState;
vp_mm_player_display_mode_t nDisplayMode;
+ sound_stream_info_h stream_info;
int nDuration;
int nVideoWidth;
int nZoomPosX;
int nZoomPosY;
+ bool reacquire_state;
void *pVideoSink;
} MMPlayer;
bool vp_mm_player_set_callback(mm_player_handle pPlayerHandle, vp_mm_player_callback_t nCallbackType, void *pCallback);
bool vp_mm_player_set_user_param(mm_player_handle pPlayerHandle, void *pParam);
+bool vp_mm_player_set_stream_info(mm_player_handle pPlayerHandle, void *stream_info);
bool vp_mm_player_play(mm_player_handle pPlayerHandle);
bool vp_mm_player_stop(mm_player_handle pPlayerHandle);
VideoLogInfo(">> player create");
+ sound_manager_get_focus_reacquisition(pMMPlayer->stream_info, &pMMPlayer->reacquire_state);
+ if (pMMPlayer->reacquire_state == EINA_FALSE)
+ sound_manager_set_focus_reacquisition(pMMPlayer->stream_info, EINA_TRUE);
+ sound_stream_focus_state_e state_for_playback;
+ sound_stream_focus_state_e state_for_recording;
+ int ret = -1;
+ ret = sound_manager_get_focus_state(pMMPlayer->stream_info, &state_for_playback, &state_for_recording);
+ if (ret != SOUND_MANAGER_ERROR_NONE) {
+ VideoLogError("failed to get focus state error[%x]", ret);
+ }
+ if (state_for_playback == SOUND_STREAM_FOCUS_STATE_RELEASED) {
+ int error = SOUND_MANAGER_ERROR_NONE;
+ error = sound_manager_acquire_focus(pMMPlayer->stream_info, SOUND_STREAM_FOCUS_FOR_PLAYBACK, NULL);
+ if (error != SOUND_MANAGER_ERROR_NONE)
+ VideoLogError("failed to acquire focus [%x]", error);
+ }
+
int nRet = 0;
nRet = player_create(&pMMPlayer->pPlayer);
if (nRet != PLAYER_ERROR_NONE) {
return TRUE;
}
+bool vp_mm_player_set_stream_info(mm_player_handle pPlayerHandle,
+ void *stream_info)
+{
+ if (pPlayerHandle == NULL) {
+ VideoLogError("pPlayerHandle is NULL");
+ return FALSE;
+ }
+
+ if (stream_info == NULL) {
+ VideoLogError("stream info is NULL");
+ return FALSE;
+ }
+
+ MMPlayer *pMMPlayer = (MMPlayer *)pPlayerHandle;
+
+ pMMPlayer->stream_info = stream_info;
+
+ return TRUE;
+}
+
bool vp_mm_player_play(mm_player_handle pPlayerHandle)
{
if (pPlayerHandle == NULL) {
VideoLogError("Not realized");
return FALSE;
}
+ sound_manager_get_focus_reacquisition(pMMPlayer->stream_info, &pMMPlayer->reacquire_state);
+ if (pMMPlayer->reacquire_state == EINA_FALSE)
+ sound_manager_set_focus_reacquisition(pMMPlayer->stream_info, EINA_TRUE);
+ sound_stream_focus_state_e state_for_playback;
+ sound_stream_focus_state_e state_for_recording;
+ int ret = -1;
+ ret = sound_manager_get_focus_state(pMMPlayer->stream_info, &state_for_playback, &state_for_recording);
+ if (ret != SOUND_MANAGER_ERROR_NONE) {
+ VideoLogError("failed to get focus state error[%x]", ret);
+ }
+ if (state_for_playback == SOUND_STREAM_FOCUS_STATE_RELEASED) {
+ int error = SOUND_MANAGER_ERROR_NONE;
+ error = sound_manager_acquire_focus(pMMPlayer->stream_info, SOUND_STREAM_FOCUS_FOR_PLAYBACK, NULL);
+ if (error != SOUND_MANAGER_ERROR_NONE)
+ VideoLogError("failed to acquire focus [%x]", error);
+ }
VideoLogWarning("[player_start start]");
int nRet = player_start(pMMPlayer->pPlayer);
return FALSE;
}
VideoLogWarning("[player_stop end]");
+ sound_stream_focus_state_e state_for_playback;
+ sound_stream_focus_state_e state_for_recording;
+ int ret = -1;
+ ret = sound_manager_get_focus_state(pMMPlayer->stream_info, &state_for_playback, &state_for_recording);
+ if (ret != SOUND_MANAGER_ERROR_NONE) {
+ VideoLogError("failed to get focus state error[%x]", ret);
+ }
+ if (state_for_playback != SOUND_STREAM_FOCUS_STATE_RELEASED) {
+ int error = SOUND_MANAGER_ERROR_NONE;
+ error = sound_manager_release_focus(pMMPlayer->stream_info, SOUND_STREAM_FOCUS_FOR_PLAYBACK, NULL);
+ if (error != SOUND_MANAGER_ERROR_NONE) {
+ VideoLogError("failed to release focus error[%x]", error);
+ }
+ }
return TRUE;
return FALSE;
}
VideoLogWarning("[player_pause end]");
+ sound_stream_focus_state_e state_for_playback;
+ sound_stream_focus_state_e state_for_recording;
+ int ret = -1;
+ ret = sound_manager_get_focus_state(pMMPlayer->stream_info, &state_for_playback, &state_for_recording);
+ if (ret != SOUND_MANAGER_ERROR_NONE) {
+ VideoLogError("failed to get focus state error[%x]", ret);
+ }
+ if (state_for_playback != SOUND_STREAM_FOCUS_STATE_RELEASED) {
+ int error = SOUND_MANAGER_ERROR_NONE;
+ error = sound_manager_release_focus(pMMPlayer->stream_info, SOUND_STREAM_FOCUS_FOR_PLAYBACK, NULL);
+ if (error != SOUND_MANAGER_ERROR_NONE) {
+ VideoLogError("failed to release focus error[%x]", error);
+ }
+ }
return TRUE;
const char *additional_info, void *user_data)
{
PlayView *pPlayView = (PlayView *)user_data;
-
sound_stream_focus_state_e state_for_playback;
sound_stream_focus_state_e state_for_recording;
int ret = -1;
ret = sound_manager_get_focus_state(pPlayView->stream_info, &state_for_playback,
&state_for_recording);
if (state_for_playback == SOUND_STREAM_FOCUS_STATE_RELEASED) {
- vp_play_view_unrealize(pPlayView);
-
+ vp_play_normal_view_pause_player(pPlayView);
if (reason_for_change != SOUND_STREAM_FOCUS_CHANGED_BY_ALARM &&
reason_for_change != SOUND_STREAM_FOCUS_CHANGED_BY_NOTIFICATION) {
sound_manager_get_focus_reacquisition(pPlayView->stream_info, &pPlayView->reacquire_state);
}
}
} else {
- ret = vp_play_view_realize(pPlayView);
+ vp_play_normal_view_play_player(pPlayView);
}
}
bool vp_play_normal_view_set_tagbuddy_on(normal_view_handle pViewHandle, bool bTagBuddyOn);
void vp_play_normal_view_show_volume_popup(void *pPlayview);
void vp_play_normal_view_pause_player(void *pPlayview);
+void vp_play_normal_view_play_player(void *pPlayview);
void vp_play_normal_view_key_create(PlayView *pPlayView, normal_view_handle pViewHandle);
bool vp_play_normal_view_player_state_changed_get(normal_view_handle pViewHandle);
bool vp_play_normal_view_stop_player(normal_view_handle pViewHandle);
_vp_play_normal_view_on_capture_mode(pNormalView);
}
+void vp_play_normal_view_play_player(void *pPlayview)
+{
+ if (!pPlayview) {
+ VideoLogError("Invalid player View)");
+ return;
+ }
+ PlayView *vPlayview = (PlayView *)pPlayview;
+ NormalView *pNormalView = vPlayview->pNormalView;
+ vp_mm_player_state_t nState = VP_MM_PLAYER_STATE_NONE;
+
+ if (!vp_mm_player_get_state(pNormalView->pPlayerHandle, &nState)) {
+ VideoLogWarning("vp_mm_player_get_state is fail");
+ }
+ if (nState == VP_MM_PLAYER_STATE_PAUSED) {
+ vp_mm_player_play(pNormalView->pPlayerHandle);
+ pNormalView->bManualPause = FALSE;
+ }
+ _vp_play_normal_view_set_play_state(pNormalView);
+ _vp_play_normal_view_on_capture_mode(pNormalView);
+}
+
void vp_play_normal_view_show_volume_popup(void *pPlayview)
{
if (!pPlayview) {
VideoLogError("unable to set sound policy [%x]", nRet);
}
+ if (!vp_mm_player_set_stream_info(pNormalView->pPlayerHandle, (void *)(pNormalView->pPlayView->stream_info))) {
+ VideoLogError("vp_mm_player_set_stream_info fail");
+ return FALSE;
+ }
if (!vp_mm_player_set_user_param(pNormalView->pPlayerHandle, (void *) pNormalView)) {
VideoLogError("vp_mm_player_set_user_param fail");
return FALSE;
if (pNormalView->pPlayerHandle && pNormalView->bIsRealize) {
_vp_play_normal_view_all_close_popup(pNormalView);
}
-
if (pNormalView->bManualPause == FALSE && pNormalView->bSharepopup == FALSE) {
vp_mm_player_state_t nState = VP_MM_PLAYER_STATE_NONE;
pPlayView->bVisible = TRUE;
vp_play_normal_view_key_create(pPlayView, pPlayView->pNormalView);
vp_play_normal_view_set_share_panel_state(pPlayView->pNormalView);
- error = sound_manager_acquire_focus(pPlayView->stream_info, SOUND_STREAM_FOCUS_FOR_PLAYBACK, NULL);
- if (error != SOUND_MANAGER_ERROR_NONE) {
- VideoLogError("failed to acquire focus [%x]", error);
- }
- sound_manager_get_focus_reacquisition(pPlayView->stream_info, &pPlayView->reacquire_state);
- if (pPlayView->reacquire_state == EINA_FALSE) {
- sound_manager_set_focus_reacquisition(pPlayView->stream_info, EINA_TRUE);
+ sound_stream_focus_state_e state_for_playback;
+ sound_stream_focus_state_e state_for_recording;
+ int ret = -1;
+ ret = sound_manager_get_focus_state(pPlayView->stream_info, &state_for_playback, &state_for_recording);
+ if (ret != SOUND_MANAGER_ERROR_NONE) {
+ VideoLogError("failed to get focus state error[%x]", ret);
+ }
+ if (state_for_playback == SOUND_STREAM_FOCUS_STATE_RELEASED) {
+ error = sound_manager_acquire_focus(pPlayView->stream_info, SOUND_STREAM_FOCUS_FOR_PLAYBACK, NULL);
+ if (error != SOUND_MANAGER_ERROR_NONE) {
+ VideoLogError("failed to acquire focus [%x]", error);
+ }
+ sound_manager_get_focus_reacquisition(pPlayView->stream_info, &pPlayView->reacquire_state);
+ if (pPlayView->reacquire_state == EINA_FALSE)
+ sound_manager_set_focus_reacquisition(pPlayView->stream_info, EINA_TRUE);
}
if (pPlayView->bRealized == TRUE) {
VideoLogWarning("Already Realize state");
vp_play_util_key_ungrab(pPlayView->pWin, VP_VOLUME_MUTE);
vp_play_util_key_ungrab(pPlayView->pWin, VP_HOME_KEY);
sound_manager_unset_current_sound_type();
- error = sound_manager_release_focus(pPlayView->stream_info, SOUND_STREAM_FOCUS_FOR_PLAYBACK, NULL);
- if (error != SOUND_MANAGER_ERROR_NONE) {
- VideoLogError("failed to release focus error[%x]", error);
- }
+ sound_stream_focus_state_e state_for_playback;
+ sound_stream_focus_state_e state_for_recording;
+ int ret = -1;
+ ret = sound_manager_get_focus_state(pPlayView->stream_info, &state_for_playback, &state_for_recording);
+ if (ret != SOUND_MANAGER_ERROR_NONE) {
+ VideoLogError("failed to get focus state error[%x]", ret);
+ }
+ if (state_for_playback != SOUND_STREAM_FOCUS_STATE_RELEASED) {
+ error = sound_manager_release_focus(pPlayView->stream_info, SOUND_STREAM_FOCUS_FOR_PLAYBACK, NULL);
+ if (error != SOUND_MANAGER_ERROR_NONE) {
+ VideoLogError("failed to release focus error[%x]", error);
+ }
+ }
media_key_release();
int nDuration = 0;
if (vp_play_normal_view_get_video_duration(pPlayView->pNormalView, &nDuration)) {