videoplayback/videohelix/src/mpxvideoplaybackstate.cpp
changeset 24 7d93ee07fb27
parent 20 b9e04db066d4
child 28 c48470be1ba7
equal deleted inserted replaced
20:b9e04db066d4 24:7d93ee07fb27
    14 * Description:  This class plays local video file
    14 * Description:  This class plays local video file
    15 *
    15 *
    16 */
    16 */
    17 
    17 
    18 
    18 
    19 // Version : %version: 41 %
    19 // Version : %version: 43 %
    20 
    20 
    21 
    21 
    22 //
    22 //
    23 //  INCLUDE FILES
    23 //  INCLUDE FILES
    24 //
    24 //
   168 //    CMPXVideoPlaybackState::HandleStopSeekL()
   168 //    CMPXVideoPlaybackState::HandleStopSeekL()
   169 //  ------------------------------------------------------------------------------------------------
   169 //  ------------------------------------------------------------------------------------------------
   170 void CMPXVideoPlaybackState::HandleStopSeekL()
   170 void CMPXVideoPlaybackState::HandleStopSeekL()
   171 {
   171 {
   172     MPX_DEBUG(_L("CMPXVideoPlaybackState::HandleStopSeekL()"));
   172     MPX_DEBUG(_L("CMPXVideoPlaybackState::HandleStopSeekL()"));
       
   173 }
       
   174 
       
   175 //  ------------------------------------------------------------------------------------------------
       
   176 //    CMPXVideoPlaybackState::HandleSetPosterFrame()
       
   177 //  ------------------------------------------------------------------------------------------------
       
   178 void CMPXVideoPlaybackState::HandleSetPosterFrame()
       
   179 {
       
   180     MPX_DEBUG(_L("CMPXVideoPlaybackState::HandleSetPosterFrame()"));    
   173 }
   181 }
   174 
   182 
   175 //  ------------------------------------------------------------------------------------------------
   183 //  ------------------------------------------------------------------------------------------------
   176 //    CMPXVideoPlaybackState::HandleForeground()
   184 //    CMPXVideoPlaybackState::HandleForeground()
   177 //  ------------------------------------------------------------------------------------------------
   185 //  ------------------------------------------------------------------------------------------------
  1193 {
  1201 {
  1194     MPX_DEBUG(_L("CMPXInitialisedState::HandlePlay()"));
  1202     MPX_DEBUG(_L("CMPXInitialisedState::HandlePlay()"));
  1195 
  1203 
  1196     if ( iVideoPlaybackCtlr->iPlaybackMode->CanPlayNow() )
  1204     if ( iVideoPlaybackCtlr->iPlaybackMode->CanPlayNow() )
  1197     {
  1205     {
  1198         iVideoPlaybackCtlr->iForegroundPause = EFalse;
       
  1199 
       
  1200         IssuePlayCommand( EMPXVideoBuffering, MMPXPlaybackPluginObserver::EPBufferingStarted );
  1206         IssuePlayCommand( EMPXVideoBuffering, MMPXPlaybackPluginObserver::EPBufferingStarted );
  1201     }
  1207     }
  1202     else
  1208     else
  1203     {
  1209     {
  1204         iVideoPlaybackCtlr->iPlaybackMode->HandlePause();
  1210         iVideoPlaybackCtlr->iPlaybackMode->HandlePause();
  1363 {
  1369 {
  1364     MPX_DEBUG(_L("CMPXPlayingState::HandlePlayPause()"));
  1370     MPX_DEBUG(_L("CMPXPlayingState::HandlePlayPause()"));
  1365     HandlePause();
  1371     HandlePause();
  1366 }
  1372 }
  1367 
  1373 
       
  1374 
       
  1375 //  ------------------------------------------------------------------------------------------------
       
  1376 //    CMPXPlayingState::HandleSetPosterFrame()
       
  1377 //  ------------------------------------------------------------------------------------------------
       
  1378 void CMPXPlayingState::HandleSetPosterFrame()
       
  1379 {
       
  1380     MPX_DEBUG(_L("CMPXPlayingState::HandleSetPosterFrame()"));
       
  1381     
       
  1382     iVideoPlaybackCtlr->iPlaybackMode->HandleSetPosterFrame();    
       
  1383 }
       
  1384 
       
  1385 
  1368 //  ------------------------------------------------------------------------------------------------
  1386 //  ------------------------------------------------------------------------------------------------
  1369 //  CMPXPlayingState::HandleStartSeekL()
  1387 //  CMPXPlayingState::HandleStartSeekL()
  1370 //  ------------------------------------------------------------------------------------------------
  1388 //  ------------------------------------------------------------------------------------------------
  1371 void CMPXPlayingState::HandleStartSeekL( TBool aForward )
  1389 void CMPXPlayingState::HandleStartSeekL( TBool aForward )
  1372 {
  1390 {
  1505 {
  1523 {
  1506     MPX_ENTER_EXIT(_L("CMPXPausedState::HandlePlay()"));
  1524     MPX_ENTER_EXIT(_L("CMPXPausedState::HandlePlay()"));
  1507 
  1525 
  1508     if ( iVideoPlaybackCtlr->iPlaybackMode->CanPlayNow() )
  1526     if ( iVideoPlaybackCtlr->iPlaybackMode->CanPlayNow() )
  1509     {
  1527     {
  1510         iVideoPlaybackCtlr->iForegroundPause = EFalse;
       
  1511 
       
  1512         IssuePlayCommand( EMPXVideoPlaying, MMPXPlaybackPluginObserver::EPPlaying );
  1528         IssuePlayCommand( EMPXVideoPlaying, MMPXPlaybackPluginObserver::EPPlaying );
  1513     }
  1529     }
  1514 }
  1530 }
  1515 
  1531 
  1516 //  ------------------------------------------------------------------------------------------------
  1532 //  ------------------------------------------------------------------------------------------------
  1518 //  ------------------------------------------------------------------------------------------------
  1534 //  ------------------------------------------------------------------------------------------------
  1519 void CMPXPausedState::HandlePlayPause()
  1535 void CMPXPausedState::HandlePlayPause()
  1520 {
  1536 {
  1521     MPX_DEBUG(_L("CMPXPausedState::HandlePlayPause()"));
  1537     MPX_DEBUG(_L("CMPXPausedState::HandlePlayPause()"));
  1522     HandlePlay();
  1538     HandlePlay();
       
  1539 }
       
  1540 
       
  1541 //  ------------------------------------------------------------------------------------------------
       
  1542 //    CMPXPausedState::HandleSetPosterFrame()
       
  1543 //  ------------------------------------------------------------------------------------------------
       
  1544 void CMPXPausedState::HandleSetPosterFrame()
       
  1545 {
       
  1546     MPX_DEBUG(_L("CMPXPausedState::HandleSetPosterFrame()"));    
       
  1547     
       
  1548     iVideoPlaybackCtlr->iPlaybackMode->HandleSetPosterFrame();
  1523 }
  1549 }
  1524 
  1550 
  1525 //  ------------------------------------------------------------------------------------------------
  1551 //  ------------------------------------------------------------------------------------------------
  1526 //  CMPXPausedState::HandleSetPositionL()
  1552 //  CMPXPausedState::HandleSetPositionL()
  1527 //  ------------------------------------------------------------------------------------------------
  1553 //  ------------------------------------------------------------------------------------------------
  1593 //  ------------------------------------------------------------------------------------------------
  1619 //  ------------------------------------------------------------------------------------------------
  1594 //    CMPXPausedState::HandleForeground()
  1620 //    CMPXPausedState::HandleForeground()
  1595 //  ------------------------------------------------------------------------------------------------
  1621 //  ------------------------------------------------------------------------------------------------
  1596 void CMPXPausedState::HandleForeground()
  1622 void CMPXPausedState::HandleForeground()
  1597 {
  1623 {
  1598     MPX_ENTER_EXIT(_L("CMPXPausedState::HandleForeground()"),
  1624     MPX_ENTER_EXIT(_L("CMPXPausedState::HandleForeground()"));
  1599                    _L("foreground pause = %d"), iVideoPlaybackCtlr->iForegroundPause );
  1625 
  1600 
  1626     MPX_TRAPD( err, iVideoPlaybackCtlr->iPlayer->RefreshFrameL() );
  1601     if ( iVideoPlaybackCtlr->iForegroundPause )
       
  1602     {
       
  1603         iVideoPlaybackCtlr->iState->HandlePlay();
       
  1604     }
       
  1605     else
       
  1606     {
       
  1607         MPX_TRAPD( err, iVideoPlaybackCtlr->iPlayer->RefreshFrameL() );
       
  1608     }
       
  1609 }
  1627 }
  1610 
  1628 
  1611 //  ------------------------------------------------------------------------------------------------
  1629 //  ------------------------------------------------------------------------------------------------
  1612 //    CMPXPausedState::HandleCustomPlay()
  1630 //    CMPXPausedState::HandleCustomPlay()
  1613 //    Handle the custom play command only when in paused state.
  1631 //    Handle the custom play command only when in paused state.
  1617 {
  1635 {
  1618     MPX_ENTER_EXIT(_L("CMPXPausedState::HandleCustomPlay()"));
  1636     MPX_ENTER_EXIT(_L("CMPXPausedState::HandleCustomPlay()"));
  1619 
  1637 
  1620     if ( iVideoPlaybackCtlr->iPlaybackMode->CanPlayNow() )
  1638     if ( iVideoPlaybackCtlr->iPlaybackMode->CanPlayNow() )
  1621     {
  1639     {
  1622         iVideoPlaybackCtlr->iForegroundPause = EFalse;
       
  1623 
       
  1624         IssuePlayCommand( EMPXVideoPlaying, MMPXPlaybackPluginObserver::EPPlaying, EFalse );
  1640         IssuePlayCommand( EMPXVideoPlaying, MMPXPlaybackPluginObserver::EPPlaying, EFalse );
  1625     }
  1641     }
  1626 }
  1642 }
  1627 
  1643 
  1628 // *************************************************************************************************
  1644 // *************************************************************************************************
  1777     MPX_ENTER_EXIT(_L("CMPXBufferingState::HandleLoadingComplete()"),
  1793     MPX_ENTER_EXIT(_L("CMPXBufferingState::HandleLoadingComplete()"),
  1778                    _L("error = %d"), aError );
  1794                    _L("error = %d"), aError );
  1779 
  1795 
  1780     if ( aError == KErrNone )
  1796     if ( aError == KErrNone )
  1781     {
  1797     {
  1782         if ( iVideoPlaybackCtlr->iAppInForeground && !iVideoPlaybackCtlr->iForegroundPause )
  1798         if ( iVideoPlaybackCtlr->iAppInForeground )
  1783         {
  1799         {
  1784             iVideoPlaybackCtlr->ChangeState( EMPXVideoPlaying );
  1800             iVideoPlaybackCtlr->ChangeState( EMPXVideoPlaying );
  1785 
  1801 
  1786             iVideoPlaybackCtlr->iMPXPluginObs->HandlePluginEvent(
  1802             iVideoPlaybackCtlr->iMPXPluginObs->HandlePluginEvent(
  1787                                                     MMPXPlaybackPluginObserver::EPPlaying,
  1803                                                     MMPXPlaybackPluginObserver::EPPlaying,