os/mm/mmlibs/mmfw/tsrc/mmfunittest/DevVideo/src/TestDevVideoPlugins/decoder.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.
sl@0
     1
// Copyright (c) 2003-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
sl@0
    17
#ifndef __DECODER_H__
sl@0
    18
#define __DECODER_H__
sl@0
    19
sl@0
    20
#include <mmf/devvideo/videoplayhwdevice.h>
sl@0
    21
#include "TestPluginUIDs.hrh"
sl@0
    22
sl@0
    23
enum TDecoderPanicCategory
sl@0
    24
	{
sl@0
    25
	EDecoderPanicInitialize = 0,
sl@0
    26
	EDecoderPanicClockSource,
sl@0
    27
	EDecoderPanicSynchronizeDecoding,
sl@0
    28
	EDecoderPanicHrdVbvSpec,
sl@0
    29
	EDecoderPanicHrdVbvParams,
sl@0
    30
	EDecoderPanicScreenClipRegion,
sl@0
    31
	EDecoderPanicPauseClipFail,
sl@0
    32
	EDecoderPanicSetPosition,
sl@0
    33
	EDecoderPanicFreezePicture,
sl@0
    34
	EDecoderPanicReleaseFreeze,
sl@0
    35
	EDecoderPanicComplexityLevel,
sl@0
    36
	EDecoderPanicComplexityLevelInfo,
sl@0
    37
	EDecoderPanicPictureHeader,
sl@0
    38
	EDecoderPanicPictureHeaderOptions,
sl@0
    39
	EDecoderPanicPictureHeaderTimestamp,
sl@0
    40
	EDecoderPanicTimedSnapshot,
sl@0
    41
	EDecoderPanicTimedSnapshotId,
sl@0
    42
	EDecoderPanicCancelTimedSnapshot,
sl@0
    43
	EDecoderPanicSupportedSnapshotFormats
sl@0
    44
	};
sl@0
    45
sl@0
    46
const TUid KUidDevVideoTestDecodeHwDevice = {KUidDevVideoTestDecodeHwDeviceDefine1}; //This is the only real plugin
sl@0
    47
const TUid KUidDevVideoTestDecodeHwDevice1 = {KUidDevVideoTestDecodeHwDeviceDefine1};
sl@0
    48
const TUid KUidDevVideoTestDecodeHwDevice2 = {KUidDevVideoTestDecodeHwDeviceDefine2};
sl@0
    49
const TUid KUidDevVideoTestDecodeHwDevice3 = {KUidDevVideoTestDecodeHwDeviceDefine3};
sl@0
    50
const TUid KUidDevVideoTestDecodeHwDevice4 = {KUidDevVideoTestDecodeHwDeviceDefine4};
sl@0
    51
const TUid KUidDevVideoTestDecodeHwDevice5 = {KUidDevVideoTestDecodeHwDeviceDefine5};
sl@0
    52
const TInt KDecoderDefaultScreenNumber = 0;
sl@0
    53
const TInt KDecoderSecondaryScreenNumber = 1;
sl@0
    54
sl@0
    55
class CMMFTestVideoDecodeHwDevice : public CMMFVideoDecodeHwDevice, public MMMFVideoPlayHwDeviceExtensionScanCopy
sl@0
    56
	{
sl@0
    57
public:
sl@0
    58
	static CMMFVideoDecodeHwDevice* NewL(TAny* aInitParams);
sl@0
    59
	~CMMFTestVideoDecodeHwDevice();
sl@0
    60
sl@0
    61
	// from CMMFVideoHwDevice
sl@0
    62
    TAny* CustomInterface(TUid aInterface);
sl@0
    63
sl@0
    64
	// from CMMFVideoPlayHwDevice
sl@0
    65
	CPostProcessorInfo* PostProcessorInfoLC();
sl@0
    66
	void GetOutputFormatListL(RArray<TUncompressedVideoFormat>& aFormats);
sl@0
    67
	void SetOutputFormatL(const TUncompressedVideoFormat &aFormat);
sl@0
    68
	void SetPostProcessTypesL(TUint32 aPostProcCombination);
sl@0
    69
	void SetInputCropOptionsL(const TRect& aRect);
sl@0
    70
	void SetYuvToRgbOptionsL(const TYuvToRgbOptions& aOptions, const TYuvFormat& aYuvFormat, TRgbFormat aRgbFormat);
sl@0
    71
	void SetYuvToRgbOptionsL(const TYuvToRgbOptions& aOptions);
sl@0
    72
	void SetRotateOptionsL(TRotationType aRotationType);
sl@0
    73
	void SetScaleOptionsL(const TSize& aTargetSize, TBool aAntiAliasFiltering);
sl@0
    74
	void SetOutputCropOptionsL(const TRect& aRect);
sl@0
    75
	void SetPostProcSpecificOptionsL(const TDesC8& aOptions);
sl@0
    76
	void SetClockSource(MMMFClockSource* aClock);
sl@0
    77
	void SetVideoDestScreenL(TBool aScreen);
sl@0
    78
	void Initialize();
sl@0
    79
	void StartDirectScreenAccessL(const TRect& aVideoRect, CFbsScreenDevice& aScreenDevice, const TRegion& aClipRegion);
sl@0
    80
	void SetScreenClipRegion(const TRegion& aRegion);
sl@0
    81
	void SetPauseOnClipFail(TBool aPause);
sl@0
    82
	void AbortDirectScreenAccess();
sl@0
    83
	TBool IsPlaying();
sl@0
    84
	void Redraw();
sl@0
    85
	void Start();
sl@0
    86
	void Stop();
sl@0
    87
	void Pause();
sl@0
    88
	void Resume();
sl@0
    89
	void SetPosition(const TTimeIntervalMicroSeconds& aPlaybackPosition);
sl@0
    90
	void FreezePicture(const TTimeIntervalMicroSeconds& aTimestamp);
sl@0
    91
	void ReleaseFreeze(const TTimeIntervalMicroSeconds& aTimestamp);
sl@0
    92
	TTimeIntervalMicroSeconds PlaybackPosition();
sl@0
    93
	TUint PictureBufferBytes();
sl@0
    94
	void GetPictureCounters(CMMFDevVideoPlay::TPictureCounters& aCounters);
sl@0
    95
	void SetComplexityLevel(TUint aLevel);
sl@0
    96
	TUint NumComplexityLevels();
sl@0
    97
	void GetComplexityLevelInfo(TUint aLevel, CMMFDevVideoPlay::TComplexityLevelInfo& aInfo);
sl@0
    98
	void ReturnPicture(TVideoPicture* aPicture);
sl@0
    99
	TBool GetSnapshotL(TPictureData& aPictureData, const TUncompressedVideoFormat& aFormat);
sl@0
   100
	void GetTimedSnapshotL(TPictureData* aPictureData, const TUncompressedVideoFormat& aFormat, const TTimeIntervalMicroSeconds& aPresentationTimestamp);
sl@0
   101
	void GetTimedSnapshotL(TPictureData* aPictureData, const TUncompressedVideoFormat& aFormat, const TPictureId& aPictureId);
sl@0
   102
	void CancelTimedSnapshot();
sl@0
   103
	void GetSupportedSnapshotFormatsL(RArray<TUncompressedVideoFormat>& aFormats);
sl@0
   104
	void InputEnd();
sl@0
   105
	void CommitL();
sl@0
   106
	void Revert();
sl@0
   107
sl@0
   108
	// from CMMFVideoDecodeHwDevice
sl@0
   109
    CVideoDecoderInfo* VideoDecoderInfoLC();
sl@0
   110
	TVideoPictureHeader* GetHeaderInformationL(TVideoDataUnitType aDataUnitType, TVideoDataUnitEncapsulation aEncapsulation, TVideoInputBuffer* aDataUnit);
sl@0
   111
    void ReturnHeader(TVideoPictureHeader* aHeader);
sl@0
   112
    void SetInputFormatL(const CCompressedVideoFormat& aFormat, TVideoDataUnitType aDataUnitType, TVideoDataUnitEncapsulation aEncapsulation, TBool aDataInOrder);
sl@0
   113
    void SynchronizeDecoding(TBool aSynchronize);
sl@0
   114
    void SetBufferOptionsL(const CMMFDevVideoPlay::TBufferOptions& aOptions);
sl@0
   115
    void GetBufferOptions(CMMFDevVideoPlay::TBufferOptions& aOptions);
sl@0
   116
    void SetHrdVbvSpec(THrdVbvSpecification aHrdVbvSpec, const TDesC8& aHrdVbvParams);
sl@0
   117
    void SetOutputDevice(CMMFVideoPostProcHwDevice* aDevice);
sl@0
   118
    TTimeIntervalMicroSeconds DecodingPosition();
sl@0
   119
    TUint PreDecoderBufferBytes();
sl@0
   120
    void GetBitstreamCounters(CMMFDevVideoPlay::TBitstreamCounters& aCounters);
sl@0
   121
    TUint NumFreeBuffers();
sl@0
   122
    TVideoInputBuffer* GetBufferL(TUint aBufferSize);
sl@0
   123
    void WriteCodedDataL(TVideoInputBuffer* aBuffer);
sl@0
   124
	void SetProxy(MMMFDevVideoPlayProxy& aProxy);
sl@0
   125
	void ConfigureDecoderL(const TVideoPictureHeader& aVideoPictureHeader);
sl@0
   126
sl@0
   127
//from MMMFVideoPlayHwDeviceExtensionScanCopy
sl@0
   128
	void WriteCodedDataL(TVideoInputBuffer* aBuffer, TFramePortion aPortion = EFramePortionUnknown);
sl@0
   129
	void ScanAndCopyCodedDataL(TPtr8 aCodedData, TVideoInputBuffer* aBuffer, TInt& aConsumed, TFramePortion aPortion = EFramePortionUnknown);
sl@0
   130
sl@0
   131
private:
sl@0
   132
	CMMFTestVideoDecodeHwDevice();
sl@0
   133
private:
sl@0
   134
	MMMFDevVideoPlayProxy* iProxy;
sl@0
   135
sl@0
   136
	RArray<CCompressedVideoFormat*> iVidFormats;
sl@0
   137
	RArray<TPictureRateAndSize> iPictureRates;
sl@0
   138
	// For post-proc info 
sl@0
   139
	RArray<TScaleFactor> iScaleFactors;
sl@0
   140
	RArray<TUncompressedVideoFormat> iPostProcVidFormats;
sl@0
   141
	RArray<TUint32> iCombinations;
sl@0
   142
	
sl@0
   143
	TVideoPictureHeader iPictureHeader;
sl@0
   144
	TVideoInputBuffer iInputBuffer;
sl@0
   145
	TBool iIsPlaying;
sl@0
   146
	TUid iExtensionUid;
sl@0
   147
sl@0
   148
	HBufC8* iBufferDataArea;
sl@0
   149
	};
sl@0
   150
sl@0
   151
#endif