videoplayback/videohelix/src/mpxvideoplaybackmode.cpp
branchRCL_3
changeset 14 55fa1ec415c6
parent 12 7f2b2a65da29
child 15 8f0df5c82986
equal deleted inserted replaced
12:7f2b2a65da29 14:55fa1ec415c6
    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: 23 %
    18 
    19 
    19 // Version : %version: 25 %
    20 
    20 
    21 
    21 
    22 //
    22 //
    23 //  INCLUDE FILES
    23 //  INCLUDE FILES
    24 //
    24 //
   175 //  ------------------------------------------------------------------------------------------------
   175 //  ------------------------------------------------------------------------------------------------
   176 void CMPXVideoPlaybackMode::HandleBackground()
   176 void CMPXVideoPlaybackMode::HandleBackground()
   177 {
   177 {
   178     MPX_DEBUG(_L("CMPXVideoPlaybackMode::HandleBackground()"));
   178     MPX_DEBUG(_L("CMPXVideoPlaybackMode::HandleBackground()"));
   179 
   179 
       
   180     //
       
   181     //  Pause in all cases to remove the different behavior based on the decoder
       
   182     //
       
   183     iVideoPlaybackCtlr->iState->HandlePause();
       
   184 
   180     if ( iVideoPlaybackCtlr->iAppInForeground )
   185     if ( iVideoPlaybackCtlr->iAppInForeground )
   181     {
   186     {
   182         if ( iVideoPlaybackCtlr->IsAlarm() )
   187         if ( iVideoPlaybackCtlr->IsAlarm() )
   183         {
   188         {
   184             iVideoPlaybackCtlr->iForegroundPause = ETrue;
   189             iVideoPlaybackCtlr->iForegroundPause = ETrue;
   185             iVideoPlaybackCtlr->iState->HandlePause();
   190         }
   186         }
   191         else if ( iVideoPlaybackCtlr->IsKeyLocked() &&
   187         else if ( iVideoPlaybackCtlr->IsKeyLocked() && iVideoPlaybackCtlr->iFileDetails->iVideoEnabled )
   192                   iVideoPlaybackCtlr->iFileDetails->iVideoEnabled )
   188         {
   193         {
   189             iVideoPlaybackCtlr->iForegroundPause = ETrue;
   194             iVideoPlaybackCtlr->iForegroundPause = ETrue;
   190             iVideoPlaybackCtlr->iState->HandlePause();
       
   191             iVideoPlaybackCtlr->SendHideControlsEventL();
   195             iVideoPlaybackCtlr->SendHideControlsEventL();
   192         }
   196         }
   193         else if ( iVideoPlaybackCtlr->IsPhoneCall() || iVideoPlaybackCtlr->IsVideoCall() )
   197         else if ( iVideoPlaybackCtlr->IsPhoneCall() || iVideoPlaybackCtlr->IsVideoCall() )
   194         {
   198         {
   195             iVideoPlaybackCtlr->iForegroundPause = EFalse;
   199             iVideoPlaybackCtlr->iForegroundPause = EFalse;
   196             iVideoPlaybackCtlr->iState->HandlePause();
       
   197         }
   200         }
   198     }
   201     }
   199     else
   202     else
   200     {
   203     {
   201         iVideoPlaybackCtlr->iForegroundPause = EFalse;
   204         iVideoPlaybackCtlr->iForegroundPause = EFalse;
   202         iVideoPlaybackCtlr->iState->HandlePause();
       
   203     }
   205     }
   204 }
   206 }
   205 
   207 
   206 //  ------------------------------------------------------------------------------------------------
   208 //  ------------------------------------------------------------------------------------------------
   207 //  CMPXVideoPlaybackMode::CanPlayNow()
   209 //  CMPXVideoPlaybackMode::CanPlayNow()
   221         }
   223         }
   222         else if ( iVideoPlaybackCtlr->IsKeyLocked() &&
   224         else if ( iVideoPlaybackCtlr->IsKeyLocked() &&
   223                   iVideoPlaybackCtlr->iFileDetails->iVideoEnabled )
   225                   iVideoPlaybackCtlr->iFileDetails->iVideoEnabled )
   224         {
   226         {
   225             iVideoPlaybackCtlr->iForegroundPause = ETrue;
   227             iVideoPlaybackCtlr->iForegroundPause = ETrue;
   226         }
       
   227         else if ( ! iVideoPlaybackCtlr->iAccessoryMonitor->IsTvOutPlaybackAllowed() )
       
   228         {
       
   229             MPX_TRAPD( err,
       
   230                 iVideoPlaybackCtlr->iState->SendErrorToViewL( KMPXVideoTvOutPlaybackNotAllowed ) );
       
   231         }
   228         }
   232         else
   229         else
   233         {
   230         {
   234             playAllowed = ETrue;
   231             playAllowed = ETrue;
   235         }
   232         }
   275     telServer.Close();
   272     telServer.Close();
   276 
   273 
   277     MPX_DEBUG(_L("CMPXVideoPlaybackMode::IsNetworkMode2GL(%d)"), networkMode2g);
   274     MPX_DEBUG(_L("CMPXVideoPlaybackMode::IsNetworkMode2GL(%d)"), networkMode2g);
   278 
   275 
   279     return networkMode2g;
   276     return networkMode2g;
   280 }
       
   281 
       
   282 
       
   283 //  ------------------------------------------------------------------------------------------------
       
   284 //    CMPXVideoPlaybackMode::IsTvOutAllowedL()
       
   285 //  ------------------------------------------------------------------------------------------------
       
   286 TBool CMPXVideoPlaybackMode::IsTvOutAllowedL()
       
   287 {
       
   288     MPX_DEBUG(_L("CMPXVideoPlaybackMode::IsTvOutAllowedL()"));
       
   289 
       
   290     TBool allowTvOut =
       
   291         iVideoPlaybackCtlr->iDrmHelper->IsTvOutAllowedL( iVideoPlaybackCtlr->iFileHandle );
       
   292 
       
   293     MPX_DEBUG(_L("CMPXVideoPlaybackMode::IsTvOutAllowedL(%d)"), allowTvOut);
       
   294 
       
   295     return allowTvOut;
       
   296 }
   277 }
   297 
   278 
   298 //************************************************************************************************//
   279 //************************************************************************************************//
   299 //          CMPXLocalPlaybackMode
   280 //          CMPXLocalPlaybackMode
   300 //************************************************************************************************//
   281 //************************************************************************************************//
   410           //exit for live streaming
   391           //exit for live streaming
   411         }
   392         }
   412         else
   393         else
   413         {
   394         {
   414             MPX_TRAPD( err,
   395             MPX_TRAPD( err,
   415             		   playAllowed = !( iVideoPlaybackCtlr->IsVoiceCall() && IsNetworkMode2GL() ) );
   396                        playAllowed = !( iVideoPlaybackCtlr->IsVoiceCall() && IsNetworkMode2GL() ) );
   416 
   397 
   417             if ( !playAllowed )
   398             if ( !playAllowed )
   418             {
   399             {
   419                 MPX_TRAPD( err,
   400                 MPX_TRAPD( err,
   420                     iVideoPlaybackCtlr->iState->SendErrorToViewL(
   401                     iVideoPlaybackCtlr->iState->SendErrorToViewL(
   425 
   406 
   426     return  playAllowed;
   407     return  playAllowed;
   427 }
   408 }
   428 
   409 
   429 //  ------------------------------------------------------------------------------------------------
   410 //  ------------------------------------------------------------------------------------------------
   430 //    CMPXStreamingPlaybackMode::IsTvOutAllowedL()
       
   431 //  ------------------------------------------------------------------------------------------------
       
   432 TBool CMPXStreamingPlaybackMode::IsTvOutAllowedL()
       
   433 {
       
   434     MPX_ENTER_EXIT(_L("CMPXStreamingPlaybackMode::IsTvOutAllowedL(1)"));
       
   435     return ETrue;
       
   436 }
       
   437 
       
   438 //  ------------------------------------------------------------------------------------------------
       
   439 //    CMPXStreamingPlaybackMode::HandlePause()
   411 //    CMPXStreamingPlaybackMode::HandlePause()
   440 //  ------------------------------------------------------------------------------------------------
   412 //  ------------------------------------------------------------------------------------------------
   441 void CMPXStreamingPlaybackMode::HandlePause()
   413 void CMPXStreamingPlaybackMode::HandlePause()
   442 {
   414 {
   443     MPX_ENTER_EXIT(_L("CMPXStreamingPlaybackMode::HandlePause()"));
   415     MPX_ENTER_EXIT(_L("CMPXStreamingPlaybackMode::HandlePause()"));
   515 //  ------------------------------------------------------------------------------------------------
   487 //  ------------------------------------------------------------------------------------------------
   516 void CMPXLiveStreamingPlaybackMode::HandleBackground()
   488 void CMPXLiveStreamingPlaybackMode::HandleBackground()
   517 {
   489 {
   518     MPX_DEBUG(_L("CMPXLiveStreamingPlaybackMode::HandleBackground()"));
   490     MPX_DEBUG(_L("CMPXLiveStreamingPlaybackMode::HandleBackground()"));
   519 
   491 
   520     if ( iVideoPlaybackCtlr->iAppInForeground )
   492     //
   521     {
   493     //  Pause in all cases to remove the different behavior based on the decoder
   522         if ( iVideoPlaybackCtlr->IsPhoneCall() ||
   494     //
   523              iVideoPlaybackCtlr->IsVideoCall() ||
   495     iVideoPlaybackCtlr->iState->HandlePause();
   524              ( iVideoPlaybackCtlr->IsKeyLocked() && iVideoPlaybackCtlr->iFileDetails->iVideoEnabled ))
       
   525         {
       
   526             iVideoPlaybackCtlr->iState->HandlePause();
       
   527         }
       
   528     }
       
   529     else
       
   530     {
       
   531         iVideoPlaybackCtlr->iState->HandlePause();
       
   532     }
       
   533 }
   496 }
   534 
   497 
   535 //************************************************************************************************//
   498 //************************************************************************************************//
   536 //          CMPXProgressiveDLPlaybackMode
   499 //          CMPXProgressiveDLPlaybackMode
   537 //************************************************************************************************//
   500 //************************************************************************************************//