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".
8 // Initial Contributors:
9 // Nokia Corporation - initial contribution.
20 #include <mmf/devvideo/videoplayhwdevice.h>
21 #include "TestPluginUIDs.hrh"
23 enum TDecoderPanicCategory
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
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;
55 class CMMFTestVideoDecodeHwDevice : public CMMFVideoDecodeHwDevice, public MMMFVideoPlayHwDeviceExtensionScanCopy
58 static CMMFVideoDecodeHwDevice* NewL(TAny* aInitParams);
59 ~CMMFTestVideoDecodeHwDevice();
61 // from CMMFVideoHwDevice
62 TAny* CustomInterface(TUid aInterface);
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);
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();
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);
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);
127 //from MMMFVideoPlayHwDeviceExtensionScanCopy
128 void WriteCodedDataL(TVideoInputBuffer* aBuffer, TFramePortion aPortion = EFramePortionUnknown);
129 void ScanAndCopyCodedDataL(TPtr8 aCodedData, TVideoInputBuffer* aBuffer, TInt& aConsumed, TFramePortion aPortion = EFramePortionUnknown);
132 CMMFTestVideoDecodeHwDevice();
134 MMMFDevVideoPlayProxy* iProxy;
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;
143 TVideoPictureHeader iPictureHeader;
144 TVideoInputBuffer iInputBuffer;
148 HBufC8* iBufferDataArea;