mmlibs/mmfw/tsrc/mmvalidationsuite/mmvalidationsuiteagents/inc/videoplayagent.h
changeset 0 40261b775718
equal deleted inserted replaced
-1:000000000000 0:40261b775718
       
     1 // Copyright (c) 2005-2009 Nokia Corporation and/or its subsidiary(-ies).
       
     2 // All rights reserved.
       
     3 // This component and the accompanying materials are made available
       
     4 // under the terms of "Eclipse Public License v1.0"
       
     5 // which accompanies this distribution, and is available
       
     6 // at the URL "http://www.eclipse.org/legal/epl-v10.html".
       
     7 //
       
     8 // Initial Contributors:
       
     9 // Nokia Corporation - initial contribution.
       
    10 //
       
    11 // Contributors:
       
    12 //
       
    13 // Description:
       
    14 // Part of the MVS Agents for TechView
       
    15 //
       
    16 
       
    17 #ifndef MVSVIDEOPLAYAGENT_H
       
    18 #define MVSVIDEOPLAYAGENT_H
       
    19 
       
    20 #include <f32file.h>
       
    21 #include <flogger.h>
       
    22 #include <ecam.h>
       
    23 
       
    24 #include <mmf/common/mmffourcc.h>
       
    25 #include <mmf/common/mmfstandardcustomcommands.h>  
       
    26 #include <mmf/common/mmfvideo.h>
       
    27 #include <mmf/server/mmfdes.h>
       
    28 #include <mmf/server/mmffile.h>
       
    29 #include <mmf/common/mmfcontroller.h>
       
    30 
       
    31 #include <videorecorder.h>
       
    32 #include <videoplayer.h>
       
    33 
       
    34 #include <mvs/agentsutility.h>
       
    35 
       
    36 
       
    37 // forward declaration
       
    38 #ifdef SYMBIAN_BUILD_GCE
       
    39 class CVideoPlayerUtility2;
       
    40 class MMMFSurfaceEventHandler;
       
    41 #endif
       
    42 
       
    43 /**
       
    44 @publishedPartner
       
    45 @prototype
       
    46 @test
       
    47 
       
    48 Provides Video playing functionality for the UI
       
    49 
       
    50 */
       
    51 class CMVSVideoPlayAgent : public CBase, MVideoPlayerUtilityObserver, MMMFAudioResourceNotificationCallback
       
    52 {
       
    53 public:
       
    54 	IMPORT_C static CMVSVideoPlayAgent* NewL(MMVSClientObserver& aObserver);
       
    55 	IMPORT_C ~CMVSVideoPlayAgent();
       
    56 	
       
    57 	//opens an video clip for playback
       
    58     IMPORT_C void OpenFileL(const TDesC& aFileName);	
       
    59 	IMPORT_C void OpenFileL(const TDesC& aFileName, TUid aControllerUid);
       
    60 	
       
    61 	//opens DRM protected source
       
    62 	IMPORT_C void OpenFileL(TMMSource &aSource);
       
    63 	
       
    64 	IMPORT_C void OpenDesL(const TDesC8 &aDescriptor); //For future support
       
    65 	
       
    66 	IMPORT_C void Prepare();
       
    67 	IMPORT_C void Close();
       
    68 	IMPORT_C void Play();
       
    69 	IMPORT_C void Play(const TTimeIntervalMicroSeconds &aStartPoint, const TTimeIntervalMicroSeconds &aEndPoint);
       
    70 	IMPORT_C TInt Stop();
       
    71 	IMPORT_C void PauseL();
       
    72 		
       
    73     //Setter Functions	
       
    74 	IMPORT_C void SetDisplayWindowL(RWsSession &aWs, CWsScreenDevice &aScreenDevice, RWindow &aWindow, const TRect &aWindowRect, const TRect &aClipRect);
       
    75 	IMPORT_C void SetVideoFrameRateL(TReal32 aFramesPerSecond);
       
    76 	IMPORT_C void SetVolumeL(TInt aVolume);
       
    77 	IMPORT_C void SetBalanceL(TInt aBalance);
       
    78 	IMPORT_C void SetPriorityL(TInt aPriority, TMdaPriorityPreference aPref);
       
    79 	IMPORT_C void SetPositionL(const TTimeIntervalMicroSeconds &aPosition);
       
    80 	IMPORT_C void SetRotationL(TVideoRotation aRotation);
       
    81 	IMPORT_C void SetScaleFactorL(TReal32 aWidthPercentage, TReal32 aHeightPercentage, TBool aAntiAliasFiltering);
       
    82 	IMPORT_C void SetCropRegionL(const TRect &aCropRegion);
       
    83 	IMPORT_C void SetVideoExtentL(const TRect& aVideoExtent);
       
    84 	IMPORT_C void SetWindowClipRectL(const TRect& aWindowClipRect);	
       
    85 	
       
    86 	IMPORT_C void GetFrameL(TDisplayMode aDisplayMode);
       
    87 	IMPORT_C void GetFrameL(TDisplayMode aDisplayMode, ContentAccess::TIntent aIntent);
       
    88 	IMPORT_C TReal32 VideoFrameRateL();
       
    89 	IMPORT_C void VideoFrameSizeL(TSize &aSize) ;
       
    90 	IMPORT_C const TDesC8 &VideoFormatMimeType() ;
       
    91 	IMPORT_C TInt VideoBitRateL() ; //No way to seek this information in HwDevice.
       
    92 	IMPORT_C TInt AudioBitRateL() ; //This is done in devsound using the custom interface.
       
    93 	IMPORT_C TFourCC AudioTypeL() ;
       
    94 	IMPORT_C TBool AudioEnabledL() ;
       
    95 	IMPORT_C TTimeIntervalMicroSeconds PositionL() ;
       
    96 	IMPORT_C TTimeIntervalMicroSeconds DurationL() ;
       
    97 	
       
    98 	IMPORT_C TInt Volume() ;
       
    99 	IMPORT_C void PriorityL(TInt &aPriority, TMdaPriorityPreference &aPref) ;
       
   100 	IMPORT_C TInt Balance() ;
       
   101 	
       
   102 	IMPORT_C TVideoRotation RotationL() ;
       
   103 	IMPORT_C void GetScaleFactorL(TReal32 &aWidthPercentage, TReal32 &aHeightPercentage, TBool &aAntiAliasFiltering) ;
       
   104 	IMPORT_C void GetCropRegionL(TRect &aCropRegion) ;
       
   105 
       
   106 	IMPORT_C TInt NumberOfMetaDataEntriesL();
       
   107     IMPORT_C void GetMetaDataArrayL(RPointerArray<CMMFMetaDataEntry>& aMetaData);
       
   108 	IMPORT_C const CMMFControllerImplementationInformation &ControllerImplementationInformationL();
       
   109 
       
   110 	IMPORT_C TMVSState GetState();
       
   111 
       
   112 	IMPORT_C void SetVideoOutputL(RWsSession& aWs,
       
   113                                   CWsScreenDevice& aScreenDevice,
       
   114                                   RWindow& aWindow,
       
   115                                   TRect& aScreenRect,
       
   116                                   TRect& aClipRect);
       
   117 
       
   118     IMPORT_C void AddDisplayWindowL(RWsSession& aWs,
       
   119                                     CWsScreenDevice& aScreenDevice,
       
   120                                     RWindow& aWindow,
       
   121                                     const TRect& aScreenRect,
       
   122                                     const TRect& aClipRect);
       
   123 
       
   124     IMPORT_C void AddDisplayWindowL(RWsSession& aWs,
       
   125                                     CWsScreenDevice& aScreenDevice,
       
   126                                     RWindow& aWindow);
       
   127 
       
   128 	IMPORT_C void AddDisplayL(RWsSession& aWs, TInt aDisplay, MMMFSurfaceEventHandler& aEventHandler);
       
   129 
       
   130     IMPORT_C void RemoveDisplayWindowL(RWindow& aWindow);
       
   131 	IMPORT_C void RemoveDisplay(TInt aDisplay);
       
   132 
       
   133     IMPORT_C TInt MaxVolume();
       
   134     IMPORT_C TInt SetScreenNumber(TInt aScreenNumber);
       
   135     IMPORT_C TInt RegisterForNotification();
       
   136     IMPORT_C TInt CancelNotification();
       
   137     IMPORT_C TInt WillResumePlay();
       
   138     IMPORT_C TBool SupportVideoPlayerUtility2() const; 
       
   139 
       
   140 	IMPORT_C void SetAutoScaleL(RWindow& aWindow, TAutoScaleType aScaleType, TInt aHorizPos, TInt aVertPos);
       
   141 	IMPORT_C void SetAutoScaleL(TAutoScaleType aScaleType, TInt aHorizPos, TInt aVertPos);
       
   142 	
       
   143 #ifdef SYMBIAN_MULTIMEDIA_SUBTITLE_SUPPORT
       
   144 	IMPORT_C void DisableSubtitlesL();
       
   145 	IMPORT_C void EnableSubtitlesL();
       
   146 	IMPORT_C void RenderSubtitle(const TRect& aRect);
       
   147 	IMPORT_C TBool SubtitlesAvailable();
       
   148 #endif //SYMBIAN_MULTIMEDIA_SUBTITLE_SUPPORT
       
   149 	
       
   150 public: 
       
   151 	void MvpuoOpenComplete(TInt aError);
       
   152     void MvpuoPrepareComplete(TInt aError);
       
   153     void MvpuoFrameReady(CFbsBitmap& aFrame,TInt aError);
       
   154     void MvpuoPlayComplete(TInt aError);
       
   155     void MvpuoEvent(const TMMFEvent& aEvent);
       
   156     
       
   157     //From MMMFAudioResourceNotificationCallback
       
   158     void MarncResourceAvailable(TUid aNotificationEventId, const TDesC8& aNotificationData);        
       
   159 private:
       
   160 	void ConstructL();
       
   161     CMVSVideoPlayAgent(MMVSClientObserver& aObserver);
       
   162 
       
   163 private:
       
   164 	CVideoPlayerUtility*    iVideoPlayer;	
       
   165 #ifdef SYMBIAN_BUILD_GCE	
       
   166 	CVideoPlayerUtility2*   iVideoPlayer2;	
       
   167 #endif	
       
   168 
       
   169 	MMVSClientObserver& iObserver;
       
   170 	TMVSState iState;
       
   171 	TMMFEvent iEvent;
       
   172 	RFs iFs;
       
   173 	RFile iFile;
       
   174 	CWsScreenDevice* iScreen;
       
   175 	RWindow* iWindow;
       
   176 	RWsSession iWs;
       
   177 	RWindowGroup iRootWindow;
       
   178     RFileLogger iFileLogger;
       
   179     TInt iScreenNumber;
       
   180     TBool iSupportVideoPlayerUtility2;
       
   181     CVideoPlayerUtility*    iCurrentVideoPlayer;
       
   182     RBuf    iFileName;
       
   183     TUid    iControllerUid;
       
   184     TBool iRequestNotify;
       
   185 #ifdef SYMBIAN_MULTIMEDIA_SUBTITLE_SUPPORT
       
   186     TBool iEnableSubtitlesOnAdd;
       
   187 #endif //SYMBIAN_MULTIMEDIA_SUBTITLE_SUPPORT
       
   188 };
       
   189 
       
   190 
       
   191 
       
   192 
       
   193 #endif  // MVSVIDEOPLAYAGENT_H