Update contrib.
2 * Copyright (c) 2005-2009 Nokia Corporation and/or its subsidiary(-ies).
4 * This component and the accompanying materials are made available
5 * under the terms of "Eclipse Public License v1.0"
6 * which accompanies this distribution, and is available
7 * at the URL "http://www.eclipse.org/legal/epl-v10.html".
9 * Initial Contributors:
10 * Nokia Corporation - initial contribution.
20 #ifndef T_CMMFDEVVIDEODATA_H
21 #define T_CMMFDEVVIDEODATA_H
27 #include <videoplayhwdevice.h>
28 #include <devvideoplay.h>
29 #include <devvideobase.h>
30 #include <bitdev.h> // for display device
33 #include "datawrapperbase.h"
34 #include "t_devvideoconstants.h"
35 #include "H264DecTestEngine.h"
37 enum TVideoDecoderOutput
43 //Forward declarations
44 class CT_CMMFDevVideoPlay;
46 //Engine observer handle Async request completeion and release waitclass of Test scriptor
48 class CEngineObserver: public CBase, public MVDecEngineObserver
51 void MvdeStreamEndReached();
52 void MvdeSetError(TInt aError);
54 CEngineObserver(CT_CMMFDevVideoPlay& aTestClass);
57 CT_CMMFDevVideoPlay& iTestClass;
61 * Test Active Notification class
64 class CT_CMMFDevVideoPlay : public CDataWrapperBase, MMMFDevVideoPlayObserver
68 ~CT_CMMFDevVideoPlay();
69 virtual TAny* GetObject();
70 virtual TBool DoCommandL(const TTEFFunction& aCommand, const TTEFSectionName& aSection, const TInt aAsyncErrorIndex);
71 static CT_CMMFDevVideoPlay* NewL();
73 TInt ReadOneCodedPicture(TVideoInputBuffer* aCodedInBuffer, TInt aSize);
74 TInt ReadOneCodedPicture(TVideoInputBuffer* aCodedInBuffer);
75 TInt ReadRawPicture();
76 void OpenFileL(TFileName& aInFileName);
77 void OpenFileL(TFileName& aOutFileName, TFileName& aInFileName);
79 void ListFrameSizeL(TVideoCodec aCodec);
80 void AbortDirectScreenAccess();
81 void StartDirectScreenAccessL();
82 void HandleRuntimeError(TInt aError);
83 void SaveAndReturnPicture();
84 void GetReturnedPicture();
85 void FillAndSendBufferL();
86 void GetInputBuffer();
87 void HandleNewBufferL();
88 void SetWindowRect(TInt aX, TInt aY, TSize aSize);
89 void CreateFiles(const TTEFSectionName& aSection);
90 void InitializeParamsL(const TTEFSectionName& aSection);
91 void MdvpoNewBuffers();
92 void MdvpoReturnPicture(TVideoPicture* aPicture);
93 void MdvpoSupplementalInformation(const TDesC8& aData, const TTimeIntervalMicroSeconds& aTimestamp, const TPictureId& aPictureId);
94 void MdvpoPictureLoss();
95 void MdvpoPictureLoss(const TArray<TPictureId>& aPictures);
96 void MdvpoSliceLoss(TUint aFirstMacroblock, TUint aNumMacroblocks, const TPictureId& aPicture);
97 void MdvpoReferencePictureSelection(const TDesC8& aSelectionData);
98 void MdvpoTimedSnapshotComplete(TInt aError, TPictureData* aPictureData, const TTimeIntervalMicroSeconds& aPresentationTimestamp, const TPictureId& aPictureId);
99 void MdvpoNewPictures();
100 void MdvpoFatalError(TInt aError);
101 void MdvpoInitComplete(TInt aError);
102 void MdvpoStreamEnd();
104 CT_CMMFDevVideoPlay();
107 void DoCmdInitialize(const TInt aAsyncErrorIndex);
108 void DoCmdStart(const TInt aAsyncErrorIndex);
112 void DoCmdSetRotateOptionsL(const TTEFSectionName& aSection);
113 void DoCmdSetScaleOptionsL(const TTEFSectionName& aSection);
114 void DoCmdSetPosition(const TTEFSectionName& aSection);
115 void DoCmdSetClockSource(const TTEFSectionName& aSection);
116 void DoCmdNewL(const TTEFSectionName& aSection);
117 void DoCmdSelectDecoderL(const TTEFSectionName& aSection);
118 void DoCmdSetInputFormatL(const TTEFSectionName& aSection);
119 void DoCmdSelectPostProcessorL(const TTEFSectionName& aSection);
120 void DoCmdGetOutputFormatListL(const TTEFSectionName& aSection);
121 void DoCmdPostProcessorInfoLC();
122 void DoCmdFindCommonFormat();
123 void DoCmdSetOutputFormatL(const TTEFSectionName& aSection);
124 void DoCmdGetHeaderInformationL(const TTEFSectionName& aSection);
125 void DoCmdSetVideoDestScreenL();
126 void DoCmdGetBufferOptions();
127 void DoCmdSetBufferOptionsL();
128 void DoCmdSetPostProcessTypesL(const TTEFSectionName& aSection);
129 void DoCmdReturnHeader();
130 void DoCmdDestructor();
131 void DoCmdAbortDirectScreenAccess();
132 void DoCmdStartDirectScreenAccessL(const TTEFSectionName& aSection);
133 void DoCmdUtilityGetEnvironmentL();
135 void DoCmdH264CreateDecTest(const TTEFSectionName& aSection);
136 void DoCmdH264SelectPostProcessor(const TTEFSectionName& aSection);
137 void DoCmdH264SetPostProcessTypes(const TTEFSectionName& aSection);
138 void DoCmdH264SetInputFormatCompr(const TTEFSectionName& aSection);
139 void DoCmdH264SetOutputFormat(const TTEFSectionName& aSection);
140 void DoCmdH264SetBufferOptions(const TTEFSectionName& aSection);
141 void DoCmdH264ListFrameSize();
142 void DoCmdH264SetVideoDestScreen(const TTEFSectionName& aSection);
143 void DoCmdH264SetWindowRect(const TTEFSectionName& aSection);
144 void DoCmdH264Initialize();
145 void DoCmdH264Start(const TTEFSectionName& aSection);
146 void DoCmdH264Stop();
147 void DoCmdH264Pause();
148 void DoCmdH264Resume();
149 void DoCmdH264IOFrameNumMatch();
150 void DoCmdH264FindCommonFormats();
151 void DoCmdH264GetHeaderInformation(const TTEFSectionName& aSection);
152 void DoCmdH264EnableSynchronization(const TTEFSectionName& aSection);
153 void DoCmdH264SetScaleOptions(const TTEFSectionName& aSection);
154 void DoCmdH264SetRotateOptions(const TTEFSectionName& aSection);
155 void DoCmdH264SynchronizeDecoding(const TTEFSectionName& aSection);
156 void DoCmdH264Delete();
157 void DoCmdH264SetPosition(const TTEFSectionName& aSection);
158 void DoCmdH264AbortDirectScreenAccess();
163 CMMFDevVideoPlay* iDevvp;
165 * For selected decoder
167 THwDeviceId iDecHWDevId;
169 * For selected Post processor
171 THwDeviceId iPostProcId;
173 * Size of video buffer
177 * Control the number of inputs
181 * Direct Screen Access
185 * For synchronize the clock(fps)
193 * The size of the picture
199 TInt iAsyncErrorIndex;
201 * Width and height of the video
205 * For management the Open files
209 * for get the coded buffer
211 TVideoInputBuffer* iCodedInBuffer;
215 TVideoPicture* iOutBuffer;
219 TVideoPicture* iRawInBuffer;
225 * Time interval in each frame
227 TInt64 iFrameTimeInterval;
235 TInt iReturnedBuffCount;
241 * The end of the stream
247 TVideoCodec iCodecType;
249 * Management of the time between frames
251 CSystemClockSource* iClock;
253 * Direct Access at the Screen
255 TBool iDirectScreenAccess;
257 * for handle the buffer
261 * For measurement of the frame
263 TBool iFrameMeasurement;
267 RArray<TInt> iFrameSizeList;
287 CFbsScreenDevice* iScreenDevice;
289 * Common format between Post processor and decoder
291 TUncompressedVideoFormat iCommonFormat;
293 * Decoder read from the ini file
297 * Post processor read from the ini file
299 TUid iSelectPostProcessor;
303 RArray<TUncompressedVideoFormat> iDecFormats;
305 * Post processor formats
307 RArray<TUncompressedVideoFormat> iPPFormats;
309 * Information about the post processor
311 CPostProcessorInfo* iInfo;
313 * if exist information for header info
315 TVideoPictureHeader* iHeaderInfo;
319 CMMFDevVideoPlay::TBufferOptions iBufferOptions;
323 TBool iCommonFormatFound;
325 * To Control the errors in GetInputBuffer
327 TBool iErrorInputBuffer;
331 static const TEnumEntryTable iCodecs[];
333 * Enum for Display mode
335 static const TEnumEntryTable iDisplayModes[];
339 static const TEnumEntryTable iRotations[];
341 * Enum for Video Data Unit Types
343 static const TEnumEntryTable iTVideoDataUnitType[];
345 * Enum for Video Data Unit Encapsulation
347 static const TEnumEntryTable iTVideoDataUnitEncapsulation[];
352 CVDecTestEngine* iEngine;
353 CEngineObserver* iObserver;
359 #endif // T_CMMFDEVVIDEODATA_H