Update contrib.
1 // Copyright (c) 2008-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.
16 #ifndef TSU_3GPLIBRARY_COMPOSER_API_H
17 #define TSU_3GPLIBRARY_COMPOSER_API_H
19 #include <test/testexecutestepbase.h>
20 #include <c3gplibrary.h>
22 class CActiveScheduler;
25 // Base class for testing composer. Provides a framework for:
28 // 2. Add video/audio data
31 class C3GPLibComposeBase : public CTestStep
36 TVerdict doTestStepPreambleL();
37 TVerdict doTestStepPostambleL();
38 TVerdict doTestStepL();
41 virtual C3GPCompose* doTestStepCreateComposerL();
43 virtual void doTestStepComposeOpenL(C3GPCompose& aComposer) = 0;
45 // default to do nothing & return the current test result
46 virtual void doTestStepComposeWriteVideoAudioL(C3GPCompose& aComposer);
47 virtual void doTestStepComposeSetUserDataL(C3GPCompose& aComposer);
50 CActiveScheduler* iScheduler;
54 // Setup a composer via filepath supplied by the configuration file
56 _LIT(K3GPComposeFilename, "3GPComposeFilename");
57 class C3GPLibComposeFilename : public C3GPLibComposeBase
60 C3GPLibComposeFilename();
62 TVerdict doTestStepPreambleL();
63 TVerdict doTestStepPostambleL();
66 virtual void doTestStepComposeOpenL(C3GPCompose& aComposer);
73 // Class to test execution of composer APIs without any setup.
75 _LIT(K3GPComposeWithoutOpen, "3GPComposeWithoutOpen");
76 class C3GPLibComposeWithoutOpen : public C3GPLibComposeBase
79 C3GPLibComposeWithoutOpen();
82 // virtual functions overriding base class implementations
83 void doTestStepComposeOpenL(C3GPCompose& aComposer);
84 void doTestStepComposeWriteVideoAudioL(C3GPCompose& aComposer);
85 void doTestStepComposeSetUserDataL(C3GPCompose& aComposer);
89 // Class to test composer with video/audio properties supplied by
90 // the configuration file.
92 _LIT(K3GPComposeFile, "3GPComposeFile");
93 class C3GPLibComposeFile : public C3GPLibComposeBase
98 TVerdict doTestStepPreambleL();
99 TVerdict doTestStepPostambleL();
102 virtual void doTestStepComposeOpenL(C3GPCompose& aComposer);
103 virtual void doTestStepComposeWriteVideoAudioL(C3GPCompose& aComposer);
105 T3GPVideoPropertiesBase* SetupVideoPropertiesL();
106 virtual T3GPVideoPropertiesBase* SetupAvcVideoL();
107 virtual T3GPVideoPropertiesBase* SetupH263VideoL();
108 virtual T3GPVideoPropertiesBase* SetupMpeg4VideoL();
110 T3GPAudioPropertiesBase* SetupAudioPropertiesL();
111 virtual T3GPAudioPropertiesBase* SetupQcelpAudioL();
112 virtual T3GPAudioPropertiesBase* SetupAmrAudioL();
113 virtual T3GPAudioPropertiesBase* SetupMpeg4AudioL();
116 T3GPFileFormatType iInputFileFormat; // requested file format
117 T3GPVideoType iVideoType;
118 T3GPAudioType iAudioType;
126 // Class to compose file conforms to the expected file format as supplied by
127 // the test configuration.
129 _LIT(K3GPComposeFileWithFileFormatCheck, "3GPComposeFileWithFileFormatCheck");
130 class C3GPLibComposeFileWithFileFormatCheck : public C3GPLibComposeFile
133 C3GPLibComposeFileWithFileFormatCheck();
135 TVerdict doTestStepPreambleL();
136 TVerdict doTestStepL();
139 TVerdict VerifyFileFormatL(const RFile& aFile);
142 T3GPFileFormatType iOutputFileFormat; // expected file format
146 // Class to compose file with video frames of all possible combinations of different
149 _LIT(K3GPComposeFrameDependency, "3GPComposeFrameDependency");
150 class C3GPLibComposeFrameDependency : public C3GPLibComposeFile
153 C3GPLibComposeFrameDependency();
156 void doTestStepComposeWriteVideoAudioL(C3GPCompose& aComposer);
160 // Class to compose file with video properties as specified in the test
163 _LIT(K3GPComposeVideoProperties, "3GPComposeVideoProperties");
164 class C3GPLibComposeVideoProperties : public C3GPLibComposeFile
167 C3GPLibComposeVideoProperties();
169 TVerdict doTestStepPreambleL();
170 TVerdict doTestStepPostambleL();
173 virtual T3GPVideoPropertiesBase* SetupAvcVideoL();
174 virtual T3GPVideoPropertiesBase* SetupH263VideoL();
175 virtual T3GPVideoPropertiesBase* SetupMpeg4VideoL();
181 RBuf8 iDecoderSpecInfo;
187 // Class to compose file with audio properties as specified in the test
190 _LIT(K3GPComposeAudioProperties, "3GPComposeAudioProperties");
191 class C3GPLibComposeAudioProperties : public C3GPLibComposeFile
194 C3GPLibComposeAudioProperties();
196 TVerdict doTestStepPreambleL();
197 TVerdict doTestStepPostambleL();
200 T3GPAudioPropertiesBase* SetupQcelpAudioL();
201 T3GPAudioPropertiesBase* SetupAmrAudioL();
202 T3GPAudioPropertiesBase* SetupMpeg4AudioL();
206 RBuf8 iDecoderSpecInfo;
208 T3GPQcelpStorageMode iQCelpMode;
213 // Class to create composer using buffer sizes and counts specified by test
216 _LIT(K3GPComposeWithSpecificBufferSize, "3GPComposeWithSpecificBufferSize");
217 class C3GPLibComposeWithSpecificBufferSize : public C3GPLibComposeFile
220 C3GPLibComposeWithSpecificBufferSize();
222 TVerdict doTestStepPreambleL();
225 C3GPCompose* doTestStepCreateComposerL();
229 TInt iBufferMaxCount;
233 // Class to compose file with user data as specified by the test
236 _LIT(K3GPComposeUserData, "3GPComposeUserData");
237 class C3GPLibComposeUserData : public C3GPLibComposeFile
240 C3GPLibComposeUserData();
241 TVerdict doTestStepPreambleL();
242 TVerdict doTestStepPostambleL();
245 void doTestStepComposeSetUserDataL(C3GPCompose& aComposer);
256 // Class to compose file using different composer flags as specified in the test
259 _LIT(K3GPComposeWithFlag, "3GPComposeWithFlag");
260 class C3GPLibComposeWithFlag : public C3GPLibComposeFile
263 C3GPLibComposeWithFlag();
264 TVerdict doTestStepPreambleL();
267 virtual void doTestStepComposeOpenL(C3GPCompose& aComposer);
274 // Class to compose file specifying no video nor audio.
276 _LIT(K3GPComposeWithNoAudioVideo, "3GPComposeWithNoAudioVideo");
277 class C3GPLibComposeWithNoAudioVideo : public C3GPLibComposeFile
280 C3GPLibComposeWithNoAudioVideo();
281 TVerdict doTestStepPreambleL();
285 // Class to compose file with audio frames of properties specified by test
288 _LIT(K3GPComposeAudioFrames, "3GPComposeAudioFrames");
289 class C3GPLibComposeAudioFrames : public C3GPLibComposeFile
292 C3GPLibComposeAudioFrames();
293 TVerdict doTestStepPreambleL();
294 TVerdict doTestStepPostambleL();
297 void doTestStepComposeWriteVideoAudioL(C3GPCompose& aComposer);
305 // Class to compose file with video frames of properties specified by test
308 _LIT(K3GPComposeVideoFrame, "3GPComposeVideoFrame");
309 class C3GPLibComposeVideoFrame : public C3GPLibComposeFile
312 C3GPLibComposeVideoFrame();
313 TVerdict doTestStepPreambleL();
314 TVerdict doTestStepPostambleL();
317 void doTestStepComposeWriteVideoAudioL(C3GPCompose& aComposer);
323 T3GPFrameDependencies* iDependencies;
328 // Class to open the composer again before closing it
330 _LIT(K3GPComposeOpenAgain, "3GPComposeOpenAgain");
331 class C3GPLibComposeOpenAgain: public C3GPLibComposeFile
334 C3GPLibComposeOpenAgain();
337 void doTestStepComposeOpenL(C3GPCompose& aComposer);
341 // Class to setup composer with a Read-Only file via file handle
343 _LIT(K3GPComposeOpenReadOnlyFile, "3GPComposeOpenReadOnlyFile");
344 class C3GPLibComposeOpenReadOnlyFile: public C3GPLibComposeWithFlag
347 C3GPLibComposeOpenReadOnlyFile();
348 TVerdict doTestStepL();
351 void doTestStepComposeOpenL(C3GPCompose& aComposer);
355 // Class to setup composer using file path of an opened file using
356 // ShareAny and then ShareReadersOrWriters mode.
358 _LIT(K3GPComposeOpenedFile, "3GPComposeOpenedFile");
359 class C3GPLibComposeOpenedFile: public C3GPLibComposeFile
362 C3GPLibComposeOpenedFile();
365 void doTestStepComposeOpenL(C3GPCompose& aComposer);
369 // Class to use 2 composer opening the same file
371 _LIT(K3GPComposeMultiComposeOnSameFile, "3GPComposeMultiComposeOnSameFile");
372 class C3GPLibComposeMultiComposeOnSameFile : public C3GPLibComposeFilename
375 C3GPLibComposeMultiComposeOnSameFile();
378 void doTestStepComposeOpenL(C3GPCompose& aComposer);
382 // Class to have multiple composers / parser working at the same time
384 _LIT(K3GPComposeMultiComposers, "3GPComposeMultiComposers");
385 class C3GPLibComposeMultiComposers : public C3GPLibComposeFilename
388 C3GPLibComposeMultiComposers();
391 void doTestStepComposeOpenL(C3GPCompose& aComposer);
395 // Class to compose file without calling complete first
397 _LIT(K3GPComposeCloseComposerWithoutComplete, "3GPComposeCloseComposerWithoutComplete");
398 class C3GPLibComposeCloseComposerWithoutComplete : public C3GPLibComposeFilename
401 C3GPLibComposeCloseComposerWithoutComplete();
404 void doTestStepComposeOpenL(C3GPCompose& aComposer);
408 // Class to test cleanup of temporary files when composer panics
410 _LIT(K3GPComposePanic, "3GPComposePanic");
411 class C3GPLibComposePanic : public C3GPLibComposeFilename
414 C3GPLibComposePanic();
415 TVerdict doTestStepPreambleL();
416 TVerdict doTestStepPostambleL();
419 void doTestStepComposeOpenL(C3GPCompose& aComposer);
427 // Class to compose a large file >2GB
429 _LIT(K3GPComposeLargeFile, "3GPComposeLargeFile");
430 class C3GPLibComposeLargeFile : public C3GPLibComposeFile
433 C3GPLibComposeLargeFile();
435 TVerdict doTestStepPreambleL();
436 TVerdict doTestStepPostambleL();
439 C3GPCompose* doTestStepCreateComposerL();
441 void doTestStepComposeOpenL(C3GPCompose& aComposer);
442 void doTestStepComposeWriteVideoAudioL(C3GPCompose& aComposer);
449 // Class to compose a large file >2GB with user data
451 _LIT(K3GPComposeLargeFileUserData, "3GPComposeLargeFileUserData");
452 class C3GPLibComposeLargeFileUserData : public C3GPLibComposeLargeFile
455 C3GPLibComposeLargeFileUserData();
458 void doTestStepComposeSetUserDataL(C3GPCompose& aComposer);
459 void WriteInt32(TUint8* aPtr, TInt32 aData);
465 // Class to compose a large file >2GB using 32bit APIs
467 _LIT(K3GPComposeLargeFile32bitAPI, "3GPComposeLargeFile32bitAPI");
468 class C3GPLibComposeLargeFile32bitAPI : public C3GPLibComposeWithFlag
471 C3GPLibComposeLargeFile32bitAPI();
474 C3GPCompose* doTestStepCreateComposerL();
475 void doTestStepComposeWriteVideoAudioL(C3GPCompose& aComposer);
481 // Class to compose a large file on an mmc card until the disk is full
483 _LIT(K3GPComposeLargeFileDiskFull, "3GPComposeLargeFileDiskFull");
484 class C3GPLibComposeLargeFileDiskFull : public C3GPLibComposeLargeFile
487 C3GPLibComposeLargeFileDiskFull();
490 void doTestStepComposeWriteVideoAudioL(C3GPCompose& aComposer);
496 // Class to compose file with AVC video that conforms to the expected AVC profile.
498 _LIT(K3GPComposeFileWithAvcProfileCheck, "3GPComposeFileWithAvcProfileCheck");
499 class C3GPLibComposeFileWithAvcProfileCheck : public C3GPLibComposeFile
502 C3GPLibComposeFileWithAvcProfileCheck();
503 virtual T3GPVideoPropertiesBase* SetupAvcVideoL();
504 TVerdict doTestStepL();
507 TVerdict VerifyAvcProfileL(const RFile& aFile);
510 TBuf8<7> iAvcDecoderConfigRecord;
514 #endif // TSU_3GPLIBRARY_COMPOSER_API_H