videoplayback/videohelix/src/mpxvideoplaybackmode.cpp
branchRCL_3
changeset 14 8970fbd719ec
parent 13 112a725ff2c2
child 16 7f2b2a65da29
equal deleted inserted replaced
13:112a725ff2c2 14:8970fbd719ec
    13 *
    13 *
    14 * Description:  This class plays local video file
    14 * Description:  This class plays local video file
    15  *
    15  *
    16 */
    16 */
    17 
    17 
    18 // Version : %version: e003sa33#21 %
    18 // Version : %version: 22 %
    19 
    19 
    20 
    20 
    21 
    21 
    22 //
    22 //
    23 //  INCLUDE FILES
    23 //  INCLUDE FILES
   197         iVideoPlaybackCtlr->iState->HandlePause();
   197         iVideoPlaybackCtlr->iState->HandlePause();
   198     }
   198     }
   199 }
   199 }
   200 
   200 
   201 //  ------------------------------------------------------------------------------------------------
   201 //  ------------------------------------------------------------------------------------------------
   202 //  CMPXVideoPlaybackMode::CanPlayNow
   202 //  CMPXVideoPlaybackMode::CanPlayNow()
   203 //  ------------------------------------------------------------------------------------------------
   203 //  ------------------------------------------------------------------------------------------------
   204 TBool CMPXVideoPlaybackMode::CanPlayNow()
   204 TBool CMPXVideoPlaybackMode::CanPlayNow()
   205 {
   205 {
   206     MPX_DEBUG(_L("CMPXVideoPlaybackMode::CanPlayNow"));
   206     MPX_ENTER_EXIT(_L("CMPXVideoPlaybackMode::CanPlayNow"));
       
   207 
   207     TBool playAllowed = EFalse;
   208     TBool playAllowed = EFalse;
   208 
   209 
   209     if ( iVideoPlaybackCtlr->iAppInForeground && iVideoPlaybackCtlr->iAllowAutoPlay )
   210     if ( iVideoPlaybackCtlr->iAppInForeground && iVideoPlaybackCtlr->iAllowAutoPlay )
   210     {
   211     {
   211         if ( iVideoPlaybackCtlr->IsVideoCall() )
   212         if ( iVideoPlaybackCtlr->IsVideoCall() )
   360 
   361 
   361         HBufC8* tempBuf = NULL;
   362         HBufC8* tempBuf = NULL;
   362         TInt apMaxLen = 3;
   363         TInt apMaxLen = 3;
   363 
   364 
   364         MPX_TRAPD( err,
   365         MPX_TRAPD( err,
   365                    HBufC8* accessPoint = HBufC8::NewLC( KMMFAccessPoint().Length() + apMaxLen );
   366         {
   366                    accessPoint->Des().Format( KMMFAccessPoint, iVideoPlaybackCtlr->iAccessPointId );
   367             HBufC8* accessPoint = HBufC8::NewLC( KMMFAccessPoint().Length() + apMaxLen );
   367 
   368             accessPoint->Des().Format( KMMFAccessPoint, iVideoPlaybackCtlr->iAccessPointId );
   368                    tempBuf = HBufC8::NewLC( accessPoint->Length() );
   369 
   369                    tempBuf->Des().Copy( accessPoint->Des() );
   370             tempBuf = HBufC8::NewLC( accessPoint->Length() );
   370 
   371             tempBuf->Des().Copy( accessPoint->Des() );
   371                    if ( tempBuf )
   372 
   372                    {
   373             if ( tempBuf )
   373                        iVideoPlaybackCtlr->iPlayer->CustomCommandSync( destinationPckg,
   374             {
   374                                                             EMMFROPControllerSetApplicationConfig,
   375                 iVideoPlaybackCtlr->iPlayer->CustomCommandSync(
   375                                                             tempBuf->Des(),
   376                                                  destinationPckg,
   376                                                             savePckg );
   377                                                  EMMFROPControllerSetApplicationConfig,
   377                    }
   378                                                  tempBuf->Des(),
   378 
   379                                                  savePckg );
   379                    CleanupStack::PopAndDestroy(2);   // accessPoint, tempBuf 
   380             }
   380                 );
   381 
   381     }
   382             CleanupStack::PopAndDestroy(2);
   382 }
   383         } );
   383 
   384     }
   384 //  ------------------------------------------------------------------------------------------------
   385 }
   385 //  CMPXStreamingPlaybackMode::CanPlayNow
   386 
       
   387 //  ------------------------------------------------------------------------------------------------
       
   388 //    CMPXStreamingPlaybackMode::CanPlayNow
   386 //  ------------------------------------------------------------------------------------------------
   389 //  ------------------------------------------------------------------------------------------------
   387 TBool CMPXStreamingPlaybackMode::CanPlayNow()
   390 TBool CMPXStreamingPlaybackMode::CanPlayNow()
   388 {
   391 {
   389     MPX_DEBUG(_L("CMPXStreamingPlaybackMode::CanPlayNow"));
   392     MPX_ENTER_EXIT(_L("CMPXStreamingPlaybackMode::CanPlayNow"));
       
   393 
   390     TBool playAllowed = EFalse;
   394     TBool playAllowed = EFalse;
   391 
   395 
   392     if ( iVideoPlaybackCtlr->iAppInForeground && iVideoPlaybackCtlr->iAllowAutoPlay )
   396     if ( iVideoPlaybackCtlr->iAppInForeground && iVideoPlaybackCtlr->iAllowAutoPlay )
   393     {
   397     {
   394         if ( iVideoPlaybackCtlr->IsVideoCall() )
   398         if ( iVideoPlaybackCtlr->IsVideoCall() )
   423 TBool CMPXStreamingPlaybackMode::IsTvOutAllowedL()
   427 TBool CMPXStreamingPlaybackMode::IsTvOutAllowedL()
   424 {
   428 {
   425     MPX_ENTER_EXIT(_L("CMPXStreamingPlaybackMode::IsTvOutAllowedL(1)"));
   429     MPX_ENTER_EXIT(_L("CMPXStreamingPlaybackMode::IsTvOutAllowedL(1)"));
   426     return ETrue;
   430     return ETrue;
   427 }
   431 }
       
   432 
   428 //  ------------------------------------------------------------------------------------------------
   433 //  ------------------------------------------------------------------------------------------------
   429 //    CMPXStreamingPlaybackMode::HandlePause()
   434 //    CMPXStreamingPlaybackMode::HandlePause()
   430 //  ------------------------------------------------------------------------------------------------
   435 //  ------------------------------------------------------------------------------------------------
   431 void CMPXStreamingPlaybackMode::HandlePause()
   436 void CMPXStreamingPlaybackMode::HandlePause()
   432 {
   437 {
   438 
   443 
   439         if ( err == KErrNone )
   444         if ( err == KErrNone )
   440         {
   445         {
   441             iVideoPlaybackCtlr->ChangeState( EMPXVideoPaused );
   446             iVideoPlaybackCtlr->ChangeState( EMPXVideoPaused );
   442 
   447 
   443             iVideoPlaybackCtlr->iMPXPluginObs->HandlePluginEvent( MMPXPlaybackPluginObserver::EPPaused,
   448             iVideoPlaybackCtlr->iMPXPluginObs->HandlePluginEvent(
   444                                                                   0,
   449                                                    MMPXPlaybackPluginObserver::EPPaused,
   445                                                                   err );
   450                                                    0,
       
   451                                                    err );
   446         }
   452         }
   447         else
   453         else
   448         {
   454         {
   449             TRAP_IGNORE( iVideoPlaybackCtlr->iState->SendErrorToViewL( err ) );
   455             TRAP_IGNORE( iVideoPlaybackCtlr->iState->SendErrorToViewL( err ) );
   450         }
   456         }