os/mm/mmdevicefw/mdf/src/video/hwdevicevideoutils/mdfplayerengine.h
author sl
Tue, 10 Jun 2014 14:32:02 +0200
changeset 1 260cb5ec6c19
permissions -rw-r--r--
Update contrib.
sl@0
     1
// Copyright (c) 2006-2009 Nokia Corporation and/or its subsidiary(-ies).
sl@0
     2
// All rights reserved.
sl@0
     3
// This component and the accompanying materials are made available
sl@0
     4
// under the terms of "Eclipse Public License v1.0"
sl@0
     5
// which accompanies this distribution, and is available
sl@0
     6
// at the URL "http://www.eclipse.org/legal/epl-v10.html".
sl@0
     7
//
sl@0
     8
// Initial Contributors:
sl@0
     9
// Nokia Corporation - initial contribution.
sl@0
    10
//
sl@0
    11
// Contributors:
sl@0
    12
//
sl@0
    13
// Description:
sl@0
    14
//
sl@0
    15
sl@0
    16
#ifndef MDFPLAYERENGINE_H
sl@0
    17
#define MDFPLAYERENGINE_H
sl@0
    18
sl@0
    19
#include <e32base.h>
sl@0
    20
sl@0
    21
class MMdfVideoPlayerHwDeviceObserver
sl@0
    22
	{
sl@0
    23
public:
sl@0
    24
	/** Get system time. May come from a local or external source.
sl@0
    25
	@return The system time as a TUint.
sl@0
    26
	*/
sl@0
    27
	virtual TUint Time() const = 0;
sl@0
    28
		
sl@0
    29
	/** 
sl@0
    30
	Is a frame (a decoded picture) available.
sl@0
    31
	@return ETrue if a frame is available.
sl@0
    32
	*/
sl@0
    33
	virtual TBool FrameAvailable() const = 0;
sl@0
    34
sl@0
    35
	/** 
sl@0
    36
	Displays a frame.
sl@0
    37
	*/
sl@0
    38
	virtual void DisplayFrame() = 0;
sl@0
    39
sl@0
    40
	/** 
sl@0
    41
	Discards a frame.
sl@0
    42
	*/
sl@0
    43
	virtual void DiscardFrame() = 0;
sl@0
    44
	};
sl@0
    45
sl@0
    46
/**
sl@0
    47
Video player engine.
sl@0
    48
This manages the playing of decoded frames for the DevVideo hardware device.
sl@0
    49
@internalComponent
sl@0
    50
*/
sl@0
    51
class CMdfVideoPlayerEngine : public CBase
sl@0
    52
	{
sl@0
    53
public:
sl@0
    54
	static CMdfVideoPlayerEngine* NewL(MMdfVideoPlayerHwDeviceObserver& aDeviceObserver);
sl@0
    55
	~CMdfVideoPlayerEngine();
sl@0
    56
sl@0
    57
	void StartL(TUint aFrameRate);
sl@0
    58
	void Stop();
sl@0
    59
	TInt FrameRate();
sl@0
    60
	TInt FrameCount();
sl@0
    61
sl@0
    62
private:
sl@0
    63
	CMdfVideoPlayerEngine(MMdfVideoPlayerHwDeviceObserver& aDeviceObserver);
sl@0
    64
	void ConstructL();
sl@0
    65
	static TInt DisplayFrame(TAny* aObject);
sl@0
    66
	void DoDisplayFrame();
sl@0
    67
public:
sl@0
    68
	// indicate that player should run unsynchronized
sl@0
    69
	static const TInt KUnsynchronized = -1;
sl@0
    70
		
sl@0
    71
private:
sl@0
    72
	// the maximum frame rate of the engine, in fps
sl@0
    73
	// NB the actual maximum frame rate of the decoder may be higher.
sl@0
    74
	static const TInt KMaxFrameRate = 100;
sl@0
    75
	
sl@0
    76
	// tick timer to manage playback
sl@0
    77
	CPeriodic* iTimer;
sl@0
    78
	TUint iStartTime;
sl@0
    79
	
sl@0
    80
	// actual frame rate
sl@0
    81
	TInt iFrameRate;
sl@0
    82
	
sl@0
    83
	// count of frames processed by the engine
sl@0
    84
	TInt iFrameCount;
sl@0
    85
	
sl@0
    86
	// the HwDevice observer
sl@0
    87
	MMdfVideoPlayerHwDeviceObserver& iDeviceObserver;
sl@0
    88
	};
sl@0
    89
sl@0
    90
#endif // MDFPLAYERENGINE_H