videoplayback/videohelix/src/mpxvideoplaybackcontroller.cpp
branchRCL_3
changeset 21 315810614048
parent 15 8f0df5c82986
equal deleted inserted replaced
20:2d690156cf8f 21:315810614048
    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: 62 %
    19 // Version : %version: 65 %
    20 
    20 
    21 
    21 
    22 //
    22 //
    23 //  INCLUDE FILES
    23 //  INCLUDE FILES
    24 //
    24 //
   542                 break;
   542                 break;
   543             }
   543             }
   544             case EPbCmdSetPosterFrame:
   544             case EPbCmdSetPosterFrame:
   545             {
   545             {
   546                 iState->HandleSetPosterFrame();
   546                 iState->HandleSetPosterFrame();
   547                 break;    
   547                 break;
       
   548             }
       
   549             case EPbCmdSurfaceRemovedFromWindow:
       
   550             {
       
   551                 TSurfaceId surfaceId =
       
   552                     aCmd.ValueTObjectL<TSurfaceId>( KMPXMediaVideoDisplayTSurfaceId );
       
   553 
       
   554                 TInt error = iPlayer->RemoveSurfaceFromHelix( surfaceId );
       
   555 
       
   556                 if ( error != KErrNone )
       
   557                 {
       
   558                     MPX_TRAPD( err, iState->SendErrorToViewL( error ) );
       
   559                 }
       
   560 
       
   561                 break;
   548             }
   562             }
   549         }
   563         }
   550     }
   564     }
   551 }
   565 }
   552 
   566 
   768             MPX_TRAPD( err, iState->SendErrorToViewL( error ) );
   782             MPX_TRAPD( err, iState->SendErrorToViewL( error ) );
   769         }
   783         }
   770     }
   784     }
   771     else if ( aEvent.iEventType == KMMFEventCategoryVideoRemoveSurface )
   785     else if ( aEvent.iEventType == KMMFEventCategoryVideoRemoveSurface )
   772     {
   786     {
   773         TInt error = iPlayer->RemoveSurface();
   787         iPlayer->RemoveSurface();
   774 
       
   775         if ( error != KErrNone )
       
   776         {
       
   777             MPX_TRAPD( err, iState->SendErrorToViewL( error ) );
       
   778         }
       
   779     }
   788     }
   780 #endif // SYMBIAN_BUILD_GCE
   789 #endif // SYMBIAN_BUILD_GCE
   781     else if ( aEvent.iEventType == KMMFEventCategoryVideoPlayerGeneralError )
   790     else if ( aEvent.iEventType == KMMFEventCategoryVideoPlayerGeneralError )
   782     {
   791     {
   783         switch ( aEvent.iErrorCode )
   792         switch ( aEvent.iErrorCode )
   866 {
   875 {
   867     MPX_ENTER_EXIT(
   876     MPX_ENTER_EXIT(
   868         _L("CMPXVideoPlaybackController::SetVolumeCenRepL()"),
   877         _L("CMPXVideoPlaybackController::SetVolumeCenRepL()"),
   869         _L("aVolume = %d"), aVolume );
   878         _L("aVolume = %d"), aVolume );
   870 
   879 
   871     if ( iFileDetails && iFileDetails->iAudioEnabled )
   880     if ( iFileDetails && iFileDetails->iAudioEnabled && !iAccessoryMonitor->IsTvOutConnected() )
   872     {
   881     {
   873         TInt volume( 0 );
   882         TInt volume( 0 );
   874 
   883 
   875         if ( aVolume > KPbPlaybackVolumeLevelMax )
   884         if ( aVolume > KPbPlaybackVolumeLevelMax )
   876         {
   885         {
   889         // Volume needs to have n number of steps.
   898         // Volume needs to have n number of steps.
   890         // For example, if we get 26, we need to save it as 25 in 20 volume steps
   899         // For example, if we get 26, we need to save it as 25 in 20 volume steps
   891         // For example, if we get 77, we need to save it as 70 in 10 volume steps
   900         // For example, if we get 77, we need to save it as 70 in 10 volume steps
   892         //
   901         //
   893         volume -= volume % iVolumeNormalizer;
   902         volume -= volume % iVolumeNormalizer;
   894  
   903 
   895         MPX_DEBUG(
   904         MPX_DEBUG(
   896             _L("CMPXVideoPlaybackController::SetVolumeCenRepL(): Setting volume = %d"), volume );
   905             _L("CMPXVideoPlaybackController::SetVolumeCenRepL(): Setting volume = %d"), volume );
   897 
   906 
   898         iVolumeWatcher->SetValueL( volume );
   907         iVolumeWatcher->SetValueL( volume );
   899 
   908 
  2520     }
  2529     }
  2521 }
  2530 }
  2522 
  2531 
  2523 #endif // SYMBIAN_ENABLE_64_BIT_FILE_SERVER_API
  2532 #endif // SYMBIAN_ENABLE_64_BIT_FILE_SERVER_API
  2524 
  2533 
  2525 //  ------------------------------------------------------------------------------------------------ 
  2534 //  ------------------------------------------------------------------------------------------------
  2526 //    CMPXVideoPlaybackController::IsViewActivated() 
  2535 //    CMPXVideoPlaybackController::IsViewActivated()
  2527 //  ------------------------------------------------------------------------------------------------ 
  2536 //  ------------------------------------------------------------------------------------------------
  2528 // 
  2537 //
  2529 TBool CMPXVideoPlaybackController::IsViewActivated() 
  2538 TBool CMPXVideoPlaybackController::IsViewActivated()
  2530 { 
  2539 {
  2531     MPX_DEBUG(_L("CMPXVideoPlaybackController::IsViewActivated")); 
  2540     MPX_DEBUG(_L("CMPXVideoPlaybackController::IsViewActivated(%d)"), iViewActivated);
  2532     return iViewActivated; 
  2541     return iViewActivated;
  2533 } 
  2542 }
  2534 
  2543 
  2535 //  ------------------------------------------------------------------------------------------------
  2544 //  ------------------------------------------------------------------------------------------------
  2536 //    CMPXVideoPlaybackController::HandleFrameReady()
  2545 //    CMPXVideoPlaybackController::HandleFrameReady()
  2537 //  ------------------------------------------------------------------------------------------------
  2546 //  ------------------------------------------------------------------------------------------------
  2538 //
  2547 //
  2539 void CMPXVideoPlaybackController::HandleFrameReady(TInt aError)
  2548 void CMPXVideoPlaybackController::HandleFrameReady(TInt aError)
  2540 {
  2549 {
  2541     MPX_DEBUG(_L("CMPXVideoPlaybackController::HandleFrameReady"));
  2550     MPX_DEBUG(_L("CMPXVideoPlaybackController::HandleFrameReady"));
  2542     
  2551 
  2543     iPlaybackMode->HandleFrameReady(aError);
  2552     iPlaybackMode->HandleFrameReady(aError);
  2544 }
  2553 }
  2545 // End of file
  2554 // End of file