⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 videoengine.h

📁 symbian video 的 实现
💻 H
字号:
/*
* ============================================================================
*  Name			: CVideoEngine.h
*  Part of		: Video
*  Created		: 10/14/2003 by Forum Nokia
*  Implementation notes:
*  Description	: Video engine
*  Version		:
*  Copyright	: Nokia Corporation, 2003
* ============================================================================
*/

#ifndef __VIDEO_ENGINE_H__
#define __VIDEO_ENGINE_H__

#include <e32base.h>
#include <VideoPlayer.h>

class CVideoPlayerUtility;
class MPlayerUIControllerListener;
class CDocumentHandler;
class CVideoFileDetails;
class DRMCommon;
class CHeartbeat;

enum TPlayerErrCode
	{
	KErrReOpen = 101,
	KErrAutoDisconnect,
	KErrAudioLost
	};

// UI controller states
enum TPlayState
    {
    EPNotInitialised,
    EPInitialising,
    EPStopped,
    EPPlaying,     
    EPPaused
    };

/**
 *  CVideoEngine class
 *  Used to load, play, stop and pause a video clip
 */
class CVideoEngine : public MVideoPlayerUtilityObserver, public MBeating, public CBase
{
	private:
		/**
		 * Constructor	
		 */
		CVideoEngine( );

		/** 
		 * Second phase constructor
		 */
		void ConstructL();

	public:
		/**
		 *	Destructor
		 */
		~CVideoEngine();

	public:  // New function
		/**
		 * Stop a playing video clip	
		 */
		void DoStop();

		/**
		 * Play a vide clip	
		 */
		void DoPlayL();

		/** 
		 * Set the new video file to be played
		 */
		void SetNewFileL(const TDesC& aFileName);

		/** 
		 * Two-phased constructor	
		 */
		static CVideoEngine* NewL( );

		/** 
		 * Pause a playing video clip
		 */
	    void DoPauseL();

		/**
		 * Get the engine state
		 * @Return return the engine state, playing, paused, stopped...
		 */
	    TInt GetEngineState();

		/**
		 * Returns a document handler	
		 */
	    CDocumentHandler& DocumentHandlerL();

        /**
         * Initializes controller. Sets the Display Window, area of 
         * the display to render the current video frame.
         * @param aCallback UI controller callback
         * @param aWs A session with the window server
         * @param aScreenDevice The screen device
         * @param aWindow The window to display
         * @param aWindowRect The rectangle to display
         * @param aClipRect The clip rectangle
         * @leaves Can leave with one of the system wide error codes
         * @return void
         */
        void InitControllerL( MPlayerUIControllerListener* aCallback,
                              RWsSession& aWs,
                              CWsScreenDevice& aScreenDevice,
                              RWindowBase& aWindow,
                              TRect& aScreenRect,
                              TRect& aClipRect);                                    

    public: // Functions from MBeating

        /** 
		 * See MBeating::Beat() 
		 */
        void Beat();
        
        /** 
		 * See MBeating::Synchronize() 
		 */
        void Synchronize();

    public: // Functions from MVideoPlayerUtilityObserver

        /** 
		 * See MVideoPlayerUtilityObserver::MvpuoOpenComplete 
		 */
        void MvpuoOpenComplete(TInt aError);

        /** 
		 * See MVideoPlayerUtilityObserver::MvpuoPrepareComplete 
		 */
        void MvpuoPrepareComplete(TInt aError);

        /** 
		 * See MVideoPlayerUtilityObserver::MvpuoFrameReady 
		 */
        void MvpuoFrameReady(CFbsBitmap& aFrame,TInt aError);

        /** 
		 * See MVideoPlayerUtilityObserver::MvpuoPlayComplete 
		 */
        void MvpuoPlayComplete(TInt aError);
        
        /** 
		 * See MVideoPlayerUtilityObserver::MvpuoEvent 
		 */
        void MvpuoEvent(const TMMFEvent& aEvent);
	
	private:

		// Video player uitility
		CVideoPlayerUtility*	iPlayer;
		HBufC*	iMediaFile;

		// The vide file details
		CVideoFileDetails* iFileDetails;

		// The state of video player engine
		TPlayState iMyState;

		// The UI listener for the video engine
		MPlayerUIControllerListener* iCallback;

		// Document handler
		CDocumentHandler* iDocHandler;

		// Update the time progress when video is playing
		CHeartbeat* iProgressUpdater;  

		// The poistion of a playing video clip
		TInt64 iPlayPosition;
};

#endif // __VIDEO_ENGINE_H__

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -