# HG changeset patch # User Dremov Kirill (Nokia-D-MSW/Tampere) # Date 1282201037 -10800 # Node ID 315810614048232f8c42a79db2fce09e7403c0ea # Parent 2d690156cf8f5ebd84528d984f3c3372e27d2f6d Revision: 201031 Kit: 201033 diff -r 2d690156cf8f -r 315810614048 mediasettings/mediasettingsengine/group/MPSettROPModel.mmp --- a/mediasettings/mediasettingsengine/group/MPSettROPModel.mmp Thu Jul 15 18:41:27 2010 +0300 +++ b/mediasettings/mediasettingsengine/group/MPSettROPModel.mmp Thu Aug 19 09:57:17 2010 +0300 @@ -16,7 +16,7 @@ -// Version : %version: 6 % +// Version : %version: 8 % diff -r 2d690156cf8f -r 315810614048 videocollection/hgmyvideos/src/vcxhgmyvideosmainview.cpp --- a/videocollection/hgmyvideos/src/vcxhgmyvideosmainview.cpp Thu Jul 15 18:41:27 2010 +0300 +++ b/videocollection/hgmyvideos/src/vcxhgmyvideosmainview.cpp Thu Aug 19 09:57:17 2010 +0300 @@ -15,7 +15,7 @@ */ -// Version : %version: 48 % +// Version : %version: 49 % // INCLUDE FILES #include @@ -530,22 +530,14 @@ { TKeyResponse response( EKeyWasNotConsumed ); - // Clear key performs 'Delete'. - if ( aKeyEvent.iScanCode == EStdKeyBackspace && aType == EEventKey ) + // Clear and Delete keys perform 'Delete'. + if ( ( aKeyEvent.iScanCode == EStdKeyBackspace || + aKeyEvent.iScanCode == EStdKeyDelete ) && + aType == EEventKey ) { if ( iModel->AppState() == CVcxHgMyVideosModel::EVcxMyVideosAppStateVideoIdle ) { - RArray markedVideos; - CleanupClosePushL( markedVideos ); - - VideoListL()->VideoModel().MarkedVideosL( markedVideos ); - TInt count = markedVideos.Count(); - CleanupStack::PopAndDestroy( &markedVideos ); - - if ( count > 0 ) - { - HandleCommandL( EVcxHgMyVideosCmdDelete ); - } + HandleCommandL( EVcxHgMyVideosCmdDelete ); response = EKeyWasConsumed; } diff -r 2d690156cf8f -r 315810614048 videocollection/mpxmyvideoscollection/src/vcxmyvideosasyncfileoperations.cpp --- a/videocollection/mpxmyvideoscollection/src/vcxmyvideosasyncfileoperations.cpp Thu Jul 15 18:41:27 2010 +0300 +++ b/videocollection/mpxmyvideoscollection/src/vcxmyvideosasyncfileoperations.cpp Thu Aug 19 09:57:17 2010 +0300 @@ -136,7 +136,17 @@ MPX_DEBUG2("CVcxMyVideosAsyncFileOperations:: trying to delete: %S", &videoInCache->ValueText( KMPXMediaGeneralUri )); - TInt err = iCollection.iFs.Delete( videoInCache->ValueText( KMPXMediaGeneralUri ) ); + + TUint attr ( 0 ); + TPtrC fileName = videoInCache->ValueText( KMPXMediaGeneralUri ); + + iCollection.iFs.Att( fileName, attr ); + if ( attr & KEntryAttReadOnly ) + { + iCollection.iFs.SetAtt( fileName, 0, KEntryAttReadOnly ); + } + + TInt err = iCollection.iFs.Delete( fileName ); if ( err != KErrNone ) { diff -r 2d690156cf8f -r 315810614048 videoplayback/inc/mpxvideopdlplaybackview.h --- a/videoplayback/inc/mpxvideopdlplaybackview.h Thu Jul 15 18:41:27 2010 +0300 +++ b/videoplayback/inc/mpxvideopdlplaybackview.h Thu Aug 19 09:57:17 2010 +0300 @@ -16,7 +16,7 @@ */ -// Version : %version: 9 % +// Version : %version: 10 % // This file defines the API for VideoPlaybackView.dll @@ -93,11 +93,19 @@ void ClosePlaybackViewWithErrorL(); + // + // Functions to unblock user inputs after a timeout + // + static TInt HandleBlockInputsTimeOut( TAny* aPtr ); + void DoHandleBlockInputsTimeOut(); + private: // data TMPXPlaybackPdDownloadState iPdlState; TInt iDownloadSize; TBool iUserInputsBlocked; + + CPeriodic* iBlockInputsTimer; }; #endif // __VIDEOPDLPLAYBACKVIEW_H__ diff -r 2d690156cf8f -r 315810614048 videoplayback/inc/mpxvideoplaybackcontrol.h --- a/videoplayback/inc/mpxvideoplaybackcontrol.h Thu Jul 15 18:41:27 2010 +0300 +++ b/videoplayback/inc/mpxvideoplaybackcontrol.h Thu Aug 19 09:57:17 2010 +0300 @@ -15,7 +15,7 @@ * */ -// Version : %version: 3 % +// Version : %version: 4 % #ifndef MPXPLAYBACKCONTROL_H_ @@ -167,6 +167,12 @@ * Stop Animation Branding Timer */ TBool StopBrandingAnimationTimer(); + + /* + * Update the controls with TV Out Connected information + */ + TBool UpdateTVOutStatusL( TBool aTvOutConnected ); + IMPORT_C void DoHandlePointerEventL( const TPointerEvent& aPointerEvent ); diff -r 2d690156cf8f -r 315810614048 videoplayback/inc/mpxvideoplaybackcontrol.hrh --- a/videoplayback/inc/mpxvideoplaybackcontrol.hrh Thu Jul 15 18:41:27 2010 +0300 +++ b/videoplayback/inc/mpxvideoplaybackcontrol.hrh Thu Aug 19 09:57:17 2010 +0300 @@ -16,7 +16,7 @@ */ -// Version : %version: 10 % +// Version : %version: 11 % #ifndef MPXVIDEOPLAYBACKCONTROL_HRH_ @@ -101,7 +101,9 @@ EMPXControlCmdHideControls, EMPXControlCmdSurfaceCreated, EMPXControlCmdSurfaceRemoved, - EMPXControlCmdLoadingStarted + EMPXControlCmdLoadingStarted, + EMPXControlCmdCreateAspectRatioIcon, + EMPXControlCmdDeleteAspectRatioIcon }; enum TMPXVideoSeekingType diff -r 2d690156cf8f -r 315810614048 videoplayback/inc/mpxvideoplaybackcontrolscontroller.h --- a/videoplayback/inc/mpxvideoplaybackcontrolscontroller.h Thu Jul 15 18:41:27 2010 +0300 +++ b/videoplayback/inc/mpxvideoplaybackcontrolscontroller.h Thu Aug 19 09:57:17 2010 +0300 @@ -16,7 +16,7 @@ */ -// Version : %version: 18 % +// Version : %version: 20 % #ifndef MPXVIDEOPLAYBACKCONTROLSCONTROLLER_H_ @@ -137,14 +137,6 @@ inline TBool IsRealMediaFormat(); - /** - * Check aspect ratio icon - * In case that Clip's AR is equals to Screen Display AR, also hide AR icon. - * - * @return ETrue in case that clip's AspectRatioIcon can be shown - */ - TBool ShowAspectRatioIcon(); - private: /** * Create controls @@ -175,7 +167,7 @@ /** * Create/delete controls based on updated control list */ - void ControlsListUpdatedL(); + void ControlsListUpdatedL( TBool aUpdateVisibility = ETrue ); /** * Create fake softkeyL @@ -236,6 +228,11 @@ TBool IsVisible(); /** + * Return ETrue if real one bitmap is visible + */ + TBool IsRealOneBitmapVisible(); + + /** * Append a control based on control index */ void AppendControlL( TMPXVideoPlaybackControls aControlIndex ); @@ -312,7 +309,9 @@ /** * Handle tvout connected/disconnected event */ - void HandleTvOutEventL( TBool aConnected, TMPXVideoPlaybackControlCommandIds aEvent ); + void HandleTvOutEventL( TBool aConnected, + TMPXVideoPlaybackControlCommandIds aEvent, + TBool aShowArIcon ); /** * Handle softkey pressed event */ diff -r 2d690156cf8f -r 315810614048 videoplayback/inc/mpxvideoplaybackdisplayhandler.h --- a/videoplayback/inc/mpxvideoplaybackdisplayhandler.h Thu Jul 15 18:41:27 2010 +0300 +++ b/videoplayback/inc/mpxvideoplaybackdisplayhandler.h Thu Aug 19 09:57:17 2010 +0300 @@ -16,7 +16,7 @@ */ -// Version : %version: 10 % +// Version : %version: 12 % #ifndef __CMPXVIDEOPLAYBACKDISPLAYHANDLER_H__ @@ -26,11 +26,7 @@ #include #include - -#ifdef SYMBIAN_BUILD_GCE #include -#endif - #include // @@ -63,18 +59,20 @@ static CMPXVideoPlaybackDisplayHandler* NewL( MMPXPlaybackUtility* aPlayUtil, CMPXVideoPlaybackContainer* aContainer ); - void CreateDisplayWindowL( CWsScreenDevice& aScreenDevice, RWindow& aWin ); + void CreateDisplayWindowL( CWsScreenDevice& aScreenDevice, + RWindow& aWin, + CMPXVideoPlaybackViewFileDetails* aFileDetails ); void RemoveDisplayWindow(); void HandleVideoDisplayMessageL( CMPXMessage* aMessage ); - TInt SetAspectRatioL( TMPXVideoPlaybackCommand aCmd ); - - TInt SetDefaultAspectRatioL( CMPXVideoPlaybackViewFileDetails* aFileDetails ); + void SetAspectRatioL( TMPXVideoPlaybackCommand aCmd ); void DoHandleRealOneBitmapTimeoutL(); + TBool ShowAspectRatioIcon(); + private: CMPXVideoPlaybackDisplayHandler( MMPXPlaybackUtility* aPlayUtil, @@ -86,10 +84,6 @@ void SaveAspectRatioL(); - -#ifdef SYMBIAN_BUILD_GCE - - private: void AddDisplayWindowL( CWsScreenDevice& aScreenDevice, RWindowBase& aWindowBase, RWindow* aWin ); @@ -97,11 +91,18 @@ void SurfaceCreatedL( CMPXMessage* aMessage ); void SurfaceChangedL( CMPXMessage* aMessage ); void SurfaceRemoved(); - TInt SetNgaAspectRatioL( TMPXVideoPlaybackCommand aCmd ); void SignalSurfaceRemovedL(); -#endif + void AttachNewSurfaceToWindowL(); + + void CalculateAspectRatioL(); + + TBool IsAspectRatioEqual( TReal aRatio1, TReal aRatio2 ); + + TReal CalculateVideoAspectRatio(); + + void RemoveSurfaceFromPlaybackPluginL(); private: MMPXPlaybackUtility* iPlaybackUtility; @@ -109,9 +110,7 @@ RArray iAspectRatioArray; TInt iCurrentIndexForAspectRatio; - TReal iDisplayAspectRatio; -#ifdef SYMBIAN_BUILD_GCE CMediaClientVideoDisplay* iVideoDisplay; TBool iSurfaceCached; @@ -124,8 +123,10 @@ TInt iVerticalPosition; TVideoRotation iRotation; TAutoScaleType iAutoScale; -#endif + TReal iDisplayAspectRatio; + TInt iVideoHeight; + TInt iVideoWidth; }; #endif // __CMPXVIDEOPLAYBACKDISPLAYHANDLER_H__ diff -r 2d690156cf8f -r 315810614048 videoplayback/inc/mpxvideoplaybackmediadetailsviewer.h --- a/videoplayback/inc/mpxvideoplaybackmediadetailsviewer.h Thu Jul 15 18:41:27 2010 +0300 +++ b/videoplayback/inc/mpxvideoplaybackmediadetailsviewer.h Thu Aug 19 09:57:17 2010 +0300 @@ -15,7 +15,9 @@ * */ -// Version : %version: e003sa33#6 % + +// Version : %version: 7 % + #ifndef MPXVIDEOPLAYBACKMEDIADETAILSVIEWER_H_ #define MPXVIDEOPLAYBACKMEDIADETAILSVIEWER_H_ @@ -78,12 +80,12 @@ * @param aRect drawable area. */ void Draw( const TRect& aRect ) const; - + /** * Creates new skins for the control * @return void */ - void SkinChangeL(); + void SkinChangeL(); public: // from CoeControl @@ -100,56 +102,56 @@ * @since 5.0 */ void Reset(); - - /** + + /** * Accessor for the dynamically calculated viewer rect - * @since 9.2 + * @since 9.2 * @return the viewer rect - */ - TRect ViewerRect(); - + */ + TRect ViewerRect(); + private: - + void CreateLabelsL(); - + void LaunchDRMDetailsL(); - + /** * Sets label rects and text */ - void FormatLabelsL() const; - + void FormatLabelsL() const; + void UpdateBackgroundBitmapL() const; - - /** + + /** * Timer callback for scroll timer - * @since 9.2 - * @param aPtr Pointer to timers callback - * @return KErrNone - */ + * @since 9.2 + * @param aPtr Pointer to timers callback + * @return KErrNone + */ static TInt ScrollTimer( TAny* aPtr ); - /** + /** * Handle Scroll Timer - * @since 9.2 - * @return void - */ + * @since 9.2 + * @return void + */ void HandleScrollTimerL(); - - /** + + /** * Determine the number of items to be shown in the viewer - * @since 9.2 + * @since 9.2 * @return the number of rows to be created - */ + */ TInt NumOfItemsShownInViewerL(); - - /** + + /** * Dynamically calculate determine the viewer rectangle dyanmically - * @since 9.2 + * @since 9.2 * @return the viewer rect - */ - TRect CalculateViewerRectL(); + */ + TRect CalculateViewerRectL(); /** * Update the text of filename label @@ -162,14 +164,14 @@ void UpdateTitleL(); private: - + /** * Scroll the too long text for some label */ class TTextScroller { public: - + /** * Constructor */ @@ -194,37 +196,38 @@ void ScrollText( const TDesC& aSrcText, TDes& aDesText ); private: - - TUint32 iDelayBeginningTick; - TInt iTextScrollPos; - TBool iDelay; - TBool iScroll; - TInt iSrcTextLen; + + TUint32 iDelayBeginningTick; + TInt iTextScrollPos; + TBool iDelay; + TBool iScroll; + TInt iSrcTextLen; }; private: // Data - + CMPXVideoPlaybackControlsController* iController; - + CEikLabel* iClipnameLabel; CEikLabel* iTitleLabel; - CEikLabel* iArtistLabel; + CEikLabel* iArtistLabel; CEikLabel* iFormatLabel; CEikLabel* iResolutionLabel; CEikLabel* iDurationLabel; CEikLabel* iBitrateLabel; CEikLabel* iLicenseLabel; CEikLabel* iAdditionalLabel; - + - CFbsBitmap* iBackgroundBitmap; + CFbsBitmap* iBackgroundBitmap; CPeriodic* iScrollingTextTimer; TRect iViewerRect; HBufC* iAdditionalString; TTextScroller iFilenameScroller; TTextScroller iTitleScroller; // after every scrolling label has updated, draw them - TBool iScrolledTextUpdated; + TBool iScrolledTextUpdated; + TBool iDrmDetailsLaunched; }; diff -r 2d690156cf8f -r 315810614048 videoplayback/inc/mpxvideoplaybackuserinputhandler.h --- a/videoplayback/inc/mpxvideoplaybackuserinputhandler.h Thu Jul 15 18:41:27 2010 +0300 +++ b/videoplayback/inc/mpxvideoplaybackuserinputhandler.h Thu Aug 19 09:57:17 2010 +0300 @@ -16,7 +16,7 @@ */ -// Version : %version: 9 % +// Version : %version: 10 % #ifndef MPXVIDEOPLAYBACKUSERINPUTHANDLER_H_ @@ -139,7 +139,6 @@ private: TMPXVideoUserInputType iProcessingInputType; // the type of input being processed - TUint iLastPressedKeyCode; // keycode of last key that sent EEventKeyDown TInt iLastPressedKeyScanCode; // scancode of last key that sent EEventKeyDown TRemConCoreApiOperationId iLastMediaKeyPressed; // Id of last mediakey thats sent a button-press diff -r 2d690156cf8f -r 315810614048 videoplayback/videohelix/inc/mpxvideoplaybackstate.h --- a/videoplayback/videohelix/inc/mpxvideoplaybackstate.h Thu Jul 15 18:41:27 2010 +0300 +++ b/videoplayback/videohelix/inc/mpxvideoplaybackstate.h Thu Aug 19 09:57:17 2010 +0300 @@ -16,7 +16,7 @@ */ -// Version : %version: 20 % +// Version : %version: 21 % #ifndef _CMPXVIDEOPLAYBACKSTATE_H_ @@ -225,6 +225,7 @@ virtual void HandleStop(); virtual void HandleForeground(); virtual void HandleBackground(); + virtual void HandlePause(); // general method virtual void HandleSetPositionL(TInt aPosition); diff -r 2d690156cf8f -r 315810614048 videoplayback/videohelix/inc/mpxvideoplayerutility.h --- a/videoplayback/videohelix/inc/mpxvideoplayerutility.h Thu Jul 15 18:41:27 2010 +0300 +++ b/videoplayback/videohelix/inc/mpxvideoplayerutility.h Thu Aug 19 09:57:17 2010 +0300 @@ -15,7 +15,8 @@ * */ -// Version : %version: 13 % + +// Version : %version: 14 % #ifndef __MPXVIDEOPLAYERUTILITY__ @@ -103,16 +104,16 @@ void SetPlayVelocityL( TInt aVelocity ); void GetVideoLoadingProgressL( TInt& aPercentageProgress ); - + void GetFrameL(); // // MMMFControllerEventMonitorObserver Implementation // void HandleEvent( const TMMFEvent& aEvent ); - + CFbsBitmap& GetBitmap(); - + void RunL(); void DoCancel(); @@ -124,7 +125,8 @@ TInt VideoSurfaceCreated(); TInt SurfaceParametersChanged(); - TInt RemoveSurface(); + void RemoveSurface(); + TInt RemoveSurfaceFromHelix( TSurfaceId aSurfaceId ); void SendSurfaceCommandL( TInt aCmd ); @@ -168,7 +170,7 @@ CMMFControllerEventMonitor* iControllerEventMonitor; TBool iDirectScreenAccessAbort; - + CFbsBitmap* iPosterFrameBitmap; }; diff -r 2d690156cf8f -r 315810614048 videoplayback/videohelix/src/mpxvideoplaybackcontroller.cpp --- a/videoplayback/videohelix/src/mpxvideoplaybackcontroller.cpp Thu Jul 15 18:41:27 2010 +0300 +++ b/videoplayback/videohelix/src/mpxvideoplaybackcontroller.cpp Thu Aug 19 09:57:17 2010 +0300 @@ -16,7 +16,7 @@ */ -// Version : %version: 62 % +// Version : %version: 65 % // @@ -544,7 +544,21 @@ case EPbCmdSetPosterFrame: { iState->HandleSetPosterFrame(); - break; + break; + } + case EPbCmdSurfaceRemovedFromWindow: + { + TSurfaceId surfaceId = + aCmd.ValueTObjectL( KMPXMediaVideoDisplayTSurfaceId ); + + TInt error = iPlayer->RemoveSurfaceFromHelix( surfaceId ); + + if ( error != KErrNone ) + { + MPX_TRAPD( err, iState->SendErrorToViewL( error ) ); + } + + break; } } } @@ -770,12 +784,7 @@ } else if ( aEvent.iEventType == KMMFEventCategoryVideoRemoveSurface ) { - TInt error = iPlayer->RemoveSurface(); - - if ( error != KErrNone ) - { - MPX_TRAPD( err, iState->SendErrorToViewL( error ) ); - } + iPlayer->RemoveSurface(); } #endif // SYMBIAN_BUILD_GCE else if ( aEvent.iEventType == KMMFEventCategoryVideoPlayerGeneralError ) @@ -868,7 +877,7 @@ _L("CMPXVideoPlaybackController::SetVolumeCenRepL()"), _L("aVolume = %d"), aVolume ); - if ( iFileDetails && iFileDetails->iAudioEnabled ) + if ( iFileDetails && iFileDetails->iAudioEnabled && !iAccessoryMonitor->IsTvOutConnected() ) { TInt volume( 0 ); @@ -891,7 +900,7 @@ // For example, if we get 77, we need to save it as 70 in 10 volume steps // volume -= volume % iVolumeNormalizer; - + MPX_DEBUG( _L("CMPXVideoPlaybackController::SetVolumeCenRepL(): Setting volume = %d"), volume ); @@ -2522,15 +2531,15 @@ #endif // SYMBIAN_ENABLE_64_BIT_FILE_SERVER_API -// ------------------------------------------------------------------------------------------------ -// CMPXVideoPlaybackController::IsViewActivated() -// ------------------------------------------------------------------------------------------------ -// -TBool CMPXVideoPlaybackController::IsViewActivated() -{ - MPX_DEBUG(_L("CMPXVideoPlaybackController::IsViewActivated")); - return iViewActivated; -} +// ------------------------------------------------------------------------------------------------ +// CMPXVideoPlaybackController::IsViewActivated() +// ------------------------------------------------------------------------------------------------ +// +TBool CMPXVideoPlaybackController::IsViewActivated() +{ + MPX_DEBUG(_L("CMPXVideoPlaybackController::IsViewActivated(%d)"), iViewActivated); + return iViewActivated; +} // ------------------------------------------------------------------------------------------------ // CMPXVideoPlaybackController::HandleFrameReady() @@ -2539,7 +2548,7 @@ void CMPXVideoPlaybackController::HandleFrameReady(TInt aError) { MPX_DEBUG(_L("CMPXVideoPlaybackController::HandleFrameReady")); - + iPlaybackMode->HandleFrameReady(aError); } // End of file diff -r 2d690156cf8f -r 315810614048 videoplayback/videohelix/src/mpxvideoplaybackmode.cpp --- a/videoplayback/videohelix/src/mpxvideoplaybackmode.cpp Thu Jul 15 18:41:27 2010 +0300 +++ b/videoplayback/videohelix/src/mpxvideoplaybackmode.cpp Thu Aug 19 09:57:17 2010 +0300 @@ -16,7 +16,7 @@ */ -// Version : %version: 33 % +// Version : %version: 34 % // @@ -301,7 +301,7 @@ // ------------------------------------------------------------------------------------------------ // CMPXVideoPlaybackMode::SendErrorToView() // ------------------------------------------------------------------------------------------------ -TBool CMPXVideoPlaybackMode::SendErrorToView( TInt aError ) +TBool CMPXVideoPlaybackMode::SendErrorToView( TInt /*aError*/ ) { MPX_DEBUG(_L("CMPXLocalPlaybackMode::SendErrorToView(%d)"), ETrue); diff -r 2d690156cf8f -r 315810614048 videoplayback/videohelix/src/mpxvideoplaybackstate.cpp --- a/videoplayback/videohelix/src/mpxvideoplaybackstate.cpp Thu Jul 15 18:41:27 2010 +0300 +++ b/videoplayback/videohelix/src/mpxvideoplaybackstate.cpp Thu Aug 19 09:57:17 2010 +0300 @@ -16,7 +16,7 @@ */ -// Version : %version: 46 % +// Version : %version: 48 % // @@ -177,7 +177,7 @@ // ------------------------------------------------------------------------------------------------ void CMPXVideoPlaybackState::HandleSetPosterFrame() { - MPX_DEBUG(_L("CMPXVideoPlaybackState::HandleSetPosterFrame()")); + MPX_DEBUG(_L("CMPXVideoPlaybackState::HandleSetPosterFrame()")); } // ------------------------------------------------------------------------------------------------ @@ -239,10 +239,10 @@ MPX_ENTER_EXIT(_L("CMPXVideoPlaybackState::HandlePlaybackComplete()"), _L("error = %d"), aError ); + iVideoPlaybackCtlr->ChangeState( EMPXVideoStopped ); + if ( aError == KErrNone ) { - iVideoPlaybackCtlr->ChangeState( EMPXVideoStopped ); - iVideoPlaybackCtlr->iMPXPluginObs->HandlePluginEvent( MMPXPlaybackPluginObserver::EPPlayComplete, 0, @@ -1275,6 +1275,16 @@ CommandHandleForeground(); } +// ------------------------------------------------------------------------------------------------ +// CMPXInitialisedState::HandlePause() +// ------------------------------------------------------------------------------------------------ +void CMPXInitialisedState::HandlePause() +{ + MPX_ENTER_EXIT(_L("CMPXInitialisedState::HandlePause()")); + + iVideoPlaybackCtlr->iPlaybackMode->HandlePause(); +} + // ************************************************************************************************* // // CMPXPlayingState @@ -1377,8 +1387,8 @@ void CMPXPlayingState::HandleSetPosterFrame() { MPX_DEBUG(_L("CMPXPlayingState::HandleSetPosterFrame()")); - - iVideoPlaybackCtlr->iPlaybackMode->HandleSetPosterFrame(); + + iVideoPlaybackCtlr->iPlaybackMode->HandleSetPosterFrame(); } @@ -1542,8 +1552,8 @@ // ------------------------------------------------------------------------------------------------ void CMPXPausedState::HandleSetPosterFrame() { - MPX_DEBUG(_L("CMPXPausedState::HandleSetPosterFrame()")); - + MPX_DEBUG(_L("CMPXPausedState::HandleSetPosterFrame()")); + iVideoPlaybackCtlr->iPlaybackMode->HandleSetPosterFrame(); } @@ -1640,8 +1650,8 @@ } else { - // As the custom play command could not resume the playback. Send a pause event to - // the view though the MPX FW to get the view state in sync playback plugin. + // As the custom play command could not resume the playback. Send a pause event to + // the view though the MPX FW to get the view state in sync playback plugin. iVideoPlaybackCtlr->iMPXPluginObs->HandlePluginEvent( MMPXPlaybackPluginObserver::EPPaused, 0, KErrNone ); diff -r 2d690156cf8f -r 315810614048 videoplayback/videohelix/src/mpxvideoplayerutility.cpp --- a/videoplayback/videohelix/src/mpxvideoplayerutility.cpp Thu Jul 15 18:41:27 2010 +0300 +++ b/videoplayback/videohelix/src/mpxvideoplayerutility.cpp Thu Aug 19 09:57:17 2010 +0300 @@ -16,7 +16,7 @@ */ -// Version : %version: 22 % +// Version : %version: 23 % #include @@ -62,7 +62,7 @@ void CMpxVideoPlayerUtility::ConstructL() { OpenControllerL(); - + CActiveScheduler::Add( this ); } @@ -88,17 +88,17 @@ iController.Close(); iDirectScreenAccessAbort = EFalse; - + if ( IsActive() ) { Cancel(); - + if ( iPosterFrameBitmap ) { delete iPosterFrameBitmap; - iPosterFrameBitmap = NULL; + iPosterFrameBitmap = NULL; } - } + } } void CMpxVideoPlayerUtility::Reset() @@ -324,18 +324,18 @@ } void CMpxVideoPlayerUtility::GetFrameL() -{ +{ MPX_DEBUG(_L("CMpxVideoPlayerUtility::GetFrameL")); - + // dont get another frame if a request is already pending // if ( ! IsActive() ) { iPosterFrameBitmap = new (ELeave) CFbsBitmap; - User::LeaveIfError(iPosterFrameBitmap->Create(TSize(0,0), EColor16MU)); - - iVideoPlayControllerCustomCommands.GetFrame( *iPosterFrameBitmap, iStatus ); - SetActive(); + User::LeaveIfError(iPosterFrameBitmap->Create(TSize(0,0), EColor16MU)); + + iVideoPlayControllerCustomCommands.GetFrame( *iPosterFrameBitmap, iStatus ); + SetActive(); } } @@ -343,32 +343,32 @@ void CMpxVideoPlayerUtility::RunL() { MPX_ENTER_EXIT(_L("CMpxVideoPlayerUtility::RunL()")); - + if ( iStatus.Int() == KErrNone ) - { - iVideoPlaybackController->HandleFrameReady( iStatus.Int() ); - } + { + iVideoPlaybackController->HandleFrameReady( iStatus.Int() ); + } else { - // Bitmap ownership will NOT be transferred to thumbnail manager so delete it + // Bitmap ownership will NOT be transferred to thumbnail manager so delete it delete iPosterFrameBitmap; - iPosterFrameBitmap = NULL; - } + iPosterFrameBitmap = NULL; + } } void CMpxVideoPlayerUtility::DoCancel() { MPX_ENTER_EXIT(_L("CMpxVideoPlayerUtility::DoCancel()")); - - // Bitmap ownership will NOT be transferred to thumbnail manager so delete it + + // Bitmap ownership will NOT be transferred to thumbnail manager so delete it delete iPosterFrameBitmap; - iPosterFrameBitmap = NULL; + iPosterFrameBitmap = NULL; } CFbsBitmap& CMpxVideoPlayerUtility::GetBitmap() { MPX_ENTER_EXIT(_L("CMpxVideoPlayerUtility::GetBitmap()")); - + return *iPosterFrameBitmap; } @@ -628,21 +628,32 @@ // CMpxVideoPlayerUtility::RemoveSurface() // ------------------------------------------------------------------------------------------------- // -TInt CMpxVideoPlayerUtility::RemoveSurface() +void CMpxVideoPlayerUtility::RemoveSurface() { - TInt error = KErrNone; + MPX_ENTER_EXIT(_L("CMpxVideoPlayerUtility::RemoveSurface()")); - if ( !iSurfaceId.IsNull() ) + if ( ! iSurfaceId.IsNull() ) { // // Send command to view to remove the surface // MPX_TRAPD( err, SendSurfaceCommandL( EPbMsgVideoSurfaceRemoved ) ); - error = iVideoPlaySurfaceSupportCustomCommands.SurfaceRemoved( iSurfaceId ); - iSurfaceId = TSurfaceId::CreateNullId(); } +} + +// ------------------------------------------------------------------------------------------------- +// CMpxVideoPlayerUtility::RemoveSurfaceFromHelix() +// ------------------------------------------------------------------------------------------------- +// +TInt CMpxVideoPlayerUtility::RemoveSurfaceFromHelix( TSurfaceId aSurfaceId ) +{ + MPX_ENTER_EXIT(_L("CMpxVideoPlayerUtility::RemoveSurfaceFromHelix()")); + + TInt error = KErrNone; + + error = iVideoPlaySurfaceSupportCustomCommands.SurfaceRemoved( aSurfaceId ); return error; } diff -r 2d690156cf8f -r 315810614048 videoplayback/videohelix/tsrc/ut_videohelixtest/inc/mpxvideoplayerutility_stub.h --- a/videoplayback/videohelix/tsrc/ut_videohelixtest/inc/mpxvideoplayerutility_stub.h Thu Jul 15 18:41:27 2010 +0300 +++ b/videoplayback/videohelix/tsrc/ut_videohelixtest/inc/mpxvideoplayerutility_stub.h Thu Aug 19 09:57:17 2010 +0300 @@ -15,7 +15,7 @@ * */ -// Version : %version: 14 % +// Version : %version: 15 % #ifndef __MPXVIDEOPLAYERUTILITY__ @@ -25,6 +25,7 @@ // INCLUDES // #include +#include #ifdef SYMBIAN_ENABLE_SPLIT_HEADERS #include @@ -34,6 +35,10 @@ #include +#ifdef SYMBIAN_BUILD_GCE +#include +#endif + #include "videohelixtest.h" typedef CArrayPtrFlat CMmfCallbackArray; @@ -113,7 +118,7 @@ void SetVolumeSteps( TInt aVolumeSteps ); void SurfaceRemovedFromView(); - + void GetFrameL(); CFbsBitmap& GetBitmap(); @@ -125,7 +130,8 @@ TInt VideoSurfaceCreated(); TInt SurfaceParametersChanged(); - TInt RemoveSurface(); + void RemoveSurface(); + TInt RemoveSurfaceFromHelix( TSurfaceId aSurfaceId );; void SendSurfaceCreatedCommand(); #endif @@ -184,7 +190,7 @@ TTimeIntervalMicroSeconds iPosition; TTimeIntervalMicroSeconds iDuration; - + CFbsBitmap* iPosterFrameBitmap; }; diff -r 2d690156cf8f -r 315810614048 videoplayback/videohelix/tsrc/ut_videohelixtest/inc/videohelixtest.h --- a/videoplayback/videohelix/tsrc/ut_videohelixtest/inc/videohelixtest.h Thu Jul 15 18:41:27 2010 +0300 +++ b/videoplayback/videohelix/tsrc/ut_videohelixtest/inc/videohelixtest.h Thu Aug 19 09:57:17 2010 +0300 @@ -15,7 +15,7 @@ * */ -// Version : %version: e003sa33#15 % +// Version : %version: 16 % #ifndef __VHPPTESTCASE_H__ @@ -35,10 +35,10 @@ #include #include -#include -#include -#include -#include +#include +#include +#include +#include #include #include "timeoutController.h" diff -r 2d690156cf8f -r 315810614048 videoplayback/videohelix/tsrc/ut_videohelixtest/src/mpxvideoplayerutility_stub.cpp --- a/videoplayback/videohelix/tsrc/ut_videohelixtest/src/mpxvideoplayerutility_stub.cpp Thu Jul 15 18:41:27 2010 +0300 +++ b/videoplayback/videohelix/tsrc/ut_videohelixtest/src/mpxvideoplayerutility_stub.cpp Thu Aug 19 09:57:17 2010 +0300 @@ -15,7 +15,7 @@ * */ -// Version : %version: 17 % +// Version : %version: 18 % #include #include @@ -427,8 +427,8 @@ void CMpxVideoPlayerUtility::GetFrameL() { - MPX_ENTER_EXIT(_L("CMpxVideoPlayerUtility::GetFrameL()")); - + MPX_ENTER_EXIT(_L("CMpxVideoPlayerUtility::GetFrameL()")); + if ( iStifObserver ) { TCallbackEvent* event = new TCallbackEvent; @@ -436,16 +436,16 @@ event->iData = 0; event->iError = KErrNone; iStifObserver->HandleUtilityEvent( event ); - } - - iVideoPlaybackController->HandleFrameReady( KErrGeneral ); + } + + iVideoPlaybackController->HandleFrameReady( KErrGeneral ); } - + CFbsBitmap& CMpxVideoPlayerUtility::GetBitmap() { MPX_ENTER_EXIT(_L("CMpxVideoPlayerUtility::GetBitmap()")); - - iPosterFrameBitmap = new (ELeave) CFbsBitmap; + + iPosterFrameBitmap = new (ELeave) CFbsBitmap; return *iPosterFrameBitmap; } @@ -681,7 +681,7 @@ iTitle = value.AllocL(); } else if ( ! aItem.Compare(_L8("Description")) || - ! aItem.Compare(_L8("Abstract")) ) + ! aItem.Compare(_L8("Abstract")) ) { if ( ! iDescription ) { @@ -771,14 +771,18 @@ return KErrNone; } -TInt CMpxVideoPlayerUtility::RemoveSurface() +void CMpxVideoPlayerUtility::RemoveSurface() +{ +} + +TInt CMpxVideoPlayerUtility::RemoveSurfaceFromHelix( TSurfaceId aSurfaceId ) { return KErrNone; } -void CMpxVideoPlayerUtility::SendSurfaceCreatedCommand() -{ - MPX_DEBUG(_L("CMpxVideoPlayerUtility::SendSurfaceCreatedCommand()")); +void CMpxVideoPlayerUtility::SendSurfaceCreatedCommand() +{ + MPX_DEBUG(_L("CMpxVideoPlayerUtility::SendSurfaceCreatedCommand()")); } #endif diff -r 2d690156cf8f -r 315810614048 videoplayback/videohelix/tsrc/ut_videohelixtest/src/videohelixtestbody.cpp --- a/videoplayback/videohelix/tsrc/ut_videohelixtest/src/videohelixtestbody.cpp Thu Jul 15 18:41:27 2010 +0300 +++ b/videoplayback/videohelix/tsrc/ut_videohelixtest/src/videohelixtestbody.cpp Thu Aug 19 09:57:17 2010 +0300 @@ -15,7 +15,7 @@ * */ -// Version : %version: e003sa33#24.1.1 % +// Version : %version: 26 % // [INCLUDE FILES] - do not remove @@ -120,9 +120,8 @@ ENTRY ("InitializeWithPositionL", CVHPPTestClass::InitializeWithPositionL), ENTRY ("InitializeLinkWithPositionL", CVHPPTestClass::InitializeLinkWithPositionL), ENTRY ("InitializeHandleWithPositionL", CVHPPTestClass::InitializeHandleWithPositionL), - ENTRY ( "InitializeStreamingWithSdpFileHandleL", - CVHPPTestClass::InitializeStreamingWithSdpFileHandleL ), - ENTRY ( "RetrieveFileNameAndModeL", CVHPPTestClass::RetrieveFileNameAndModeL ) + ENTRY ( "InitializeStreamingWithSdpFileHandleL", CVHPPTestClass::InitializeStreamingWithSdpFileHandleL ), + ENTRY ( "RetrieveFileNameAndModeL", CVHPPTestClass::RetrieveFileNameAndModeL ) // // ADD NEW ENTRIES HERE @@ -290,7 +289,7 @@ TInt duration; TInt volumeSteps; - + TInt err = aItem.GetNextInt( duration ); if ( err == KErrNone ) @@ -306,32 +305,32 @@ AddExpectedEvent( event ); - // + // // read number of volume steps // err = aItem.GetNextInt( volumeSteps ); - + if ( err == KErrNone ) - { + { // // set volume steps // SetVolumeSteps( volumeSteps ); - - TBuf<120> fullPath; + + TBuf<120> fullPath; err = ReadFileInitializationParameters( aItem, fullPath ); - + if ( err == KErrNone ) { PreparePluginL(); - + // // Initalize the Plugin with a file name // MPX_DEBUG(_L("Initialize the Plugin: filename = %S"), &fullPath); iLog->Log(_L("Initialize the Plugin: filename = %S"), &fullPath); - + iPlaybackPlugin->InitialiseL( fullPath ); } } @@ -368,40 +367,40 @@ AddExpectedEvent( event ); - // + // // read number of volume steps // err = aItem.GetNextInt( volumeSteps ); - + if ( err == KErrNone ) - { + { // // set volume steps // SetVolumeSteps( volumeSteps ); - + TPtrC link; - + // // Read in the link from the config file // TInt err = aItem.GetNextString( link ); - + if ( err == KErrNone ) { TInt err = ReadInitializationErrors( aItem ); - + if ( err == KErrNone ) { PreparePluginL(); - + // // Extract the streaming link from the ram file and // Initalize the Plugin with the link and an access point // MPX_DEBUG(_L("Initialize the Plugin: link = %S"), &link); iLog->Log(_L("Initialize the Plugin: link = %S"), &link); - + iPlaybackPlugin->InitStreamingL( link, KNullDesC8, 11 ); } } @@ -463,57 +462,57 @@ TInt duration; TInt volumeSteps; TInt fileHandle32; - + TInt err = aItem.GetNextInt( fileHandle32 ); - + if ( err == KErrNone ) - { - + { + #ifndef SYMBIAN_ENABLE_64_BIT_FILE_SERVER_API // // set RFile as default if the 64-bit flag is not defined // fileHandle32 = ETrue; #endif // SYMBIAN_ENABLE_64_BIT_FILE_SERVER_API - + err = aItem.GetNextInt( duration ); - + if ( err == KErrNone ) { // // We will always get an Init Complete message out // TCallbackEvent* event = new TCallbackEvent; - + event->iEvent = EPInitialised; event->iData = duration; event->iError = KErrNone; - + AddExpectedEvent( event ); - - // + + // // read number of volume steps // err = aItem.GetNextInt( volumeSteps ); - + if ( err == KErrNone ) - { + { // // set volume steps // SetVolumeSteps( volumeSteps ); - + TBuf<120> fullPath; - + err = ReadFileInitializationParameters( aItem, fullPath ); - + if ( err == KErrNone ) { PreparePluginL(); - + RFs fs; TInt error = fs.Connect(); - + // // Open a file handle to the clip // @@ -533,18 +532,18 @@ file64.Close(); } #endif // SYMBIAN_ENABLE_64_BIT_FILE_SERVER_API - + // // Initalize the Plugin with a file name // MPX_DEBUG(_L("Initialize the Plugin with File Handle: filename = %S"), &fullPath); iLog->Log(_L("Initialize the Plugin with File Handle: filename = %S"), &fullPath); - + fs.Close(); } - } - } - } + } + } + } return err; } @@ -891,14 +890,14 @@ event->iError = KErrNone; AddExpectedEvent( event ); } - else - { - event->iEvent = EPSetComplete; - event->iData = property; - event->iError = KErrNone; - AddExpectedEvent( event ); - } - + else + { + event->iEvent = EPSetComplete; + event->iData = property; + event->iError = KErrNone; + AddExpectedEvent( event ); + } + } TRAP( err, iPlaybackPlugin->SetL( (TMPXPlaybackProperty)property, value ) ); @@ -1147,9 +1146,9 @@ iLog->Log(_L("CVHPPTestClass::ConnectToDownloadL()")); TInt err = KErrNone; - -#ifdef USE_S60_DOWNLOAD_MANAGER - + +#ifdef USE_S60_DOWNLOAD_MANAGER + iDlMgrTester = CDlMgrTestClass::NewL(); iDlMgrTester->AddStifObserver( this ); @@ -1196,17 +1195,17 @@ CleanupStack::PopAndDestroy( cmd ); } } - -#else // USE_S60_DOWNLOAD_MANAGER - - // suppress build warning - MPX_DEBUG(_L("CVHPPTestClass::ConnectToDownloadL() : parsing type = %d"), aItem.ParsingType()); - - // Signal TestScripter to continue from waittestclass + +#else // USE_S60_DOWNLOAD_MANAGER + + // suppress build warning + MPX_DEBUG(_L("CVHPPTestClass::ConnectToDownloadL() : parsing type = %d"), aItem.ParsingType()); + + // Signal TestScripter to continue from waittestclass Signal(); - + #endif // USE_S60_DOWNLOAD_MANAGER - + return err; } @@ -1220,7 +1219,7 @@ MPX_ENTER_EXIT(_L("CVHPPTestClass::SendPdlCustomCommandL"), _L("aCustomCmd = %d"), aCustomCmd ); -#ifdef USE_S60_DOWNLOAD_MANAGER +#ifdef USE_S60_DOWNLOAD_MANAGER CMPXCommand* cmd = CMPXCommand::NewL(); CleanupStack::PushL( cmd ); @@ -1232,12 +1231,12 @@ iPlaybackPlugin->CommandL( *cmd ); CleanupStack::PopAndDestroy( cmd ); - -#else // USE_S60_DOWNLOAD_MANAGER - - // Signal TestScripter to continue from waittestclass + +#else // USE_S60_DOWNLOAD_MANAGER + + // Signal TestScripter to continue from waittestclass Signal(); - + #endif // USE_S60_DOWNLOAD_MANAGER } @@ -1252,8 +1251,8 @@ MPX_ENTER_EXIT(_L("CVHPPTestClass::PauseDownloadL()")); iLog->Log(_L("CVHPPTestClass::PauseDownloadL()")); -#ifdef USE_S60_DOWNLOAD_MANAGER - +#ifdef USE_S60_DOWNLOAD_MANAGER + TCallbackEvent* event = new TCallbackEvent; event->iEvent = EPDownloadStateChanged; @@ -1263,14 +1262,14 @@ AddExpectedEvent( event ); iDlMgrTester->PauseDownload(); - -#else // USE_S60_DOWNLOAD_MANAGER - - // Signal TestScripter to continue from waittestclass + +#else // USE_S60_DOWNLOAD_MANAGER + + // Signal TestScripter to continue from waittestclass Signal(); - -#endif // USE_S60_DOWNLOAD_MANAGER - + +#endif // USE_S60_DOWNLOAD_MANAGER + return KErrNone; } @@ -1285,9 +1284,9 @@ iLog->Log(_L("CVHPPTestClass::ResumeDownloadL()")); TInt err = KErrNone; - -#ifdef USE_S60_DOWNLOAD_MANAGER - + +#ifdef USE_S60_DOWNLOAD_MANAGER + TInt dlSize; err = aItem.GetNextInt( dlSize ); @@ -1314,17 +1313,17 @@ iDlMgrTester->ResumeDownload(); } - -#else // USE_S60_DOWNLOAD_MANAGER - - // suppress build warning - MPX_DEBUG(_L("CVHPPTestClass::ResumeDownloadL() : parsing type = %d"), aItem.ParsingType()); - - // Signal TestScripter to continue from waittestclass + +#else // USE_S60_DOWNLOAD_MANAGER + + // suppress build warning + MPX_DEBUG(_L("CVHPPTestClass::ResumeDownloadL() : parsing type = %d"), aItem.ParsingType()); + + // Signal TestScripter to continue from waittestclass Signal(); - -#endif // USE_S60_DOWNLOAD_MANAGER - + +#endif // USE_S60_DOWNLOAD_MANAGER + return err; } @@ -1338,8 +1337,8 @@ MPX_ENTER_EXIT(_L("CVHPPTestClass::CancelDownloadL()")); iLog->Log(_L("CVHPPTestClass::CancelDownloadL()")); -#ifdef USE_S60_DOWNLOAD_MANAGER - +#ifdef USE_S60_DOWNLOAD_MANAGER + TCallbackEvent* event = new TCallbackEvent; event->iEvent = EPDownloadStateChanged; @@ -1350,13 +1349,13 @@ iDlMgrTester->CancelDownload(); -#else // USE_S60_DOWNLOAD_MANAGER - - // Signal TestScripter to continue from waittestclass +#else // USE_S60_DOWNLOAD_MANAGER + + // Signal TestScripter to continue from waittestclass Signal(); - -#endif // USE_S60_DOWNLOAD_MANAGER - + +#endif // USE_S60_DOWNLOAD_MANAGER + return KErrNone; } @@ -1371,9 +1370,9 @@ iLog->Log(_L("CVHPPTestClass::RetrievePdlStatusL()")); TInt err = KErrNone; - -#ifdef USE_S60_DOWNLOAD_MANAGER - + +#ifdef USE_S60_DOWNLOAD_MANAGER + TInt pdlState; TInt expectedPdlState; TInt downloadedBytes; @@ -1432,16 +1431,16 @@ CleanupStack::PopAndDestroy( cmd ); } -#else // USE_S60_DOWNLOAD_MANAGER - - // suppress build warning - MPX_DEBUG(_L("CVHPPTestClass::RetrievePdlStatusL() : parsing type = %d"), aItem.ParsingType()); - - // Signal TestScripter to continue from waittestclass +#else // USE_S60_DOWNLOAD_MANAGER + + // suppress build warning + MPX_DEBUG(_L("CVHPPTestClass::RetrievePdlStatusL() : parsing type = %d"), aItem.ParsingType()); + + // Signal TestScripter to continue from waittestclass Signal(); - -#endif // USE_S60_DOWNLOAD_MANAGER - + +#endif // USE_S60_DOWNLOAD_MANAGER + return err; } @@ -1623,7 +1622,7 @@ CVHPPTestClass::ProcessEvent( TCallbackEvent* aCallback ) { MPX_ENTER_EXIT(_L("CVHPPTestClass::ProcessEvent")); - + if ( iExpectedCallbackArray->Count() > 0 ) { TCallbackEvent* expectedCallback = (*iExpectedCallbackArray)[0]; @@ -2027,7 +2026,14 @@ event->iError = KErrNone; AddExpectedEvent( event ); - + + event = new TCallbackEvent; + event->iEvent = EPPaused; + event->iData = 0; + event->iError = KErrNone; + + AddExpectedEvent( event ); + iAccObserver->UpdateTvOutStatusL( EFalse ); return KErrNone; @@ -2121,69 +2127,69 @@ return err; } -// ----------------------------------------------------------------------------- -// CVHPPTestClass::SetVolumeSteps -// ----------------------------------------------------------------------------- -// -TInt -CVHPPTestClass::SetVolumeSteps( TInt aVolumeSteps ) -{ - MPX_ENTER_EXIT(_L("CVHPPTestClass::SetVolumeSteps()")); - iLog->Log(_L("CVHPPTestClass::SetVolumeSteps()")); - +// ----------------------------------------------------------------------------- +// CVHPPTestClass::SetVolumeSteps +// ----------------------------------------------------------------------------- +// +TInt +CVHPPTestClass::SetVolumeSteps( TInt aVolumeSteps ) +{ + MPX_ENTER_EXIT(_L("CVHPPTestClass::SetVolumeSteps()")); + iLog->Log(_L("CVHPPTestClass::SetVolumeSteps()")); + iPlayerUtility->SetVolumeSteps( aVolumeSteps ); - - return KErrNone; -} - -// ----------------------------------------------------------------------------- -// CVHPPTestClass::HandleVolumeL -// ----------------------------------------------------------------------------- -// -TInt -CVHPPTestClass::HandleVolumeL( CStifItemParser& aItem ) -{ - MPX_ENTER_EXIT(_L("CVHPPTestClass::HandleVolumeL()")); - iLog->Log(_L("CVHPPTestClass::HandleVolumeL()")); - - TInt command; - TInt value; - + + return KErrNone; +} + +// ----------------------------------------------------------------------------- +// CVHPPTestClass::HandleVolumeL +// ----------------------------------------------------------------------------- +// +TInt +CVHPPTestClass::HandleVolumeL( CStifItemParser& aItem ) +{ + MPX_ENTER_EXIT(_L("CVHPPTestClass::HandleVolumeL()")); + iLog->Log(_L("CVHPPTestClass::HandleVolumeL()")); + + TInt command; + TInt value; + TInt err = aItem.GetNextInt( command ); if ( err == KErrNone ) { err = aItem.GetNextInt( value ); - if ( err == KErrNone ) - { - // - // assign callback event values - // - TCallbackEvent* event = new TCallbackEvent; - event->iEvent = EPVolumeChanged; - event->iData = value; - event->iError = KErrNone; - - // - // save expected result to be compared later - // - AddExpectedEvent( event ); - + if ( err == KErrNone ) + { + // + // assign callback event values + // + TCallbackEvent* event = new TCallbackEvent; + event->iEvent = EPVolumeChanged; + event->iData = value; + event->iError = KErrNone; + + // + // save expected result to be compared later + // + AddExpectedEvent( event ); + // // send command to playback plugin // - CreateVideoPlaybackCommandL( aItem, (TMPXVideoPlaybackCommand)command ); - } + CreateVideoPlaybackCommandL( aItem, (TMPXVideoPlaybackCommand)command ); + } } - + if ( err == KErrNone ) { MPX_DEBUG(_L("CVHPPTestClass::HandleVolumeL() leaves with proper error")); } - - return err; -} + + return err; +} TInt @@ -2195,7 +2201,7 @@ TInt duration; TInt volumeSteps; TInt position; - + TInt err = aItem.GetNextInt( duration ); if ( err == KErrNone ) @@ -2211,36 +2217,36 @@ AddExpectedEvent( event ); - // + // // read number of volume steps // err = aItem.GetNextInt( volumeSteps ); - + if ( err == KErrNone ) - { + { // // set volume steps // SetVolumeSteps( volumeSteps ); - + err = aItem.GetNextInt( position ); - + if (err == KErrNone ) { - TBuf<120> fullPath; + TBuf<120> fullPath; err = ReadFileInitializationParameters( aItem, fullPath ); - + if ( err == KErrNone ) { PreparePluginL(); - + // // Initalize the Plugin with a file name // MPX_DEBUG(_L("Initialize the Plugin: filename = %S, position = %d"), &fullPath, position); iLog->Log(_L("Initialize the Plugin: filename = %S, position = %d"), &fullPath, position); - + iPlaybackPlugin->InitialiseWithPositionL( fullPath, position ); } @@ -2261,7 +2267,7 @@ TInt duration; TInt volumeSteps; TInt position; - + TInt err = aItem.GetNextInt( duration ); if ( err == KErrNone ) @@ -2277,44 +2283,44 @@ AddExpectedEvent( event ); - // + // // read number of volume steps // err = aItem.GetNextInt( volumeSteps ); - + if ( err == KErrNone ) - { + { // // set volume steps // SetVolumeSteps( volumeSteps ); - + err = aItem.GetNextInt( position ); - + if ( err == KErrNone ) { TPtrC link; - + // // Read in the link from the config file // TInt err = aItem.GetNextString( link ); - + if ( err == KErrNone ) { TInt err = ReadInitializationErrors( aItem ); - + if ( err == KErrNone ) { PreparePluginL(); - + // // Extract the streaming link from the ram file and // Initalize the Plugin with the link and an access point // MPX_DEBUG(_L("Initialize the Plugin: link = %S, position = %d"), &link, position); iLog->Log(_L("Initialize the Plugin: link = %S, position = %d"), &link, position); - + iPlaybackPlugin->InitStreamingL( link, KNullDesC8, 11, position ); } } @@ -2336,41 +2342,41 @@ TInt volumeSteps; TInt position; TInt fileHandle32; - + TInt err = aItem.GetNextInt( fileHandle32 ); - + if ( err == KErrNone ) - { - + { + #ifndef SYMBIAN_ENABLE_64_BIT_FILE_SERVER_API // // set RFile as default if the 64-bit flag is not defined // fileHandle32 = ETrue; #endif // SYMBIAN_ENABLE_64_BIT_FILE_SERVER_API - + err = aItem.GetNextInt( duration ); - + if ( err == KErrNone ) { // // We will always get an Init Complete message out // TCallbackEvent* event = new TCallbackEvent; - + event->iEvent = EPInitialised; event->iData = duration; event->iError = KErrNone; - + AddExpectedEvent( event ); - - // + + // // read number of volume steps // err = aItem.GetNextInt( volumeSteps ); - + if ( err == KErrNone ) - { + { // // set volume steps // @@ -2381,16 +2387,16 @@ if (err == KErrNone ) { TBuf<120> fullPath; - + err = ReadFileInitializationParameters( aItem, fullPath ); - + if ( err == KErrNone ) { PreparePluginL(); - + RFs fs; TInt error = fs.Connect(); - + // // Open a file handle to the clip // @@ -2410,20 +2416,20 @@ file64.Close(); } #endif // SYMBIAN_ENABLE_64_BIT_FILE_SERVER_API - + // // Initalize the Plugin with a file name // MPX_DEBUG(_L("Initialize the Plugin with File Handle: filename = %S, position = %d"), &fullPath, position); iLog->Log(_L("Initialize the Plugin with File Handle: filename = %S, position = %d"), &fullPath, position); - + fs.Close(); } - } - - } - } - } + } + + } + } + } return err; } @@ -2437,97 +2443,97 @@ TInt duration; TInt volumeSteps; TInt fileHandle32; - + TInt err = aItem.GetNextInt( fileHandle32 ); - + if ( err == KErrNone ) - { - + { + #ifndef SYMBIAN_ENABLE_64_BIT_FILE_SERVER_API // // set RFile as default if the 64-bit flag is not defined // fileHandle32 = ETrue; #endif // SYMBIAN_ENABLE_64_BIT_FILE_SERVER_API - + err = aItem.GetNextInt( duration ); - + if ( err == KErrNone ) { // // We will always get an Init Complete message out // TCallbackEvent* event = new TCallbackEvent; - + event->iEvent = EPInitialised; event->iData = duration; event->iError = KErrNone; - + AddExpectedEvent( event ); - - // + + // // read number of volume steps // err = aItem.GetNextInt( volumeSteps ); - + if ( err == KErrNone ) - { + { // // set volume steps // SetVolumeSteps( volumeSteps ); - + TBuf<120> fullPath; err = ReadFileInitializationParameters( aItem, fullPath ); if ( err == KErrNone ) { - PreparePluginL(); - - MPX_DEBUG( _L("Initialize the Plugin: link = %S"), &fullPath ); - iLog->Log( _L("Initialize the Plugin: link = %S"), &fullPath ); - - // - // Extract the streaming link from the ram file and - // Initalize the Plugin with the file handle and an access point - // - RFs fs; - TInt error = fs.Connect(); - - if ( fileHandle32 ) - { - RFile file; - error = file.Open( fs, fullPath, EFileRead | EFileShareAny ); - - MPX_DEBUG( _L("Initialize the Plugin: file open error = %d"), - error ); - - User::LeaveIfError( error ); - - iPlaybackPlugin->InitStreamingL( file, 11 ); - file.Close(); - } + PreparePluginL(); + + MPX_DEBUG( _L("Initialize the Plugin: link = %S"), &fullPath ); + iLog->Log( _L("Initialize the Plugin: link = %S"), &fullPath ); + + // + // Extract the streaming link from the ram file and + // Initalize the Plugin with the file handle and an access point + // + RFs fs; + TInt error = fs.Connect(); + + if ( fileHandle32 ) + { + RFile file; + error = file.Open( fs, fullPath, EFileRead | EFileShareAny ); + + MPX_DEBUG( _L("Initialize the Plugin: file open error = %d"), + error ); + + User::LeaveIfError( error ); + + iPlaybackPlugin->InitStreamingL( file, 11 ); + file.Close(); + } #ifdef SYMBIAN_ENABLE_64_BIT_FILE_SERVER_API - else - { - RFile64 file64; - error = file64.Open( fs, fullPath, EFileRead | EFileShareAny ); - - MPX_DEBUG( _L("Initialize the Plugin: file open error = %d"), - error ); - - User::LeaveIfError( error ); - - iPlaybackPlugin->InitStreaming64L( file64, 11 ); - file64.Close(); - } + else + { + RFile64 file64; + error = file64.Open( fs, fullPath, EFileRead | EFileShareAny ); + + MPX_DEBUG( _L("Initialize the Plugin: file open error = %d"), + error ); + + User::LeaveIfError( error ); + + iPlaybackPlugin->InitStreaming64L( file64, 11 ); + file64.Close(); + } #endif // SYMBIAN_ENABLE_64_BIT_FILE_SERVER_API - - fs.Close(); + + fs.Close(); } - } - } - } + } + } + } return err; } @@ -2537,10 +2543,10 @@ MPX_ENTER_EXIT( _L("CVHPPTestClass::RetrieveFileNameAndModeL()") ); iLog->Log( _L("CVHPPTestClass::RetrieveFileNameAndModeL()") ); - TBuf<120> fullPath; - TPtrC fileName; - TInt err; - + TBuf<120> fullPath; + TPtrC fileName; + TInt err; + err = aItem.GetNextString( fileName ); if ( err == KErrNone ) @@ -2550,38 +2556,38 @@ // fullPath.Append( KVideoTestPath ); fullPath.Append( fileName ); - + TInt mode; err = aItem.GetNextInt( mode); - + if ( err == KErrNone ) { - CMPXCommand* cmd = CMPXCommand::NewL(); - CleanupStack::PushL( cmd ); - - cmd->SetTObjectValueL( KMPXCommandGeneralDoSync, ETrue ); - cmd->SetTObjectValueL( KMPXCommandGeneralId, - KMPXMediaIdVideoPlayback ); - cmd->SetTObjectValueL( KMPXMediaVideoPlaybackCommand, EPbCmdInitView ); - - iPlaybackPlugin->CommandL( *cmd ); - - TPtrC clipName( cmd->ValueText( KMPXMediaVideoPlaybackFileName ) ); - TMPXVideoMode playbackMode = (TMPXVideoMode) cmd->ValueTObjectL( KMPXMediaVideoMode ); - - MPX_DEBUG( _L(" Expected Data: filename = %S, playbackmode= %d" ), - &fullPath, mode ); - - MPX_DEBUG( _L(" Retrieved Data: filename = %S, playbackmode= %d"), - &clipName, playbackMode ); - - if ( fullPath.Compare( clipName) != 0 || mode != playbackMode ) - { - err = KErrGeneral; - MPX_DEBUG( _L(" err = %d"), err ); - } - - CleanupStack::PopAndDestroy( cmd ); + CMPXCommand* cmd = CMPXCommand::NewL(); + CleanupStack::PushL( cmd ); + + cmd->SetTObjectValueL( KMPXCommandGeneralDoSync, ETrue ); + cmd->SetTObjectValueL( KMPXCommandGeneralId, + KMPXMediaIdVideoPlayback ); + cmd->SetTObjectValueL( KMPXMediaVideoPlaybackCommand, EPbCmdInitView ); + + iPlaybackPlugin->CommandL( *cmd ); + + TPtrC clipName( cmd->ValueText( KMPXMediaVideoPlaybackFileName ) ); + TMPXVideoMode playbackMode = (TMPXVideoMode) cmd->ValueTObjectL( KMPXMediaVideoMode ); + + MPX_DEBUG( _L(" Expected Data: filename = %S, playbackmode= %d" ), + &fullPath, mode ); + + MPX_DEBUG( _L(" Retrieved Data: filename = %S, playbackmode= %d"), + &clipName, playbackMode ); + + if ( fullPath.Compare( clipName) != 0 || mode != playbackMode ) + { + err = KErrGeneral; + MPX_DEBUG( _L(" err = %d"), err ); + } + + CleanupStack::PopAndDestroy( cmd ); } } diff -r 2d690156cf8f -r 315810614048 videoplayback/videoplaybackcontrols/inc/mpxvideoplaybackcontrolconfiguration.h --- a/videoplayback/videoplaybackcontrols/inc/mpxvideoplaybackcontrolconfiguration.h Thu Jul 15 18:41:27 2010 +0300 +++ b/videoplayback/videoplaybackcontrols/inc/mpxvideoplaybackcontrolconfiguration.h Thu Aug 19 09:57:17 2010 +0300 @@ -15,7 +15,7 @@ * */ -// Version : %version: 4 % +// Version : %version: 5 % @@ -65,7 +65,8 @@ /** * Update control list */ - void UpdateControlListL( TMPXVideoPlaybackControlCommandIds aEvent ); + void UpdateControlListL( TMPXVideoPlaybackControlCommandIds aEvent, + TBool aShowArIcon = EFalse ); /** * Return control list diff -r 2d690156cf8f -r 315810614048 videoplayback/videoplaybackcontrols/inc/mpxvideoplaybackvolumebar.h --- a/videoplayback/videoplaybackcontrols/inc/mpxvideoplaybackvolumebar.h Thu Jul 15 18:41:27 2010 +0300 +++ b/videoplayback/videoplaybackcontrols/inc/mpxvideoplaybackvolumebar.h Thu Aug 19 09:57:17 2010 +0300 @@ -15,7 +15,7 @@ * */ -// Version : %version: e003sa33#8 % +// Version : %version: 9 % @@ -69,6 +69,8 @@ * By default Symbian 2nd phase constructor is private. */ void ConstructL(); + + void CreateSliderIconsL(); private: // from CoeControl @@ -110,6 +112,12 @@ * @since 5.0 */ void Reset(); + + /** + * TV Out connected + * @return void + */ + void UpdateTVOutStatusL( TBool aConnected ); private: //new fuctions /** diff -r 2d690156cf8f -r 315810614048 videoplayback/videoplaybackcontrols/src/mpxvideoplaybackcontrol.cpp --- a/videoplayback/videoplaybackcontrols/src/mpxvideoplaybackcontrol.cpp Thu Jul 15 18:41:27 2010 +0300 +++ b/videoplayback/videoplaybackcontrols/src/mpxvideoplaybackcontrol.cpp Thu Aug 19 09:57:17 2010 +0300 @@ -16,7 +16,7 @@ */ -// Version : %version: 23 % +// Version : %version: 25 % // INCLUDE FILES @@ -332,6 +332,7 @@ } break; } + case EPbStateInitialised: case EPbStateBuffering: { if ( iProperties & EMPXBufferingControl ) @@ -558,6 +559,26 @@ } // ------------------------------------------------------------------------------------------------- +// CMPXVideoPlaybackControl::UpdateTVOutStatusL() +// ------------------------------------------------------------------------------------------------- +// +TBool CMPXVideoPlaybackControl::UpdateTVOutStatusL( TBool aTvOutConnected) +{ + TBool changed = EFalse; + + if ( iControlIndex == EMPXVolumeBar ) + { + MPX_DEBUG(_L("CMPXVideoPlaybackControlsController::UpdateTVOutStatus()")); + + static_cast(iControl)->UpdateTVOutStatusL( aTvOutConnected ); + + changed = ETrue; + } + + return changed; +} + +// ------------------------------------------------------------------------------------------------- // CMPXVideoPlaybackControl::ResetControl() // ------------------------------------------------------------------------------------------------- // diff -r 2d690156cf8f -r 315810614048 videoplayback/videoplaybackcontrols/src/mpxvideoplaybackcontrolconfiguration.cpp --- a/videoplayback/videoplaybackcontrols/src/mpxvideoplaybackcontrolconfiguration.cpp Thu Jul 15 18:41:27 2010 +0300 +++ b/videoplayback/videoplaybackcontrols/src/mpxvideoplaybackcontrolconfiguration.cpp Thu Aug 19 09:57:17 2010 +0300 @@ -16,7 +16,7 @@ */ -// Version : %version: 15 % +// Version : %version: 16 % // INCLUDE FILES @@ -137,7 +137,7 @@ // ------------------------------------------------------------------------------------------------- // void CMPXVideoPlaybackControlConfiguration::UpdateControlListL( - TMPXVideoPlaybackControlCommandIds aEvent ) + TMPXVideoPlaybackControlCommandIds aEvent, TBool aShowArIcon ) { MPX_DEBUG(_L("CMPXVideoPlaybackControlConfiguration::UpdateControlListL(%d)"), aEvent); @@ -145,7 +145,6 @@ // This fuction will be getting called // - After Initialization complete // - When TV-out cable get connected/disconnected - // - When enters/exits aspect ratio mode // switch ( aEvent ) { @@ -201,7 +200,7 @@ iTitleArtistIndicatorsAdded = EFalse; } - if ( ! iAspectRatioIconAdded && iControlsController->ShowAspectRatioIcon() ) + if ( ! iAspectRatioIconAdded && aShowArIcon ) { iControlsList.AppendL( EMPXAspectRatioIcon ); iAspectRatioIconAdded = ETrue; @@ -219,6 +218,26 @@ break; } + case EMPXControlCmdCreateAspectRatioIcon: + { + if ( ! iAspectRatioIconAdded ) + { + iControlsList.AppendL( EMPXAspectRatioIcon ); + iAspectRatioIconAdded = ETrue; + } + + break; + } + case EMPXControlCmdDeleteAspectRatioIcon: + { + if ( iAspectRatioIconAdded ) + { + DeleteControlFromList( EMPXAspectRatioIcon ); + iAspectRatioIconAdded = EFalse; + } + + break; + } } } @@ -269,12 +288,6 @@ iTitleArtistIndicatorsAdded = ETrue; } - - if ( iAspectRatioIconAdded ) - { - DeleteControlFromList( EMPXAspectRatioIcon ); - iAspectRatioIconAdded = EFalse; - } } else { @@ -285,12 +298,6 @@ iTitleArtistIndicatorsAdded = EFalse; } - - if ( ! iAspectRatioIconAdded && iControlsController->ShowAspectRatioIcon() ) - { - iControlsList.AppendL( EMPXAspectRatioIcon ); - iAspectRatioIconAdded = ETrue; - } } } else @@ -335,15 +342,6 @@ iTitleArtistIndicatorsAdded = ETrue; } - - // - // If video isn't enable, delete aspect ratio icon - // - if ( iAspectRatioIconAdded ) - { - DeleteControlFromList( EMPXAspectRatioIcon ); - iAspectRatioIconAdded = EFalse; - } } } diff -r 2d690156cf8f -r 315810614048 videoplayback/videoplaybackcontrols/src/mpxvideoplaybackcontrolpolicy.cpp --- a/videoplayback/videoplaybackcontrols/src/mpxvideoplaybackcontrolpolicy.cpp Thu Jul 15 18:41:27 2010 +0300 +++ b/videoplayback/videoplaybackcontrols/src/mpxvideoplaybackcontrolpolicy.cpp Thu Aug 19 09:57:17 2010 +0300 @@ -15,7 +15,8 @@ * */ -// Version : %version: 9 % + +// Version : %version: 10 % // INCLUDE FILES @@ -94,16 +95,7 @@ // // Transitory Buffering states will be filtered out by the View // - aProperties = EMPXBufferingControl; - - // - // Do not show Back when Initializing for Local Mode - // It causes a flicker when playback begins - // - if ( aDetails->iPlaybackMode != EMPXVideoLocal ) - { - aProperties += EMPXShownWhenInitializing; - } + aProperties = EMPXBufferingControl | EMPXShownWhenInitializing; } case EMPXSoftkeyDetails: { @@ -117,6 +109,16 @@ case EMPXBufferingLabel: { aProperties = EMPXBufferingControl; + + // + // Show Loading when Initializing for local playback modes + // This allows for a smoother transition to playing state + // + if ( aDetails->iPlaybackMode == EMPXVideoLocal || + aDetails->iPlaybackMode == EMPXVideoProgressiveDownload ) + { + aProperties += EMPXShownWhenInitializing; + } break; } case EMPXTitleLabel: diff -r 2d690156cf8f -r 315810614048 videoplayback/videoplaybackcontrols/src/mpxvideoplaybackcontrolscontroller.cpp --- a/videoplayback/videoplaybackcontrols/src/mpxvideoplaybackcontrolscontroller.cpp Thu Jul 15 18:41:27 2010 +0300 +++ b/videoplayback/videoplaybackcontrols/src/mpxvideoplaybackcontrolscontroller.cpp Thu Aug 19 09:57:17 2010 +0300 @@ -16,7 +16,7 @@ */ -// Version : %version: 42 % +// Version : %version: 45 % // INCLUDE FILES @@ -117,10 +117,18 @@ iFileDetails = aDetails; iTvOutConnected = iFileDetails->iTvOutConnected; - iShowControls = ETrue; iRNFormat = IsRealFormatL( iFileDetails->iClipName->Des() ); + if ( IsRealOneBitmapVisible() ) + { + iShowControls = EFalse; + } + else + { + iShowControls = ETrue; + } + iControlsPolicy = CMPXVideoPlaybackControlPolicy::NewL(); iControlsConfig = CMPXVideoPlaybackControlConfiguration::NewL( this ); @@ -228,9 +236,6 @@ ControlsListUpdatedL(); - // - // Show controls initially if this doens't have playable video track - // for ( TInt i = 0 ; i < iControls.Count() ; i++ ) { iControls[i]->UpdateControlsWithFileDetailsL( iFileDetails ); @@ -315,16 +320,22 @@ } case EMPXControlCmdTvOutConnected: { - MPX_DEBUG(_L(" [EMPXControlCmdTvOutConnected]")); iTvOutConnected = ETrue; - HandleTvOutEventL( ETrue, aEvent ); + + // + // Do not show the aspect ratio icon when TV Out is connected + // + HandleTvOutEventL( ETrue, aEvent, EFalse ); break; } case EMPXControlCmdTvOutDisconnected: { - MPX_DEBUG(_L(" [EMPXControlCmdTvOutDisConnected]")); iTvOutConnected = EFalse; - HandleTvOutEventL( EFalse, aEvent ); + + // + // Pass in the show aspect ratio flag from the event + // + HandleTvOutEventL( EFalse, aEvent, aValue ); break; } case EMPXControlCmdHandleBackgroundEvent: @@ -334,7 +345,9 @@ TBool keylock( EFalse ); RProperty::Get( KPSUidAvkonDomain, KAknKeyguardStatus, keylock ); - // Don't show controls when key is locked + // + // Don't show controls when key is locked + // if ( keylock ) { iShowControls = EFalse; @@ -352,8 +365,13 @@ case EMPXControlCmdHandleForegroundEvent: { MPX_DEBUG(_L(" [EMPXControlCmdHandleForegroundEvent]")); - iShowControls = ETrue; - UpdateControlsVisibility(); + + if ( ! IsRealOneBitmapVisible() ) + { + iShowControls = ETrue; + UpdateControlsVisibility(); + } + break; } case EMPXControlCmdHandleErrors: @@ -399,6 +417,23 @@ HandleLoadingStarted(); break; } + case EMPXControlCmdCreateAspectRatioIcon: + case EMPXControlCmdDeleteAspectRatioIcon: + { + // + // Ignore the Aspect Ration commands for non touch devices and + // when the TV-Out is connected. + // + if ( AknLayoutUtils::PenEnabled() && ! iTvOutConnected ) + { + iControlsConfig->UpdateControlListL( aEvent ); + + // + // Set the update visibility flag based on the visibility of the controls + // + ControlsListUpdatedL( IsVisible() ); + } + } } } @@ -546,9 +581,10 @@ // CMPXVideoPlaybackControlsController::ControlsListUpdatedL() // ------------------------------------------------------------------------------------------------- // -void CMPXVideoPlaybackControlsController::ControlsListUpdatedL() +void CMPXVideoPlaybackControlsController::ControlsListUpdatedL( TBool aUpdateVisibility ) { - MPX_ENTER_EXIT(_L("CMPXVideoPlaybackControlsController::ControlsListUpdatedL()")); + MPX_ENTER_EXIT(_L("CMPXVideoPlaybackControlsController::ControlsListUpdatedL()"), + _L("aUpdateVisibility = %d"), aUpdateVisibility ); RArray& updatedList = iControlsConfig->ControlList(); @@ -603,7 +639,10 @@ AppendControlL( myList[j] ); } - UpdateControlsVisibility(); + if ( aUpdateVisibility ) + { + UpdateControlsVisibility(); + } CleanupStack::PopAndDestroy(); } @@ -824,12 +863,15 @@ TRect ctrlRect = dlPausedBitmap->Rect(); - // To make it aligned with AspectRatioIcon when touch is supported. + // + // To make it aligned with AspectRatioIcon when touch is supported. + // if ( AknLayoutUtils::PenEnabled() ) { ctrlRect.iBr.iY += 10; ctrlRect.iTl.iY += 10; } + CMPXVideoPlaybackControl* control = CMPXVideoPlaybackControlPdl::NewL( this, dlPausedBitmap, @@ -872,6 +914,8 @@ aControlIndex, properties ); + control->MakeVisible( EFalse ); + CleanupStack::PushL( control ); iControls.AppendL( control ); @@ -1745,7 +1789,39 @@ if ( iRealOneBitmap ) { iRealOneBitmap->MakeVisible( aVisible ); + + if ( ! aVisible ) + { + // HDMI/TV-out cable connected then show the controls + if ( iTvOutConnected && !iShowControls ) + { + iShowControls = ETrue; + UpdateControlsVisibility(); + } + else + { + iShowControls = ETrue; + } + } + }// iRealOneBitmap +} + +// ------------------------------------------------------------------------------------------------- +// CMPXVideoPlaybackControlsController::IsRealOneBitmapVisible() +// ------------------------------------------------------------------------------------------------- +// +TBool CMPXVideoPlaybackControlsController::IsRealOneBitmapVisible() +{ + TBool visible = EFalse; + + if ( iRealOneBitmap ) + { + visible = iRealOneBitmap->IsVisible(); } + + MPX_DEBUG(_L("CMPXVideoPlaybackControlsController::IsRealOneBitmapVisible(%d)"), visible); + + return visible; } // ------------------------------------------------------------------------------------------------- @@ -1813,13 +1889,21 @@ // ------------------------------------------------------------------------------------------------- // void CMPXVideoPlaybackControlsController::HandleTvOutEventL( - TBool aConnected, TMPXVideoPlaybackControlCommandIds aEvent ) + TBool aConnected, TMPXVideoPlaybackControlCommandIds aEvent, TBool aShowArIcon ) { MPX_ENTER_EXIT(_L("CMPXVideoPlaybackControlsController::HandleTvOutEventL()")); iFileDetails->iTvOutConnected = aConnected; - iControlsConfig->UpdateControlListL( aEvent ); + iControlsConfig->UpdateControlListL( aEvent, aShowArIcon ); ControlsListUpdatedL(); + + for ( TInt i = 0 ; i < iControls.Count() ; i++ ) + { + if ( iControls[i]->UpdateTVOutStatusL( aConnected ) ) + { + break; + } + } } // ------------------------------------------------------------------------------------------------- @@ -1939,38 +2023,6 @@ } // ------------------------------------------------------------------------------------------------- -// CMPXVideoPlaybackControlsController::ShowAspectRatioIcon -// ------------------------------------------------------------------------------------------------- -// -TBool CMPXVideoPlaybackControlsController::ShowAspectRatioIcon() -{ - MPX_ENTER_EXIT(_L("CMPXVideoPlaybackControlsController::ShowAspectRatioIcon()")); - - TBool retVal = EFalse; - - if ( iFileDetails->iVideoEnabled && - iFileDetails->iVideoHeight > 0 && - iFileDetails->iVideoWidth > 0 && - AknLayoutUtils::PenEnabled() ) - { - TRect displayRect = iContainer->Rect(); - TReal displayAspectRatio = ( TReal32 )displayRect.Width() / ( TReal32 )displayRect.Height(); - TReal videoAspectRatio = ( TReal32 )iFileDetails->iVideoWidth / - ( TReal32 )iFileDetails->iVideoHeight; - - // If clip's AR is as same as screen display AR, AspectRatioIcon does not display. - if ( displayAspectRatio != videoAspectRatio ) - { - retVal = ETrue; - } - } - - MPX_DEBUG( _L( "CMPXVideoPlaybackControlsController::ShowAspectRatioIcon()[%d]" ), retVal ); - - return retVal; -} - -// ------------------------------------------------------------------------------------------------- // CMPXVideoPlaybackControlsController::HandleLoadingStarted // ------------------------------------------------------------------------------------------------- // diff -r 2d690156cf8f -r 315810614048 videoplayback/videoplaybackcontrols/src/mpxvideoplaybackmediadetailsviewer.cpp --- a/videoplayback/videoplaybackcontrols/src/mpxvideoplaybackmediadetailsviewer.cpp Thu Jul 15 18:41:27 2010 +0300 +++ b/videoplayback/videoplaybackcontrols/src/mpxvideoplaybackmediadetailsviewer.cpp Thu Aug 19 09:57:17 2010 +0300 @@ -16,7 +16,7 @@ */ -// Version : %version: e003sa33#17 % +// Version : %version: 18 % // INCLUDE FILES @@ -65,6 +65,7 @@ CMPXVideoPlaybackMediaDetailsViewer::CMPXVideoPlaybackMediaDetailsViewer( CMPXVideoPlaybackControlsController* aController ) : iController( aController ) + , iDrmDetailsLaunched( EFalse ) { } @@ -238,7 +239,12 @@ // void CMPXVideoPlaybackMediaDetailsViewer::LaunchDRMDetailsL() { - iController->iContainer->HandleCommandL(EMPXPbvLaunchDRMDetails); + if ( ! iDrmDetailsLaunched ) + { + iDrmDetailsLaunched = ETrue; + iController->iContainer->HandleCommandL( EMPXPbvLaunchDRMDetails ); + iDrmDetailsLaunched = EFalse; + } } // ------------------------------------------------------------------------------------------------- @@ -307,10 +313,10 @@ CleanupStack::PopAndDestroy( heading ); } - + // Title HBufC* fileTitle = iController->FileDetails()->GenerateFileTitleL(); - + if ( fileTitle && fileTitle->Length() ) { // Title gets populated by UpdateTitle method @@ -322,7 +328,7 @@ iTitleLabel->MakeVisible( ETrue ); rowsAdded++; } - + delete fileTitle; // Filename @@ -339,9 +345,9 @@ iClipnameLabel->MakeVisible( ETrue ); rowsAdded++; } - + delete fileName; - + // Mime Type (Format) if ( iController->FileDetails()->iMimeType && iController->FileDetails()->iMimeType->Length() ) { @@ -697,7 +703,7 @@ { UpdateFilenameL(); } - + if ( iTitleScroller.IsUpdateNeeded() ) { UpdateTitleL(); @@ -755,8 +761,8 @@ } HBufC* title = NULL; - TRAP_IGNORE ( title = iController->FileDetails()->GenerateFileTitleL() ); - + TRAP_IGNORE ( title = iController->FileDetails()->GenerateFileTitleL() ); + if ( title ) { numOfItems++; @@ -843,10 +849,10 @@ void CMPXVideoPlaybackMediaDetailsViewer::UpdateFilenameL() { MPX_ENTER_EXIT( _L( "CMPXVideoPlaybackMediaDetailsViewer::UpdateFilenameL" ) ); - - HBufC* fileName = iController->FileDetails()->GenerateFileNameL(); + + HBufC* fileName = iController->FileDetails()->GenerateFileNameL(); CleanupStack::PushL( fileName ); - + if ( fileName && fileName->Length() ) { HBufC* heading = iEikonEnv->AllocReadResourceL( R_MPX_FILENAME_HEADING ); @@ -865,7 +871,7 @@ CleanupStack::PopAndDestroy( heading ); } - + CleanupStack::PopAndDestroy( fileName ); } @@ -876,11 +882,11 @@ void CMPXVideoPlaybackMediaDetailsViewer::UpdateTitleL() { MPX_ENTER_EXIT( _L( "CMPXVideoPlaybackMediaDetailsViewer::UpdateTitleL" ) ); - - HBufC* fileTitle = iController->FileDetails()->GenerateFileTitleL(); + + HBufC* fileTitle = iController->FileDetails()->GenerateFileTitleL(); CleanupStack::PushL( fileTitle ); - - if ( fileTitle && fileTitle->Length() ) + + if ( fileTitle && fileTitle->Length() ) { HBufC* heading = iEikonEnv->AllocReadResourceL( R_MPX_TITLE_HEADING ); CleanupStack::PushL( heading ); @@ -898,8 +904,8 @@ CleanupStack::PopAndDestroy( heading ); } - - CleanupStack::PopAndDestroy( fileTitle ); + + CleanupStack::PopAndDestroy( fileTitle ); } // ------------------------------------------------------------------------------------------------- @@ -940,8 +946,8 @@ TBool CMPXVideoPlaybackMediaDetailsViewer::TTextScroller::IsUpdateNeeded() { MPX_ENTER_EXIT( _L( "CMPXVideoPlaybackMediaDetailsViewer::TTextScroller::IsUpdateNeeded" ) ); - - // skip the scrolling operation if the loop for delay is going on + + // skip the scrolling operation if the loop for delay is going on TBool skipForTimerDelay = EFalse; // add a delay after each complete scrolling @@ -977,12 +983,12 @@ TDes& aDesText ) { MPX_ENTER_EXIT( _L( "CMPXVideoPlaybackMediaDetailsViewer::TTextScroller::ScrollText" ) ); - - if ( 0 == iSrcTextLen ) + + if ( 0 == iSrcTextLen ) { iSrcTextLen = aSrcText.Length(); } - + ASSERT( aSrcText.Length() == iSrcTextLen ); if ( aSrcText.Length() >= KMediaDetailsViewerVisibleCharacters ) { @@ -999,7 +1005,7 @@ iTextScrollPos++; } iScroll = ETrue; - + } else { diff -r 2d690156cf8f -r 315810614048 videoplayback/videoplaybackcontrols/src/mpxvideoplaybackprogressbar.cpp --- a/videoplayback/videoplaybackcontrols/src/mpxvideoplaybackprogressbar.cpp Thu Jul 15 18:41:27 2010 +0300 +++ b/videoplayback/videoplaybackcontrols/src/mpxvideoplaybackprogressbar.cpp Thu Aug 19 09:57:17 2010 +0300 @@ -16,7 +16,7 @@ */ -// Version : %version: e003sa33#24 % +// Version : %version: 25 % // INCLUDE FILES @@ -772,7 +772,8 @@ EAspectRatioNotPreserved ); } } - else if ( aDetails->iPlaybackMode == EMPXVideoLiveStreaming ) + else if ( aDetails->iPlaybackMode == EMPXVideoLiveStreaming && + ! iLiveStreamingString ) { iLiveStreamingString = iEikonEnv->AllocReadResourceL( R_MPX_LIVE_STREAMING ); diff -r 2d690156cf8f -r 315810614048 videoplayback/videoplaybackcontrols/src/mpxvideoplaybackvolumebar.cpp --- a/videoplayback/videoplaybackcontrols/src/mpxvideoplaybackvolumebar.cpp Thu Jul 15 18:41:27 2010 +0300 +++ b/videoplayback/videoplaybackcontrols/src/mpxvideoplaybackvolumebar.cpp Thu Aug 19 09:57:17 2010 +0300 @@ -16,7 +16,7 @@ */ -// Version : %version: 24 % +// Version : %version: 27 % // INCLUDE FILES @@ -283,6 +283,8 @@ TFileName iconsPath; iController->LocateBitmapFileL( iconsPath ); + CreateSliderIconsL(); + delete iSpeakerIcon; iSpeakerIcon = NULL; iSpeakerIcon = AknsUtils::CreateGulIconL( @@ -333,38 +335,6 @@ EAspectRatioPreserved ); } - delete iSliderIcon; - iSliderIcon = NULL; - iSliderIcon = AknsUtils::CreateGulIconL( - skin, - KAknsIIDQgnGrafNsliderVerticalMarker, - iconsPath, - EMbmMpxvideoplaybackcontrolsQgn_graf_nslider_vertical_marker, - EMbmMpxvideoplaybackcontrolsQgn_graf_nslider_vertical_marker_mask ); - - if ( iSliderIcon ) - { - AknIconUtils::SetSize( iSliderIcon->Bitmap(), - TSize(KMPXSliderWidth, KMPXSliderHeight), - EAspectRatioNotPreserved ); - } - - delete iSliderSelectedIcon; - iSliderSelectedIcon = NULL; - iSliderSelectedIcon = AknsUtils::CreateGulIconL( - skin, - KAknsIIDQgnGrafNsliderVerticalMarkerSelected, - iconsPath, - EMbmMpxvideoplaybackcontrolsQgn_graf_nslider_vertical_marker_selected, - EMbmMpxvideoplaybackcontrolsQgn_graf_nslider_vertical_marker_selected_mask ); - - if ( iSliderSelectedIcon ) - { - AknIconUtils::SetSize( iSliderSelectedIcon->Bitmap(), - TSize(KMPXSliderWidth, KMPXSliderHeight), - EAspectRatioNotPreserved ); - } - delete iVolumeUpIcon; iVolumeUpIcon = NULL; iVolumeUpIcon = AknsUtils::CreateGulIconL( @@ -487,13 +457,9 @@ case TPointerEvent::EButtonRepeat: { #ifdef RD_TACTILE_FEEDBACK - if ( iFeedback ) + if ( iFeedback && !iController->FileDetails()->iTvOutConnected ) { -#ifdef SYMBIAN_BUILD_GCE iFeedback->InstantFeedback( ETouchFeedbackSlider ); -#else - iFeedback->InstantFeedback( ETouchFeedbackSensitive ); -#endif //SYMBIAN_BUILD_GCE } #endif //RD_TACTILE_FEEDBACK iController->HandleCommandL( EMPXPbvCmdIncreaseVolume ); @@ -516,13 +482,9 @@ case TPointerEvent::EButton1Up: { #ifdef RD_TACTILE_FEEDBACK - if ( iFeedback ) + if ( iFeedback && !iController->FileDetails()->iTvOutConnected ) { -#ifdef SYMBIAN_BUILD_GCE iFeedback->InstantFeedback( ETouchFeedbackSlider ); -#else - iFeedback->InstantFeedback( ETouchFeedbackBasic ); -#endif //SYMBIAN_BUILD_GCE } #endif //RD_TACTILE_FEEDBACK @@ -549,13 +511,9 @@ case TPointerEvent::EButtonRepeat: { #ifdef RD_TACTILE_FEEDBACK - if ( iFeedback ) + if ( iFeedback && !iController->FileDetails()->iTvOutConnected ) { -#ifdef SYMBIAN_BUILD_GCE iFeedback->InstantFeedback( ETouchFeedbackSlider ); -#else - iFeedback->InstantFeedback( ETouchFeedbackSensitive ); -#endif //SYMBIAN_BUILD_GCE } #endif //RD_TACTILE_FEEDBACK iController->HandleCommandL( EMPXPbvCmdDecreaseVolume ); @@ -578,13 +536,9 @@ case TPointerEvent::EButton1Up: { #ifdef RD_TACTILE_FEEDBACK - if ( iFeedback ) + if ( iFeedback && !iController->FileDetails()->iTvOutConnected ) { -#ifdef SYMBIAN_BUILD_GCE iFeedback->InstantFeedback( ETouchFeedbackSlider ); -#else - iFeedback->InstantFeedback( ETouchFeedbackBasic ); -#endif //SYMBIAN_BUILD_GCE } #endif //RD_TACTILE_FEEDBACK @@ -613,11 +567,7 @@ #ifdef RD_TACTILE_FEEDBACK if ( iFeedback ) { -#ifdef SYMBIAN_BUILD_GCE iFeedback->InstantFeedback( ETouchFeedbackBasicButton ); -#else - iFeedback->InstantFeedback( ETouchFeedbackBasic ); -#endif //SYMBIAN_BUILD_GCE } #endif //RD_TACTILE_FEEDBACK @@ -686,7 +636,7 @@ case TPointerEvent::EButton1Down: { #ifdef RD_TACTILE_FEEDBACK - if ( iFeedback ) + if ( iFeedback && !iController->FileDetails()->iTvOutConnected ) { iFeedback->InstantFeedback( ETouchFeedbackSlider ); } @@ -707,7 +657,8 @@ case TPointerEvent::EDrag: { #ifdef RD_TACTILE_FEEDBACK - if ( iFeedback && giveDynamicSliderFeedback ) + if ( iFeedback && giveDynamicSliderFeedback && + !iController->FileDetails()->iTvOutConnected ) { iFeedback->StartFeedback( this, ETouchDynamicSlider, @@ -932,6 +883,7 @@ if ( iController->FileDetails() && iController->FileDetails()->iAudioEnabled && + !iController->FileDetails()->iTvOutConnected && iSliderIcon && iSliderSelectedIcon ) { @@ -1015,4 +967,80 @@ iController->HandleCommandL( EMPXPbvCmdSetVolume, aVolume ); } +// ------------------------------------------------------------------------------------------------- +// CMPXVideoPlaybackVolumeBar::UpdateTVOutStatus() +// ------------------------------------------------------------------------------------------------- +// +void CMPXVideoPlaybackVolumeBar::UpdateTVOutStatusL( TBool aConnected ) +{ + MPX_ENTER_EXIT(_L("CMPXVideoPlaybackVolumeBar::UpdateTVOutStatus()")); + + if ( aConnected ) + { + if ( iSliderIcon ) + { + delete iSliderIcon; + iSliderIcon = NULL; + } + + if ( iSliderSelectedIcon ) + { + delete iSliderSelectedIcon; + iSliderSelectedIcon = NULL; + } + } + else + { + CreateSliderIconsL(); + } +} + +// ------------------------------------------------------------------------------------------------- +// CMPXVideoPlaybackVolumeBar::CreateSliderIconsL() +// ------------------------------------------------------------------------------------------------- +// +void CMPXVideoPlaybackVolumeBar::CreateSliderIconsL() +{ + MPX_ENTER_EXIT(_L("CMPXVideoPlaybackVolumeBar::CreateSliderIconsL()")); + + // + // Create icons + // + MAknsSkinInstance* skin = AknsUtils::SkinInstance(); + + TFileName iconsPath; + iController->LocateBitmapFileL( iconsPath ); + + delete iSliderIcon; + iSliderIcon = NULL; + iSliderIcon = AknsUtils::CreateGulIconL( + skin, + KAknsIIDQgnGrafNsliderVerticalMarker, + iconsPath, + EMbmMpxvideoplaybackcontrolsQgn_graf_nslider_vertical_marker, + EMbmMpxvideoplaybackcontrolsQgn_graf_nslider_vertical_marker_mask ); + + if ( iSliderIcon ) + { + AknIconUtils::SetSize( iSliderIcon->Bitmap(), + TSize(KMPXSliderWidth, KMPXSliderHeight), + EAspectRatioNotPreserved ); + } + + delete iSliderSelectedIcon; + iSliderSelectedIcon = NULL; + iSliderSelectedIcon = AknsUtils::CreateGulIconL( + skin, + KAknsIIDQgnGrafNsliderVerticalMarkerSelected, + iconsPath, + EMbmMpxvideoplaybackcontrolsQgn_graf_nslider_vertical_marker_selected, + EMbmMpxvideoplaybackcontrolsQgn_graf_nslider_vertical_marker_selected_mask ); + + if ( iSliderSelectedIcon ) + { + AknIconUtils::SetSize( iSliderSelectedIcon->Bitmap(), + TSize(KMPXSliderWidth, KMPXSliderHeight), + EAspectRatioNotPreserved ); + } +} // End of File diff -r 2d690156cf8f -r 315810614048 videoplayback/videoplaybackcontrols/tsrc/videoplaybackcontrols_test/conf/ui_videoplaybackcontrolstest.cfg --- a/videoplayback/videoplaybackcontrols/tsrc/videoplaybackcontrols_test/conf/ui_videoplaybackcontrolstest.cfg Thu Jul 15 18:41:27 2010 +0300 +++ b/videoplayback/videoplaybackcontrols/tsrc/videoplaybackcontrols_test/conf/ui_videoplaybackcontrolstest.cfg Thu Aug 19 09:57:17 2010 +0300 @@ -26,7 +26,7 @@ EPbStatePaused 3 EPbStateBuffering 8 EPbStateInitialised 10 - + EMMFNatural 2 EMPXVideoLocal 0 @@ -52,9 +52,9 @@ pause 100 ControlsTest ShowControls pause 1000 -ControlsTest PointerEvent eventtype=EButton1Down x=630 y=350 +ControlsTest PointerEvent eventtype=EButton1Down x=600 y=325 pause 100 -ControlsTest PointerEvent eventtype=EButton1Up x=630 y=350 +ControlsTest PointerEvent eventtype=EButton1Up x=600 y=325 pause 100 ControlsTest ExpectedResult EAknSoftkeyBack 0 pause 100 @@ -76,9 +76,9 @@ pause 100 ControlsTest ToggleVisibility pause 1000 -ControlsTest PointerEvent eventtype=EButton1Down x=40 y=350 +ControlsTest PointerEvent eventtype=EButton1Down x=60 y=325 pause 100 -ControlsTest PointerEvent eventtype=EButton1Up x=40 y=350 +ControlsTest PointerEvent eventtype=EButton1Up x=60 y=325 pause 100 ControlsTest ExpectedResult EMPXPbvCmdShowFileDetails 0 pause 100 @@ -101,9 +101,9 @@ pause 100 ControlsTest ShowControls pause 1000 -ControlsTest PointerEvent eventtype=EButton1Down x=70 y=50 +ControlsTest PointerEvent eventtype=EButton1Down x=70 y=30 pause 100 -ControlsTest PointerEvent eventtype=EButton1Up x=70 y=10 +ControlsTest PointerEvent eventtype=EButton1Up x=70 y=30 pause 100 ControlsTest ExpectedResult EMPXPbvCmdStretchAspectRatio 0 pause 100 @@ -131,7 +131,7 @@ ControlsTest PointerEvent eventtype=EButton1Up x=20 y=90 pause 100 ControlsTest ExpectedResult EMPXPbvCmdIncreaseVolume 0 -pause 100 +pause 100 ControlsTest DeleteControls delete ControlsTest sendtobackground @@ -156,7 +156,7 @@ ControlsTest PointerEvent eventtype=EButton1Up x=20 y=230 pause 100 ControlsTest ExpectedResult EMPXPbvCmdDecreaseVolume 0 -pause 100 +pause 100 ControlsTest DeleteControls delete ControlsTest sendtobackground @@ -164,34 +164,7 @@ [Endtest] [Test] -title [6]Set volume to 25 -bringtoforeground -create ui_videoplaybackcontrolstest ControlsTest -ControlsTest CreateControls test.3gp EMPXVideoLocal -pause 100 -ControlsTest AddDefaultFileDetails -pause 100 -ControlsTest SetState EPbStatePlaying -ControlsTest SetVolume 50 -pause 100 -ControlsTest ShowControls -pause 1000 -ControlsTest PointerEvent eventtype=EButton1Down x=75 y=198 -pause 200 -ControlsTest PointerEvent eventtype=EDrag x=75 y=198 -pause 100 -ControlsTest PointerEvent eventtype=EButton1Up x=75 y=198 -pause 100 -ControlsTest ExpectedResult EMPXPbvCmdSetVolume 25 -pause 100 -ControlsTest DeleteControls -delete ControlsTest -sendtobackground -pause 2000 -[Endtest] - -[Test] -title [7]Mute / Unmute +title [6]Mute / Unmute bringtoforeground create ui_videoplaybackcontrolstest ControlsTest ControlsTest CreateControls test.3gp EMPXVideoLocal @@ -208,7 +181,7 @@ ControlsTest PointerEvent eventtype=EButton1Up x=75 y=260 pause 100 ControlsTest ExpectedResult EMPXPbvCmdMute 0 -pause 100 +pause 100 ControlsTest SetVolume 0 pause 100 ControlsTest PointerEvent eventtype=EButton1Down x=75 y=260 @@ -224,7 +197,7 @@ [Endtest] [Test] -title [8]SetPosition +title [7]SetPosition bringtoforeground create ui_videoplaybackcontrolstest ControlsTest ControlsTest CreateControls test.3gp EMPXVideoLocal @@ -234,7 +207,7 @@ ControlsTest SetState EPbStatePaused pause 100 ControlsTest SetDuration 100000 -pause 100 +pause 100 ControlsTest PointerEvent eventtype=EButton1Down x=310 y=350 pause 100 ControlsTest PointerEvent eventtype=EDrag x=310 y=350 @@ -250,7 +223,7 @@ [Endtest] [Test] -title [9]Audio only clip +title [8]Audio only clip bringtoforeground create ui_videoplaybackcontrolstest ControlsTest ControlsTest CreateControls test.3gp EMPXVideoLocal @@ -259,9 +232,9 @@ pause 100 ControlsTest SetState EPbStatePlaying pause 100 -ControlsTest PointerEvent eventtype=EButton1Down x=630 y=350 +ControlsTest PointerEvent eventtype=EButton1Down x=600 y=325 pause 100 -ControlsTest PointerEvent eventtype=EButton1Up x=630 y=350 +ControlsTest PointerEvent eventtype=EButton1Up x=600 y=325 pause 100 ControlsTest ExpectedResult EAknSoftkeyBack 0 pause 100 @@ -272,7 +245,7 @@ [Endtest] [Test] -title [10]Play using Button bar +title [9]Play using Button bar bringtoforeground create ui_videoplaybackcontrolstest ControlsTest ControlsTest CreateControls test.3gp EMPXVideoLocal @@ -294,7 +267,7 @@ [Endtest] [Test] -title [11]Pause using Button bar +title [10]Pause using Button bar bringtoforeground create ui_videoplaybackcontrolstest ControlsTest ControlsTest CreateControls test.3gp EMPXVideoLocal @@ -318,7 +291,7 @@ [Endtest] [Test] -title [12]FF using Button bar +title [11]FF using Button bar bringtoforeground create ui_videoplaybackcontrolstest ControlsTest ControlsTest CreateControls test.3gp EMPXVideoLocal @@ -343,7 +316,7 @@ [Endtest] [Test] -title [13]RW using Button bar +title [12]RW using Button bar bringtoforeground create ui_videoplaybackcontrolstest ControlsTest ControlsTest CreateControls test.3gp EMPXVideoLocal @@ -368,7 +341,7 @@ [Endtest] [Test] -title [14]PDL SetDownLoadPostion +title [13]PDL SetDownLoadPostion bringtoforeground create ui_videoplaybackcontrolstest ControlsTest ControlsTest CreateControls test.3gp EMPXVideoProgressiveDownload @@ -391,7 +364,7 @@ [Endtest] [Test] -title [15]PDL SetDownLoadPaused +title [14]PDL SetDownLoadPaused bringtoforeground create ui_videoplaybackcontrolstest ControlsTest ControlsTest CreateControls test.3gp EMPXVideoProgressiveDownload @@ -409,7 +382,7 @@ [Endtest] [Test] -title [16]PDL ClearDownLoadPaused +title [15]PDL ClearDownLoadPaused bringtoforeground create ui_videoplaybackcontrolstest ControlsTest ControlsTest CreateControls test.3gp EMPXVideoProgressiveDownload @@ -432,7 +405,7 @@ [Endtest] [Test] -title [17]TV-Out +title [16]TV-Out bringtoforeground create ui_videoplaybackcontrolstest ControlsTest ControlsTest CreateControls test.3gp EMPXVideoLocal @@ -452,7 +425,7 @@ [Endtest] [Test] -title [18] RealMedia Streaming +title [17] RealMedia Streaming bringtoforeground create ui_videoplaybackcontrolstest ControlsTest ControlsTest CreateControls rtsp:\/\/1.1.1.1/1.rm EMPXVideoStreaming @@ -468,7 +441,7 @@ [Endtest] [Test] -title [19] 3GPP Streaming +title [18] 3GPP Streaming bringtoforeground create ui_videoplaybackcontrolstest ControlsTest ControlsTest CreateControls rtsp:\/\/1.1.1.1/1.3gp EMPXVideoStreaming @@ -484,7 +457,7 @@ [Endtest] [Test] -title [20] Error during Connecting +title [19] Error during Connecting bringtoforeground create ui_videoplaybackcontrolstest ControlsTest ControlsTest CreateControls test.rm EMPXVideoStreaming @@ -500,7 +473,7 @@ [Endtest] [Test] -title [21]Play/pause using enter key +title [20]Play/pause using enter key bringtoforeground create ui_videoplaybackcontrolstest ControlsTest ControlsTest CreateControls test.3gp EMPXVideoLocal @@ -524,7 +497,7 @@ [Endtest] [Test] -title [22] Key input while FF via pointer event in progress +title [21] Key input while FF via pointer event in progress bringtoforeground create ui_videoplaybackcontrolstest ControlsTest ControlsTest CreateControls test.3gp EMPXVideoLocal @@ -551,7 +524,7 @@ [Endtest] [Test] -title [23] Ptr input while key input being processed +title [22] Ptr input while key input being processed bringtoforeground create ui_videoplaybackcontrolstest ControlsTest ControlsTest CreateControls test.3gp EMPXVideoLocal @@ -579,7 +552,7 @@ [Endtest] [Test] -title [24] Press back key through offerkeyevent +title [23] Press back key through offerkeyevent bringtoforeground create ui_videoplaybackcontrolstest ControlsTest ControlsTest CreateControls test.3gp EMPXVideoLocal @@ -603,7 +576,7 @@ [Endtest] [Test] -title [25]Press details key through offerkeyevent +title [24]Press details key through offerkeyevent bringtoforeground create ui_videoplaybackcontrolstest ControlsTest ControlsTest CreateControls test.3gp EMPXVideoLocal @@ -625,7 +598,7 @@ [Endtest] [Test] -title [26]Send the view to background while FF using Button bar +title [25]Send the view to background while FF using Button bar bringtoforeground create ui_videoplaybackcontrolstest ControlsTest ControlsTest CreateControls test.3gp EMPXVideoLocal @@ -650,7 +623,7 @@ [Endtest] [Test] -title [27]Tap on back softkey while buffering in live streaming mode +title [26]Tap on back softkey while buffering in live streaming mode bringtoforeground create ui_videoplaybackcontrolstest ControlsTest ControlsTest CreateControls rtsp:\/\/1.1.1.1/1.3gp EMPXVideoLiveStreaming @@ -659,9 +632,9 @@ pause 100 ControlsTest SetState EPbStateBuffering pause 100 -ControlsTest PointerEvent eventtype=EButton1Down x=630 y=350 +ControlsTest PointerEvent eventtype=EButton1Down x=600 y=325 pause 100 -ControlsTest PointerEvent eventtype=EButton1Up x=630 y=350 +ControlsTest PointerEvent eventtype=EButton1Up x=600 y=325 pause 100 ControlsTest ExpectedResult EAknSoftkeyBack 0 pause 100 @@ -672,7 +645,7 @@ [Endtest] [Test] -title [28]Timout for toggling control's visibility in playing state +title [27]Timout for toggling control's visibility in playing state bringtoforeground create ui_videoplaybackcontrolstest ControlsTest ControlsTest CreateControls test.3gp EMPXVideoLocal @@ -690,7 +663,7 @@ [Endtest] [Test] -title [29]SetPosition when playing +title [28]SetPosition when playing bringtoforeground create ui_videoplaybackcontrolstest ControlsTest ControlsTest CreateControls test.3gp EMPXVideoLocal @@ -704,7 +677,7 @@ ControlsTest ShowControls pause 1000 ControlsTest SetDuration 100000 -pause 100 +pause 100 ControlsTest PointerEvent eventtype=EButton1Down x=251 y=350 pause 100 ControlsTest ExpectedResult EMPXPbvCmdCustomPause 0 @@ -723,7 +696,7 @@ [Test] -title [30] Open Close Media Details Viewer (no scrolling) +title [29] Open Close Media Details Viewer (no scrolling) bringtoforeground create ui_videoplaybackcontrolstest ControlsTest ControlsTest CreateControls test.3gp EMPXVideoLocal @@ -746,7 +719,7 @@ [Test] -title [31] Open Close Media Details Viewer w/Scrolling +title [30] Open Close Media Details Viewer w/Scrolling bringtoforeground create ui_videoplaybackcontrolstest ControlsTest ControlsTest CreateControls TestClipWithLongNameToTestScrollingInMediaDetailsViewer.3gp EMPXVideoLocal @@ -769,7 +742,7 @@ [Test] -title [32] Media Details Viewer (audio only) +title [31] Media Details Viewer (audio only) bringtoforeground create ui_videoplaybackcontrolstest ControlsTest ControlsTest CreateControls TestClipWithLongNameToTestScrollingInMediaDetailsViewer.3gp EMPXVideoLocal @@ -792,7 +765,7 @@ [Test] -title [33] Media Details Viewer Streaming Link +title [32] Media Details Viewer Streaming Link bringtoforeground create ui_videoplaybackcontrolstest ControlsTest ControlsTest CreateControls rtsp:\/\/1.1.1.1/1.3gp EMPXVideoStreaming @@ -814,7 +787,7 @@ [Endtest] [Test] -title [34] Open Close Media Details Viewer (with long details) +title [33] Open Close Media Details Viewer (with long details) bringtoforeground create ui_videoplaybackcontrolstest ControlsTest ControlsTest CreateControls test.3gp EMPXVideoLocal @@ -836,7 +809,7 @@ [Endtest] [Test] -title [35] Hide aspect ratio +title [34] Hide aspect ratio bringtoforeground create ui_videoplaybackcontrolstest ControlsTest ControlsTest CreateControls test.3gp EMPXVideoLocal @@ -858,7 +831,7 @@ [Endtest] [Test] -title [36] Open Close Media Details Viewer (with empty title) +title [35] Open Close Media Details Viewer (with empty title) bringtoforeground create ui_videoplaybackcontrolstest ControlsTest ControlsTest CreateControls rtsp:\/\/10.41.2.3/h264/Video%20BitRate%2008%20-%2064/Meat%20Loaf%20-%20I%20would%20do%20anything%20for%20love.3gp EMPXVideoStreaming diff -r 2d690156cf8f -r 315810614048 videoplayback/videoplaybackcontrols/tsrc/videoplaybackcontrols_test/inc/mpxvpbuih_stub.h --- a/videoplayback/videoplaybackcontrols/tsrc/videoplaybackcontrols_test/inc/mpxvpbuih_stub.h Thu Jul 15 18:41:27 2010 +0300 +++ b/videoplayback/videoplaybackcontrols/tsrc/videoplaybackcontrols_test/inc/mpxvpbuih_stub.h Thu Aug 19 09:57:17 2010 +0300 @@ -15,7 +15,7 @@ * */ -// Version : %version: ou1cpsw#4 % +// Version : %version: 5 % #ifndef MPXVIDEOPLAYBACKUSERINPUTHANDLER_H_ @@ -78,11 +78,10 @@ private: - TMPXVideoUserInputType iProcessingInputType; // the type of input being processed - TUint iLastPressedKeyCode; // keycode of last key that sent EEventKeyDown + TMPXVideoUserInputType iProcessingInputType; // the type of input being processed TInt iLastPressedKeyScanCode; // scancode of last key that sent EEventKeyDown - CMPXVideoPlaybackContainer* iContainer; // not owned + CMPXVideoPlaybackContainer* iContainer; // not owned }; diff -r 2d690156cf8f -r 315810614048 videoplayback/videoplaybackcontrols/tsrc/videoplaybackcontrols_test/src/mpxvpbc_stub.cpp --- a/videoplayback/videoplaybackcontrols/tsrc/videoplaybackcontrols_test/src/mpxvpbc_stub.cpp Thu Jul 15 18:41:27 2010 +0300 +++ b/videoplayback/videoplaybackcontrols/tsrc/videoplaybackcontrols_test/src/mpxvpbc_stub.cpp Thu Aug 19 09:57:17 2010 +0300 @@ -1,5 +1,5 @@ /* -* Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). +* Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). * All rights reserved. * This component and the accompanying materials are made available * under the terms of "Eclipse Public License v1.0" @@ -15,13 +15,13 @@ * */ -// Version : %version: e003sa33#15 % +// Version : %version: 16 % // INCLUDES #include #include -#include +#include #include #include #include @@ -64,16 +64,16 @@ { MPX_DEBUG(_L("CMPXVideoPlaybackContainer::ConstructL()")); - iFileDetails = CMPXVideoPlaybackViewFileDetails::NewL(); + iFileDetails = CMPXVideoPlaybackViewFileDetails::NewL(); iFileDetails->iClipName = HBufC::NewL( aFileName.Length() ); iFileDetails->iClipName->Des().Copy( aFileName ); - CreateWindowL(); + CreateWindowL(); iUserInputHandler = CMPXVideoPlaybackUserInputHandler::NewL( this ); - + SetFocus( ETrue ); - + MakeVisible( ETrue ); ActivateL(); @@ -98,7 +98,7 @@ return self; } -// +// // ------------------------------------------------------------------------------------------------- // CMPXVideoPlaybackContainer::~CMPXVideoPlaybackContainer() // Destructor. @@ -112,13 +112,13 @@ { delete iFileDetails; iFileDetails = NULL; - } - + } + if ( iUserInputHandler ) { delete iUserInputHandler; iUserInputHandler = NULL; - } + } CloseWindow(); } @@ -146,7 +146,7 @@ gc.DrawRect( aRect ); } -// +// // ------------------------------------------------------------------------------------------------- // CMPXVideoPlaybackContainer::HandleCommandL() // ------------------------------------------------------------------------------------------------- @@ -159,7 +159,7 @@ iValue = aValue; } -// +// // ------------------------------------------------------------------------------------------------- // CMPXVideoPlaybackContainer::ExpectedResultL() // ------------------------------------------------------------------------------------------------- @@ -168,8 +168,26 @@ { MPX_DEBUG(_L("CMPXVideoPlaybackContainer::ExpectedResultL(aCommand=%d,aValue=%d)"),aCommand,aValue); - if ( iCommand != aCommand || iValue != aValue ) + if ( aCommand == iCommand ) { + if ( iValue != aValue ) + { + if ( aCommand == EMPXPbvCmdSetVolume ) + { + if ( Abs( iValue - aValue ) > 6 ) + { + User::Leave( KErrGeneral ); + } + } + else + { + User::Leave( KErrGeneral ); + } + } + } + else + { + User::Leave( KErrGeneral ); } } @@ -199,16 +217,16 @@ iFileDetails->iAudioEnabled = ETrue; iFileDetails->iVideoEnabled = aHasVideoTrack; iFileDetails->iSeekable = ETrue; - + iFileDetails->iTitle = _L("Test Title").Alloc(); if ( iFileDetails->iVideoEnabled ) - { + { iFileDetails->iVideoHeight = 176; iFileDetails->iVideoWidth = 144; - + iFileDetails->iBitRate = 8000; - iFileDetails->iMimeType = _L("video/3gp").Alloc(); + iFileDetails->iMimeType = _L("video/3gp").Alloc(); } if ( iFileDetails->iPlaybackMode == EMPXVideoLiveStreaming ) @@ -243,9 +261,9 @@ TEventCode aType ) { iKeyResponse = EKeyWasNotConsumed; - + iUserInputHandler->ProcessKeyEventL( aKeyEvent, aType ); - + return iKeyResponse; } @@ -256,7 +274,7 @@ void CMPXVideoPlaybackContainer::DoHandleKeyEventL( const TKeyEvent& aKeyEvent, TEventCode aType ) { MPX_DEBUG(_L("CMPXVideoPlaybackContainer::DoHandleKeyEventL()")); - + switch ( aKeyEvent.iScanCode ) { case EStdKeyDevice3: // rocker middle key @@ -288,7 +306,7 @@ { HandleCommandL(EMPXPbvCmdEndSeek); } - + iKeyResponse = EKeyWasConsumed; break; } @@ -302,7 +320,7 @@ { HandleCommandL(EMPXPbvCmdEndSeek); } - + iKeyResponse = EKeyWasConsumed; break; } @@ -317,7 +335,7 @@ { break; } - } + } } // ------------------------------------------------------------------------------------------------- @@ -375,7 +393,7 @@ { MPX_ENTER_EXIT(_L("CMPXVideoPlaybackContainer::HandlePointerEventL()")); - MPX_DEBUG(_L(" iType = %d, iPosition = (%d,%d)"), + MPX_DEBUG(_L(" iType = %d, iPosition = (%d,%d)"), aPointerEvent.iType, aPointerEvent.iPosition.iX, aPointerEvent.iPosition.iY ); } @@ -385,19 +403,19 @@ // void CMPXVideoPlaybackContainer::AddSameARFileDetailsL( TBool aHasVideoTrack ) { - MPX_ENTER_EXIT( _L( "CMPXVideoPlaybackContainer::AddSameARFileDetailsL() ") ); + MPX_ENTER_EXIT( _L( "CMPXVideoPlaybackContainer::AddSameARFileDetailsL() ") ); iFileDetails->iAudioEnabled = ETrue; iFileDetails->iVideoEnabled = aHasVideoTrack; iFileDetails->iSeekable = ETrue; if ( iFileDetails->iVideoEnabled ) - { + { iFileDetails->iVideoHeight = this->Rect().Height(); iFileDetails->iVideoWidth = this->Rect().Width(); - + iFileDetails->iBitRate = 8000; - iFileDetails->iMimeType = _L("video/3gp").Alloc(); + iFileDetails->iMimeType = _L("video/3gp").Alloc(); } if ( iFileDetails->iPlaybackMode == EMPXVideoLiveStreaming ) @@ -420,14 +438,14 @@ iFileDetails->iAudioEnabled = ETrue; iFileDetails->iVideoEnabled = aHasVideoTrack; iFileDetails->iSeekable = ETrue; - + if ( iFileDetails->iVideoEnabled ) - { + { iFileDetails->iVideoHeight = 176; iFileDetails->iVideoWidth = 144; - + iFileDetails->iBitRate = 8000; - iFileDetails->iMimeType = _L("video/3gp").Alloc(); + iFileDetails->iMimeType = _L("video/3gp").Alloc(); } if ( iFileDetails->iPlaybackMode == EMPXVideoLiveStreaming ) diff -r 2d690156cf8f -r 315810614048 videoplayback/videoplaybackcontrols/tsrc/videoplaybackcontrols_test/src/mpxvpbuih_stub.cpp --- a/videoplayback/videoplaybackcontrols/tsrc/videoplaybackcontrols_test/src/mpxvpbuih_stub.cpp Thu Jul 15 18:41:27 2010 +0300 +++ b/videoplayback/videoplaybackcontrols/tsrc/videoplaybackcontrols_test/src/mpxvpbuih_stub.cpp Thu Aug 19 09:57:17 2010 +0300 @@ -15,7 +15,7 @@ * */ -// Version : %version: 7 % +// Version : %version: 8 % @@ -101,7 +101,7 @@ { MPX_DEBUG(_L("CMPXVideoPlaybackUserInputHandler::ProcessPointerEvent")); - MPX_DEBUG(_L(" iType = %d, iPosition = (%d,%d)"), + MPX_DEBUG(_L(" iType = %d, iPosition = (%d,%d)"), aPointerEvent.iType, aPointerEvent.iPosition.iX, aPointerEvent.iPosition.iY ); switch (iProcessingInputType) @@ -154,7 +154,6 @@ if (aType == EEventKeyDown) { iProcessingInputType = EMpxVideoKeyboard; - iLastPressedKeyCode = aKeyEvent.iCode; iLastPressedKeyScanCode = aKeyEvent.iScanCode; iContainer->DoHandleKeyEventL(aKeyEvent, aType); } @@ -162,19 +161,16 @@ } case EMpxVideoKeyboard: { - if (aType == EEventKeyUp) + if ( aKeyEvent.iScanCode == iLastPressedKeyScanCode ) { - // only handle up event for the key being handled - // ignore spurious key presses - if (aKeyEvent.iCode == iLastPressedKeyCode && - aKeyEvent.iScanCode == iLastPressedKeyScanCode) + iContainer->DoHandleKeyEventL( aKeyEvent, aType ); + + if ( aType == EEventKeyUp ) { - iContainer->DoHandleKeyEventL(aKeyEvent, aType); - - // reset the value only on key up event iProcessingInputType = EMpxVideoNone; } } + break; } default: diff -r 2d690156cf8f -r 315810614048 videoplayback/videoplaybackcontrols/tsrc/videoplaybackcontrols_test/src/videoplaybackcontrolstestblocks.cpp --- a/videoplayback/videoplaybackcontrols/tsrc/videoplaybackcontrols_test/src/videoplaybackcontrolstestblocks.cpp Thu Jul 15 18:41:27 2010 +0300 +++ b/videoplayback/videoplaybackcontrols/tsrc/videoplaybackcontrols_test/src/videoplaybackcontrolstestblocks.cpp Thu Aug 19 09:57:17 2010 +0300 @@ -15,7 +15,7 @@ * */ -// Version : %version: e003sa33#12 % +// Version : %version: 13 % // [INCLUDE FILES] - do not remove @@ -92,11 +92,11 @@ ENTRY( "TvOutDisconnected", CVideoPlaybackControlsTest::TvOutDisconnected ), ENTRY( "HandleErrors", CVideoPlaybackControlsTest::HandleErrors ), - + // Media Details Viewer ENTRY( "ShowMediaDetailsViewer", CVideoPlaybackControlsTest::ShowMediaDetailsViewer ), ENTRY( "CloseMediaDetailsViewer", CVideoPlaybackControlsTest::CloseMediaDetailsViewer ) - + //ADD NEW ENTRY HERE // [test cases entries] - Do not remove }; @@ -118,13 +118,13 @@ if ( iAvkonViewAppUi->OrientationCanBeChanged() ) { - TRAPD( err, iAvkonViewAppUi->SetOrientationL( CAknAppUiBase::EAppUiOrientationLandscape ) ); + MPX_TRAPD( err, iAvkonViewAppUi->SetOrientationL( CAknAppUiBase::EAppUiOrientationLandscape ) ); MPX_DEBUG(_L("CVideoPlaybackControlsTest::CreateController() err = [%d]"), err); } TRect rect = iAvkonViewAppUi->ApplicationRect(); - TRAP + MPX_TRAP ( result, { @@ -156,7 +156,7 @@ TInt err = KErrNone; - TRAP( err, iAvkonViewAppUi->SetOrientationL( CAknAppUiBase::EAppUiOrientationAutomatic ) ); + MPX_TRAP( err, iAvkonViewAppUi->SetOrientationL( CAknAppUiBase::EAppUiOrientationAutomatic ) ); if ( iController ) { @@ -228,7 +228,12 @@ { MPX_DEBUG(_L("CVideoPlaybackControlsTest::SetAspectRatio() [%d]"), aspectRatio); - TRAP( result, iController->HandleEventL( EMPXControlCmdSetAspectRatio, aspectRatio ) ); + MPX_TRAP( + result, + { + iController->HandleEventL( EMPXControlCmdSetAspectRatio, aspectRatio ); + iController->HandleEventL( EMPXControlCmdCreateAspectRatioIcon ); + } ); } return result; @@ -250,7 +255,7 @@ { MPX_DEBUG(_L("CVideoPlaybackControlsTest::SetVolume() [%d]"), volume); - TRAP( result, iController->HandleEventL( EMPXControlCmdSetVolume, + MPX_TRAP( result, iController->HandleEventL( EMPXControlCmdSetVolume, (TInt64)volume ) ); } @@ -271,7 +276,7 @@ if ( result == KErrNone ) { - TRAP( result, iController->HandleEventL( EMPXControlCmdSetDuration, + MPX_TRAP( result, iController->HandleEventL( EMPXControlCmdSetDuration, (TInt64)duration ) ); } @@ -434,7 +439,7 @@ if ( result == KErrNone ) { - TRAP( result, iContainer->ExpectedResultL( command, value ) ); + MPX_TRAP( result, iContainer->ExpectedResultL( command, value ) ); } } @@ -454,7 +459,7 @@ if ( result == KErrNone ) { - TRAP( result, iController->HandleEventL( EMPXControlCmdStateChanged, state ) ); + MPX_TRAP( result, iController->HandleEventL( EMPXControlCmdStateChanged, state ) ); } return result; @@ -468,7 +473,7 @@ { MPX_DEBUG(_L("CVideoPlaybackControlsTest::AddDefaultFileDetails()")); - TRAPD( result, iContainer->AddFileDetailsL() ); + MPX_TRAPD( result, iContainer->AddFileDetailsL() ); return result; } @@ -481,7 +486,7 @@ { MPX_DEBUG(_L("CVideoPlaybackControlsTest::AddAudioOnlyFileDetails()")); - TRAPD( result, iContainer->AddFileDetailsL( EFalse ) ); + MPX_TRAPD( result, iContainer->AddFileDetailsL( EFalse ) ); return result; } @@ -494,7 +499,7 @@ { MPX_DEBUG(_L("CVideoPlaybackControlsTest::AddLongFileDetails()")); - TRAPD( result, iContainer->AddLongFileDetailsL() ); + MPX_TRAPD( result, iContainer->AddLongFileDetailsL() ); return result; } @@ -505,7 +510,7 @@ // TInt CVideoPlaybackControlsTest::AddSameARFileDetails() { - MPX_ENTER_EXIT( _L( "CVideoPlaybackControlsTest::AddSameARFileDetails()" ) ); + MPX_ENTER_EXIT( _L( "CVideoPlaybackControlsTest::AddSameARFileDetails()" ) ); MPX_TRAPD( result, iContainer->AddSameARFileDetailsL() ); @@ -518,7 +523,7 @@ // TInt CVideoPlaybackControlsTest::AddEmptyTitleFileDetailsL() { - MPX_ENTER_EXIT( _L( "CVideoPlaybackControlsTest::AddEmptyTitleFileDetailsL()" ) ); + MPX_ENTER_EXIT( _L( "CVideoPlaybackControlsTest::AddEmptyTitleFileDetailsL()" ) ); MPX_TRAPD( result, iContainer->AddEmptyTitleFileDetailsL() ); @@ -585,12 +590,12 @@ // The YOffset can be read from the wsini.ini file // // iy = oldPosition.iX - // + // tapPoint.iX = ( 360 - 1 ) - aPosition.iY - 12; tapPoint.iY = aPosition.iX; #endif - + MPX_DEBUG(_L(" tapPosition = (%d,%d)"), tapPoint.iX, tapPoint.iY); TRawEvent pointer; @@ -617,14 +622,14 @@ // TInt CVideoPlaybackControlsTest::SetDownLoadSize( CStifItemParser& aItem ) { - MPX_DEBUG(_L("CVideoPlaybackControlsTest::SetExpectedResult()")); + MPX_DEBUG(_L("CVideoPlaybackControlsTest::SetExpectedResult()")); TInt size = 0; TInt result = aItem.GetNextInt( size ); if ( result == KErrNone ) { - TRAP( result, iController->HandleEventL( EMPXControlCmdSetDownloadSize, size ) ); + MPX_TRAP( result, iController->HandleEventL( EMPXControlCmdSetDownloadSize, size ) ); } return result; @@ -636,14 +641,14 @@ // TInt CVideoPlaybackControlsTest::SetDownLoadPostion( CStifItemParser& aItem ) { - MPX_DEBUG(_L("CVideoPlaybackControlsTest::SetExpectedResult()")); + MPX_DEBUG(_L("CVideoPlaybackControlsTest::SetExpectedResult()")); TInt position = 0; TInt result = aItem.GetNextInt( position ); if ( result == KErrNone ) { - TRAP( result, iController->HandleEventL( EMPXControlCmdSetPosition, position ) ); + MPX_TRAP( result, iController->HandleEventL( EMPXControlCmdSetPosition, position ) ); } return result; @@ -662,7 +667,7 @@ if ( result == KErrNone ) { - TRAP( result, iController->HandleEventL( EMPXControlCmdDownloadUpdated, position ) ); + MPX_TRAP( result, iController->HandleEventL( EMPXControlCmdDownloadUpdated, position ) ); } return result; @@ -674,9 +679,9 @@ // TInt CVideoPlaybackControlsTest::SetDownLoadPaused() { - MPX_DEBUG(_L("CVideoPlaybackControlsTest::SetDownLoadPaused()")); + MPX_DEBUG(_L("CVideoPlaybackControlsTest::SetDownLoadPaused()")); - TRAPD( result, iController->HandleEventL( EMPXControlCmdSetDownloadPaused) ); + MPX_TRAPD( result, iController->HandleEventL( EMPXControlCmdSetDownloadPaused) ); return result; } @@ -687,9 +692,9 @@ // TInt CVideoPlaybackControlsTest::ClearDownLoadPaused() { - MPX_DEBUG(_L("CVideoPlaybackControlsTest::ClearDownLoadPaused()")); + MPX_DEBUG(_L("CVideoPlaybackControlsTest::ClearDownLoadPaused()")); - TRAPD( result, iController->HandleEventL( EMPXControlCmdClearDownloadPaused) ); + MPX_TRAPD( result, iController->HandleEventL( EMPXControlCmdClearDownloadPaused) ); return result; } @@ -700,9 +705,9 @@ // TInt CVideoPlaybackControlsTest::TvOutConnected() { - MPX_DEBUG(_L("CVideoPlaybackControlsTest::TvOutConnected()")); + MPX_DEBUG(_L("CVideoPlaybackControlsTest::TvOutConnected()")); - TRAPD( result, iController->HandleEventL( EMPXControlCmdTvOutConnected ) ); + MPX_TRAPD( result, iController->HandleEventL( EMPXControlCmdTvOutConnected ) ); return result; } @@ -713,9 +718,9 @@ // TInt CVideoPlaybackControlsTest::TvOutDisconnected() { - MPX_DEBUG(_L("CVideoPlaybackControlsTest::TvOutDisconnected()")); + MPX_DEBUG(_L("CVideoPlaybackControlsTest::TvOutDisconnected()")); - TRAPD( result, iController->HandleEventL( EMPXControlCmdTvOutDisconnected ) ); + MPX_TRAPD( result, iController->HandleEventL( EMPXControlCmdTvOutDisconnected ) ); return result; } @@ -728,7 +733,7 @@ { MPX_DEBUG(_L("CVideoPlaybackControlsTest::HandleErrors()")); - TRAPD( result, iController->HandleEventL( EMPXControlCmdHandleErrors ) ); + MPX_TRAPD( result, iController->HandleEventL( EMPXControlCmdHandleErrors ) ); return result; } @@ -745,7 +750,7 @@ TInt result = aItem.GetNextInt( key ); - TRAP( result, iController->HandleEventL( EMPXControlCmdSoftKeyPressed, key ) ); + MPX_TRAP( result, iController->HandleEventL( EMPXControlCmdSoftKeyPressed, key ) ); return result; } @@ -758,7 +763,7 @@ { MPX_DEBUG(_L("CVideoPlaybackControlsTest::ShowControls()")); - TRAPD( result, iController->HandleEventL( EMPXControlCmdShowControls ) ); + MPX_TRAPD( result, iController->HandleEventL( EMPXControlCmdShowControls ) ); return result; } @@ -771,7 +776,7 @@ { MPX_DEBUG(_L("CVideoPlaybackControlsTest::ToggleVisibility()")); - TRAPD( result, iController->HandleEventL( EMPXControlCmdToggleVisibility ) ); + MPX_TRAPD( result, iController->HandleEventL( EMPXControlCmdToggleVisibility ) ); return result; } @@ -784,7 +789,7 @@ { MPX_DEBUG(_L("CVideoPlaybackControlsTest::HandleBackgroundEvnet()")); - TRAPD( result, iController->HandleEventL( EMPXControlCmdHandleBackgroundEvent ) ); + MPX_TRAPD( result, iController->HandleEventL( EMPXControlCmdHandleBackgroundEvent ) ); return result; } @@ -825,7 +830,7 @@ { MPX_DEBUG(_L("CVideoPlaybackControlsTest::ShowMediaDetailsViewer()")); - TRAPD( result, iController->HandleEventL( EMPXControlCmdShowFileDetailsViewer ) ); + MPX_TRAPD( result, iController->HandleEventL( EMPXControlCmdShowFileDetailsViewer ) ); return result; } @@ -838,7 +843,7 @@ { MPX_DEBUG(_L("CVideoPlaybackControlsTest::CloseMediaDetailsViewer()")); - TRAPD( result, iController->HandleEventL( EMPXControlCmdCloseFileDetailsViewer ) ); + MPX_TRAPD( result, iController->HandleEventL( EMPXControlCmdCloseFileDetailsViewer ) ); return result; } diff -r 2d690156cf8f -r 315810614048 videoplayback/videoplaybackviews/data/mpxvideoplaybackviews.rss --- a/videoplayback/videoplaybackviews/data/mpxvideoplaybackviews.rss Thu Jul 15 18:41:27 2010 +0300 +++ b/videoplayback/videoplaybackviews/data/mpxvideoplaybackviews.rss Thu Aug 19 09:57:17 2010 +0300 @@ -15,7 +15,7 @@ * */ -// Version : %version: 7 % +// Version : %version: 8 % // RESOURCE NAME IDENTIFIER @@ -126,7 +126,6 @@ RESOURCE AVKON_VIEW r_mpx_video_playback_view { menubar = r_mpx_video_playback_view_menubar; - cba = R_AVKON_SOFTKEYS_OPTIONS_BACK; } // ------------------------------------------------------------------------------------------------- diff -r 2d690156cf8f -r 315810614048 videoplayback/videoplaybackviews/src/mpxvideobaseplaybackview.cpp --- a/videoplayback/videoplaybackviews/src/mpxvideobaseplaybackview.cpp Thu Jul 15 18:41:27 2010 +0300 +++ b/videoplayback/videoplaybackviews/src/mpxvideobaseplaybackview.cpp Thu Aug 19 09:57:17 2010 +0300 @@ -16,7 +16,7 @@ */ -// Version : %version: 83 % +// Version : %version: 86 % // Include Files @@ -189,7 +189,8 @@ // CMPXVideoBasePlaybackView::CreateGeneralPlaybackCommandL() // ------------------------------------------------------------------------------------------------- // -void CMPXVideoBasePlaybackView::CreateGeneralPlaybackCommandL( TMPXPlaybackCommand aCmd, TBool aDoSync ) +void CMPXVideoBasePlaybackView::CreateGeneralPlaybackCommandL( TMPXPlaybackCommand aCmd, + TBool aDoSync ) { MPX_ENTER_EXIT(_L("CMPXVideoBasePlaybackView::CreateGeneralPlaybackCommandL()"), _L("aCmd = %d, aDoSync, = %d"), aCmd, aDoSync ); @@ -234,7 +235,7 @@ case EMPXPbvCmdClose: { MPX_DEBUG(_L("CMPXVideoBasePlaybackView::HandleCommandL() EMPXPbvCmdClose")); - CreateGeneralPlaybackCommandL( EPbCmdClose ); + CreateGeneralPlaybackCommandL( EPbCmdClose, iSyncClose ); break; } case EMPXPbvCmdSeekForward: @@ -471,11 +472,6 @@ iAknEventMonitor->AddObserverL( this ); // - // Deactivate the CBA set the LSK & RSK to empty - // - Cba()->SetCommandSetL( R_AVKON_SOFTKEYS_EMPTY ); - - // // Determine if the playback is from a playlist on view activation // MMPXSource* s = iPlaybackUtility->Source(); @@ -891,8 +887,10 @@ if ( iContainer ) { - MPX_TRAPD( err, iContainer->HandleEventL( cmdId ) ); + MPX_TRAPD( err, + iContainer->HandleEventL( cmdId, iDisplayHandler->ShowAspectRatioIcon() ) ); } + break; } case EPbCmdLoadingStarted: @@ -1280,12 +1278,9 @@ // Aspect ratio should be calculated 1st so the auto scale will be set when // the display window is created. // - TInt newAspectRatio = iDisplayHandler->SetDefaultAspectRatioL( iFileDetails ); - iDisplayHandler->CreateDisplayWindowL( *(CCoeEnv::Static()->ScreenDevice()), - iContainer->GetWindow() ); - - iContainer->HandleEventL( EMPXControlCmdSetAspectRatio, newAspectRatio ); + iContainer->GetWindow(), + iFileDetails ); } else { @@ -1620,12 +1615,7 @@ { MPX_DEBUG(_L("CMPXVideoBasePlaybackView::SetAspectRatioL()")); - TInt newAspectRatio = iDisplayHandler->SetAspectRatioL( aCmd ); - - if ( iContainer ) - { - iContainer->HandleEventL( EMPXControlCmdSetAspectRatio, newAspectRatio ); - } + iDisplayHandler->SetAspectRatioL( aCmd ); } // ------------------------------------------------------------------------------------------------- diff -r 2d690156cf8f -r 315810614048 videoplayback/videoplaybackviews/src/mpxvideopdlplaybackview.cpp --- a/videoplayback/videoplaybackviews/src/mpxvideopdlplaybackview.cpp Thu Jul 15 18:41:27 2010 +0300 +++ b/videoplayback/videoplaybackviews/src/mpxvideopdlplaybackview.cpp Thu Aug 19 09:57:17 2010 +0300 @@ -16,7 +16,7 @@ */ -// Version : %version: 28 % +// Version : %version: 30 % // Include Files @@ -83,7 +83,9 @@ MPX_ENTER_EXIT(_L("CMPXVideoPdlPlaybackView::ConstructL()")); InitializeVideoPlaybackViewL(); - + + iBlockInputsTimer = CPeriodic::NewL( CActive::EPriorityStandard ); + iSyncClose = ETrue; } @@ -94,6 +96,13 @@ CMPXVideoPdlPlaybackView::~CMPXVideoPdlPlaybackView() { MPX_DEBUG(_L("CMPXVideoPdlPlaybackView::~CMPXVideoPdlPlaybackView()")); + + if ( iBlockInputsTimer ) + { + iBlockInputsTimer->Cancel(); + delete iBlockInputsTimer; + iBlockInputsTimer = NULL; + } } // ------------------------------------------------------------------------------------------------- @@ -239,7 +248,7 @@ // For progressive download mode, this indicates that the file // could not be played until the entire file is downloaded. // - DisplayInfoMessageL( R_MPX_VIDEO_PDL_WAIT_DL_COMPLETE_MSG ); + DisplayInfoMessageL( R_MPX_VIDEO_PDL_WAIT_DL_COMPLETE_MSG, ETrue ); ClosePlaybackViewWithErrorL(); break; @@ -452,12 +461,11 @@ // For PDL view, reset the container and controls for new download // DoHandleInitializingStateL( aLastState ); - + // // User inputs should not be blocked since the new download is initializing // - iUserInputsBlocked = EFalse; - iContainer->UserInputHandler()->BlockPdlUserInputs( iUserInputsBlocked ); + ResetPdlUserInputs(); } // ------------------------------------------------------------------------------------------------- @@ -471,7 +479,29 @@ CMPXVideoBasePlaybackView::SendWindowCommandL( aCmd ); - if ( aCmd == EPbCmdHandleBackground && ! IsAppInFrontL() ) + if ( aCmd == EPbCmdHandleForeground ) + { + // + // If user inputs are blocked, start timer to unblock them + // + if ( iUserInputsBlocked ) + { + if ( iBlockInputsTimer->IsActive() ) + { + iBlockInputsTimer->Cancel(); + } + + // + // Set timer to unblock user inputs after 1 second + // The message from the download manager should take less than 1 second + // + iBlockInputsTimer->Start( + 1000000, + 0, + TCallBack( CMPXVideoPdlPlaybackView::HandleBlockInputsTimeOut, this ) ); + } + } + else if ( aCmd == EPbCmdHandleBackground && ! IsAppInFrontL() ) { // // Block all inputs when PDL view is sent to full background @@ -489,7 +519,7 @@ void CMPXVideoPdlPlaybackView::HandlePdlReloadComplete() { MPX_ENTER_EXIT(_L("CMPXVideoPdlPlaybackView::HandlePdlReloadComplete()")); - + // // User inputs should not be blocked since the new PDL command is complete // @@ -506,6 +536,43 @@ iUserInputsBlocked = EFalse; iContainer->UserInputHandler()->BlockPdlUserInputs( iUserInputsBlocked ); + + if ( iBlockInputsTimer->IsActive() ) + { + iBlockInputsTimer->Cancel(); + } +} + +// ------------------------------------------------------------------------------------------------- +// CMPXVideoPdlPlaybackView::HandleBlockInputsTimeOut() +// ------------------------------------------------------------------------------------------------- +// +TInt CMPXVideoPdlPlaybackView::HandleBlockInputsTimeOut( TAny* aPtr ) +{ + MPX_DEBUG(_L("CMPXVideoPdlPlaybackView::HandleBlockInputsTimeOut()")); + + static_cast(aPtr)->DoHandleBlockInputsTimeOut(); + return KErrNone; +} + +// ------------------------------------------------------------------------------------------------- +// CMPXVideoPdlPlaybackView::DoHandleBlockInputsTimeOut() +// ------------------------------------------------------------------------------------------------- +// +void CMPXVideoPdlPlaybackView::DoHandleBlockInputsTimeOut() +{ + // + // Check if we are reloading due to the message from the Download Manager + // If we are still reloading, keep the user inputs blocked. + // If not, unblock the user inputs + // + if ( ! iPdlReloading ) + { + // + // Reload message not received, unblock inputs + // + ResetPdlUserInputs(); + } } // EOF diff -r 2d690156cf8f -r 315810614048 videoplayback/videoplaybackviews/src/mpxvideoplaybackcontainer.cpp --- a/videoplayback/videoplaybackviews/src/mpxvideoplaybackcontainer.cpp Thu Jul 15 18:41:27 2010 +0300 +++ b/videoplayback/videoplaybackviews/src/mpxvideoplaybackcontainer.cpp Thu Aug 19 09:57:17 2010 +0300 @@ -16,7 +16,7 @@ */ -// Version : %version: 29 % +// Version : %version: 30 % // INCLUDE FILES @@ -190,8 +190,7 @@ { MPX_ENTER_EXIT( _L("CMPXVideoPlaybackContainer::OfferKeyEventL()"), - _L("iCode = %d iScanCode = %d aType = %d"), - aKeyEvent.iCode, aKeyEvent.iScanCode, aType ); + _L("aKeyEvent = (%d,%d), aType = %d"), aKeyEvent.iCode, aKeyEvent.iScanCode, aType ); iKeyResponse = EKeyWasNotConsumed; @@ -208,7 +207,7 @@ EXPORT_C void CMPXVideoPlaybackContainer::DoHandleKeyEventL( const TKeyEvent& aKeyEvent, TEventCode aType ) { - MPX_DEBUG(_L("CMPXVideoPlaybackContainer::DoHandleKeyEventL()")); + MPX_ENTER_EXIT(_L("CMPXVideoPlaybackContainer::DoHandleKeyEventL()")); switch ( aKeyEvent.iScanCode ) { @@ -221,36 +220,38 @@ } case EStdKeyUpArrow: // rocker up key { - if ( aType == EEventKeyDown ) + if ( aType != EEventKeyUp ) { HandleCommandL( EMPXPbvCmdIncreaseVolume ); iKeyResponse = EKeyWasConsumed; } + break; } case EStdKeyDownArrow: // rocker down key { - if ( aType == EEventKeyDown ) + if ( aType != EEventKeyUp ) { HandleCommandL( EMPXPbvCmdDecreaseVolume ); iKeyResponse = EKeyWasConsumed; } + break; } case EStdKeyLeftArrow: // rocker left key { - HandleSeekBackL(aType); + HandleSeekBackL( aType ); iKeyResponse = EKeyWasConsumed; break; } case EStdKeyRightArrow: // rocker right key { - HandleSeekFwdL(aType); + HandleSeekFwdL( aType ); iKeyResponse = EKeyWasConsumed; break; } - case EStdKeyDevice0: - case EStdKeyDevice1: + case EStdKeyDevice0: // LSK + case EStdKeyDevice1: // RSK { if ( aType == EEventKeyUp ) { @@ -273,7 +274,7 @@ { if ( aKeyEvent.iCode == EKeyNull && aType == EEventKeyDown ) { - iView->HandleCommandL(EMPXPbvCmdPlayPause); + iView->HandleCommandL( EMPXPbvCmdPlayPause ); } } diff -r 2d690156cf8f -r 315810614048 videoplayback/videoplaybackviews/src/mpxvideoplaybackdisplayhandler.cpp --- a/videoplayback/videoplaybackviews/src/mpxvideoplaybackdisplayhandler.cpp Thu Jul 15 18:41:27 2010 +0300 +++ b/videoplayback/videoplaybackviews/src/mpxvideoplaybackdisplayhandler.cpp Thu Aug 19 09:57:17 2010 +0300 @@ -16,7 +16,7 @@ */ -// Version : %version: 15 % +// Version : %version: 17 % #include @@ -24,13 +24,13 @@ #include #include #include +#include #include "mpxvideoplaybackdisplayhandler.h" #include "mpxvideoregion.h" #include "mpxvideoplaybackviewfiledetails.h" #include "mpxvideoplaybackcontainer.h" #include "mpxcommonvideoplaybackview.hrh" -#include _LIT( KAspectRatioFile, "c:\\private\\200159b2\\mpxvideoplayer_aspect_ratio.dat" ); @@ -41,14 +41,12 @@ CMPXVideoPlaybackContainer* aContainer) : iPlaybackUtility( aPlayUtil ) , iContainer( aContainer ) -#ifdef SYMBIAN_BUILD_GCE , iScaleWidth( 100.0f ) , iScaleHeight( 100.0f ) , iHorizontalPosition( EHorizontalAlignCenter ) , iVerticalPosition( EVerticalAlignCenter ) , iRotation( EVideoRotationNone ) , iAutoScale( EAutoScaleBestFit ) -#endif { } @@ -60,13 +58,11 @@ iAspectRatioArray.Close(); -#ifdef SYMBIAN_BUILD_GCE if ( iVideoDisplay ) { delete iVideoDisplay; iVideoDisplay = NULL; } -#endif iSurfaceId = TSurfaceId::CreateNullId(); } @@ -87,26 +83,42 @@ } // ------------------------------------------------------------------------------------------------- -// CMPXVideoPlaybackDisplayHandler::ConstructL() +// CMPXVideoPlaybackDisplayHandler::ConstructL() // ------------------------------------------------------------------------------------------------- // void CMPXVideoPlaybackDisplayHandler::ConstructL() { LoadAspectRatioL(); + + TRect displayRect = iContainer->Rect(); + iDisplayAspectRatio = (TReal32)displayRect.Width() / (TReal32)displayRect.Height(); + + MPX_DEBUG(_L("CMPXVideoPlaybackDisplayHandler::ConstructL() iDisplayAspectRatio = %f"), + iDisplayAspectRatio ); } // ------------------------------------------------------------------------------------------------- // CMPXVideoPlaybackDisplayHandler::CreateDisplayWindowL() // ------------------------------------------------------------------------------------------------- // -void CMPXVideoPlaybackDisplayHandler::CreateDisplayWindowL( CWsScreenDevice& aScreenDevice, - RWindow& aWin ) +void CMPXVideoPlaybackDisplayHandler::CreateDisplayWindowL( + CWsScreenDevice& aScreenDevice, + RWindow& aWin, + CMPXVideoPlaybackViewFileDetails* aFileDetails ) { MPX_ENTER_EXIT(_L("CMPXVideoPlaybackDisplayHandler::CreateDisplayWindowL()")); -#ifdef SYMBIAN_BUILD_GCE + // + // Save off the video aspect ratio + // + iVideoHeight = aFileDetails->iVideoHeight; + iVideoWidth = aFileDetails->iVideoWidth; + + MPX_DEBUG( + _L("CMPXVideoPlaybackDisplayHandler::CreateDisplayWindowL() clip size (%d,%d)"), + iVideoHeight, iVideoWidth ); + AddDisplayWindowL( aScreenDevice, aWin, &aWin ); -#endif } // ------------------------------------------------------------------------------------------------- @@ -117,7 +129,6 @@ { MPX_ENTER_EXIT(_L("CMPXVideoPlaybackDisplayHandler::RemoveDisplayWindow()")); -#ifdef SYMBIAN_BUILD_GCE if ( iVideoDisplay ) { // @@ -131,7 +142,6 @@ delete iVideoDisplay; iVideoDisplay = NULL; } -#endif iSurfaceId = TSurfaceId::CreateNullId(); } @@ -150,76 +160,40 @@ switch ( message ) { -#ifdef SYMBIAN_BUILD_GCE case EPbMsgVideoSurfaceCreated: { - MPX_DEBUG(_L(" message = EPbMsgVideoSurfaceCreated")); SurfaceCreatedL( aMessage ); break; } case EPbMsgVideoSurfaceChanged: { - MPX_DEBUG(_L(" message = EPbMsgVideoSurfaceChanged")); SurfaceChangedL( aMessage ); break; } case EPbMsgVideoSurfaceRemoved: { - MPX_DEBUG(_L(" message = EPbMsgVideoSurfaceRemoved")); SurfaceRemoved(); break; } -#endif } } // ------------------------------------------------------------------------------------------------- -// CMPXVideoPlaybackDisplayHandler::SetAspectRatioL() +// CMPXVideoPlaybackDisplayHandler::CalculateAspectRatioL // ------------------------------------------------------------------------------------------------- // -TInt CMPXVideoPlaybackDisplayHandler::SetAspectRatioL( TMPXVideoPlaybackCommand aCmd ) +void CMPXVideoPlaybackDisplayHandler::CalculateAspectRatioL() { - MPX_DEBUG(_L("CMPXVideoPlaybackDisplayHandler::SetAspectRatioL()")); - - TInt aspectRatio; - -#ifdef SYMBIAN_BUILD_GCE - aspectRatio = SetNgaAspectRatioL( aCmd ); -#endif - - // - // Update the aspect ratio in the array - // - TInt count = iAspectRatioArray.Count(); + MPX_ENTER_EXIT(_L("CMPXVideoPlaybackDisplayHandler::CalculateAspectRatioL()")); - if ( count > 0 && count > iCurrentIndexForAspectRatio ) - { - iAspectRatioArray[iCurrentIndexForAspectRatio].scalingType = (TMMFScalingType)aspectRatio; - } - - return aspectRatio; -} - -// ------------------------------------------------------------------------------------------------- -// CMPXVideoPlaybackDisplayHandler::SetDefaultAspectRatioL -// ------------------------------------------------------------------------------------------------- -// -TInt CMPXVideoPlaybackDisplayHandler::SetDefaultAspectRatioL( - CMPXVideoPlaybackViewFileDetails* aFileDetails ) -{ - MPX_ENTER_EXIT(_L("CMPXVideoPlaybackDisplayHandler::SetDefaultAspectRatioL()")); - - TRect displayRect = iContainer->Rect(); - TReal displayAspectRatio = (TReal32)displayRect.Width() / (TReal32)displayRect.Height(); - - TInt newAspectRatio = EMMFNatural; - - if ( aFileDetails->iVideoHeight > 0 && aFileDetails->iVideoWidth > 0 ) + if ( iVideoHeight > 0 && iVideoWidth > 0 ) { TMMFScalingType scalingType = EMMFNatural; - TReal32 videoAspectRatio = (TReal32)aFileDetails->iVideoWidth / - (TReal32)aFileDetails->iVideoHeight; + TReal videoAspectRatio = CalculateVideoAspectRatio(); + + MPX_DEBUG(_L("CMPXVideoPlaybackDisplayHandler::CalculateAspectRatioL() displayAR = %f videoAR = %f)"), + iDisplayAspectRatio, videoAspectRatio ); TInt cnt = iAspectRatioArray.Count(); TInt i = 0; @@ -229,32 +203,32 @@ // for ( ; i < cnt ; i++ ) { - if ( iAspectRatioArray[i].videoRatio == videoAspectRatio && - iAspectRatioArray[i].screenRatio == displayAspectRatio && + if ( IsAspectRatioEqual( iAspectRatioArray[i].videoRatio, videoAspectRatio ) && + IsAspectRatioEqual( iAspectRatioArray[i].screenRatio, iDisplayAspectRatio ) && ( scalingType = iAspectRatioArray[i].scalingType ) > 0 ) { + MPX_DEBUG(_L("CMPXVideoPlaybackDisplayHandler::CalculateAspectRatioL() ratio found)")); break; } } // // if can't find out match aspect ratio in dat file, - // choose the scaling type through the rule + // choose the scaling type through the rule // aspectRatioDiff = videoAspectRatio - aDisplayAspectRatio // aspectRatioDiff == 0 ==> natural // aspectRatioDiff > 0.1 ==> zoom // aspectRatioDiff < - 0.3 ==> natural // aspectRatioDiff >= - 0.3 and <= 0.1 ==> stretch - // if ( i == cnt ) { - if ( videoAspectRatio - displayAspectRatio > 0.1 ) + if ( videoAspectRatio - iDisplayAspectRatio > 0.1 ) { scalingType = EMMFZoom; } - else if ( ( videoAspectRatio != displayAspectRatio ) && - ( videoAspectRatio - displayAspectRatio > (- 0.3) ) ) + else if ( ( ! IsAspectRatioEqual( videoAspectRatio, iDisplayAspectRatio ) ) && + ( videoAspectRatio - iDisplayAspectRatio > (- 0.3) ) ) { scalingType = EMMFStretch; } @@ -262,7 +236,7 @@ TMPXAspectRatio ratio; ratio.videoRatio = videoAspectRatio; - ratio.screenRatio = displayAspectRatio; + ratio.screenRatio = iDisplayAspectRatio; ratio.scalingType = scalingType; iAspectRatioArray.Append( ratio ); @@ -281,10 +255,21 @@ aspectRatioCmd = EPbCmdStretchAspectRatio; } - newAspectRatio = SetAspectRatioL( aspectRatioCmd ); + SetAspectRatioL( aspectRatioCmd ); + + // + // If the screen aspect ratio and the video aspect ratio are not equal, + // signal the controls controller to create the aspect ratio icon + // + if ( ShowAspectRatioIcon() ) + { + iContainer->HandleEventL( EMPXControlCmdCreateAspectRatioIcon ); + } + else + { + iContainer->HandleEventL( EMPXControlCmdDeleteAspectRatioIcon ); + } } - - return newAspectRatio; } // ------------------------------------------------------------------------------------------------- @@ -380,8 +365,6 @@ CleanupStack::PopAndDestroy(); } -#ifdef SYMBIAN_BUILD_GCE - // ------------------------------------------------------------------------------------------------- // CMPXVideoPlaybackDisplayHandler::AddDisplayWindowL() // ------------------------------------------------------------------------------------------------- @@ -429,14 +412,7 @@ // if ( iSurfaceCached && ! iContainer->IsRealOneBitmapTimerActive() ) { - iVideoDisplay->SurfaceCreated( iSurfaceId, iCropRect, iAspectRatio, iCropRect ); - - if ( iContainer ) - { - iContainer->HandleCommandL( EMPXPbvSurfaceCreated ); - } - - iSurfaceCached = EFalse; + AttachNewSurfaceToWindowL(); } } @@ -457,6 +433,10 @@ iCropRect = aMessage->ValueTObjectL( KMPXMediaVideoDisplayCropRect ); iAspectRatio = aMessage->ValueTObjectL( KMPXMediaVideoDisplayAspectRatio ); + MPX_DEBUG(_L("CMPXVideoPlaybackDisplayHandler::SurfaceCreatedL iCropRect[(%d,%d),(%d,%d)] iAspectRatio = (%d,%d)"), + iCropRect.iTl.iX, iCropRect.iTl.iY, iCropRect.iBr.iX, iCropRect.iBr.iY, + iAspectRatio.iNumerator, iAspectRatio.iDenominator ); + // // Add the surface unless the video display hasn't been created or // the Real One bitmap is being shown. @@ -471,15 +451,7 @@ iVideoDisplay->RemoveSurface(); } - // - // Add new surface - // - iVideoDisplay->SurfaceCreated( iSurfaceId, iCropRect, iAspectRatio, iCropRect ); - - if ( iContainer ) - { - iContainer->HandleCommandL( EMPXPbvSurfaceCreated ); - } + AttachNewSurfaceToWindowL(); } else { @@ -498,6 +470,8 @@ { MPX_ENTER_EXIT(_L("CMPXVideoPlaybackDisplayHandler::SurfaceChangedL()")); + TVideoAspectRatio oldAspectRatio = iAspectRatio; + // // Extract the surface parameters from the message // @@ -515,12 +489,40 @@ // Add new surface // iVideoDisplay->SurfaceParametersChanged( iSurfaceId, iCropRect, iAspectRatio ); + iVideoDisplay->RedrawWindows( iCropRect ); - iVideoDisplay->RedrawWindows( iCropRect ); + // + // Update the Aspect Ratio if it changed on the surface + // + if ( oldAspectRatio != iAspectRatio ) + { + CalculateAspectRatioL(); + } } } // ------------------------------------------------------------------------------------------------- +// CMPXVideoPlaybackDisplayHandler::RemoveSurfaceFromPlaybackPluginL() +// ------------------------------------------------------------------------------------------------- +// +void CMPXVideoPlaybackDisplayHandler::RemoveSurfaceFromPlaybackPluginL() +{ + MPX_ENTER_EXIT(_L("CMPXVideoPlaybackDisplayHandler::RemoveSurfaceFromPlaybackPluginL()")); + + CMPXCommand* cmd = CMPXCommand::NewL(); + CleanupStack::PushL( cmd ); + + cmd->SetTObjectValueL( KMPXCommandGeneralDoSync, ETrue ); + cmd->SetTObjectValueL( KMPXCommandGeneralId, KMPXMediaIdVideoPlayback ); + cmd->SetTObjectValueL( KMPXMediaVideoPlaybackCommand, + EPbCmdSurfaceRemovedFromWindow ); + cmd->SetTObjectValueL( KMPXMediaVideoDisplayTSurfaceId, iSurfaceId ); + + iPlaybackUtility->CommandL( *cmd ); + CleanupStack::PopAndDestroy( cmd ); +} + +// ------------------------------------------------------------------------------------------------- // CMPXVideoPlaybackDisplayHandler::SurfaceRemoved() // ------------------------------------------------------------------------------------------------- // @@ -536,18 +538,24 @@ } iVideoDisplay->RemoveSurface(); + + // + // Signal the playback plugin to remove the surface from Helix + // + MPX_TRAPD( err2, RemoveSurfaceFromPlaybackPluginL() ); } iSurfaceId = TSurfaceId::CreateNullId(); } // ------------------------------------------------------------------------------------------------- -// CMPXVideoPlaybackDisplayHandler::SetNgaAspectRatioL() +// CMPXVideoPlaybackDisplayHandler::SetAspectRatioL() // ------------------------------------------------------------------------------------------------- // -TInt CMPXVideoPlaybackDisplayHandler::SetNgaAspectRatioL( TMPXVideoPlaybackCommand aCmd ) +void CMPXVideoPlaybackDisplayHandler::SetAspectRatioL( TMPXVideoPlaybackCommand aCmd ) { - MPX_ENTER_EXIT(_L("CMPXVideoPlaybackDisplayHandler::SetNgaAspectRatioL()")); + MPX_ENTER_EXIT(_L("CMPXVideoPlaybackDisplayHandler::SetAspectRatioL()"), + _L("aCmd = %d"), aCmd); TInt aspectRatio = EMMFNatural; @@ -581,11 +589,25 @@ iCropRect ); } - return aspectRatio; + // + // Update the controls controller with the new aspect ratio + // + if ( iContainer ) + { + iContainer->HandleEventL( EMPXControlCmdSetAspectRatio, aspectRatio ); + } + + // + // Update the aspect ratio in the array + // + TInt count = iAspectRatioArray.Count(); + + if ( count > 0 && count > iCurrentIndexForAspectRatio ) + { + iAspectRatioArray[iCurrentIndexForAspectRatio].scalingType = (TMMFScalingType)aspectRatio; + } } -#endif - // ------------------------------------------------------------------------------------------------- // CMPXVideoPlaybackDisplayHandler::DoHandleRealOneBitmapTimeoutL() // ------------------------------------------------------------------------------------------------- @@ -599,16 +621,105 @@ // if ( iSurfaceCached && iVideoDisplay ) { - iVideoDisplay->SurfaceCreated( iSurfaceId, iCropRect, iAspectRatio, iCropRect ); - - if ( iContainer ) - { - iContainer->HandleCommandL( EMPXPbvSurfaceCreated ); - } - - iSurfaceCached = EFalse; + AttachNewSurfaceToWindowL(); } } +// ------------------------------------------------------------------------------------------------- +// CMPXVideoPlaybackDisplayHandler::AttachNewSurfaceToWindowL() +// ------------------------------------------------------------------------------------------------- +// +void CMPXVideoPlaybackDisplayHandler::AttachNewSurfaceToWindowL() +{ + MPX_ENTER_EXIT(_L("CMPXVideoPlaybackDisplayHandler::AttachNewSurfaceToWindowL()")); + + // + // Calculate the video aspect ratio and set the proper value on the video display + // before attaching the surface + // + CalculateAspectRatioL(); + + iVideoDisplay->SurfaceCreated( iSurfaceId, iCropRect, iAspectRatio, iCropRect ); + + if ( iContainer ) + { + iContainer->HandleCommandL( EMPXPbvSurfaceCreated ); + } + + iSurfaceCached = EFalse; +} + +// ------------------------------------------------------------------------------------------------- +// CMPXVideoPlaybackDisplayHandler::ShowAspectRatioIcon() +// ------------------------------------------------------------------------------------------------- +// +TBool CMPXVideoPlaybackDisplayHandler::ShowAspectRatioIcon() +{ + TBool showAspectRatio = ETrue; + + TReal videoAspectRatio = CalculateVideoAspectRatio(); + + if ( IsAspectRatioEqual( videoAspectRatio, iDisplayAspectRatio ) ) + { + showAspectRatio = EFalse; + } + + MPX_DEBUG(_L("CMPXVideoPlaybackDisplayHandler::ShowAspectRatioIcon(%d)"), showAspectRatio); + + return showAspectRatio; +} + +// ------------------------------------------------------------------------------------------------- +// CMPXVideoPlaybackDisplayHandler::IsAspectRatioEqual() +// ------------------------------------------------------------------------------------------------- +// +TBool CMPXVideoPlaybackDisplayHandler::IsAspectRatioEqual( TReal aRatio1, TReal aRatio2 ) +{ + MPX_DEBUG(_L("CMPXVideoPlaybackDisplayHandler::IsAspectRatioEqual() ar1 = %f ar2 = %f)"), + aRatio1, aRatio2 ); + + TBool valuesEqual = EFalse; + TReal arDiff = aRatio1 - aRatio2; + + if ( arDiff < 0.00001 && arDiff > -0.00001 ) + { + valuesEqual = ETrue; + } + + MPX_DEBUG(_L("CMPXVideoPlaybackDisplayHandler::IsAspectRatioEqual(%d)"), valuesEqual); + + return valuesEqual; +} + +// ------------------------------------------------------------------------------------------------- +// CMPXVideoPlaybackDisplayHandler::CalculateVideoAspectRatio() +// ------------------------------------------------------------------------------------------------- +// +TReal CMPXVideoPlaybackDisplayHandler::CalculateVideoAspectRatio() +{ + TReal videoAspectRatio = 0.0; + + if ( iVideoHeight > 0 && iVideoWidth > 0 ) + { + videoAspectRatio = (TReal32)iVideoWidth / (TReal32)iVideoHeight; + + // + // If the pixel aspect ratio is valid, use it to modify the videoAspectRatio + // + if ( iAspectRatio.iDenominator ) + { + MPX_DEBUG(_L("CMPXVideoPlaybackDisplayHandler::CalculateVideoAspectRatio() iAspectRatio = (%d,%d)"), + iAspectRatio.iNumerator, iAspectRatio.iDenominator ); + + TReal32 par = (TReal32)iAspectRatio.iNumerator / (TReal32)iAspectRatio.iDenominator; + + videoAspectRatio *= par; + } + } + + MPX_DEBUG(_L("CMPXVideoPlaybackDisplayHandler::CalculateVideoAspectRatio(%f)"), videoAspectRatio ); + + return videoAspectRatio; +} // End of File diff -r 2d690156cf8f -r 315810614048 videoplayback/videoplaybackviews/src/mpxvideoplaybackuserinputhandler.cpp --- a/videoplayback/videoplaybackviews/src/mpxvideoplaybackuserinputhandler.cpp Thu Jul 15 18:41:27 2010 +0300 +++ b/videoplayback/videoplaybackviews/src/mpxvideoplaybackuserinputhandler.cpp Thu Aug 19 09:57:17 2010 +0300 @@ -16,7 +16,7 @@ */ -// Version : %version: 19 % +// Version : %version: 20 % // INCLUDE FILES @@ -448,7 +448,8 @@ void CMPXVideoPlaybackUserInputHandler::ProcessKeyEventL( const TKeyEvent& aKeyEvent, TEventCode aType ) { - MPX_ENTER_EXIT(_L("MPXVideoPlaybackUserInputHandler::ProcessKeyEvent()")); + MPX_ENTER_EXIT(_L("MPXVideoPlaybackUserInputHandler::ProcessKeyEvent()"), + _L("iProcessingInputType = %d, aType = %d"), iProcessingInputType, aType ); switch ( iProcessingInputType ) { @@ -457,28 +458,30 @@ if ( aType == EEventKeyDown && IsUserInputAllowed() ) { iProcessingInputType = EMpxVideoKeyboard; - iLastPressedKeyCode = aKeyEvent.iCode; iLastPressedKeyScanCode = aKeyEvent.iScanCode; - iContainer->DoHandleKeyEventL(aKeyEvent, aType); + iContainer->DoHandleKeyEventL( aKeyEvent, aType ); } break; } case EMpxVideoKeyboard: { - if ( aType == EEventKeyUp ) + MPX_DEBUG(_L("aKeyEvent.iScanCode = %d, iLastPressedKeyScanCode = %d"), + aKeyEvent.iScanCode, iLastPressedKeyScanCode ); + + // + // Only handle events for the key being handled + // + if ( aKeyEvent.iScanCode == iLastPressedKeyScanCode ) { - // only handle up event for the key being handled - // ignore spurious key presses - if ( aKeyEvent.iCode == iLastPressedKeyCode && - aKeyEvent.iScanCode == iLastPressedKeyScanCode ) + iContainer->DoHandleKeyEventL( aKeyEvent, aType ); + + if ( aType == EEventKeyUp ) { - iContainer->DoHandleKeyEventL(aKeyEvent, aType); - - // reset the value only on key up event iProcessingInputType = EMpxVideoNone; } } + break; } } // switch diff -r 2d690156cf8f -r 315810614048 videoplayerapp/mpxvideoplayer/sis/VideoPlayer.pkg --- a/videoplayerapp/mpxvideoplayer/sis/VideoPlayer.pkg Thu Jul 15 18:41:27 2010 +0300 +++ b/videoplayerapp/mpxvideoplayer/sis/VideoPlayer.pkg Thu Aug 19 09:57:17 2010 +0300 @@ -20,7 +20,7 @@ &EN ; Header -#{"Video Player"},(0x200159B2),9,20,24, TYPE=SA, RU +#{"Video Player"},(0x200159B2),9,20,28, TYPE=SA, RU ; Supports Series 60 v5.0 ;[0x1028315F], 0, 0, 0, {"Series60ProductID"} diff -r 2d690156cf8f -r 315810614048 videoplayerapp/mpxvideoplayer/sis/VideoPlayer_stub.pkg --- a/videoplayerapp/mpxvideoplayer/sis/VideoPlayer_stub.pkg Thu Jul 15 18:41:27 2010 +0300 +++ b/videoplayerapp/mpxvideoplayer/sis/VideoPlayer_stub.pkg Thu Aug 19 09:57:17 2010 +0300 @@ -20,7 +20,7 @@ &EN ;Header -#{"Video Player"},(0x200159B2),9,20,24, TYPE=SA +#{"Video Player"},(0x200159B2),9,20,28, TYPE=SA ;Localised Vendor name %{"Nokia"} diff -r 2d690156cf8f -r 315810614048 videoplayerapp/mpxvideoplayer/src/mpxvideoplayerappui.cpp --- a/videoplayerapp/mpxvideoplayer/src/mpxvideoplayerappui.cpp Thu Jul 15 18:41:27 2010 +0300 +++ b/videoplayerapp/mpxvideoplayer/src/mpxvideoplayerappui.cpp Thu Aug 19 09:57:17 2010 +0300 @@ -15,7 +15,7 @@ * */ -// Version : %version: e92_38 % +// Version : %version: da1mmcf#e92_38.1.1 % #include // Help launcher @@ -70,6 +70,12 @@ // Set the orientation to landscape for Embedded instances // SetOrientationL( CAknAppUiBase::EAppUiOrientationLandscape ); + + // + // Hide status pane for embedded use cases + // + MPX_DEBUG(_L("CMpxVideoPlayerAppUi::ConstructL() Hide Status Pane")); + StatusPane()->MakeVisible( EFalse ); } iAppUiEngine = CMpxVideoPlayerAppUiEngine::NewL( this );