os/mm/mmlibs/mmfw/tsrc/mmfunittest/DevVideo/src/TestDevVideoPlugins/decoder.h
changeset 0 bde4ae8d615e
     1.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.2 +++ b/os/mm/mmlibs/mmfw/tsrc/mmfunittest/DevVideo/src/TestDevVideoPlugins/decoder.h	Fri Jun 15 03:10:57 2012 +0200
     1.3 @@ -0,0 +1,151 @@
     1.4 +// Copyright (c) 2003-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 +//
    1.18 +
    1.19 +
    1.20 +#ifndef __DECODER_H__
    1.21 +#define __DECODER_H__
    1.22 +
    1.23 +#include <mmf/devvideo/videoplayhwdevice.h>
    1.24 +#include "TestPluginUIDs.hrh"
    1.25 +
    1.26 +enum TDecoderPanicCategory
    1.27 +	{
    1.28 +	EDecoderPanicInitialize = 0,
    1.29 +	EDecoderPanicClockSource,
    1.30 +	EDecoderPanicSynchronizeDecoding,
    1.31 +	EDecoderPanicHrdVbvSpec,
    1.32 +	EDecoderPanicHrdVbvParams,
    1.33 +	EDecoderPanicScreenClipRegion,
    1.34 +	EDecoderPanicPauseClipFail,
    1.35 +	EDecoderPanicSetPosition,
    1.36 +	EDecoderPanicFreezePicture,
    1.37 +	EDecoderPanicReleaseFreeze,
    1.38 +	EDecoderPanicComplexityLevel,
    1.39 +	EDecoderPanicComplexityLevelInfo,
    1.40 +	EDecoderPanicPictureHeader,
    1.41 +	EDecoderPanicPictureHeaderOptions,
    1.42 +	EDecoderPanicPictureHeaderTimestamp,
    1.43 +	EDecoderPanicTimedSnapshot,
    1.44 +	EDecoderPanicTimedSnapshotId,
    1.45 +	EDecoderPanicCancelTimedSnapshot,
    1.46 +	EDecoderPanicSupportedSnapshotFormats
    1.47 +	};
    1.48 +
    1.49 +const TUid KUidDevVideoTestDecodeHwDevice = {KUidDevVideoTestDecodeHwDeviceDefine1}; //This is the only real plugin
    1.50 +const TUid KUidDevVideoTestDecodeHwDevice1 = {KUidDevVideoTestDecodeHwDeviceDefine1};
    1.51 +const TUid KUidDevVideoTestDecodeHwDevice2 = {KUidDevVideoTestDecodeHwDeviceDefine2};
    1.52 +const TUid KUidDevVideoTestDecodeHwDevice3 = {KUidDevVideoTestDecodeHwDeviceDefine3};
    1.53 +const TUid KUidDevVideoTestDecodeHwDevice4 = {KUidDevVideoTestDecodeHwDeviceDefine4};
    1.54 +const TUid KUidDevVideoTestDecodeHwDevice5 = {KUidDevVideoTestDecodeHwDeviceDefine5};
    1.55 +const TInt KDecoderDefaultScreenNumber = 0;
    1.56 +const TInt KDecoderSecondaryScreenNumber = 1;
    1.57 +
    1.58 +class CMMFTestVideoDecodeHwDevice : public CMMFVideoDecodeHwDevice, public MMMFVideoPlayHwDeviceExtensionScanCopy
    1.59 +	{
    1.60 +public:
    1.61 +	static CMMFVideoDecodeHwDevice* NewL(TAny* aInitParams);
    1.62 +	~CMMFTestVideoDecodeHwDevice();
    1.63 +
    1.64 +	// from CMMFVideoHwDevice
    1.65 +    TAny* CustomInterface(TUid aInterface);
    1.66 +
    1.67 +	// from CMMFVideoPlayHwDevice
    1.68 +	CPostProcessorInfo* PostProcessorInfoLC();
    1.69 +	void GetOutputFormatListL(RArray<TUncompressedVideoFormat>& aFormats);
    1.70 +	void SetOutputFormatL(const TUncompressedVideoFormat &aFormat);
    1.71 +	void SetPostProcessTypesL(TUint32 aPostProcCombination);
    1.72 +	void SetInputCropOptionsL(const TRect& aRect);
    1.73 +	void SetYuvToRgbOptionsL(const TYuvToRgbOptions& aOptions, const TYuvFormat& aYuvFormat, TRgbFormat aRgbFormat);
    1.74 +	void SetYuvToRgbOptionsL(const TYuvToRgbOptions& aOptions);
    1.75 +	void SetRotateOptionsL(TRotationType aRotationType);
    1.76 +	void SetScaleOptionsL(const TSize& aTargetSize, TBool aAntiAliasFiltering);
    1.77 +	void SetOutputCropOptionsL(const TRect& aRect);
    1.78 +	void SetPostProcSpecificOptionsL(const TDesC8& aOptions);
    1.79 +	void SetClockSource(MMMFClockSource* aClock);
    1.80 +	void SetVideoDestScreenL(TBool aScreen);
    1.81 +	void Initialize();
    1.82 +	void StartDirectScreenAccessL(const TRect& aVideoRect, CFbsScreenDevice& aScreenDevice, const TRegion& aClipRegion);
    1.83 +	void SetScreenClipRegion(const TRegion& aRegion);
    1.84 +	void SetPauseOnClipFail(TBool aPause);
    1.85 +	void AbortDirectScreenAccess();
    1.86 +	TBool IsPlaying();
    1.87 +	void Redraw();
    1.88 +	void Start();
    1.89 +	void Stop();
    1.90 +	void Pause();
    1.91 +	void Resume();
    1.92 +	void SetPosition(const TTimeIntervalMicroSeconds& aPlaybackPosition);
    1.93 +	void FreezePicture(const TTimeIntervalMicroSeconds& aTimestamp);
    1.94 +	void ReleaseFreeze(const TTimeIntervalMicroSeconds& aTimestamp);
    1.95 +	TTimeIntervalMicroSeconds PlaybackPosition();
    1.96 +	TUint PictureBufferBytes();
    1.97 +	void GetPictureCounters(CMMFDevVideoPlay::TPictureCounters& aCounters);
    1.98 +	void SetComplexityLevel(TUint aLevel);
    1.99 +	TUint NumComplexityLevels();
   1.100 +	void GetComplexityLevelInfo(TUint aLevel, CMMFDevVideoPlay::TComplexityLevelInfo& aInfo);
   1.101 +	void ReturnPicture(TVideoPicture* aPicture);
   1.102 +	TBool GetSnapshotL(TPictureData& aPictureData, const TUncompressedVideoFormat& aFormat);
   1.103 +	void GetTimedSnapshotL(TPictureData* aPictureData, const TUncompressedVideoFormat& aFormat, const TTimeIntervalMicroSeconds& aPresentationTimestamp);
   1.104 +	void GetTimedSnapshotL(TPictureData* aPictureData, const TUncompressedVideoFormat& aFormat, const TPictureId& aPictureId);
   1.105 +	void CancelTimedSnapshot();
   1.106 +	void GetSupportedSnapshotFormatsL(RArray<TUncompressedVideoFormat>& aFormats);
   1.107 +	void InputEnd();
   1.108 +	void CommitL();
   1.109 +	void Revert();
   1.110 +
   1.111 +	// from CMMFVideoDecodeHwDevice
   1.112 +    CVideoDecoderInfo* VideoDecoderInfoLC();
   1.113 +	TVideoPictureHeader* GetHeaderInformationL(TVideoDataUnitType aDataUnitType, TVideoDataUnitEncapsulation aEncapsulation, TVideoInputBuffer* aDataUnit);
   1.114 +    void ReturnHeader(TVideoPictureHeader* aHeader);
   1.115 +    void SetInputFormatL(const CCompressedVideoFormat& aFormat, TVideoDataUnitType aDataUnitType, TVideoDataUnitEncapsulation aEncapsulation, TBool aDataInOrder);
   1.116 +    void SynchronizeDecoding(TBool aSynchronize);
   1.117 +    void SetBufferOptionsL(const CMMFDevVideoPlay::TBufferOptions& aOptions);
   1.118 +    void GetBufferOptions(CMMFDevVideoPlay::TBufferOptions& aOptions);
   1.119 +    void SetHrdVbvSpec(THrdVbvSpecification aHrdVbvSpec, const TDesC8& aHrdVbvParams);
   1.120 +    void SetOutputDevice(CMMFVideoPostProcHwDevice* aDevice);
   1.121 +    TTimeIntervalMicroSeconds DecodingPosition();
   1.122 +    TUint PreDecoderBufferBytes();
   1.123 +    void GetBitstreamCounters(CMMFDevVideoPlay::TBitstreamCounters& aCounters);
   1.124 +    TUint NumFreeBuffers();
   1.125 +    TVideoInputBuffer* GetBufferL(TUint aBufferSize);
   1.126 +    void WriteCodedDataL(TVideoInputBuffer* aBuffer);
   1.127 +	void SetProxy(MMMFDevVideoPlayProxy& aProxy);
   1.128 +	void ConfigureDecoderL(const TVideoPictureHeader& aVideoPictureHeader);
   1.129 +
   1.130 +//from MMMFVideoPlayHwDeviceExtensionScanCopy
   1.131 +	void WriteCodedDataL(TVideoInputBuffer* aBuffer, TFramePortion aPortion = EFramePortionUnknown);
   1.132 +	void ScanAndCopyCodedDataL(TPtr8 aCodedData, TVideoInputBuffer* aBuffer, TInt& aConsumed, TFramePortion aPortion = EFramePortionUnknown);
   1.133 +
   1.134 +private:
   1.135 +	CMMFTestVideoDecodeHwDevice();
   1.136 +private:
   1.137 +	MMMFDevVideoPlayProxy* iProxy;
   1.138 +
   1.139 +	RArray<CCompressedVideoFormat*> iVidFormats;
   1.140 +	RArray<TPictureRateAndSize> iPictureRates;
   1.141 +	// For post-proc info 
   1.142 +	RArray<TScaleFactor> iScaleFactors;
   1.143 +	RArray<TUncompressedVideoFormat> iPostProcVidFormats;
   1.144 +	RArray<TUint32> iCombinations;
   1.145 +	
   1.146 +	TVideoPictureHeader iPictureHeader;
   1.147 +	TVideoInputBuffer iInputBuffer;
   1.148 +	TBool iIsPlaying;
   1.149 +	TUid iExtensionUid;
   1.150 +
   1.151 +	HBufC8* iBufferDataArea;
   1.152 +	};
   1.153 +
   1.154 +#endif