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 AVI_TEST_H_INCLUDED
19#define AVI_TEST_H_INCLUDED
20
21#include "test_engine.h"
22#ifndef PVMI_MIO_AVIFILE_FACTORY_H_INCLUDED
23#include "pvmi_mio_avi_wav_file_factory.h"
24#endif
25
26class avi_test : public engine_test
27{
28    public:
29        avi_test(bool aUseProxy,
30                 PVMFFormatType audio_src_format = PVMF_MIME_PCM16,
31                 PVMFFormatType audio_sink_format = PVMF_MIME_PCM16,
32                 PVMFFormatType video_src_format = PVMF_MIME_YUV420,
33                 PVMFFormatType video_sink_format = PVMF_MIME_YUV420)
34                : engine_test(aUseProxy, 1) ,
35                iAudSrcFormatType(audio_src_format),
36                iAudSinkFormatType(audio_sink_format),
37                iVidSrcFormatType(video_src_format),
38                iVidSinkFormatType(video_sink_format),
39                iPVAviFile(NULL),
40                iFileParser(NULL),
41                iAudioMediaInput(NULL),
42                iVideoMediaInput(NULL)
43        {}
44
45        ~avi_test()
46        {
47            delete iPVAviFile;
48            PVAviFile::DeleteAviFileParser((PVAviFile*)iFileParser);
49            delete iAudioMediaInput;
50            delete iVideoMediaInput;
51        }
52
53        void test();
54
55        void Run();
56
57        void DoCancel();
58
59        void HandleInformationalEvent(const PVAsyncInformationalEvent& aEvent);
60
61        void CommandCompleted(const PVCmdResponse& aResponse);
62
63        void TimerCallback();
64
65        bool HandleAvi();
66
67    private:
68        bool start_async_test();
69        PVMFFormatType iAudSrcFormatType, iAudSinkFormatType;
70        PVMFFormatType iVidSrcFormatType, iVidSinkFormatType;
71        PVAviFile*  iPVAviFile;
72        OsclAny*                 iFileParser;
73        Oscl_FileServer          iFileServer;
74        uint32 iAudioNum;
75        uint32 iVideoNum;
76        PvmiMIOControl* iAudioMediaInput;
77        PvmiMIOControl* iVideoMediaInput;
78};
79
80
81#endif
82
83
84