os/mm/mmdevicefw/mdf/src/video/hwdevicevideoutils/mdfplayerengine.h
author sl@SLION-WIN7.fritz.box
Fri, 15 Jun 2012 03:10:57 +0200
changeset 0 bde4ae8d615e
permissions -rw-r--r--
First public contribution.
     1 // Copyright (c) 2006-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 //
    15 
    16 #ifndef MDFPLAYERENGINE_H
    17 #define MDFPLAYERENGINE_H
    18 
    19 #include <e32base.h>
    20 
    21 class MMdfVideoPlayerHwDeviceObserver
    22 	{
    23 public:
    24 	/** Get system time. May come from a local or external source.
    25 	@return The system time as a TUint.
    26 	*/
    27 	virtual TUint Time() const = 0;
    28 		
    29 	/** 
    30 	Is a frame (a decoded picture) available.
    31 	@return ETrue if a frame is available.
    32 	*/
    33 	virtual TBool FrameAvailable() const = 0;
    34 
    35 	/** 
    36 	Displays a frame.
    37 	*/
    38 	virtual void DisplayFrame() = 0;
    39 
    40 	/** 
    41 	Discards a frame.
    42 	*/
    43 	virtual void DiscardFrame() = 0;
    44 	};
    45 
    46 /**
    47 Video player engine.
    48 This manages the playing of decoded frames for the DevVideo hardware device.
    49 @internalComponent
    50 */
    51 class CMdfVideoPlayerEngine : public CBase
    52 	{
    53 public:
    54 	static CMdfVideoPlayerEngine* NewL(MMdfVideoPlayerHwDeviceObserver& aDeviceObserver);
    55 	~CMdfVideoPlayerEngine();
    56 
    57 	void StartL(TUint aFrameRate);
    58 	void Stop();
    59 	TInt FrameRate();
    60 	TInt FrameCount();
    61 
    62 private:
    63 	CMdfVideoPlayerEngine(MMdfVideoPlayerHwDeviceObserver& aDeviceObserver);
    64 	void ConstructL();
    65 	static TInt DisplayFrame(TAny* aObject);
    66 	void DoDisplayFrame();
    67 public:
    68 	// indicate that player should run unsynchronized
    69 	static const TInt KUnsynchronized = -1;
    70 		
    71 private:
    72 	// the maximum frame rate of the engine, in fps
    73 	// NB the actual maximum frame rate of the decoder may be higher.
    74 	static const TInt KMaxFrameRate = 100;
    75 	
    76 	// tick timer to manage playback
    77 	CPeriodic* iTimer;
    78 	TUint iStartTime;
    79 	
    80 	// actual frame rate
    81 	TInt iFrameRate;
    82 	
    83 	// count of frames processed by the engine
    84 	TInt iFrameCount;
    85 	
    86 	// the HwDevice observer
    87 	MMdfVideoPlayerHwDeviceObserver& iDeviceObserver;
    88 	};
    89 
    90 #endif // MDFPLAYERENGINE_H