os/mm/mmlibs/mmfw/tsrc/mmvalidationsuite/mmvalidationsuiteagents/inc/videoplayagent.h
1.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
1.2 +++ b/os/mm/mmlibs/mmfw/tsrc/mmvalidationsuite/mmvalidationsuiteagents/inc/videoplayagent.h Fri Jun 15 03:10:57 2012 +0200
1.3 @@ -0,0 +1,193 @@
1.4 +// Copyright (c) 2005-2009 Nokia Corporation and/or its subsidiary(-ies).
1.5 +// All rights reserved.
1.6 +// This component and the accompanying materials are made available
1.7 +// under the terms of "Eclipse Public License v1.0"
1.8 +// which accompanies this distribution, and is available
1.9 +// at the URL "http://www.eclipse.org/legal/epl-v10.html".
1.10 +//
1.11 +// Initial Contributors:
1.12 +// Nokia Corporation - initial contribution.
1.13 +//
1.14 +// Contributors:
1.15 +//
1.16 +// Description:
1.17 +// Part of the MVS Agents for TechView
1.18 +//
1.19 +
1.20 +#ifndef MVSVIDEOPLAYAGENT_H
1.21 +#define MVSVIDEOPLAYAGENT_H
1.22 +
1.23 +#include <f32file.h>
1.24 +#include <flogger.h>
1.25 +#include <ecam.h>
1.26 +
1.27 +#include <mmf/common/mmffourcc.h>
1.28 +#include <mmf/common/mmfstandardcustomcommands.h>
1.29 +#include <mmf/common/mmfvideo.h>
1.30 +#include <mmf/server/mmfdes.h>
1.31 +#include <mmf/server/mmffile.h>
1.32 +#include <mmf/common/mmfcontroller.h>
1.33 +
1.34 +#include <videorecorder.h>
1.35 +#include <videoplayer.h>
1.36 +
1.37 +#include <mvs/agentsutility.h>
1.38 +
1.39 +
1.40 +// forward declaration
1.41 +#ifdef SYMBIAN_BUILD_GCE
1.42 +class CVideoPlayerUtility2;
1.43 +class MMMFSurfaceEventHandler;
1.44 +#endif
1.45 +
1.46 +/**
1.47 +@publishedPartner
1.48 +@prototype
1.49 +@test
1.50 +
1.51 +Provides Video playing functionality for the UI
1.52 +
1.53 +*/
1.54 +class CMVSVideoPlayAgent : public CBase, MVideoPlayerUtilityObserver, MMMFAudioResourceNotificationCallback
1.55 +{
1.56 +public:
1.57 + IMPORT_C static CMVSVideoPlayAgent* NewL(MMVSClientObserver& aObserver);
1.58 + IMPORT_C ~CMVSVideoPlayAgent();
1.59 +
1.60 + //opens an video clip for playback
1.61 + IMPORT_C void OpenFileL(const TDesC& aFileName);
1.62 + IMPORT_C void OpenFileL(const TDesC& aFileName, TUid aControllerUid);
1.63 +
1.64 + //opens DRM protected source
1.65 + IMPORT_C void OpenFileL(TMMSource &aSource);
1.66 +
1.67 + IMPORT_C void OpenDesL(const TDesC8 &aDescriptor); //For future support
1.68 +
1.69 + IMPORT_C void Prepare();
1.70 + IMPORT_C void Close();
1.71 + IMPORT_C void Play();
1.72 + IMPORT_C void Play(const TTimeIntervalMicroSeconds &aStartPoint, const TTimeIntervalMicroSeconds &aEndPoint);
1.73 + IMPORT_C TInt Stop();
1.74 + IMPORT_C void PauseL();
1.75 +
1.76 + //Setter Functions
1.77 + IMPORT_C void SetDisplayWindowL(RWsSession &aWs, CWsScreenDevice &aScreenDevice, RWindow &aWindow, const TRect &aWindowRect, const TRect &aClipRect);
1.78 + IMPORT_C void SetVideoFrameRateL(TReal32 aFramesPerSecond);
1.79 + IMPORT_C void SetVolumeL(TInt aVolume);
1.80 + IMPORT_C void SetBalanceL(TInt aBalance);
1.81 + IMPORT_C void SetPriorityL(TInt aPriority, TMdaPriorityPreference aPref);
1.82 + IMPORT_C void SetPositionL(const TTimeIntervalMicroSeconds &aPosition);
1.83 + IMPORT_C void SetRotationL(TVideoRotation aRotation);
1.84 + IMPORT_C void SetScaleFactorL(TReal32 aWidthPercentage, TReal32 aHeightPercentage, TBool aAntiAliasFiltering);
1.85 + IMPORT_C void SetCropRegionL(const TRect &aCropRegion);
1.86 + IMPORT_C void SetVideoExtentL(const TRect& aVideoExtent);
1.87 + IMPORT_C void SetWindowClipRectL(const TRect& aWindowClipRect);
1.88 +
1.89 + IMPORT_C void GetFrameL(TDisplayMode aDisplayMode);
1.90 + IMPORT_C void GetFrameL(TDisplayMode aDisplayMode, ContentAccess::TIntent aIntent);
1.91 + IMPORT_C TReal32 VideoFrameRateL();
1.92 + IMPORT_C void VideoFrameSizeL(TSize &aSize) ;
1.93 + IMPORT_C const TDesC8 &VideoFormatMimeType() ;
1.94 + IMPORT_C TInt VideoBitRateL() ; //No way to seek this information in HwDevice.
1.95 + IMPORT_C TInt AudioBitRateL() ; //This is done in devsound using the custom interface.
1.96 + IMPORT_C TFourCC AudioTypeL() ;
1.97 + IMPORT_C TBool AudioEnabledL() ;
1.98 + IMPORT_C TTimeIntervalMicroSeconds PositionL() ;
1.99 + IMPORT_C TTimeIntervalMicroSeconds DurationL() ;
1.100 +
1.101 + IMPORT_C TInt Volume() ;
1.102 + IMPORT_C void PriorityL(TInt &aPriority, TMdaPriorityPreference &aPref) ;
1.103 + IMPORT_C TInt Balance() ;
1.104 +
1.105 + IMPORT_C TVideoRotation RotationL() ;
1.106 + IMPORT_C void GetScaleFactorL(TReal32 &aWidthPercentage, TReal32 &aHeightPercentage, TBool &aAntiAliasFiltering) ;
1.107 + IMPORT_C void GetCropRegionL(TRect &aCropRegion) ;
1.108 +
1.109 + IMPORT_C TInt NumberOfMetaDataEntriesL();
1.110 + IMPORT_C void GetMetaDataArrayL(RPointerArray<CMMFMetaDataEntry>& aMetaData);
1.111 + IMPORT_C const CMMFControllerImplementationInformation &ControllerImplementationInformationL();
1.112 +
1.113 + IMPORT_C TMVSState GetState();
1.114 +
1.115 + IMPORT_C void SetVideoOutputL(RWsSession& aWs,
1.116 + CWsScreenDevice& aScreenDevice,
1.117 + RWindow& aWindow,
1.118 + TRect& aScreenRect,
1.119 + TRect& aClipRect);
1.120 +
1.121 + IMPORT_C void AddDisplayWindowL(RWsSession& aWs,
1.122 + CWsScreenDevice& aScreenDevice,
1.123 + RWindow& aWindow,
1.124 + const TRect& aScreenRect,
1.125 + const TRect& aClipRect);
1.126 +
1.127 + IMPORT_C void AddDisplayWindowL(RWsSession& aWs,
1.128 + CWsScreenDevice& aScreenDevice,
1.129 + RWindow& aWindow);
1.130 +
1.131 + IMPORT_C void AddDisplayL(RWsSession& aWs, TInt aDisplay, MMMFSurfaceEventHandler& aEventHandler);
1.132 +
1.133 + IMPORT_C void RemoveDisplayWindowL(RWindow& aWindow);
1.134 + IMPORT_C void RemoveDisplay(TInt aDisplay);
1.135 +
1.136 + IMPORT_C TInt MaxVolume();
1.137 + IMPORT_C TInt SetScreenNumber(TInt aScreenNumber);
1.138 + IMPORT_C TInt RegisterForNotification();
1.139 + IMPORT_C TInt CancelNotification();
1.140 + IMPORT_C TInt WillResumePlay();
1.141 + IMPORT_C TBool SupportVideoPlayerUtility2() const;
1.142 +
1.143 + IMPORT_C void SetAutoScaleL(RWindow& aWindow, TAutoScaleType aScaleType, TInt aHorizPos, TInt aVertPos);
1.144 + IMPORT_C void SetAutoScaleL(TAutoScaleType aScaleType, TInt aHorizPos, TInt aVertPos);
1.145 +
1.146 +#ifdef SYMBIAN_MULTIMEDIA_SUBTITLE_SUPPORT
1.147 + IMPORT_C void DisableSubtitlesL();
1.148 + IMPORT_C void EnableSubtitlesL();
1.149 + IMPORT_C void RenderSubtitle(const TRect& aRect);
1.150 + IMPORT_C TBool SubtitlesAvailable();
1.151 +#endif //SYMBIAN_MULTIMEDIA_SUBTITLE_SUPPORT
1.152 +
1.153 +public:
1.154 + void MvpuoOpenComplete(TInt aError);
1.155 + void MvpuoPrepareComplete(TInt aError);
1.156 + void MvpuoFrameReady(CFbsBitmap& aFrame,TInt aError);
1.157 + void MvpuoPlayComplete(TInt aError);
1.158 + void MvpuoEvent(const TMMFEvent& aEvent);
1.159 +
1.160 + //From MMMFAudioResourceNotificationCallback
1.161 + void MarncResourceAvailable(TUid aNotificationEventId, const TDesC8& aNotificationData);
1.162 +private:
1.163 + void ConstructL();
1.164 + CMVSVideoPlayAgent(MMVSClientObserver& aObserver);
1.165 +
1.166 +private:
1.167 + CVideoPlayerUtility* iVideoPlayer;
1.168 +#ifdef SYMBIAN_BUILD_GCE
1.169 + CVideoPlayerUtility2* iVideoPlayer2;
1.170 +#endif
1.171 +
1.172 + MMVSClientObserver& iObserver;
1.173 + TMVSState iState;
1.174 + TMMFEvent iEvent;
1.175 + RFs iFs;
1.176 + RFile iFile;
1.177 + CWsScreenDevice* iScreen;
1.178 + RWindow* iWindow;
1.179 + RWsSession iWs;
1.180 + RWindowGroup iRootWindow;
1.181 + RFileLogger iFileLogger;
1.182 + TInt iScreenNumber;
1.183 + TBool iSupportVideoPlayerUtility2;
1.184 + CVideoPlayerUtility* iCurrentVideoPlayer;
1.185 + RBuf iFileName;
1.186 + TUid iControllerUid;
1.187 + TBool iRequestNotify;
1.188 +#ifdef SYMBIAN_MULTIMEDIA_SUBTITLE_SUPPORT
1.189 + TBool iEnableSubtitlesOnAdd;
1.190 +#endif //SYMBIAN_MULTIMEDIA_SUBTITLE_SUPPORT
1.191 +};
1.192 +
1.193 +
1.194 +
1.195 +
1.196 +#endif // MVSVIDEOPLAYAGENT_H