* @param bAppToFW
* @return
*/
-static int _vp_mm_player_priv_convert_interrupt(int nCode, bool bAppToFW)
-{
-
- if (bAppToFW) {
- switch (nCode) {
- case PLAYER_INTERRUPTED_BY_RESOURCE_CONFLICT:
- return VP_MM_PLAYER_INTERRUPTED_BY_RESOURCE_CONFLICT;
- }
- } else {
- switch (nCode) {
- case VP_MM_PLAYER_INTERRUPTED_COMPLETED:
- return PLAYER_INTERRUPTED_COMPLETED;
- case VP_MM_PLAYER_INTERRUPTED_BY_MEDIA:
- return PLAYER_INTERRUPTED_BY_MEDIA;
- case VP_MM_PLAYER_INTERRUPTED_BY_CALL:
- return PLAYER_INTERRUPTED_BY_CALL;
- case VP_MM_PLAYER_INTERRUPTED_BY_EARJACK_UNPLUG:
- return PLAYER_INTERRUPTED_BY_EARJACK_UNPLUG;
- case VP_MM_PLAYER_INTERRUPTED_BY_RESOURCE_CONFLICT:
- return PLAYER_INTERRUPTED_BY_RESOURCE_CONFLICT;
- case VP_MM_PLAYER_INTERRUPTED_BY_ALARM:
- return PLAYER_INTERRUPTED_BY_ALARM;
- case VP_MM_PLAYER_INTERRUPTED_BY_EMERGENCY:
- return PLAYER_INTERRUPTED_BY_EMERGENCY;
- case VP_MM_PLAYER_INTERRUPTED_NOTIFICATION:
- return PLAYER_INTERRUPTED_BY_NOTIFICATION;
- }
- }
- return 0;
-}
-
-/**
- *
- * @param nCode
- * @param bAppToFW
- * @return
- */
static int _vp_mm_player_priv_convert_player_state(int nCode,
bool bAppToFW)
{
MMPlayer *pMMPlayer = (MMPlayer *) pUserData;
if (pMMPlayer->pCbFunc->pInterruptedCb) {
- int nInterruptCode = 0;
if (pMMPlayer->pInterruptParam) {
- nInterruptCode =
- _vp_mm_player_priv_convert_interrupt
- (pMMPlayer->pInterruptParam->nInterrupt, TRUE);
+ int nInterruptCode = pMMPlayer->pInterruptParam->nInterrupt;
+ if (nInterruptCode == PLAYER_INTERRUPTED_BY_RESOURCE_CONFLICT) {
+ pMMPlayer->pCbFunc->pInterruptedCb(nInterruptCode, pMMPlayer->pParam);
+ }
}
-
- pMMPlayer->pCbFunc->pInterruptedCb(nInterruptCode,
- pMMPlayer->pParam);
}
return;
return;
}
- NormalView *pNormalView = (NormalView *) pUserData;
- PlayView *pPlayView = pNormalView->pPlayView;
-
- if (!pPlayView) {
- VideoLogError("pPlayView is NULL");
- }
VideoLogWarning("== %d ==", nCode);
- if (nCode == VP_MM_PLAYER_INTERRUPTED_COMPLETED) {
- if (pNormalView->bManualPause == FALSE) {
- vp_mm_player_play(pNormalView->pPlayerHandle);
- if (pPlayView && pPlayView->win_minicon) {
- vp_minicontroller_update_control(pPlayView);
- }
- if (pPlayView && pPlayView->win_lockmini) {
- vp_lockscreenmini_update_control(pPlayView);
- }
- }
- } else if (nCode == VP_MM_PLAYER_INTERRUPTED_BY_MEDIA) {
- pNormalView->bManualPause = TRUE;
- } else if (nCode == VP_MM_PLAYER_INTERRUPTED_BY_EARJACK_UNPLUG) {
- if (pNormalView->bDeviceRemoveInterrupt) {
- if (pNormalView->bManualPause == FALSE) {
- vp_mm_player_play(pNormalView->pPlayerHandle);
- if (pPlayView && pPlayView->win_minicon) {
- vp_minicontroller_update_control(pPlayView);
- }
- if (pPlayView && pPlayView->win_lockmini) {
- vp_lockscreenmini_update_control(pPlayView);
- }
- }
- pNormalView->bDeviceRemoveInterrupt = FALSE;
- }
- } else if (nCode == VP_MM_PLAYER_INTERRUPTED_BY_RESOURCE_CONFLICT) {
+ if (nCode == VP_MM_PLAYER_INTERRUPTED_BY_RESOURCE_CONFLICT) {
+ NormalView *pNormalView = (NormalView *) pUserData;
PlayView *pPlayView = pNormalView->pPlayView;
if (!pPlayView) {
VideoLogError("pPlayView is NULL");
return;
}
- _vp_play_normal_view_set_play_state(pNormalView);
- _vp_play_normal_view_on_capture_mode(pNormalView);
}
/**