• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 /* ------------------------------------------------------------------
2  * Copyright (C) 1998-2009 PacketVideo
3  *
4  * Licensed under the Apache License, Version 2.0 (the "License");
5  * you may not use this file except in compliance with the License.
6  * You may obtain a copy of the License at
7  *
8  *      http://www.apache.org/licenses/LICENSE-2.0
9  *
10  * Unless required by applicable law or agreed to in writing, software
11  * distributed under the License is distributed on an "AS IS" BASIS,
12  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either
13  * express or implied.
14  * See the License for the specific language governing permissions
15  * and limitations under the License.
16  * -------------------------------------------------------------------
17  */
18 #ifndef PVAETEST_H_INCLUDED
19 #define PVAETEST_H_INCLUDED
20 
21 #ifndef TEST_PV_AUTHOR_ENGINE_TYPEDEFS_H
22 #include "test_pv_author_engine_typedefs.h"
23 #endif
24 
25 ////////////////////////////////////////////////////////////////////////////
26 // test_base-based class which will run async tests on pvPlayer engine
27 class PVAuthorEngineTest : public test_case,
28         public pvauthor_async_test_observer,
29         public PVLoggerSchedulerSetup
30 
31 {
32     public:
33         PVAuthorEngineTest(FILE* aStdOut, int32 aFirstTest, int32 aLastTest, const char* aInputFileName1,
34                            const char* aInputFileName2, const char* aInputFileName3, const char* aOutputFileName,
35                            AVTConfig iAVTConfig, PVAETestInputType aAudioInputType,
36                            PVAETestInputType aVideoInputType, PVAETestInputType aTextInputType, const char* aComposerMimeType,
37                            const char* aAudioEncoderMimeType, const char* aVideoEncoderMimeType, const char* aTextEncoderMimeType, uint32 aAuthoringTime);
38 
39         ~PVAuthorEngineTest();
40         // From test_case
41         virtual void test();
42         // From pvauthor_async_test_observer
43         void CompleteTest(test_case&);
44 
45         void RunTestCases();
46 
47     private:
48         pvauthor_async_test_base* iCurrentTest;
49 
50         int32 iFirstTest;
51         int32 iLastTest;
52         int32 iNextTestCase;
53 
54         FILE* iStdOut;
55 
56         // For test results
57         int iTotalSuccess;
58         int iTotalError;
59         int iTotalFail;
60 
61         // For memory statistics
62         uint32 iTotalAlloc;
63         uint32 iTotalBytes;
64         uint32 iAllocFails;
65         uint32 iNumAllocs;
66 
67         //Needed by the test to be run
68         OSCL_HeapString<OsclMemAllocator> iOutputFileName;
69         OSCL_HeapString<OsclMemAllocator> iInputFileNameAudio;
70         OSCL_HeapString<OsclMemAllocator> iInputFileNameVideo;
71         OSCL_HeapString<OsclMemAllocator> iInputFileNameText;
72         OSCL_HeapString<OsclMemAllocator> iInputFileNameTextLog;
73         OSCL_HeapString<OsclMemAllocator> iInputFileNameTextConfig;
74         PVAETestInputType iAudioInputType;
75         PVAETestInputType iVideoInputType;
76         PVAETestInputType iTextInputType;
77         OSCL_HeapString<OsclMemAllocator> iComposerMimeType;
78         OSCL_HeapString<OsclMemAllocator> iAudioEncoderMimeType;
79         OSCL_HeapString<OsclMemAllocator> iVideoEncoderMimeType;
80         OSCL_HeapString<OsclMemAllocator> iTextEncoderMimeType;
81         AVTConfig iAVTConfig;
82         uint32 iAuthoringTime;
83 };
84 
85 
86 ///////////////////////////////////////////////////////////////////////////
87 class PVAuthorEngineTestSuite : public test_case
88 {
89     public:
PVAuthorEngineTestSuite(FILE * aStdOut,int32 aFirstTest,int32 aLastTest,const char * iInputFileName1,const char * iInputFileName2,const char * iInputFileName3,const char * iOutputFileName,AVTConfig iAVTConfig,PVAETestInputType aAudioInputType,PVAETestInputType aVideoInputType,PVAETestInputType aTextInputType,const char * aComposerMimeType,const char * aAudioEncoderMimeType,const char * aVideoEncoderMimeType,const char * aTextEncoderMimeType,uint aAuthoringTime)90         PVAuthorEngineTestSuite(FILE* aStdOut, int32 aFirstTest, int32 aLastTest, const char* iInputFileName1, const char* iInputFileName2, const char* iInputFileName3, const char* iOutputFileName, AVTConfig iAVTConfig, PVAETestInputType aAudioInputType, PVAETestInputType aVideoInputType,  PVAETestInputType aTextInputType, const char* aComposerMimeType, const char* aAudioEncoderMimeType, const char* aVideoEncoderMimeType, const char* aTextEncoderMimeType, uint aAuthoringTime) : test_case()
91         {
92             adopt_test_case(new PVAuthorEngineTest(aStdOut, aFirstTest, aLastTest, iInputFileName1, iInputFileName2, iInputFileName3, iOutputFileName,
93                                                    iAVTConfig, aAudioInputType, aVideoInputType, aTextInputType, aComposerMimeType, aAudioEncoderMimeType, aVideoEncoderMimeType, aTextEncoderMimeType, aAuthoringTime));
94         }
~PVAuthorEngineTestSuite()95         ~PVAuthorEngineTestSuite() {};
96 };
97 
98 #endif // PVAETEST_H_INCLUDED
99