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