• 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 TEST_PV_PLAYER_ENGINE_TESTSET1_H_INCLUDED
19 #define TEST_PV_PLAYER_ENGINE_TESTSET1_H_INCLUDED
20 
21 /**
22  *  @file test_pv_player_engine_testset1.h
23  *  @brief This file contains the class definitions for the first set of
24  *         test cases for PVPlayerEngine
25  *
26  */
27 
28 #ifndef TEST_PV_PLAYER_ENGINE_H_INCLUDED
29 #include "test_pv_player_engine.h"
30 #endif
31 
32 #ifndef PV_PLAYER_DATASOURCEURL_H_INCLUDED
33 #include "pv_player_datasourceurl.h"
34 #endif
35 
36 #ifndef PVMF_NODE_INTERFACE_H_INCLUDED
37 #include "pvmf_node_interface.h"
38 #endif
39 
40 #ifndef PV_ENGINE_TYPES_H_INCLUDED
41 #include "pv_engine_types.h"
42 #endif
43 
44 #ifndef TEST_PV_PLAYER_ENGINE_CONFIG_H_INCLUDED
45 #include "test_pv_player_engine_config.h"
46 #endif
47 
48 #ifndef OSCL_FILE_IO_H_INCLUDED
49 #include "oscl_file_io.h"
50 #endif
51 
52 #ifndef PVMI_CONFIG_AND_CAPABILITY_OBSERVER_H_INCLUDED
53 #include "pvmi_config_and_capability_observer.h"
54 #endif
55 
56 #ifndef PVMF_CPMPLUGIN_FACTORY_REGISTRY_H_INCLUDED
57 #include "pvmf_cpmplugin_factory_registry.h"
58 #endif
59 
60 #ifndef PVMF_STREAMING_DATA_SOURCE_H_INCLUDED
61 #include "pvmf_streaming_data_source.h"
62 #endif
63 
64 #ifndef PVMF_SOURCE_CONTEXT_DATA_H_INCLUDED
65 #include "pvmf_source_context_data.h"
66 #endif
67 
68 
69 
70 #define AMR_MPEG4_RTSP_URL "rtsp://pvserveroha.pv.com/public/Interop/3GPP/pv2/pv-amr-475_mpeg4-20.3gp"
71 
72 
73 class PVPlayerDataSink;
74 class PVPlayerDataSinkFilename;
75 class PvmfFileOutputNodeConfigInterface;
76 class PvmiCapabilityAndConfig;
77 class PVRefFileOutput;
78 
79 
80 /*!
81  *  A test case to instantiate and destroy the player engine object via the factory class
82  *  - Data Source: N/A
83  *  - Data Sink(s): N/A
84  *  - Sequence:
85  *             -# CreatePlayer()/DeletePlayer()
86  *
87  */
88 class pvplayer_async_test_newdelete : public pvplayer_async_test_base
89 {
90     public:
pvplayer_async_test_newdelete(PVPlayerAsyncTestParam aTestParam)91         pvplayer_async_test_newdelete(PVPlayerAsyncTestParam aTestParam):
92                 pvplayer_async_test_base(aTestParam)
93         {
94             iTestCaseName = _STRLIT_CHAR("New-Delete");
95         }
96 
~pvplayer_async_test_newdelete()97         ~pvplayer_async_test_newdelete() {}
98 
99         void StartTest();
100         void Run();
101 
102         void CommandCompleted(const PVCmdResponse& aResponse);
103         void HandleErrorEvent(const PVAsyncErrorEvent& aEvent);
104         void HandleInformationalEvent(const PVAsyncInformationalEvent& aEvent);
105 };
106 
107 
108 /*!
109  *  A test case to test the normal engine sequence of playing a specified source
110  *  - Data Source: Passed in parameter
111  *  - Data Sink(s): Video[FileOutputNode-test_player_openplaystop_[SRCFILENAME]_video.dat]\n
112  *                  Audio[FileOutputNode-test_player_openplaystop_[SRCFILENAME]_audio.dat]\n
113  *                  Text[FileOutputNode-test_player_openplaystop_[SRCFILENAME]_text.dat]
114  *  - Sequence:
115  *             -# CreatePlayer()
116  *             -# AddDataSource()
117  *             -# Init()
118  *             -# AddDataSink() (video)
119  *             -# AddDataSink() (audio)
120  *             -# AddDataSink() (text)
121  *             -# Prepare()
122  *             -# Start()
123  *             -# WAIT 15 sec.
124  *             -# Stop()
125  *             -# RemoveDataSink() (video)
126  *             -# RemoveDataSink() (audio)
127  *             -# RemoveDataSink() (text)
128  *             -# Reset()
129  *             -# RemoveDataSource()
130  *             -# DeletePlayer()
131  *
132  */
133 class pvplayer_async_test_openplaystopreset : public pvplayer_async_test_base
134 {
135     public:
pvplayer_async_test_openplaystopreset(PVPlayerAsyncTestParam aTestParam)136         pvplayer_async_test_openplaystopreset(PVPlayerAsyncTestParam aTestParam):
137                 pvplayer_async_test_base(aTestParam)
138                 , iPlayer(NULL)
139                 , iDataSource(NULL)
140                 , iDataSinkVideo(NULL)
141                 , iIONodeVideo(NULL)
142                 , iMIOFileOutVideo(NULL)
143                 , iDataSinkAudio(NULL)
144                 , iIONodeAudio(NULL)
145                 , iMIOFileOutAudio(NULL)
146                 , iDataSinkText(NULL)
147                 , iIONodeText(NULL)
148                 , iMIOFileOutText(NULL)
149                 , iCurrentCmdId(0)
150         {
151             iTestCaseName = _STRLIT_CHAR("Open-Play-Stop-Reset");
152         }
153 
~pvplayer_async_test_openplaystopreset()154         ~pvplayer_async_test_openplaystopreset() {}
155 
156         void StartTest();
157         void Run();
158 
159         void CommandCompleted(const PVCmdResponse& aResponse);
160         void HandleErrorEvent(const PVAsyncErrorEvent& aEvent);
161         void HandleInformationalEvent(const PVAsyncInformationalEvent& aEvent);
162 
163         enum PVTestState
164         {
165             STATE_CREATE,
166             STATE_ADDDATASOURCE,
167             STATE_INIT,
168             STATE_ADDDATASINK_VIDEO,
169             STATE_ADDDATASINK_AUDIO,
170             STATE_ADDDATASINK_TEXT,
171             STATE_PREPARE,
172             STATE_START,
173             STATE_STOP,
174             STATE_REMOVEDATASINK_VIDEO,
175             STATE_REMOVEDATASINK_AUDIO,
176             STATE_REMOVEDATASINK_TEXT,
177             STATE_RESET,
178             STATE_REMOVEDATASOURCE,
179             STATE_CLEANUPANDCOMPLETE
180         };
181 
182         PVTestState iState;
183 
184         PVPlayerInterface* iPlayer;
185         PVPlayerDataSourceURL* iDataSource;
186         PVPlayerDataSink* iDataSinkVideo;
187         PVMFNodeInterface* iIONodeVideo;
188         PvmiMIOControl* iMIOFileOutVideo;
189         PVPlayerDataSink* iDataSinkAudio;
190         PVMFNodeInterface* iIONodeAudio;
191         PvmiMIOControl* iMIOFileOutAudio;
192         PVPlayerDataSink* iDataSinkText;
193         PVMFNodeInterface* iIONodeText;
194         PvmiMIOControl* iMIOFileOutText;
195         PVCommandId iCurrentCmdId;
196 
197     private:
198         OSCL_wHeapString<OsclMemAllocator> wFileName;
199         oscl_wchar output[512];
200 };
201 
202 
203 class PVMFLocalDataSource;
204 class PVMFOma1PassthruPluginFactory;
205 class PVMFCPMPluginAccessInterfaceFactory;
206 class PVMFSourceContextData;
207 
208 /*!
209  *  A test case to test the normal engine sequence of playing a specified source with pass-through CPM plug-in
210  *  - Data Source: Passed in parameter
211  *  - Data Sink(s): Video[FileOutputNode-test_player_cpmopenplaystop_[SRCFILENAME]_video.dat]\n
212  *                  Audio[FileOutputNode-test_player_cpmopenplaystop_[SRCFILENAME]_audio.dat]\n
213  *                  Text[FileOutputNode-test_player_cpmopenplaystop_[SRCFILENAME]_text.dat]
214  *  - Sequence:
215  *             -# CreatePlayer()
216  *             -# AddDataSource() with pass-through CPM plug-in
217  *             -# Init()
218  *             -# AddDataSink() (video)
219  *             -# AddDataSink() (audio)
220  *             -# AddDataSink() (text)
221  *             -# Prepare()
222  *             -# Start()
223  *             -# WAIT 15 sec.
224  *             -# Stop()
225  *             -# RemoveDataSink() (video)
226  *             -# RemoveDataSink() (audio)
227  *             -# RemoveDataSink() (text)
228  *             -# Reset()
229  *             -# RemoveDataSource()
230  *             -# DeletePlayer()
231  *
232  */
233 class pvplayer_async_test_cpmopenplaystopreset : public pvplayer_async_test_base
234 {
235     public:
236         pvplayer_async_test_cpmopenplaystopreset(PVPlayerAsyncTestParam aTestParam, bool aUsingDataStreamInput = false):
pvplayer_async_test_base(aTestParam)237                 pvplayer_async_test_base(aTestParam)
238                 , iPlayer(NULL)
239                 , iDataSource(NULL)
240                 , iDataSinkVideo(NULL)
241                 , iIONodeVideo(NULL)
242                 , iMIOFileOutVideo(NULL)
243                 , iDataSinkAudio(NULL)
244                 , iIONodeAudio(NULL)
245                 , iMIOFileOutAudio(NULL)
246                 , iDataSinkText(NULL)
247                 , iIONodeText(NULL)
248                 , iMIOFileOutText(NULL)
249                 , iCurrentCmdId(0)
250                 , iDataStreamFactory(NULL)
251                 , iSourceContextData(NULL)
252                 , iUsingDataStreamInput(aUsingDataStreamInput)
253         {
254             if (aUsingDataStreamInput)
255             {
256                 iTestCaseName = _STRLIT_CHAR("CPM Open-Play-Stop-Reset Using DataStream Input");
257             }
258             else
259             {
260                 iTestCaseName = _STRLIT_CHAR("CPM Open-Play-Stop-Reset");
261             }
262             iLocalDataSource = NULL;
263             iPluginFactory = NULL;
264         }
265 
~pvplayer_async_test_cpmopenplaystopreset()266         ~pvplayer_async_test_cpmopenplaystopreset() {}
267 
268         void StartTest();
269         void Run();
270 
271         void CommandCompleted(const PVCmdResponse& aResponse);
272         void HandleErrorEvent(const PVAsyncErrorEvent& aEvent);
273         void HandleInformationalEvent(const PVAsyncInformationalEvent& aEvent);
274 
275         enum PVTestState
276         {
277             STATE_CREATE,
278             STATE_ADDDATASOURCE,
279             STATE_INIT,
280             STATE_ADDDATASINK_VIDEO,
281             STATE_ADDDATASINK_AUDIO,
282             STATE_ADDDATASINK_TEXT,
283             STATE_PREPARE,
284             STATE_START,
285             STATE_STOP,
286             STATE_REMOVEDATASINK_VIDEO,
287             STATE_REMOVEDATASINK_AUDIO,
288             STATE_REMOVEDATASINK_TEXT,
289             STATE_RESET,
290             STATE_REMOVEDATASOURCE,
291             STATE_CLEANUPANDCOMPLETE
292         };
293 
294         PVTestState iState;
295 
296         PVPlayerInterface* iPlayer;
297         PVPlayerDataSourceURL* iDataSource;
298         PVPlayerDataSink* iDataSinkVideo;
299         PVMFNodeInterface* iIONodeVideo;
300         PvmiMIOControl* iMIOFileOutVideo;
301         PVPlayerDataSink* iDataSinkAudio;
302         PVMFNodeInterface* iIONodeAudio;
303         PvmiMIOControl* iMIOFileOutAudio;
304         PVPlayerDataSink* iDataSinkText;
305         PVMFNodeInterface* iIONodeText;
306         PvmiMIOControl* iMIOFileOutText;
307         PVCommandId iCurrentCmdId;
308 
309         PVMFLocalDataSource* iLocalDataSource;
310         PVMFCPMPluginFactoryRegistryClient iPluginRegistryClient;
311         PVMFOma1PassthruPluginFactory* iPluginFactory;
312         OSCL_HeapString<OsclMemAllocator> iPluginMimeType;
313         PVMFCPMPluginAccessInterfaceFactory* iDataStreamFactory;
314         PVMFSourceContextData* iSourceContextData;
315 
316     private:
317         OSCL_wHeapString<OsclMemAllocator> wFileName;
318         oscl_wchar output[512];
319         bool iUsingDataStreamInput;
320 };
321 
322 
323 /*!
324  *  A test case to test metadata retrieval APIs on a local MP4 file
325  *  - Data Source: test_metadata.mp4
326  *  - Data Sink(s): Video[FileOutputNode-test_player_metadata_video.dat]\n
327  *                  Audio[FileOutputNode-test_player_metadata_audio.dat]
328  *  - Sequence:
329  *             -# CreatePlayer()
330  *             -# AddDataSource()
331  *             -# Init()
332  *             =# GetMetadataKeys()
333  *             -# GetMetadataValues() Check the metadata values
334  *             -# AddDataSink() (video)
335  *             -# AddDataSink() (audio)
336  *             -# Prepare()
337  *             -# GetMetadataKeys() with key query string
338  *             -# GetMetadataValues() Check the metadata values
339  *             -# GetMetadataKeys() full list
340  *             -# GetMetadataValues() full list
341  *             -# GetMetadataValues() segment 1 (0-5)
342  *             -# GetMetadataValues() segment 2 (6-end) Check that total of two segments is same as full list
343  *             -# Start()
344  *             -# WAIT 3 sec.
345  *             -# Stop()
346  *             -# GetMetadataKeys() Check that list of keys shrunk
347  *             -# GetMetadataValues() Check the metadata values
348  *             -# RemoveDataSink() (video)
349  *             -# RemoveDataSink() (audio)
350  *             -# Reset()
351  *             -# RemoveDataSource()
352  *             -# DeletePlayer()
353  *
354  */
355 class pvplayer_async_test_metadata : public pvplayer_async_test_base
356 {
357     public:
pvplayer_async_test_metadata(PVPlayerAsyncTestParam aTestParam)358         pvplayer_async_test_metadata(PVPlayerAsyncTestParam aTestParam):
359                 pvplayer_async_test_base(aTestParam)
360                 , iPlayer(NULL)
361                 , iDataSource(NULL)
362                 , iDataSinkVideo(NULL)
363                 , iDataSinkAudio(NULL)
364                 , iIONodeVideo(NULL)
365                 , iIONodeAudio(NULL)
366                 , iMIOFileOutVideo(NULL)
367                 , iMIOFileOutAudio(NULL)
368                 , iCurrentCmdId(0)
369         {
370             iTestCaseName = _STRLIT_CHAR("Metadata");
371         }
372 
~pvplayer_async_test_metadata()373         ~pvplayer_async_test_metadata() {}
374 
375         void StartTest();
376         void Run();
377 
378         void CommandCompleted(const PVCmdResponse& aResponse);
379         void HandleErrorEvent(const PVAsyncErrorEvent& aEvent);
380         void HandleInformationalEvent(const PVAsyncInformationalEvent& aEvent);
381 
382         enum PVTestState
383         {
384             STATE_CREATE,
385             STATE_ADDDATASOURCE,
386             STATE_INIT,
387             STATE_GETMETADATAKEYS1,
388             STATE_GETMETADATAVALUES1,
389             STATE_ADDDATASINK_VIDEO,
390             STATE_ADDDATASINK_AUDIO,
391             STATE_PREPARE,
392             STATE_GETMETADATAKEYS2,
393             STATE_GETMETADATAVALUES2,
394             STATE_GETMETADATAKEYSSEG,
395             STATE_GETMETADATAVALUESSEG1,
396             STATE_GETMETADATAVALUESSEG2,
397             STATE_GETMETADATAVALUESSEG3,
398             STATE_START,
399             STATE_STOP,
400             STATE_GETMETADATAKEYS3,
401             STATE_GETMETADATAVALUES3,
402             STATE_REMOVEDATASINK_VIDEO,
403             STATE_REMOVEDATASINK_AUDIO,
404             STATE_RESET,
405             STATE_REMOVEDATASOURCE,
406             STATE_CLEANUPANDCOMPLETE
407         };
408 
409         PVTestState iState;
410 
411         PVPlayerInterface* iPlayer;
412         PVPlayerDataSourceURL* iDataSource;
413 
414         PVPlayerDataSink* iDataSinkVideo;
415         PVPlayerDataSink* iDataSinkAudio;
416         PVMFNodeInterface* iIONodeVideo;
417         PVMFNodeInterface* iIONodeAudio;
418         PvmiMIOControl* iMIOFileOutVideo;
419         PvmiMIOControl* iMIOFileOutAudio;
420 
421         PVCommandId iCurrentCmdId;
422 
423     private:
424         PVPMetadataList iKeyList;
425         int32 iNumAvailableValues;
426         Oscl_Vector<PvmiKvp, OsclMemAllocator> iValueList;
427         Oscl_Vector<PvmiKvp, OsclMemAllocator> iValueListSeg1;
428         Oscl_Vector<PvmiKvp, OsclMemAllocator> iValueListSeg2;
429         OSCL_HeapString<OsclMemAllocator> iKeyQueryString;
430 
431         int32 CheckMetadataValue(Oscl_Vector<PvmiKvp, OsclMemAllocator>& aValueList);
432 };
433 
434 
435 /*!
436  *  A test case to start a normal playback of local MP4 file, check the playback position periodically, and stop.
437  *  - Data Source: test.mp4
438  *  - Data Sink(s): Video[FileOutputNode-test_player_timing_video.dat]\n
439  *                  Audio[FileOutputNode-test_player_timing_audio.dat]
440  *  - Sequence:
441  *             -# CreatePlayer()
442  *             -# AddDataSource()
443  *             -# Init()
444  *             -# AddDataSink() (video)
445  *             -# AddDataSink() (audio)
446  *             -# Prepare()
447  *             -# Start()
448  *             -# Check playback position every 100 millisec and stop after 4 sec
449  *             -# Stop()
450  *             -# RemoveDataSink() (video)
451  *             -# RemoveDataSink() (audio)
452  *             -# Reset()
453  *             -# RemoveDataSource()
454  *             -# DeletePlayer()
455  *
456  */
457 class pvplayer_async_test_timing : public pvplayer_async_test_base
458 {
459     public:
pvplayer_async_test_timing(PVPlayerAsyncTestParam aTestParam)460         pvplayer_async_test_timing(PVPlayerAsyncTestParam aTestParam):
461                 pvplayer_async_test_base(aTestParam)
462                 , iPlayer(NULL)
463                 , iDataSource(NULL)
464                 , iDataSinkVideo(NULL)
465                 , iDataSinkAudio(NULL)
466                 , iIONodeVideo(NULL)
467                 , iIONodeAudio(NULL)
468                 , iMIOFileOutVideo(NULL)
469                 , iMIOFileOutAudio(NULL)
470                 , iCurrentCmdId(0)
471                 , iStartTime(0)
472         {
473             iTestCaseName = _STRLIT_CHAR("Timing");
474         }
475 
~pvplayer_async_test_timing()476         ~pvplayer_async_test_timing() {}
477 
478         void StartTest();
479         void Run();
480 
481         void CommandCompleted(const PVCmdResponse& aResponse);
482         void HandleErrorEvent(const PVAsyncErrorEvent& aEvent);
483         void HandleInformationalEvent(const PVAsyncInformationalEvent& aEvent);
484 
485         enum PVTestState
486         {
487             STATE_CREATE,
488             STATE_ADDDATASOURCE,
489             STATE_INIT,
490             STATE_ADDDATASINK_VIDEO,
491             STATE_ADDDATASINK_AUDIO,
492             STATE_PREPARE,
493             STATE_START,
494             STATE_STOP,
495             STATE_REMOVEDATASINK_VIDEO,
496             STATE_REMOVEDATASINK_AUDIO,
497             STATE_RESET,
498             STATE_REMOVEDATASOURCE,
499             STATE_CLEANUPANDCOMPLETE,
500             STATE_WAIT
501         };
502 
503         PVTestState iState;
504 
505         PVPlayerInterface* iPlayer;
506         PVPlayerDataSourceURL* iDataSource;
507         PVPlayerDataSink* iDataSinkVideo;
508         PVPlayerDataSink* iDataSinkAudio;
509         PVMFNodeInterface* iIONodeVideo;
510         PVMFNodeInterface* iIONodeAudio;
511         PvmiMIOControl* iMIOFileOutVideo;
512         PvmiMIOControl* iMIOFileOutAudio;
513         PVCommandId iCurrentCmdId;
514         PVPPlaybackPosition aPos;
515         uint32 iStartTime;
516 };
517 
518 
519 
520 /*!
521  *  A test case to test the invalid states of the player engine
522  *  - Data Source: test.mp4
523  *  - Data Sink(s): Video[FileOutputNode-test_player_invalid_video.dat]\n
524  *                  Audio[FileOutputNode-test_player_invalid_audio.dat]
525  *  - Sequence:
526  *             -# CreatePlayer()
527  *             -# Start() (Invalid State)
528  *             -# Stop() (Invalid State)
529  *             -# AddDataSource()
530  *             -# Init()
531  *             -# AddDataSource() (Invalid State)
532  *             -# Start() (Invalid State)
533  *             -# AddDataSink() (video)
534  *             -# AddDataSink() (audio)
535  *             -# Prepare()
536  *             -# Init() (Invalid State)
537  *             -# Pause() (Invalid State)
538  *             -# Start()
539  *             -# Resume() (Invalid State)
540  *             -# Prepare() (Invalid State)
541  *             -# Pause()
542  *             -# Init() (Invalid State)
543  *             -# Prepare() (Invalid State)
544  *             -# Stop()
545  *             -# RemoveDataSink() (video)
546  *             -# RemoveDataSink() (audio)
547  *             -# Reset()
548  *             -# RemoveDataSource()
549  *             -# DeletePlayer()
550  *
551  */
552 class pvplayer_async_test_invalidstate : public pvplayer_async_test_base
553 {
554     public:
pvplayer_async_test_invalidstate(PVPlayerAsyncTestParam aTestParam)555         pvplayer_async_test_invalidstate(PVPlayerAsyncTestParam aTestParam):
556                 pvplayer_async_test_base(aTestParam)
557                 , iPlayer(NULL)
558                 , iDataSource(NULL)
559                 , iDataSinkVideo(NULL)
560                 , iDataSinkAudio(NULL)
561                 , iIONodeVideo(NULL)
562                 , iIONodeAudio(NULL)
563                 , iMIOFileOutVideo(NULL)
564                 , iMIOFileOutAudio(NULL)
565                 , iCurrentCmdId(0)
566         {
567             iTestCaseName = _STRLIT_CHAR("Invalid State");
568         }
569 
~pvplayer_async_test_invalidstate()570         ~pvplayer_async_test_invalidstate() {}
571 
572         void StartTest();
573         void Run();
574 
575         void CommandCompleted(const PVCmdResponse& aResponse);
576         void HandleErrorEvent(const PVAsyncErrorEvent& aEvent);
577         void HandleInformationalEvent(const PVAsyncInformationalEvent& aEvent);
578 
579         enum PVTestState
580         {
581             STATE_CREATE,
582             STATE_IDLE_INVALID_START,
583             STATE_IDLE_INVALID_STOP,
584             STATE_ADDDATASOURCE,
585             STATE_INIT,
586             STATE_INITIALIZED_INVALID_ADDDATASOURCE,
587             STATE_INITIALIZED_INVALID_START,
588             STATE_ADDDATASINK_VIDEO,
589             STATE_ADDDATASINK_AUDIO,
590             STATE_PREPARE,
591             STATE_PREPARED_INVALID_INIT,
592             STATE_PREPARED_INVALID_PAUSE,
593             STATE_START,
594             STATE_STARTED_INVALID_RESUME,
595             STATE_STARTED_INVALID_PREPARE,
596             STATE_PAUSE,
597             STATE_PAUSED_INVALID_INIT,
598             STATE_PAUSED_INVALID_PREPARE,
599             STATE_STOP,
600             STATE_REMOVEDATASINK_VIDEO,
601             STATE_REMOVEDATASINK_AUDIO,
602             STATE_RESET,
603             STATE_REMOVEDATASOURCE,
604             STATE_CLEANUPANDCOMPLETE
605         };
606 
607         PVTestState iState;
608 
609         PVPlayerInterface* iPlayer;
610         PVPlayerDataSourceURL* iDataSource;
611         PVPlayerDataSink* iDataSinkVideo;
612         PVPlayerDataSink* iDataSinkAudio;
613         PVMFNodeInterface* iIONodeVideo;
614         PVMFNodeInterface* iIONodeAudio;
615         PvmiMIOControl* iMIOFileOutVideo;
616         PvmiMIOControl* iMIOFileOutAudio;
617         PVCommandId iCurrentCmdId;
618 };
619 
620 
621 /*!
622  *  A test case to test the normal engine sequence of calling stop immediately after prepare
623  *  - Data Source: test.mp4
624  *  - Data Sink(s): Video[FileOutputNode-test_player_preparedstop_video.dat]\n
625  *                  Audio[FileOutputNode-test_player_preparedstop_audio.dat]
626  *  - Sequence:
627  *             -# CreatePlayer()
628  *             -# AddDataSource()
629  *             -# Init()
630  *             -# AddDataSink() (video)
631  *             -# AddDataSink() (audio)
632  *             -# Prepare()
633  *             -# Stop()
634  *             -# RemoveDataSink() (video)
635  *             -# RemoveDataSink() (audio)
636  *             -# Reset()
637  *             -# RemoveDataSource()
638  *             -# DeletePlayer()
639  *
640  */
641 class pvplayer_async_test_preparedstop : public pvplayer_async_test_base
642 {
643     public:
pvplayer_async_test_preparedstop(PVPlayerAsyncTestParam aTestParam)644         pvplayer_async_test_preparedstop(PVPlayerAsyncTestParam aTestParam):
645                 pvplayer_async_test_base(aTestParam)
646                 , iPlayer(NULL)
647                 , iDataSource(NULL)
648                 , iDataSinkVideo(NULL)
649                 , iDataSinkAudio(NULL)
650                 , iIONodeVideo(NULL)
651                 , iIONodeAudio(NULL)
652                 , iMIOFileOutVideo(NULL)
653                 , iMIOFileOutAudio(NULL)
654                 , iCurrentCmdId(0)
655         {
656             iTestCaseName = _STRLIT_CHAR("Stop When Prepared");
657         }
658 
~pvplayer_async_test_preparedstop()659         ~pvplayer_async_test_preparedstop() {}
660 
661         void StartTest();
662         void Run();
663 
664         void CommandCompleted(const PVCmdResponse& aResponse);
665         void HandleErrorEvent(const PVAsyncErrorEvent& aEvent);
666         void HandleInformationalEvent(const PVAsyncInformationalEvent& aEvent);
667 
668         enum PVTestState
669         {
670             STATE_CREATE,
671             STATE_ADDDATASOURCE,
672             STATE_INIT,
673             STATE_ADDDATASINK_VIDEO,
674             STATE_ADDDATASINK_AUDIO,
675             STATE_PREPARE,
676             STATE_STOP,
677             STATE_REMOVEDATASINK_VIDEO,
678             STATE_REMOVEDATASINK_AUDIO,
679             STATE_RESET,
680             STATE_REMOVEDATASOURCE,
681             STATE_CLEANUPANDCOMPLETE
682         };
683 
684         PVTestState iState;
685 
686         PVPlayerInterface* iPlayer;
687         PVPlayerDataSourceURL* iDataSource;
688         PVPlayerDataSink* iDataSinkVideo;
689         PVPlayerDataSink* iDataSinkAudio;
690         PVMFNodeInterface* iIONodeVideo;
691         PVMFNodeInterface* iIONodeAudio;
692         PvmiMIOControl* iMIOFileOutVideo;
693         PvmiMIOControl* iMIOFileOutAudio;
694         PVCommandId iCurrentCmdId;
695 };
696 
697 
698 /*!
699  *  A test case to test the video only play back for 7 seconds
700  *  - Data Source: test.mp4
701  *  - Data Sink(s): Video[FileOutputNode-test_player_videoonly7s_video.dat]\n
702  *  - Sequence:
703  *             -# CreatePlayer()
704  *             -# AddDataSource()
705  *             -# Init()
706  *             -# AddDataSink() (video)
707  *             -# Prepare()
708  *             -# Start()
709  *             -# WAIT 7 sec.
710  *             -# Stop()
711  *             -# RemoveDataSink() (video)
712  *             -# Reset()
713  *             -# RemoveDataSource()
714  *             -# DeletePlayer()
715  *
716  */
717 class pvplayer_async_test_videoonlyplay7seconds: public pvplayer_async_test_base
718 {
719     public:
pvplayer_async_test_videoonlyplay7seconds(PVPlayerAsyncTestParam aTestParam)720         pvplayer_async_test_videoonlyplay7seconds(PVPlayerAsyncTestParam aTestParam):
721                 pvplayer_async_test_base(aTestParam)
722                 , iPlayer(NULL)
723                 , iDataSource(NULL)
724                 , iDataSinkVideo(NULL)
725                 , iIONodeVideo(NULL)
726                 , iMIOFileOutVideo(NULL)
727                 , iCurrentCmdId(0)
728         {
729             iTestCaseName = _STRLIT_CHAR("Video-only Play 7 Sec");
730         }
731 
~pvplayer_async_test_videoonlyplay7seconds()732         ~pvplayer_async_test_videoonlyplay7seconds() {}
733 
734         void StartTest();
735         void Run();
736 
737         void CommandCompleted(const PVCmdResponse& aResponse);
738         void HandleErrorEvent(const PVAsyncErrorEvent& aEvent);
739         void HandleInformationalEvent(const PVAsyncInformationalEvent& aEvent);
740 
741         enum PVTestState
742         {
743             STATE_CREATE,
744             STATE_ADDDATASOURCE,
745             STATE_INIT,
746             STATE_ADDDATASINK_VIDEO,
747             STATE_PREPARE,
748             STATE_START,
749             STATE_STOP,
750             STATE_REMOVEDATASINK_VIDEO,
751             STATE_RESET,
752             STATE_REMOVEDATASOURCE,
753             STATE_CLEANUPANDCOMPLETE
754         };
755 
756         PVTestState iState;
757 
758         PVPlayerInterface* iPlayer;
759         PVPlayerDataSourceURL* iDataSource;
760         PVPlayerDataSink* iDataSinkVideo;
761         PVMFNodeInterface* iIONodeVideo;
762         PvmiMIOControl* iMIOFileOutVideo;
763         PVCommandId iCurrentCmdId;
764 };
765 
766 
767 /*!
768  *  A test case to test playback of 5 sec, stopping, and then playing for 10 sec from beginning again
769  *  - Data Source: test.mp4
770  *  - Data Sink(s): Video[FileOutputNode-test_player_playstop2times_video.dat]\n
771  *                  Audio[FileOutputNode-test_player_playstop2times_audio.dat]
772  *  - Sequence:
773  *             -# CreatePlayer()
774  *             -# AddDataSource()
775  *             -# Init()
776  *             -# AddDataSink() (video)
777  *             -# AddDataSink() (audio)
778  *             -# Prepare()
779  *             -# Start()
780  *             -# WAIT 5 sec.
781  *             -# Stop()
782  *             -# Prepare()
783  *             -# Start()
784  *             -# WAIT 10 sec.
785  *             -# Stop()
786  *             -# RemoveDataSink() (video)
787  *             -# RemoveDataSink() (audio)
788  *             -# Reset()
789  *             -# RemoveDataSource()
790  *             -# DeletePlayer()
791  *
792  */
793 class pvplayer_async_test_play5stopplay10stopreset: public pvplayer_async_test_base
794 {
795     public:
pvplayer_async_test_play5stopplay10stopreset(PVPlayerAsyncTestParam aTestParam)796         pvplayer_async_test_play5stopplay10stopreset(PVPlayerAsyncTestParam aTestParam):
797                 pvplayer_async_test_base(aTestParam)
798                 , iPlayer(NULL)
799                 , iDataSource(NULL)
800                 , iDataSinkVideo(NULL)
801                 , iDataSinkAudio(NULL)
802                 , iIONodeVideo(NULL)
803                 , iIONodeAudio(NULL)
804                 , iMIOFileOutVideo(NULL)
805                 , iMIOFileOutAudio(NULL)
806                 , iCurrentCmdId(0)
807         {
808             iTestCaseName = _STRLIT_CHAR("Play 5 Sec-Stop-Play 10 Sec-Stop-Reset");
809         }
810 
~pvplayer_async_test_play5stopplay10stopreset()811         ~pvplayer_async_test_play5stopplay10stopreset() {}
812 
813         void StartTest();
814         void Run();
815 
816         void CommandCompleted(const PVCmdResponse& aResponse);
817         void HandleErrorEvent(const PVAsyncErrorEvent& aEvent);
818         void HandleInformationalEvent(const PVAsyncInformationalEvent& aEvent);
819 
820         enum PVTestState
821         {
822             STATE_CREATE,
823             STATE_ADDDATASOURCE,
824             STATE_INIT,
825             STATE_ADDDATASINK_VIDEO,
826             STATE_ADDDATASINK_AUDIO,
827             STATE_PREPARE_FIRST,
828             STATE_START_FIRST,
829             STATE_STOP_FIRST,
830             STATE_PREPARE_SECOND,
831             STATE_START_SECOND,
832             STATE_STOP_SECOND,
833             STATE_REMOVEDATASINK_VIDEO,
834             STATE_REMOVEDATASINK_AUDIO,
835             STATE_RESET,
836             STATE_REMOVEDATASOURCE,
837             STATE_CLEANUPANDCOMPLETE
838         };
839 
840         PVTestState iState;
841 
842         PVPlayerInterface* iPlayer;
843         PVPlayerDataSourceURL* iDataSource;
844         PVPlayerDataSink* iDataSinkVideo;
845         PVPlayerDataSink* iDataSinkAudio;
846         PVMFNodeInterface* iIONodeVideo;
847         PVMFNodeInterface* iIONodeAudio;
848         PvmiMIOControl* iMIOFileOutVideo;
849         PvmiMIOControl* iMIOFileOutAudio;
850         PVCommandId iCurrentCmdId;
851 };
852 
853 
854 /*!
855  *  A test case to test pausing and resuming during normal playback
856  *  - Data Source: test.mp4
857  *  - Data Sink(s): Video[FileOutputNode-test_player_pauseresume_video.dat]\n
858  *                  Audio[FileOutputNode-test_player_pauseresume_audio.dat]
859  *  - Sequence:
860  *             -# CreatePlayer()
861  *             -# AddDataSource()
862  *             -# Init()
863  *             -# AddDataSink() (video)
864  *             -# AddDataSink() (audio)
865  *             -# Prepare()
866  *             -# Start()
867  *             -# WAIT 10 sec.
868  *             -# Pause()
869  *             -# WAIT 5 sec
870  *             -# Resume()
871  *             -# WAIT 10 sec.
872  *             -# Stop()
873  *             -# RemoveDataSink() (video)
874  *             -# RemoveDataSink() (audio)
875  *             -# Reset()
876  *             -# RemoveDataSource()
877  *             -# DeletePlayer()
878  *
879  */
880 class pvplayer_async_test_pauseresume : public pvplayer_async_test_base
881 {
882     public:
pvplayer_async_test_pauseresume(PVPlayerAsyncTestParam aTestParam)883         pvplayer_async_test_pauseresume(PVPlayerAsyncTestParam aTestParam):
884                 pvplayer_async_test_base(aTestParam)
885                 , iPlayer(NULL)
886                 , iDataSource(NULL)
887                 , iDataSinkVideo(NULL)
888                 , iDataSinkAudio(NULL)
889                 , iIONodeVideo(NULL)
890                 , iIONodeAudio(NULL)
891                 , iMIOFileOutVideo(NULL)
892                 , iMIOFileOutAudio(NULL)
893                 , iCurrentCmdId(0)
894         {
895             iTestCaseName = _STRLIT_CHAR("Pause-Resume");
896         }
897 
~pvplayer_async_test_pauseresume()898         ~pvplayer_async_test_pauseresume() {}
899 
900         void StartTest();
901         void Run();
902 
903         void CommandCompleted(const PVCmdResponse& aResponse);
904         void HandleErrorEvent(const PVAsyncErrorEvent& aEvent);
905         void HandleInformationalEvent(const PVAsyncInformationalEvent& aEvent);
906 
907         enum PVTestState
908         {
909             STATE_CREATE,
910             STATE_ADDDATASOURCE,
911             STATE_INIT,
912             STATE_ADDDATASINK_VIDEO,
913             STATE_ADDDATASINK_AUDIO,
914             STATE_PREPARE,
915             STATE_START,
916             STATE_PAUSE,
917             STATE_RESUME,
918             STATE_STOP,
919             STATE_REMOVEDATASINK_VIDEO,
920             STATE_REMOVEDATASINK_AUDIO,
921             STATE_RESET,
922             STATE_REMOVEDATASOURCE,
923             STATE_CLEANUPANDCOMPLETE
924         };
925 
926         PVTestState iState;
927 
928         PVPlayerInterface* iPlayer;
929         PVPlayerDataSourceURL* iDataSource;
930         PVPlayerDataSink* iDataSinkVideo;
931         PVPlayerDataSink* iDataSinkAudio;
932         PVMFNodeInterface* iIONodeVideo;
933         PVMFNodeInterface* iIONodeAudio;
934         PvmiMIOControl* iMIOFileOutVideo;
935         PvmiMIOControl* iMIOFileOutAudio;
936         PVCommandId iCurrentCmdId;
937 };
938 
939 
940 /*!
941  *  A test case to test stop when playback is paused
942  *  - Data Source: test.mp4
943  *  - Data Sink(s): Video[FileOutputNode-test_player_playpausestop_vidoe.dat]\n
944  *                  Audio[FileOutputNode-test_player_playpausestop_audio.dat]
945  *  - Sequence:
946  *             -# CreatePlayer()
947  *             -# AddDataSource()
948  *             -# Init()
949  *             -# AddDataSink() (video)
950  *             -# AddDataSink() (audio)
951  *             -# Prepare()
952  *             -# Start()
953  *             -# WAIT 20 sec.
954  *             -# Pause()
955  *             -# Stop()
956  *             -# RemoveDataSink() (video)
957  *             -# RemoveDataSink() (audio)
958  *             -# Reset()
959  *             -# RemoveDataSource()
960  *             -# DeletePlayer()
961  *
962  */
963 class pvplayer_async_test_playpausestop : public pvplayer_async_test_base
964 {
965     public:
pvplayer_async_test_playpausestop(PVPlayerAsyncTestParam aTestParam)966         pvplayer_async_test_playpausestop(PVPlayerAsyncTestParam aTestParam):
967                 pvplayer_async_test_base(aTestParam)
968                 , iPlayer(NULL)
969                 , iDataSource(NULL)
970                 , iDataSinkVideo(NULL)
971                 , iDataSinkAudio(NULL)
972                 , iIONodeVideo(NULL)
973                 , iIONodeAudio(NULL)
974                 , iMIOFileOutVideo(NULL)
975                 , iMIOFileOutAudio(NULL)
976                 , iCurrentCmdId(0)
977         {
978             iTestCaseName = _STRLIT_CHAR("Play-Pause-Stop");
979         }
980 
~pvplayer_async_test_playpausestop()981         ~pvplayer_async_test_playpausestop() {}
982 
983         void StartTest();
984         void Run();
985 
986         void CommandCompleted(const PVCmdResponse& aResponse);
987         void HandleErrorEvent(const PVAsyncErrorEvent& aEvent);
988         void HandleInformationalEvent(const PVAsyncInformationalEvent& aEvent);
989 
990         enum PVTestState
991         {
992             STATE_CREATE,
993             STATE_ADDDATASOURCE,
994             STATE_INIT,
995             STATE_ADDDATASINK_VIDEO,
996             STATE_ADDDATASINK_AUDIO,
997             STATE_PREPARE,
998             STATE_START,
999             STATE_PAUSE,
1000             STATE_STOP,
1001             STATE_REMOVEDATASINK_VIDEO,
1002             STATE_REMOVEDATASINK_AUDIO,
1003             STATE_RESET,
1004             STATE_REMOVEDATASOURCE,
1005             STATE_CLEANUPANDCOMPLETE
1006         };
1007 
1008         PVTestState iState;
1009 
1010         PVPlayerInterface* iPlayer;
1011         PVPlayerDataSourceURL* iDataSource;
1012         PVPlayerDataSink* iDataSinkVideo;
1013         PVPlayerDataSink* iDataSinkAudio;
1014         PVMFNodeInterface* iIONodeVideo;
1015         PVMFNodeInterface* iIONodeAudio;
1016         PvmiMIOControl* iMIOFileOutVideo;
1017         PvmiMIOControl* iMIOFileOutAudio;
1018         PVCommandId iCurrentCmdId;
1019 };
1020 
1021 
1022 /*!
1023  *  A test case to test whether engine can accept outside node for video sink
1024  *  - Data Source: test.mp4
1025  *  - Data Sink(s): Video[FileOutputNode-test_player_outsidevideosink_video.dat]\n
1026  *                  Audio[FileOutputNode-test_player_outsidevideosink_audio.dat]
1027  *  - Sequence:
1028  *             -# CreatePlayer()
1029  *             -# AddDataSource()
1030  *             -# Init()
1031  *             -# AddDataSink() (video)Where we will pass the outside node
1032  *             -# AddDataSink() (audio)
1033  *             -# Prepare()
1034  *             -# Start()
1035  *             -# WAIT 10 sec.
1036  *             -# Stop()
1037  *             -# RemoveDataSink() (video)
1038  *             -# RemoveDataSink() (audio)
1039  *             -# Reset()
1040  *             -# RemoveDataSource()
1041  *             -# DeletePlayer()
1042  *
1043  */
1044 class pvplayer_async_test_outsidenodeforvideosink : public pvplayer_async_test_base,
1045         public PVMFNodeCmdStatusObserver,
1046         public PVMFNodeInfoEventObserver,
1047         public PVMFNodeErrorEventObserver
1048 {
1049     public:
pvplayer_async_test_outsidenodeforvideosink(PVPlayerAsyncTestParam aTestParam)1050         pvplayer_async_test_outsidenodeforvideosink(PVPlayerAsyncTestParam aTestParam):
1051                 pvplayer_async_test_base(aTestParam)
1052                 , iPlayer(NULL)
1053                 , iDataSource(NULL)
1054                 , iDataSinkVideo(NULL)
1055                 , iDataSinkAudio(NULL)
1056                 , iIONodeVideo(NULL)
1057                 , iIONodeAudio(NULL)
1058                 , iMOutVideo(NULL)
1059                 , iMOutAudio(NULL)
1060                 , iCurrentCmdId(0)
1061         {
1062             iTestCaseName = _STRLIT_CHAR("Outside Node for Video Sink");
1063         }
1064 
~pvplayer_async_test_outsidenodeforvideosink()1065         ~pvplayer_async_test_outsidenodeforvideosink() {}
1066 
1067         void StartTest();
1068         void Run();
1069 
1070         void CommandCompleted(const PVCmdResponse& aResponse);
1071         void HandleErrorEvent(const PVAsyncErrorEvent& aEvent);
1072         void HandleInformationalEvent(const PVAsyncInformationalEvent& aEvent);
1073 
1074         void NodeCommandCompleted(const PVMFCmdResp& aResponse);
HandleNodeInformationalEvent(const PVMFAsyncEvent &)1075         void HandleNodeInformationalEvent(const PVMFAsyncEvent& /*aEvent*/) {}
HandleNodeErrorEvent(const PVMFAsyncEvent &)1076         void HandleNodeErrorEvent(const PVMFAsyncEvent& /*aEvent*/) {}
1077 
1078         enum PVTestState
1079         {
1080             STATE_CREATE,
1081             STATE_ADDDATASOURCE,
1082             STATE_INIT,
1083             STATE_ADDDATASINK_VIDEO,
1084             STATE_ADDDATASINK_AUDIO,
1085             STATE_PREPARE,
1086             STATE_START,
1087             STATE_STOP,
1088             STATE_REMOVEDATASINK_VIDEO,
1089             STATE_REMOVEDATASINK_AUDIO,
1090             STATE_RESET,
1091             STATE_REMOVEDATASOURCE,
1092             STATE_CLEANUPANDCOMPLETE
1093         };
1094 
1095         PVTestState iState;
1096 
1097         PVPlayerInterface* iPlayer;
1098         PVPlayerDataSourceURL* iDataSource;
1099         PVPlayerDataSink* iDataSinkVideo;
1100         PVPlayerDataSink* iDataSinkAudio;
1101         PVMFNodeInterface* iIONodeVideo;
1102         PVMFNodeInterface* iIONodeAudio;
1103         PvmiMIOControl* iMOutVideo;
1104         PvmiMIOControl* iMOutAudio;
1105         PVCommandId iCurrentCmdId;
1106 };
1107 
1108 
1109 /*!
1110  *  A test case to test the whether the engine is in correct state or not
1111  *  - Data Source: test.mp4
1112  *  - Data Sink(s): Video[FileOutputNode-test_player_getplayerstate_video.dat]\n
1113  *                  Audio[FileOutputNode-test_player_getplayerstate_audio.dat]
1114  *  - Sequence:
1115  *             -# CreatePlayer()
1116  *             -# AddDataSource()
1117  *             -# GetPVPlayerStateSync()
1118  *             -# Init()
1119  *             -# GetPVPlayerStateSync()
1120  *             -# AddDataSink() (video)
1121  *             -# GetPVPlayerStateSync()
1122  *             -# AddDataSink() (audio)
1123  *             -# GetPVPlayerStateSync()
1124  *             -# Prepare()
1125  *             -# GetPVPlayerStateSync()
1126  *             -# Start()
1127  *             -# GetPVPlayerStateSync()
1128  *             -# WAIT 20 sec.
1129  *             -# Stop()
1130  *             -# GetPVPlayerState()
1131  *             -# RemoveDataSink() (video)
1132  *             -# GetPVPlayerState()
1133  *             -# RemoveDataSink() (audio)
1134  *             -# GetPVPlayerState()
1135  *             -# Reset()
1136  *             -# GetPVPlayerState()
1137  *             -# RemoveDataSource()
1138  *             -# DeletePlayer()
1139  *
1140  */
1141 class pvplayer_async_test_getplayerstate : public pvplayer_async_test_base
1142 {
1143     public:
pvplayer_async_test_getplayerstate(PVPlayerAsyncTestParam aTestParam)1144         pvplayer_async_test_getplayerstate(PVPlayerAsyncTestParam aTestParam):
1145                 pvplayer_async_test_base(aTestParam)
1146                 , iPlayer(NULL)
1147                 , iDataSource(NULL)
1148                 , iDataSinkVideo(NULL)
1149                 , iIONodeVideo(NULL)
1150                 , iMIOFileOutVideo(NULL)
1151                 , iDataSinkAudio(NULL)
1152                 , iIONodeAudio(NULL)
1153                 , iMIOFileOutAudio(NULL)
1154                 , iCurrentCmdId(0)
1155         {
1156             iTestCaseName = _STRLIT_CHAR("GetPlayerState");
1157         }
1158 
~pvplayer_async_test_getplayerstate()1159         ~pvplayer_async_test_getplayerstate() {}
1160 
1161         void StartTest();
1162         void Run();
1163 
1164         void CommandCompleted(const PVCmdResponse& aResponse);
1165         void HandleErrorEvent(const PVAsyncErrorEvent& aEvent);
1166         void HandleInformationalEvent(const PVAsyncInformationalEvent& aEvent);
1167 
1168         enum PVTestState
1169         {
1170             STATE_CREATE,
1171             STATE_ADDDATASOURCE,
1172             STATE_INIT,
1173             STATE_ADDDATASINK_VIDEO,
1174             STATE_ADDDATASINK_AUDIO,
1175             STATE_PREPARE,
1176             STATE_START,
1177             STATE_STOP,
1178             STATE_PLAYER_STATE_FIRST,
1179             STATE_REMOVEDATASINK_VIDEO,
1180             STATE_PLAYER_STATE_SECOND,
1181             STATE_REMOVEDATASINK_AUDIO,
1182             STATE_PLAYER_STATE_THIRD,
1183             STATE_RESET,
1184             STATE_PLAYER_STATE_FOURTH,
1185             STATE_REMOVEDATASOURCE,
1186             STATE_CLEANUPANDCOMPLETE
1187         };
1188 
1189         PVTestState iState;
1190         PVPlayerState aState;
1191 
1192         PVPlayerInterface* iPlayer;
1193         PVPlayerDataSourceURL* iDataSource;
1194         PVPlayerDataSink* iDataSinkVideo;
1195         PVMFNodeInterface* iIONodeVideo;
1196         PvmiMIOControl* iMIOFileOutVideo;
1197         PVPlayerDataSink* iDataSinkAudio;
1198         PVMFNodeInterface* iIONodeAudio;
1199         PvmiMIOControl* iMIOFileOutAudio;
1200         PVCommandId iCurrentCmdId;
1201 };
1202 
1203 
1204 /*!
1205  *  A test case to test current position of the play back
1206  *  - Data Source: test.mp4
1207  *  - Data Sink(s): Video[FileOutputNode-test_player_getcurrentposition_video.dat]\n
1208  *                  Audio[FileOutputNode-test_player_getcurrentposition_audio.dat]
1209  *  - Sequence:
1210  *             -# CreatePlayer()
1211  *             -# AddDataSource()
1212  *             -# Init()
1213  *             -# AddDataSink() (video)
1214  *             -# AddDataSink() (audio)
1215  *             -# Prepare()
1216  *             -# Start()
1217  *             -# GetCurrentPositionSync()(Call this synchronous API after every 1 sec)
1218  *             -# GetCurrentPosition()(Call this asynchronous API after every 1 sec)
1219  *             -# Stop()
1220  *             -# RemoveDataSink() (video)
1221  *             -# RemoveDataSink() (audio)
1222  *             -# Reset()
1223  *             -# RemoveDataSource()
1224  *             -# DeletePlayer()
1225  *
1226  */
1227 class pvplayer_async_test_getcurrentposition : public pvplayer_async_test_base
1228 {
1229     public:
pvplayer_async_test_getcurrentposition(PVPlayerAsyncTestParam aTestParam)1230         pvplayer_async_test_getcurrentposition(PVPlayerAsyncTestParam aTestParam):
1231                 pvplayer_async_test_base(aTestParam)
1232                 , iPlayer(NULL)
1233                 , iDataSource(NULL)
1234                 , iDataSinkVideo(NULL)
1235                 , iIONodeVideo(NULL)
1236                 , iMIOFileOutVideo(NULL)
1237                 , iDataSinkAudio(NULL)
1238                 , iIONodeAudio(NULL)
1239                 , iMIOFileOutAudio(NULL)
1240                 , iCurrentCmdId(0)
1241                 , iCount(0)
1242         {
1243             iTestCaseName = _STRLIT_CHAR("GetCurrentPosition");
1244         }
1245 
~pvplayer_async_test_getcurrentposition()1246         ~pvplayer_async_test_getcurrentposition() {}
1247 
1248         void StartTest();
1249         void Run();
1250 
1251         void CommandCompleted(const PVCmdResponse& aResponse);
1252         void HandleErrorEvent(const PVAsyncErrorEvent& aEvent);
1253         void HandleInformationalEvent(const PVAsyncInformationalEvent& aEvent);
1254 
1255         enum PVTestState
1256         {
1257             STATE_CREATE,
1258             STATE_ADDDATASOURCE,
1259             STATE_INIT,
1260             STATE_ADDDATASINK_VIDEO,
1261             STATE_ADDDATASINK_AUDIO,
1262             STATE_PREPARE,
1263             STATE_START,
1264             STATE_GETCURRENT_POSITION_SYNC,
1265             STATE_GETCURRENT_POSITION,
1266             STATE_STOP,
1267             STATE_REMOVEDATASINK_VIDEO,
1268             STATE_REMOVEDATASINK_AUDIO,
1269             STATE_RESET,
1270             STATE_REMOVEDATASOURCE,
1271             STATE_CLEANUPANDCOMPLETE
1272         };
1273 
1274         PVTestState iState;
1275 
1276         PVPlayerInterface* iPlayer;
1277         PVPlayerDataSourceURL* iDataSource;
1278         PVPlayerDataSink* iDataSinkVideo;
1279         PVMFNodeInterface* iIONodeVideo;
1280         PvmiMIOControl* iMIOFileOutVideo;
1281         PVPlayerDataSink* iDataSinkAudio;
1282         PVMFNodeInterface* iIONodeAudio;
1283         PvmiMIOControl* iMIOFileOutAudio;
1284         PVCommandId iCurrentCmdId;
1285         PVMFStatus Status;
1286         PVPPlaybackPosition Position ;
1287         uint32 iCount;
1288 };
1289 
1290 
1291 /*!
1292  *  A test case to test the play and stops the play at specified position
1293  *  - Data Source: test_reposition.mp4
1294  *  - Data Sink(s): Video[FileOutputNode-test_player_playsetstopposition_video.dat]\n
1295  *                  Audio[FileOutputNode-test_player_playsetstopposition_audio.dat]
1296  *  - Sequence:
1297  *             -# CreatePlayer()
1298  *             -# AddDataSource()
1299  *             -# Init()
1300  *             -# AddDataSink() (video)
1301  *             -# AddDataSink() (audio)
1302  *             -# Prepare()
1303  *             -# Start()
1304  *             -# SetPlaybackRange(blank,stop at 15 sec)
1305  *             -# WAIT 20 sec. for end time reached event
1306  *             -# Stop()
1307  *             -# RemoveDataSink() (video)
1308  *             -# RemoveDataSink() (audio)
1309  *             -# Reset()
1310  *             -# RemoveDataSource()
1311  *             -# DeletePlayer()
1312  *
1313  */
1314 class pvplayer_async_test_playsetstopposition : public pvplayer_async_test_base
1315 {
1316     public:
pvplayer_async_test_playsetstopposition(PVPlayerAsyncTestParam aTestParam)1317         pvplayer_async_test_playsetstopposition(PVPlayerAsyncTestParam aTestParam):
1318                 pvplayer_async_test_base(aTestParam)
1319                 , iPlayer(NULL)
1320                 , iDataSource(NULL)
1321                 , iDataSinkVideo(NULL)
1322                 , iIONodeVideo(NULL)
1323                 , iMIOFileOutVideo(NULL)
1324                 , iDataSinkAudio(NULL)
1325                 , iIONodeAudio(NULL)
1326                 , iMIOFileOutAudio(NULL)
1327                 , iCurrentCmdId(0)
1328         {
1329             iTestCaseName = _STRLIT_CHAR("Play-Set End Time");
1330         }
1331 
~pvplayer_async_test_playsetstopposition()1332         ~pvplayer_async_test_playsetstopposition() {}
1333 
1334         void StartTest();
1335         void Run();
1336 
1337         void CommandCompleted(const PVCmdResponse& aResponse);
1338         void HandleErrorEvent(const PVAsyncErrorEvent& aEvent);
1339         void HandleInformationalEvent(const PVAsyncInformationalEvent& aEvent);
1340 
1341         enum PVTestState
1342         {
1343             STATE_CREATE,
1344             STATE_ADDDATASOURCE,
1345             STATE_INIT,
1346             STATE_ADDDATASINK_VIDEO,
1347             STATE_ADDDATASINK_AUDIO,
1348             STATE_PREPARE,
1349             STATE_START,
1350             STATE_SETPLAYBACKRANGE,
1351             STATE_STOPTIMENOTREACHED,
1352             STATE_STOP,
1353             STATE_REMOVEDATASINK_VIDEO,
1354             STATE_REMOVEDATASINK_AUDIO,
1355             STATE_RESET,
1356             STATE_REMOVEDATASOURCE,
1357             STATE_CLEANUPANDCOMPLETE
1358         };
1359 
1360         PVTestState iState;
1361 
1362         PVPlayerInterface* iPlayer;
1363         PVPlayerDataSourceURL* iDataSource;
1364         PVPlayerDataSink* iDataSinkVideo;
1365         PVMFNodeInterface* iIONodeVideo;
1366         PvmiMIOControl* iMIOFileOutVideo;
1367         PVPlayerDataSink* iDataSinkAudio;
1368         PVMFNodeInterface* iIONodeAudio;
1369         PvmiMIOControl* iMIOFileOutAudio;
1370         PVCommandId iCurrentCmdId;
1371 };
1372 
1373 
1374 /*!
1375  *  A test case to test the play and stops the play at specified video frame number
1376  *  - Data Source: test_reposition.mp4
1377  *  - Data Sink(s): Video[FileOutputNode-test_player_playsetstoppositionvidframenum_video.dat]\n
1378  *                  Audio[FileOutputNode-test_player_playsetstoppositionvidframenum_audio.dat]
1379  *  - Sequence:
1380  *             -# CreatePlayer()
1381  *             -# AddDataSource()
1382  *             -# Init()
1383  *             -# AddDataSink() (video)
1384  *             -# AddDataSink() (audio)
1385  *             -# Prepare()
1386  *             -# Start()
1387  *             -# SetPlaybackRange(blank,stop at 150 frame=~15 sec)
1388  *             -# WAIT 20 sec. for end time reached event
1389  *             -# Stop()
1390  *             -# RemoveDataSink() (video)
1391  *             -# RemoveDataSink() (audio)
1392  *             -# Reset()
1393  *             -# RemoveDataSource()
1394  *             -# DeletePlayer()
1395  *
1396  */
1397 class pvplayer_async_test_playsetstoppositionvidframenum : public pvplayer_async_test_base
1398 {
1399     public:
pvplayer_async_test_playsetstoppositionvidframenum(PVPlayerAsyncTestParam aTestParam)1400         pvplayer_async_test_playsetstoppositionvidframenum(PVPlayerAsyncTestParam aTestParam):
1401                 pvplayer_async_test_base(aTestParam)
1402                 , iPlayer(NULL)
1403                 , iDataSource(NULL)
1404                 , iDataSinkVideo(NULL)
1405                 , iIONodeVideo(NULL)
1406                 , iMIOFileOutVideo(NULL)
1407                 , iDataSinkAudio(NULL)
1408                 , iIONodeAudio(NULL)
1409                 , iMIOFileOutAudio(NULL)
1410                 , iCurrentCmdId(0)
1411         {
1412             iTestCaseName = _STRLIT_CHAR("Play-Set End Time by VidFrameNum");
1413         }
1414 
~pvplayer_async_test_playsetstoppositionvidframenum()1415         ~pvplayer_async_test_playsetstoppositionvidframenum() {}
1416 
1417         void StartTest();
1418         void Run();
1419 
1420         void CommandCompleted(const PVCmdResponse& aResponse);
1421         void HandleErrorEvent(const PVAsyncErrorEvent& aEvent);
1422         void HandleInformationalEvent(const PVAsyncInformationalEvent& aEvent);
1423 
1424         enum PVTestState
1425         {
1426             STATE_CREATE,
1427             STATE_ADDDATASOURCE,
1428             STATE_INIT,
1429             STATE_ADDDATASINK_VIDEO,
1430             STATE_ADDDATASINK_AUDIO,
1431             STATE_PREPARE,
1432             STATE_START,
1433             STATE_SETPLAYBACKRANGE,
1434             STATE_STOPTIMENOTREACHED,
1435             STATE_STOP,
1436             STATE_REMOVEDATASINK_VIDEO,
1437             STATE_REMOVEDATASINK_AUDIO,
1438             STATE_RESET,
1439             STATE_REMOVEDATASOURCE,
1440             STATE_CLEANUPANDCOMPLETE
1441         };
1442 
1443         PVTestState iState;
1444 
1445         PVPlayerInterface* iPlayer;
1446         PVPlayerDataSourceURL* iDataSource;
1447         PVPlayerDataSink* iDataSinkVideo;
1448         PVMFNodeInterface* iIONodeVideo;
1449         PvmiMIOControl* iMIOFileOutVideo;
1450         PVPlayerDataSink* iDataSinkAudio;
1451         PVMFNodeInterface* iIONodeAudio;
1452         PvmiMIOControl* iMIOFileOutAudio;
1453         PVCommandId iCurrentCmdId;
1454 };
1455 
1456 
1457 /*!
1458  *  A test case to test the start of play at specified position and then stop
1459  *  - Data Source: test_reposition.mp4
1460  *  - Data Sink(s): Video[FileOutputNode-test_player_setstartpositionplaystop_video.dat]\n
1461  *                  Audio[FileOutputNode-test_player_setstartpositionplaystop_audio.dat]
1462  *  - Sequence:
1463  *             -# CreatePlayer()
1464  *             -# AddDataSource()
1465  *             -# Init()
1466  *             -# AddDataSink() (video)
1467  *             -# AddDataSink() (audio)
1468  *             -# SetPlaybackRange(start at 10 sec, blank)
1469  *             -# Prepare()
1470  *             -# Start()
1471  *             -# WAIT 20 sec.
1472  *             -# Stop()
1473  *             -# RemoveDataSink() (video)
1474  *             -# RemoveDataSink() (audio)
1475  *             -# Reset()
1476  *             -# RemoveDataSource()
1477  *             -# DeletePlayer()
1478  *
1479  */
1480 class pvplayer_async_test_setstartpositionplaystop : public pvplayer_async_test_base
1481 {
1482     public:
pvplayer_async_test_setstartpositionplaystop(PVPlayerAsyncTestParam aTestParam)1483         pvplayer_async_test_setstartpositionplaystop(PVPlayerAsyncTestParam aTestParam):
1484                 pvplayer_async_test_base(aTestParam)
1485                 , iPlayer(NULL)
1486                 , iDataSource(NULL)
1487                 , iDataSinkVideo(NULL)
1488                 , iIONodeVideo(NULL)
1489                 , iMIOFileOutVideo(NULL)
1490                 , iDataSinkAudio(NULL)
1491                 , iIONodeAudio(NULL)
1492                 , iMIOFileOutAudio(NULL)
1493                 , iCurrentCmdId(0)
1494                 , iSourceContextData(NULL)
1495         {
1496             iTestCaseName = _STRLIT_CHAR("Set Begin Position-Play-Stop");
1497             iTargetNumSeek = 1;
1498             iNumSeek = 0;
1499         }
1500 
~pvplayer_async_test_setstartpositionplaystop()1501         ~pvplayer_async_test_setstartpositionplaystop() {}
1502 
1503         void StartTest();
1504         void Run();
1505 
1506         void CommandCompleted(const PVCmdResponse& aResponse);
1507         void HandleErrorEvent(const PVAsyncErrorEvent& aEvent);
1508         void HandleInformationalEvent(const PVAsyncInformationalEvent& aEvent);
1509 
1510         enum PVTestState
1511         {
1512             STATE_CREATE,
1513             STATE_ADDDATASOURCE,
1514             STATE_INIT,
1515             STATE_ADDDATASINK_VIDEO,
1516             STATE_ADDDATASINK_AUDIO,
1517             STATE_SETPLAYBACKRANGE,
1518             STATE_PREPARE,
1519             STATE_START,
1520             STATE_STOP,
1521             STATE_REMOVEDATASINK_VIDEO,
1522             STATE_REMOVEDATASINK_AUDIO,
1523             STATE_RESET,
1524             STATE_REMOVEDATASOURCE,
1525             STATE_CLEANUPANDCOMPLETE
1526         };
1527 
1528         PVTestState iState;
1529 
1530         PVPlayerInterface* iPlayer;
1531         PVPlayerDataSourceURL* iDataSource;
1532         PVPlayerDataSink* iDataSinkVideo;
1533         PVMFNodeInterface* iIONodeVideo;
1534         PvmiMIOControl* iMIOFileOutVideo;
1535         PVPlayerDataSink* iDataSinkAudio;
1536         PVMFNodeInterface* iIONodeAudio;
1537         PvmiMIOControl* iMIOFileOutAudio;
1538         PVCommandId iCurrentCmdId;
1539 
setMultipleSeekMode(uint32 aNum)1540         void setMultipleSeekMode(uint32 aNum)
1541         {
1542             iTargetNumSeek = aNum;
1543         }
1544 
1545     private:
1546         OSCL_wHeapString<OsclMemAllocator> wFileName;
1547         oscl_wchar output[512];
1548         uint32 iTargetNumSeek;
1549         uint32 iNumSeek;
1550 
1551         PVMFSourceContextData* iSourceContextData;
1552 };
1553 
1554 
1555 /*!
1556  *  A test case to test the start and stop of play at specified position using the play range
1557  *  - Data Source: test_reposition.mp4
1558  *  - Data Sink(s): Video[FileOutputNode-test_player_setplayrange_video.dat]\n
1559  *                  Audio[FileOutputNode-test_player_setplayrange_audio.dat]
1560  *  - Sequence:
1561  *             -# CreatePlayer()
1562  *             -# AddDataSource()
1563  *             -# Init()
1564  *             -# AddDataSink() (video)
1565  *             -# AddDataSink() (audio)
1566  *             =# SetPlaybackRange(start at 10 sec, stop at 25 sec)
1567  *             -# Prepare()
1568  *             -# Start()
1569  *             -# WAIT 20 sec. for end time reached event
1570  *             -# Stop()
1571  *             -# RemoveDataSink() (video)
1572  *             -# RemoveDataSink() (audio)
1573  *             -# Reset()
1574  *             -# RemoveDataSource()
1575  *             -# DeletePlayer()
1576  *
1577  */
1578 class pvplayer_async_test_setplayrangeplay : public pvplayer_async_test_base
1579 {
1580     public:
pvplayer_async_test_setplayrangeplay(PVPlayerAsyncTestParam aTestParam)1581         pvplayer_async_test_setplayrangeplay(PVPlayerAsyncTestParam aTestParam):
1582                 pvplayer_async_test_base(aTestParam)
1583                 , iPlayer(NULL)
1584                 , iDataSource(NULL)
1585                 , iDataSinkVideo(NULL)
1586                 , iIONodeVideo(NULL)
1587                 , iMIOFileOutVideo(NULL)
1588                 , iDataSinkAudio(NULL)
1589                 , iIONodeAudio(NULL)
1590                 , iMIOFileOutAudio(NULL)
1591                 , iCurrentCmdId(0)
1592         {
1593             iTestCaseName = _STRLIT_CHAR("SetPlaybackRange-Play");
1594         }
1595 
~pvplayer_async_test_setplayrangeplay()1596         ~pvplayer_async_test_setplayrangeplay() {}
1597 
1598         void StartTest();
1599         void Run();
1600 
1601         void CommandCompleted(const PVCmdResponse& aResponse);
1602         void HandleErrorEvent(const PVAsyncErrorEvent& aEvent);
1603         void HandleInformationalEvent(const PVAsyncInformationalEvent& aEvent);
1604 
1605         enum PVTestState
1606         {
1607             STATE_CREATE,
1608             STATE_ADDDATASOURCE,
1609             STATE_INIT,
1610             STATE_ADDDATASINK_VIDEO,
1611             STATE_ADDDATASINK_AUDIO,
1612             STATE_SETPLAYBACKRANGE,
1613             STATE_PREPARE,
1614             STATE_START,
1615             STATE_STOPTIMENOTREACHED,
1616             STATE_STOP,
1617             STATE_REMOVEDATASINK_VIDEO,
1618             STATE_REMOVEDATASINK_AUDIO,
1619             STATE_RESET,
1620             STATE_REMOVEDATASOURCE,
1621             STATE_CLEANUPANDCOMPLETE
1622         };
1623 
1624         PVTestState iState;
1625 
1626         PVPlayerInterface* iPlayer;
1627         PVPlayerDataSourceURL* iDataSource;
1628         PVPlayerDataSink* iDataSinkVideo;
1629         PVMFNodeInterface* iIONodeVideo;
1630         PvmiMIOControl* iMIOFileOutVideo;
1631         PVPlayerDataSink* iDataSinkAudio;
1632         PVMFNodeInterface* iIONodeAudio;
1633         PvmiMIOControl* iMIOFileOutAudio;
1634         PVCommandId iCurrentCmdId;
1635 };
1636 
1637 
1638 /*!
1639  *  A test case to test the start and stop of play at specified position using the play range
1640  *  with start position in video frame number
1641  *  - Data Source: test_reposition.mp4
1642  *  - Data Sink(s): Video[FileOutputNode-test_player_setplayrangevidframenum_video.dat]\n
1643  *                  Audio[FileOutputNode-test_player_setplayrangevidframenum_audio.dat]
1644  *  - Sequence:
1645  *             -# CreatePlayer()
1646  *             -# AddDataSource()
1647  *             -# Init()
1648  *             -# AddDataSink() (video)
1649  *             -# AddDataSink() (audio)
1650  *             =# SetPlaybackRange(start at frame 100=~10 sec, stop at 20sec)
1651  *             -# Prepare()
1652  *             -# Start()
1653  *             -# WAIT 20 sec. for end time reached event
1654  *             -# Stop()
1655  *             -# RemoveDataSink() (video)
1656  *             -# RemoveDataSink() (audio)
1657  *             -# Reset()
1658  *             -# RemoveDataSource()
1659  *             -# DeletePlayer()
1660  *
1661  */
1662 class pvplayer_async_test_setplayrangevidframenumplay : public pvplayer_async_test_base
1663 {
1664     public:
pvplayer_async_test_setplayrangevidframenumplay(PVPlayerAsyncTestParam aTestParam)1665         pvplayer_async_test_setplayrangevidframenumplay(PVPlayerAsyncTestParam aTestParam):
1666                 pvplayer_async_test_base(aTestParam)
1667                 , iPlayer(NULL)
1668                 , iDataSource(NULL)
1669                 , iDataSinkVideo(NULL)
1670                 , iIONodeVideo(NULL)
1671                 , iMIOFileOutVideo(NULL)
1672                 , iDataSinkAudio(NULL)
1673                 , iIONodeAudio(NULL)
1674                 , iMIOFileOutAudio(NULL)
1675                 , iCurrentCmdId(0)
1676         {
1677             iTestCaseName = _STRLIT_CHAR("SetPlaybackRange by VidFrameNum-Play");
1678         }
1679 
~pvplayer_async_test_setplayrangevidframenumplay()1680         ~pvplayer_async_test_setplayrangevidframenumplay() {}
1681 
1682         void StartTest();
1683         void Run();
1684 
1685         void CommandCompleted(const PVCmdResponse& aResponse);
1686         void HandleErrorEvent(const PVAsyncErrorEvent& aEvent);
1687         void HandleInformationalEvent(const PVAsyncInformationalEvent& aEvent);
1688 
1689         enum PVTestState
1690         {
1691             STATE_CREATE,
1692             STATE_ADDDATASOURCE,
1693             STATE_INIT,
1694             STATE_ADDDATASINK_VIDEO,
1695             STATE_ADDDATASINK_AUDIO,
1696             STATE_SETPLAYBACKRANGE,
1697             STATE_PREPARE,
1698             STATE_START,
1699             STATE_STOPTIMENOTREACHED,
1700             STATE_STOP,
1701             STATE_REMOVEDATASINK_VIDEO,
1702             STATE_REMOVEDATASINK_AUDIO,
1703             STATE_RESET,
1704             STATE_REMOVEDATASOURCE,
1705             STATE_CLEANUPANDCOMPLETE
1706         };
1707 
1708         PVTestState iState;
1709 
1710         PVPlayerInterface* iPlayer;
1711         PVPlayerDataSourceURL* iDataSource;
1712         PVPlayerDataSink* iDataSinkVideo;
1713         PVMFNodeInterface* iIONodeVideo;
1714         PvmiMIOControl* iMIOFileOutVideo;
1715         PVPlayerDataSink* iDataSinkAudio;
1716         PVMFNodeInterface* iIONodeAudio;
1717         PvmiMIOControl* iMIOFileOutAudio;
1718         PVCommandId iCurrentCmdId;
1719 };
1720 
1721 
1722 /*!
1723  *  A test case to test the repositioning during playback
1724  *  - Data Source: test_reposition.mp4
1725  *  - Data Sink(s): Video[FileOutputNode-test_player_playsetplayrangestop_video.dat]\n
1726  *                  Audio[FileOutputNode-test_player_playsetplayrangestop_audio.dat]
1727  *  - Sequence:
1728  *             -# CreatePlayer()
1729  *             -# AddDataSource()
1730  *             -# Init()
1731  *             -# AddDataSink() (video)
1732  *             -# AddDataSink() (audio)
1733  *             -# Prepare()
1734  *             -# Start()
1735  *             -# WAIT 10 sec.
1736  *             -# SetPlaybackRange(start at 20 sec, blank)
1737  *             -# WAIT 10 sec.
1738  *             -# Stop()
1739  *             -# RemoveDataSink() (video)
1740  *             -# RemoveDataSink() (audio)
1741  *             -# Reset()
1742  *             -# RemoveDataSource()
1743  *             -# DeletePlayer()
1744  *
1745  */
1746 class pvplayer_async_test_playsetplayrangestop : public pvplayer_async_test_base
1747 {
1748     public:
pvplayer_async_test_playsetplayrangestop(PVPlayerAsyncTestParam aTestParam)1749         pvplayer_async_test_playsetplayrangestop(PVPlayerAsyncTestParam aTestParam):
1750                 pvplayer_async_test_base(aTestParam)
1751                 , iPlayer(NULL)
1752                 , iDataSource(NULL)
1753                 , iDataSinkVideo(NULL)
1754                 , iIONodeVideo(NULL)
1755                 , iMIOFileOutVideo(NULL)
1756                 , iDataSinkAudio(NULL)
1757                 , iIONodeAudio(NULL)
1758                 , iMIOFileOutAudio(NULL)
1759                 , iCurrentCmdId(0)
1760         {
1761             iTestCaseName = _STRLIT_CHAR("Play-SetPlaybackRange-Stop");
1762         }
1763 
~pvplayer_async_test_playsetplayrangestop()1764         ~pvplayer_async_test_playsetplayrangestop() {}
1765 
1766         void StartTest();
1767         void Run();
1768 
1769         void CommandCompleted(const PVCmdResponse& aResponse);
1770         void HandleErrorEvent(const PVAsyncErrorEvent& aEvent);
1771         void HandleInformationalEvent(const PVAsyncInformationalEvent& aEvent);
1772 
1773         enum PVTestState
1774         {
1775             STATE_CREATE,
1776             STATE_ADDDATASOURCE,
1777             STATE_INIT,
1778             STATE_ADDDATASINK_VIDEO,
1779             STATE_ADDDATASINK_AUDIO,
1780             STATE_PREPARE,
1781             STATE_START,
1782             STATE_SETPLAYBACKRANGE,
1783             STATE_STOP,
1784             STATE_REMOVEDATASINK_VIDEO,
1785             STATE_REMOVEDATASINK_AUDIO,
1786             STATE_RESET,
1787             STATE_REMOVEDATASOURCE,
1788             STATE_CLEANUPANDCOMPLETE
1789         };
1790 
1791         PVTestState iState;
1792 
1793         PVPlayerInterface* iPlayer;
1794         PVPlayerDataSourceURL* iDataSource;
1795         PVPlayerDataSink* iDataSinkVideo;
1796         PVMFNodeInterface* iIONodeVideo;
1797         PvmiMIOControl* iMIOFileOutVideo;
1798         PVPlayerDataSink* iDataSinkAudio;
1799         PVMFNodeInterface* iIONodeAudio;
1800         PvmiMIOControl* iMIOFileOutAudio;
1801         PVCommandId iCurrentCmdId;
1802 };
1803 
1804 
1805 /*!
1806  *  A test case to test the repositioning during playback using video frame number
1807  *  - Data Source: test_reposition.mp4
1808  *  - Data Sink(s): Video[FileOutputNode-test_player_playsetplayrangevidframenumstop_video.dat]\n
1809  *                  Audio[FileOutputNode-test_player_playsetplayrangevidframenumstop_audio.dat]
1810  *  - Sequence:
1811  *             -# CreatePlayer()
1812  *             -# AddDataSource()
1813  *             -# Init()
1814  *             -# AddDataSink() (video)
1815  *             -# AddDataSink() (audio)
1816  *             -# Prepare()
1817  *             -# Start()
1818  *             -# WAIT 10 sec.
1819  *             -# SetPlaybackRange(start at video frame 100=~10sec, blank)
1820  *             -# WAIT 10 sec.
1821  *             -# Stop()
1822  *             -# RemoveDataSink() (video)
1823  *             -# RemoveDataSink() (audio)
1824  *             -# Reset()
1825  *             -# RemoveDataSource()
1826  *             -# DeletePlayer()
1827  *
1828  */
1829 class pvplayer_async_test_playsetplayrangevidframenumstop : public pvplayer_async_test_base
1830 {
1831     public:
pvplayer_async_test_playsetplayrangevidframenumstop(PVPlayerAsyncTestParam aTestParam)1832         pvplayer_async_test_playsetplayrangevidframenumstop(PVPlayerAsyncTestParam aTestParam):
1833                 pvplayer_async_test_base(aTestParam)
1834                 , iPlayer(NULL)
1835                 , iDataSource(NULL)
1836                 , iDataSinkVideo(NULL)
1837                 , iIONodeVideo(NULL)
1838                 , iMIOFileOutVideo(NULL)
1839                 , iDataSinkAudio(NULL)
1840                 , iIONodeAudio(NULL)
1841                 , iMIOFileOutAudio(NULL)
1842                 , iCurrentCmdId(0)
1843         {
1844             iTestCaseName = _STRLIT_CHAR("Play-SetPlaybackRange by VidFrameNum-Stop");
1845         }
1846 
~pvplayer_async_test_playsetplayrangevidframenumstop()1847         ~pvplayer_async_test_playsetplayrangevidframenumstop() {}
1848 
1849         void StartTest();
1850         void Run();
1851 
1852         void CommandCompleted(const PVCmdResponse& aResponse);
1853         void HandleErrorEvent(const PVAsyncErrorEvent& aEvent);
1854         void HandleInformationalEvent(const PVAsyncInformationalEvent& aEvent);
1855 
1856         enum PVTestState
1857         {
1858             STATE_CREATE,
1859             STATE_ADDDATASOURCE,
1860             STATE_INIT,
1861             STATE_ADDDATASINK_VIDEO,
1862             STATE_ADDDATASINK_AUDIO,
1863             STATE_PREPARE,
1864             STATE_START,
1865             STATE_SETPLAYBACKRANGE,
1866             STATE_STOP,
1867             STATE_REMOVEDATASINK_VIDEO,
1868             STATE_REMOVEDATASINK_AUDIO,
1869             STATE_RESET,
1870             STATE_REMOVEDATASOURCE,
1871             STATE_CLEANUPANDCOMPLETE
1872         };
1873 
1874         PVTestState iState;
1875 
1876         PVPlayerInterface* iPlayer;
1877         PVPlayerDataSourceURL* iDataSource;
1878         PVPlayerDataSink* iDataSinkVideo;
1879         PVMFNodeInterface* iIONodeVideo;
1880         PvmiMIOControl* iMIOFileOutVideo;
1881         PVPlayerDataSink* iDataSinkAudio;
1882         PVMFNodeInterface* iIONodeAudio;
1883         PvmiMIOControl* iMIOFileOutAudio;
1884         PVCommandId iCurrentCmdId;
1885 };
1886 
1887 
1888 /*!
1889  *  A test case to test the track level information extension interface
1890  *  - Data Source: test_trackinfo.mp4
1891  *  - Data Sink(s): Video[FileOutputNode-test_player_tracklevelinfo_video.dat]\n
1892  *                  Audio[FileOutputNode-test_player_tracklevelinfo_audio.dat]
1893  *  - Sequence:
1894  *             -# CreatePlayer()
1895  *             -# QueryInterface() (track level info extension IF) THIS SHOULD FAIL
1896  *             -# AddDataSource()
1897  *             -# Init()
1898  *             -# AddDataSink() (video)
1899  *             -# AddDataSink() (audio)
1900  *             -# Prepare()
1901  *             -# Start()
1902  *             -# QueryInterface() (track level info extension IF)
1903  *             -# Call track level info APIs
1904  *             -# Stop()
1905  *             -# RemoveDataSink() (video)
1906  *             -# RemoveDataSink() (audio)
1907  *             -# Reset()
1908  *             -# RemoveDataSource()
1909  *             -# QueryInterface() (track level info extension IF) THIS SHOULD FAIL
1910  *             -# DeletePlayer()
1911  *
1912  */
1913 class PVMFTrackLevelInfoExtensionInterface;
1914 
1915 class pvplayer_async_test_tracklevelinfo : public pvplayer_async_test_base
1916 {
1917     public:
pvplayer_async_test_tracklevelinfo(PVPlayerAsyncTestParam aTestParam)1918         pvplayer_async_test_tracklevelinfo(PVPlayerAsyncTestParam aTestParam):
1919                 pvplayer_async_test_base(aTestParam)
1920                 , iPlayer(NULL)
1921                 , iDataSource(NULL)
1922                 , iDataSinkVideo(NULL)
1923                 , iIONodeVideo(NULL)
1924                 , iMIOFileOutVideo(NULL)
1925                 , iDataSinkAudio(NULL)
1926                 , iIONodeAudio(NULL)
1927                 , iMIOFileOutAudio(NULL)
1928                 , iTrackLevelInfoIF(NULL)
1929                 , iCurrentCmdId(0)
1930         {
1931             iTestCaseName = _STRLIT_CHAR("Track-Level Info");
1932         }
1933 
~pvplayer_async_test_tracklevelinfo()1934         ~pvplayer_async_test_tracklevelinfo() {}
1935 
1936         void StartTest();
1937         void Run();
1938 
1939         void CommandCompleted(const PVCmdResponse& aResponse);
1940         void HandleErrorEvent(const PVAsyncErrorEvent& aEvent);
1941         void HandleInformationalEvent(const PVAsyncInformationalEvent& aEvent);
1942 
1943         enum PVTestState
1944         {
1945             STATE_CREATE,
1946             STATE_INVALIDQUERYINTERFACE1,
1947             STATE_ADDDATASOURCE,
1948             STATE_INIT,
1949             STATE_ADDDATASINK_VIDEO,
1950             STATE_ADDDATASINK_AUDIO,
1951             STATE_PREPARE,
1952             STATE_START,
1953             STATE_QUERYINTERFACE,
1954             STATE_TRACKLEVELINFOTEST,
1955             STATE_STOP,
1956             STATE_REMOVEDATASINK_VIDEO,
1957             STATE_REMOVEDATASINK_AUDIO,
1958             STATE_RESET,
1959             STATE_REMOVEDATASOURCE,
1960             STATE_INVALIDQUERYINTERFACE2,
1961             STATE_CLEANUPANDCOMPLETE
1962         };
1963 
1964         PVTestState iState;
1965 
1966         PVPlayerInterface* iPlayer;
1967         PVPlayerDataSourceURL* iDataSource;
1968         PVPlayerDataSink* iDataSinkVideo;
1969         PVMFNodeInterface* iIONodeVideo;
1970         PvmiMIOControl* iMIOFileOutVideo;
1971         PVPlayerDataSink* iDataSinkAudio;
1972         PVMFNodeInterface* iIONodeAudio;
1973         PvmiMIOControl* iMIOFileOutAudio;
1974         PVMFTrackLevelInfoExtensionInterface* iTrackLevelInfoIF;
1975         PVCommandId iCurrentCmdId;
1976     private:
1977         OSCL_wHeapString<OsclMemAllocator> wFileName;
1978         oscl_wchar output[512];
1979 };
1980 
1981 
1982 /*!
1983  *  A test case to test playback at a rate faster than "real-time"
1984  *  - Data Source: test_reposition.mp4
1985  *  - Data Sink(s): Video[FileOutputNode-test_player_setplaybackrate2X_video.dat]\n
1986  *                  Audio[FileOutputNode-test_player_setplaybackrate2X_audio.dat]
1987  *  - Sequence:
1988  *             -# CreatePlayer()
1989  *             -# AddDataSource()
1990  *             -# Init()
1991  *             -# AddDataSink() (video)
1992  *             -# AddDataSink() (audio)
1993  *             =# SetPlaybackRate(200000)
1994  *             -# Prepare()
1995  *             -# Start()
1996  *             -# WAIT 15 sec
1997  *             -# RemoveDataSink() (video)
1998  *             -# RemoveDataSink() (audio)
1999  *             -# Reset()
2000  *             -# RemoveDataSource()
2001  *             -# DeletePlayer()
2002  *
2003  */
2004 class pvplayer_async_test_setplaybackrate2X : public pvplayer_async_test_base
2005 {
2006     public:
pvplayer_async_test_setplaybackrate2X(PVPlayerAsyncTestParam aTestParam)2007         pvplayer_async_test_setplaybackrate2X(PVPlayerAsyncTestParam aTestParam):
2008                 pvplayer_async_test_base(aTestParam)
2009                 , iPlayer(NULL)
2010                 , iDataSource(NULL)
2011                 , iDataSinkVideo(NULL)
2012                 , iIONodeVideo(NULL)
2013                 , iMIOFileOutVideo(NULL)
2014                 , iDataSinkAudio(NULL)
2015                 , iIONodeAudio(NULL)
2016                 , iMIOFileOutAudio(NULL)
2017                 , iCurrentCmdId(0)
2018         {
2019             iTestCaseName = _STRLIT_CHAR("SetPlaybackRate 2X");
2020         }
2021 
~pvplayer_async_test_setplaybackrate2X()2022         ~pvplayer_async_test_setplaybackrate2X() {}
2023 
2024         void StartTest();
2025         void Run();
2026 
2027         void CommandCompleted(const PVCmdResponse& aResponse);
2028         void HandleErrorEvent(const PVAsyncErrorEvent& aEvent);
2029         void HandleInformationalEvent(const PVAsyncInformationalEvent& aEvent);
2030 
2031         enum PVTestState
2032         {
2033             STATE_CREATE,
2034             STATE_ADDDATASOURCE,
2035             STATE_INIT,
2036             STATE_ADDDATASINK_VIDEO,
2037             STATE_ADDDATASINK_AUDIO,
2038             STATE_PREPARE,
2039             STATE_SETPLAYBACKRATE,
2040             STATE_START,
2041             STATE_STOP,
2042             STATE_REMOVEDATASINK_VIDEO,
2043             STATE_REMOVEDATASINK_AUDIO,
2044             STATE_RESET,
2045             STATE_REMOVEDATASOURCE,
2046             STATE_CLEANUPANDCOMPLETE
2047         };
2048 
2049         PVTestState iState;
2050 
2051         PVPlayerInterface* iPlayer;
2052         PVPlayerDataSourceURL* iDataSource;
2053         PVPlayerDataSink* iDataSinkVideo;
2054         PVMFNodeInterface* iIONodeVideo;
2055         PvmiMIOControl* iMIOFileOutVideo;
2056         PVPlayerDataSink* iDataSinkAudio;
2057         PVMFNodeInterface* iIONodeAudio;
2058         PvmiMIOControl* iMIOFileOutAudio;
2059         PVCommandId iCurrentCmdId;
2060 };
2061 
2062 
2063 /*!
2064  *  A test case to test playback at a rate slower than "real-time"
2065  *  - Data Source: test_reposition.mp4
2066  *  - Data Sink(s): Video[FileOutputNode-test_player_setplaybackratefifth_video.dat]\n
2067  *                  Audio[FileOutputNode-test_player_setplaybackratefifth_audio.dat]
2068  *  - Sequence:
2069  *             -# CreatePlayer()
2070  *             -# AddDataSource()
2071  *             -# Init()
2072  *             -# AddDataSink() (video)
2073  *             -# AddDataSink() (audio)
2074  *             =# SetPlaybackRate(20000)
2075  *             -# Prepare()
2076  *             -# Start()
2077  *             -# WAIT 15 sec
2078  *             -# RemoveDataSink() (video)
2079  *             -# RemoveDataSink() (audio)
2080  *             -# Reset()
2081  *             -# RemoveDataSource()
2082  *             -# DeletePlayer()
2083  *
2084  */
2085 class pvplayer_async_test_setplaybackratefifth : public pvplayer_async_test_base
2086 {
2087     public:
pvplayer_async_test_setplaybackratefifth(PVPlayerAsyncTestParam aTestParam)2088         pvplayer_async_test_setplaybackratefifth(PVPlayerAsyncTestParam aTestParam):
2089                 pvplayer_async_test_base(aTestParam)
2090                 , iPlayer(NULL)
2091                 , iDataSource(NULL)
2092                 , iDataSinkVideo(NULL)
2093                 , iIONodeVideo(NULL)
2094                 , iMIOFileOutVideo(NULL)
2095                 , iDataSinkAudio(NULL)
2096                 , iIONodeAudio(NULL)
2097                 , iMIOFileOutAudio(NULL)
2098                 , iCurrentCmdId(0)
2099         {
2100             iTestCaseName = _STRLIT_CHAR("SetPlaybackRate 1/5X");
2101         }
2102 
~pvplayer_async_test_setplaybackratefifth()2103         ~pvplayer_async_test_setplaybackratefifth() {}
2104 
2105         void StartTest();
2106         void Run();
2107 
2108         void CommandCompleted(const PVCmdResponse& aResponse);
2109         void HandleErrorEvent(const PVAsyncErrorEvent& aEvent);
2110         void HandleInformationalEvent(const PVAsyncInformationalEvent& aEvent);
2111 
2112         enum PVTestState
2113         {
2114             STATE_CREATE,
2115             STATE_ADDDATASOURCE,
2116             STATE_INIT,
2117             STATE_ADDDATASINK_VIDEO,
2118             STATE_ADDDATASINK_AUDIO,
2119             STATE_PREPARE,
2120             STATE_SETPLAYBACKRATE,
2121             STATE_START,
2122             STATE_STOP,
2123             STATE_REMOVEDATASINK_VIDEO,
2124             STATE_REMOVEDATASINK_AUDIO,
2125             STATE_RESET,
2126             STATE_REMOVEDATASOURCE,
2127             STATE_CLEANUPANDCOMPLETE
2128         };
2129 
2130         PVTestState iState;
2131 
2132         PVPlayerInterface* iPlayer;
2133         PVPlayerDataSourceURL* iDataSource;
2134         PVPlayerDataSink* iDataSinkVideo;
2135         PVMFNodeInterface* iIONodeVideo;
2136         PvmiMIOControl* iMIOFileOutVideo;
2137         PVPlayerDataSink* iDataSinkAudio;
2138         PVMFNodeInterface* iIONodeAudio;
2139         PvmiMIOControl* iMIOFileOutAudio;
2140         PVCommandId iCurrentCmdId;
2141 };
2142 
2143 
2144 /*!
2145  *  A test case to test the normal engine sequence of playing a specified source when queueing commands together
2146  *  - Data Source: Specified source
2147  *  - Data Sink(s): Video[FileOutputNode-test_player_queuedcmd_[SRCFILENAME]_video.dat]\n
2148  *                  Audio[FileOutputNode-test_player_queuedcmd_[SRCFILENAME]_audio.dat]
2149  *  - Sequence:
2150  *             -# CreatePlayer()
2151  *             -# AddDataSource()/Init()/AddDataSink() (video)/AddDataSink() (audio)
2152  *             -# Prepare()/Start()
2153  *             -# WAIT 10 sec.
2154  *             -# Stop()/RemoveDataSink() (video)
2155  *             -# RemoveDataSink() (audio)/Reset()/RemoveDataSource()
2156  *             -# DeletePlayer()
2157  *
2158  */
2159 class pvplayer_async_test_queuedcommands : public pvplayer_async_test_base
2160 {
2161     public:
pvplayer_async_test_queuedcommands(PVPlayerAsyncTestParam aTestParam)2162         pvplayer_async_test_queuedcommands(PVPlayerAsyncTestParam aTestParam):
2163                 pvplayer_async_test_base(aTestParam)
2164                 , iPlayer(NULL)
2165                 , iDataSource(NULL)
2166                 , iDataSinkVideo(NULL)
2167                 , iIONodeVideo(NULL)
2168                 , iMIOFileOutVideo(NULL)
2169                 , iDataSinkAudio(NULL)
2170                 , iIONodeAudio(NULL)
2171                 , iMIOFileOutAudio(NULL)
2172                 , iCurrentCmdId(0)
2173         {
2174             iTestCaseName = _STRLIT_CHAR("Queued Commands");
2175         }
2176 
~pvplayer_async_test_queuedcommands()2177         ~pvplayer_async_test_queuedcommands() {}
2178 
2179         void StartTest();
2180         void Run();
2181 
2182         void CommandCompleted(const PVCmdResponse& aResponse);
2183         void HandleErrorEvent(const PVAsyncErrorEvent& aEvent);
2184         void HandleInformationalEvent(const PVAsyncInformationalEvent& aEvent);
2185 
2186         enum PVTestState
2187         {
2188             STATE_CREATE,
2189             STATE_QUEUEDCMD1,
2190             STATE_QUEUEDCMD2,
2191             STATE_QUEUEDCMD3,
2192             STATE_QUEUEDCMD4,
2193             STATE_CLEANUPANDCOMPLETE
2194         };
2195 
2196         PVTestState iState;
2197 
2198         PVPlayerInterface* iPlayer;
2199         PVPlayerDataSourceURL* iDataSource;
2200         PVPlayerDataSink* iDataSinkVideo;
2201         PVMFNodeInterface* iIONodeVideo;
2202         PvmiMIOControl* iMIOFileOutVideo;
2203         PVPlayerDataSink* iDataSinkAudio;
2204         PVMFNodeInterface* iIONodeAudio;
2205         PvmiMIOControl* iMIOFileOutAudio;
2206         Oscl_Vector<PVCommandId, OsclMemAllocator> iCmdIds;
2207         PVCommandId iCurrentCmdId;
2208 
2209     private:
2210         OSCL_wHeapString<OsclMemAllocator> wFileName;
2211         oscl_wchar output[512];
2212 };
2213 
2214 
2215 /*!
2216  *  A test case to test looping feature by calling SetPlaybackRange() when engine automatically pauses due to end time reached
2217  *  - Data Source: Specified source
2218  *  - Data Sink(s): Video[FileOutputNode-test_player_looping_[SRCFILENAME]_video.dat]\n
2219  *                  Audio[FileOutputNode-test_player_looping_[SRCFILENAME]_audio.dat]\n
2220  *                  Text[FileOutputNode-test_player_looping_[SRCFILENAME]_text.dat]
2221  *  - Sequence:
2222  *             -# CreatePlayer()
2223  *             -# AddDataSource()/Init()/AddDataSink() (video)/AddDataSink() (audio)/AddDataSink() (text)/Prepare()/Start()
2224  *             -# SetPlaybackRange(blank, end at 10 sec)
2225  *             -# WAIT 15 sec. for end time reached event
2226  *             -# SetPlaybackRange(start at 0 sec, end at 10 sec)
2227  *             -# Resume()
2228  *             -# WAIT 15 sec. for end time reached event
2229  *             -# Stop()/RemoveDataSink() (video)/RemoveDataSink() (audio)/RemoveDataSink() (text)/Reset()/RemoveDataSource()
2230  *             -# DeletePlayer()
2231  *
2232  */
2233 class pvplayer_async_test_looping : public pvplayer_async_test_base
2234 {
2235     public:
pvplayer_async_test_looping(PVPlayerAsyncTestParam aTestParam)2236         pvplayer_async_test_looping(PVPlayerAsyncTestParam aTestParam):
2237                 pvplayer_async_test_base(aTestParam)
2238                 , iPlayer(NULL)
2239                 , iDataSource(NULL)
2240                 , iDataSinkVideo(NULL)
2241                 , iIONodeVideo(NULL)
2242                 , iMIOFileOutVideo(NULL)
2243                 , iDataSinkAudio(NULL)
2244                 , iIONodeAudio(NULL)
2245                 , iMIOFileOutAudio(NULL)
2246                 , iDataSinkText(NULL)
2247                 , iIONodeText(NULL)
2248                 , iMIOFileOutText(NULL)
2249                 , iCurrentCmdId(0)
2250         {
2251             iTestCaseName = _STRLIT_CHAR("Looping");
2252         }
2253 
~pvplayer_async_test_looping()2254         ~pvplayer_async_test_looping() {}
2255 
2256         void StartTest();
2257         void Run();
2258 
2259         void CommandCompleted(const PVCmdResponse& aResponse);
2260         void HandleErrorEvent(const PVAsyncErrorEvent& aEvent);
2261         void HandleInformationalEvent(const PVAsyncInformationalEvent& aEvent);
2262 
2263         enum PVTestState
2264         {
2265             STATE_CREATE,
2266             STATE_STARTPLAYBACK,
2267             STATE_SETPLAYBACKRANGE1,
2268             STATE_ENDTIMENOTREACHED1,
2269             STATE_SETPLAYBACKRANGE2,
2270             STATE_RESUME,
2271             STATE_ENDTIMENOTREACHED2,
2272             STATE_SHUTDOWN,
2273             STATE_CLEANUPANDCOMPLETE
2274         };
2275 
2276         PVTestState iState;
2277 
2278         PVPlayerInterface* iPlayer;
2279         PVPlayerDataSourceURL* iDataSource;
2280         PVPlayerDataSink* iDataSinkVideo;
2281         PVMFNodeInterface* iIONodeVideo;
2282         PvmiMIOControl* iMIOFileOutVideo;
2283         PVPlayerDataSink* iDataSinkAudio;
2284         PVMFNodeInterface* iIONodeAudio;
2285         PvmiMIOControl* iMIOFileOutAudio;
2286         PVPlayerDataSink* iDataSinkText;
2287         PVMFNodeInterface* iIONodeText;
2288         PvmiMIOControl* iMIOFileOutText;
2289         Oscl_Vector<PVCommandId, OsclMemAllocator> iCmdIds;
2290         PVCommandId iCurrentCmdId;
2291 
2292     private:
2293         OSCL_wHeapString<OsclMemAllocator> wFileName;
2294         oscl_wchar output[512];
2295 };
2296 
2297 
2298 /*!
2299  *  A test case to test the normal engine sequence of playing a specified source till end of clip
2300  *  - Data Source: Passed in parameter
2301  *  - Data Sink(s): Video[FileOutputNode-test_player_waitforeos_[SRCFILENAME]_video.dat]\n
2302  *                  Audio[FileOutputNode-test_player_waitforeos_[SRCFILENAME]_audio.dat]\n
2303  *                  Text[FileOutputNode-test_player_waitforeos_[SRCFILENAME]_text.dat]
2304  *  - Sequence
2305  *             -# CreatePlayer()
2306  *             -# AddDataSource()
2307  *             -# Init()
2308  *             -# AddDataSink() (video)
2309  *             -# AddDataSink() (audio)
2310  *             -# AddDataSink() (text)
2311  *             -# Prepare()
2312  *             -# Start()
2313  *             -# WAIT FOR EOS OR 180 SEC TIMEOUT
2314  *             -# Stop()
2315  *             -# RemoveDataSink() (video)
2316  *             -# RemoveDataSink() (audio)
2317  *             -# RemoveDataSink() (text)
2318  *             -# Reset()
2319  *             -# RemoveDataSource()
2320  *             -# DeletePlayer()
2321  *
2322  */
2323 class pvplayer_async_test_waitforeos : public pvplayer_async_test_base
2324 {
2325     public:
pvplayer_async_test_waitforeos(PVPlayerAsyncTestParam aTestParam)2326         pvplayer_async_test_waitforeos(PVPlayerAsyncTestParam aTestParam):
2327                 pvplayer_async_test_base(aTestParam)
2328                 , iPlayer(NULL)
2329                 , iDataSource(NULL)
2330                 , iDataSinkVideo(NULL)
2331                 , iIONodeVideo(NULL)
2332                 , iMIOFileOutVideo(NULL)
2333                 , iDataSinkAudio(NULL)
2334                 , iIONodeAudio(NULL)
2335                 , iMIOFileOutAudio(NULL)
2336                 , iDataSinkText(NULL)
2337                 , iIONodeText(NULL)
2338                 , iMIOFileOutText(NULL)
2339                 , iCurrentCmdId(0)
2340         {
2341             iTestCaseName = _STRLIT_CHAR("Play-Wait For EOS");
2342         }
2343 
~pvplayer_async_test_waitforeos()2344         ~pvplayer_async_test_waitforeos() {}
2345 
2346         void StartTest();
2347         void Run();
2348 
2349         void CommandCompleted(const PVCmdResponse& aResponse);
2350         void HandleErrorEvent(const PVAsyncErrorEvent& aEvent);
2351         void HandleInformationalEvent(const PVAsyncInformationalEvent& aEvent);
2352 
2353         enum PVTestState
2354         {
2355             STATE_CREATE,
2356             STATE_ADDDATASOURCE,
2357             STATE_INIT,
2358             STATE_ADDDATASINK_VIDEO,
2359             STATE_ADDDATASINK_AUDIO,
2360             STATE_ADDDATASINK_TEXT,
2361             STATE_PREPARE,
2362             STATE_START,
2363             STATE_EOSNOTREACHED,
2364             STATE_STOP,
2365             STATE_REMOVEDATASINK_VIDEO,
2366             STATE_REMOVEDATASINK_AUDIO,
2367             STATE_REMOVEDATASINK_TEXT,
2368             STATE_RESET,
2369             STATE_REMOVEDATASOURCE,
2370             STATE_CLEANUPANDCOMPLETE
2371         };
2372 
2373         PVTestState iState;
2374 
2375         PVPlayerInterface* iPlayer;
2376         PVPlayerDataSourceURL* iDataSource;
2377         PVPlayerDataSink* iDataSinkVideo;
2378         PVMFNodeInterface* iIONodeVideo;
2379         PvmiMIOControl* iMIOFileOutVideo;
2380         PVPlayerDataSink* iDataSinkAudio;
2381         PVMFNodeInterface* iIONodeAudio;
2382         PvmiMIOControl* iMIOFileOutAudio;
2383         PVPlayerDataSink* iDataSinkText;
2384         PVMFNodeInterface* iIONodeText;
2385         PvmiMIOControl* iMIOFileOutText;
2386         PVCommandId iCurrentCmdId;
2387 
2388     private:
2389         OSCL_wHeapString<OsclMemAllocator> wFileName;
2390         oscl_wchar output[512];
2391 };
2392 
2393 
2394 
2395 /*!
2396  *  A test case to test if the player engine can handle multiple pause-resume requests
2397  *  - Data Source: Specified source
2398  *  - Data Sink(s): Video[FileOutputNode-test_player_multipauseresume_[SRCFILENAME]_video.dat]\n
2399  *                  Audio[FileOutputNode-test_player_multipauseresume_[SRCFILENAME]_audio.dat]\n
2400  *                  Text[FileOutputNode-test_player_multipauseresume_[SRCFILENAME]_text.dat]
2401  *  - Sequence:
2402  *             -# CreatePlayer()
2403  *             -# AddDataSource()/Init()/AddDataSink() (video)/AddDataSink() (audio)/AddDataSink() (text)/Prepare()/Start()
2404  *             -# WAIT 5 sec.
2405  *             -# Pause()/Resume() X 5
2406  *             -# WAIT 2 sec.
2407  *             -# Pause()
2408  *             -# WAIT 5 sec.
2409  *             -# Resume()
2410  *             -# WAIT 3 sec.
2411  *             -# Pause()/Resume() X 3
2412  *             -# Wait 5 sec.
2413  *             -# Stop()/RemoveDataSink() (video)/RemoveDataSink() (audio)/RemoveDataSink() (text)/Reset()/RemoveDataSource()
2414  *             -# DeletePlayer()
2415  *
2416  */
2417 class pvplayer_async_test_multipauseresume : public pvplayer_async_test_base
2418 {
2419     public:
pvplayer_async_test_multipauseresume(PVPlayerAsyncTestParam aTestParam)2420         pvplayer_async_test_multipauseresume(PVPlayerAsyncTestParam aTestParam):
2421                 pvplayer_async_test_base(aTestParam)
2422                 , iPlayer(NULL)
2423                 , iDataSource(NULL)
2424                 , iDataSinkVideo(NULL)
2425                 , iIONodeVideo(NULL)
2426                 , iMIOFileOutVideo(NULL)
2427                 , iDataSinkAudio(NULL)
2428                 , iIONodeAudio(NULL)
2429                 , iMIOFileOutAudio(NULL)
2430                 , iDataSinkText(NULL)
2431                 , iIONodeText(NULL)
2432                 , iMIOFileOutText(NULL)
2433                 , iCurrentCmdId(0)
2434         {
2435             iTestCaseName = _STRLIT_CHAR("Multiple Pause-Resume");
2436         }
2437 
~pvplayer_async_test_multipauseresume()2438         ~pvplayer_async_test_multipauseresume() {}
2439 
2440         void StartTest();
2441         void Run();
2442 
2443         void CommandCompleted(const PVCmdResponse& aResponse);
2444         void HandleErrorEvent(const PVAsyncErrorEvent& aEvent);
2445         void HandleInformationalEvent(const PVAsyncInformationalEvent& aEvent);
2446 
2447         enum PVTestState
2448         {
2449             STATE_CREATE,
2450             STATE_STARTPLAYBACK,
2451             STATE_PAUSERESUME1,
2452             STATE_PAUSE,
2453             STATE_RESUME,
2454             STATE_PAUSERESUME2,
2455             STATE_SHUTDOWN,
2456             STATE_CLEANUPANDCOMPLETE
2457         };
2458 
2459         PVTestState iState;
2460 
2461         PVPlayerInterface* iPlayer;
2462         PVPlayerDataSourceURL* iDataSource;
2463         PVPlayerDataSink* iDataSinkVideo;
2464         PVMFNodeInterface* iIONodeVideo;
2465         PvmiMIOControl* iMIOFileOutVideo;
2466         PVPlayerDataSink* iDataSinkAudio;
2467         PVMFNodeInterface* iIONodeAudio;
2468         PvmiMIOControl* iMIOFileOutAudio;
2469         PVPlayerDataSink* iDataSinkText;
2470         PVMFNodeInterface* iIONodeText;
2471         PvmiMIOControl* iMIOFileOutText;
2472         Oscl_Vector<PVCommandId, OsclMemAllocator> iCmdIds;
2473         PVCommandId iCurrentCmdId;
2474 
2475     private:
2476         OSCL_wHeapString<OsclMemAllocator> wFileName;
2477         oscl_wchar output[512];
2478 };
2479 
2480 
2481 /*!
2482  *  A test case to test if the player engine can handle multiple repositioning during playback
2483  *  - Data Source: Specified source
2484  *  - Data Sink(s): Video[FileOutputNode-test_player_multireposition_[SRCFILENAME]_video.dat]\n
2485  *                  Audio[FileOutputNode-test_player_multireposition_[SRCFILENAME]_audio.dat]\n
2486  *                  Text[FileOutputNode-test_player_multireposition_[SRCFILENAME]_text.dat]
2487  *  - Sequence:
2488  *             -# CreatePlayer()
2489  *             -# AddDataSource()/Init()/AddDataSink() (video)/AddDataSink() (audio)/AddDataSink() (text)/Prepare()/Start()
2490  *             -# WAIT 5 sec.
2491  *             -# SetPlaybackRange(20 sec, indeterminate)
2492  *             -# WAIT 5 sec.
2493  *             -# SetPlaybackRange(5 sec, indeterminate)
2494  *             -# WAIT 5 sec.
2495  *             -# SetPlaybackRange(25 sec, indeterminate)
2496  *             -# WAIT 5 sec.
2497  *             -# SetPlaybackRange(10 sec, indeterminate)
2498  *             -# WAIT 5 sec.
2499  *             -# SetPlaybackRange(20 sec, indeterminate)
2500  *             -# SetPlaybackRange(0 sec, indeterminate)
2501  *             -# WAIT 5 sec.
2502  *             -# Stop()/RemoveDataSink() (video)/RemoveDataSink() (audio)/RemoveDataSink() (text)/Reset()/RemoveDataSource()
2503  *             -# DeletePlayer()
2504  *
2505  */
2506 class pvplayer_async_test_multireposition : public pvplayer_async_test_base
2507 {
2508     public:
pvplayer_async_test_multireposition(PVPlayerAsyncTestParam aTestParam)2509         pvplayer_async_test_multireposition(PVPlayerAsyncTestParam aTestParam):
2510                 pvplayer_async_test_base(aTestParam)
2511                 , iPlayer(NULL)
2512                 , iDataSource(NULL)
2513                 , iDataSinkVideo(NULL)
2514                 , iIONodeVideo(NULL)
2515                 , iMIOFileOutVideo(NULL)
2516                 , iDataSinkAudio(NULL)
2517                 , iIONodeAudio(NULL)
2518                 , iMIOFileOutAudio(NULL)
2519                 , iDataSinkText(NULL)
2520                 , iIONodeText(NULL)
2521                 , iMIOFileOutText(NULL)
2522                 , iCurrentCmdId(0)
2523         {
2524             iTestCaseName = _STRLIT_CHAR("Multiple SetPlaybackRange");
2525         }
2526 
~pvplayer_async_test_multireposition()2527         ~pvplayer_async_test_multireposition() {}
2528 
2529         void StartTest();
2530         void Run();
2531 
2532         void CommandCompleted(const PVCmdResponse& aResponse);
2533         void HandleErrorEvent(const PVAsyncErrorEvent& aEvent);
2534         void HandleInformationalEvent(const PVAsyncInformationalEvent& aEvent);
2535 
2536         enum PVTestState
2537         {
2538             STATE_CREATE,
2539             STATE_STARTPLAYBACK,
2540             STATE_SETPLAYBACKRANGE1,
2541             STATE_SETPLAYBACKRANGE2,
2542             STATE_SETPLAYBACKRANGE3,
2543             STATE_SETPLAYBACKRANGE4,
2544             STATE_SETPLAYBACKRANGE5,
2545             STATE_SETPLAYBACKRANGE6,
2546             STATE_SHUTDOWN,
2547             STATE_CLEANUPANDCOMPLETE
2548         };
2549 
2550         PVTestState iState;
2551 
2552         PVPlayerInterface* iPlayer;
2553         PVPlayerDataSourceURL* iDataSource;
2554         PVPlayerDataSink* iDataSinkVideo;
2555         PVMFNodeInterface* iIONodeVideo;
2556         PvmiMIOControl* iMIOFileOutVideo;
2557         PVPlayerDataSink* iDataSinkAudio;
2558         PVMFNodeInterface* iIONodeAudio;
2559         PvmiMIOControl* iMIOFileOutAudio;
2560         PVPlayerDataSink* iDataSinkText;
2561         PVMFNodeInterface* iIONodeText;
2562         PvmiMIOControl* iMIOFileOutText;
2563         PVCommandId iCurrentCmdId;
2564         Oscl_Vector<PVCommandId, OsclMemAllocator> iCmdIds;
2565 
2566         Oscl_FileServer iFS;
2567         Oscl_File iTimeLogFile;
2568 
2569     private:
2570         OSCL_wHeapString<OsclMemAllocator> wFileName;
2571         oscl_wchar output[512];
2572 };
2573 
2574 
2575 /*!
2576  *  A test case to test capability-and-configuration interface of player engine
2577  *  - Data Source: Passed in parameter
2578  *  - Data Sink(s): Video[FileOutputNode-test_player_capconfigif_[SRCFILENAME]_video.dat]\n
2579  *                  Audio[FileOutputNode-test_player_capconfigif_[SRCFILENAME]_audio.dat]
2580  *  - Sequence:
2581  *             -# CreatePlayer()
2582  *             -# QueryInterface() (capability-and-config interface)
2583  *             -# CALL CAPCONFIG METHODS WHILE IDLE
2584  *             -# AddDataSource()
2585  *             -# Init()
2586  *             -# CALL CAPCONFIG METHODS WHILE INITIALIZED
2587  *             -# AddDataSink() (video)
2588  *             -# AddDataSink() (audio)
2589  *             -# Prepare()
2590  *             -# Start()
2591  *             -# CALL CAPCONFIG METHODS WHILE PLAYING
2592  *             -# Stop()
2593  *             -# RemoveDataSink() (video)
2594  *             -# RemoveDataSink() (audio)
2595  *             -# Reset()
2596  *             -# RemoveDataSource()
2597  *             -# DeletePlayer()
2598  *
2599  */
2600 class pvplayer_async_test_capconfigiftest : public pvplayer_async_test_base, public PvmiConfigAndCapabilityCmdObserver
2601 {
2602     public:
pvplayer_async_test_capconfigiftest(PVPlayerAsyncTestParam aTestParam)2603         pvplayer_async_test_capconfigiftest(PVPlayerAsyncTestParam aTestParam):
2604                 pvplayer_async_test_base(aTestParam)
2605                 , iPlayer(NULL)
2606                 , iPlayerCapConfigIF(NULL)
2607                 , iDataSource(NULL)
2608                 , iDataSinkVideo(NULL)
2609                 , iIONodeVideo(NULL)
2610                 , iMIOFileOutVideo(NULL)
2611                 , iDataSinkAudio(NULL)
2612                 , iIONodeAudio(NULL)
2613                 , iMIOFileOutAudio(NULL)
2614                 , iCurrentCmdId(0)
2615                 , iErrorKVP(NULL)
2616         {
2617             iTestCaseName = _STRLIT_CHAR("Capability&Config Interface");
2618         }
2619 
~pvplayer_async_test_capconfigiftest()2620         ~pvplayer_async_test_capconfigiftest() {}
2621 
2622         void StartTest();
2623         void Run();
2624 
2625         void CommandCompleted(const PVCmdResponse& aResponse);
2626         void HandleErrorEvent(const PVAsyncErrorEvent& aEvent);
2627         void HandleInformationalEvent(const PVAsyncInformationalEvent& aEvent);
2628 
2629         // From PvmiConfigAndCapabilityCmdObserver
2630         void SignalEvent(int32 req_id);
2631 
2632         enum PVTestState
2633         {
2634             STATE_CREATE,
2635             STATE_QUERYINTERFACE,
2636             STATE_CAPCONFIG1,
2637             STATE_CAPCONFIG2,
2638             STATE_ADDDATASOURCE,
2639             STATE_INIT,
2640             STATE_CAPCONFIG3,
2641             STATE_ADDDATASINK_VIDEO,
2642             STATE_ADDDATASINK_AUDIO,
2643             STATE_PREPARE,
2644             STATE_START,
2645             STATE_CAPCONFIG4,
2646             STATE_STOP,
2647             STATE_REMOVEDATASINK_VIDEO,
2648             STATE_REMOVEDATASINK_AUDIO,
2649             STATE_RESET,
2650             STATE_REMOVEDATASOURCE,
2651             STATE_CLEANUPANDCOMPLETE
2652         };
2653 
2654         PVTestState iState;
2655 
2656         PVPlayerInterface* iPlayer;
2657         PvmiCapabilityAndConfig* iPlayerCapConfigIF;
2658         PVPlayerDataSourceURL* iDataSource;
2659         PVPlayerDataSink* iDataSinkVideo;
2660         PVMFNodeInterface* iIONodeVideo;
2661         PvmiMIOControl* iMIOFileOutVideo;
2662         PVPlayerDataSink* iDataSinkAudio;
2663         PVMFNodeInterface* iIONodeAudio;
2664         PvmiMIOControl* iMIOFileOutAudio;
2665         PVCommandId iCurrentCmdId;
2666 
2667         PvmiKvp* iErrorKVP;
2668         PvmiKvp iKVPSetAsync;
2669         OSCL_StackString<64> iKeyStringSetAsync;
2670 
2671     private:
2672         OSCL_wHeapString<OsclMemAllocator> wFileName;
2673         oscl_wchar output[512];
2674 };
2675 
2676 
2677 /*!
2678  *  A test case to test the working of Start - Stop - Prepare - SetPlaybackRange - Start
2679  *  - Data Source: Specified source
2680  *  - Data Sink(s): Video[FileOutputNode-test_player_multireposition_[SRCFILENAME]_video.dat]\n
2681  *                  Audio[FileOutputNode-test_player_multireposition_[SRCFILENAME]_audio.dat]\n
2682  *                  Text[FileOutputNode-test_player_multireposition_[SRCFILENAME]_text.dat]
2683  *  - Sequence:
2684  *             -# CreatePlayer()
2685  *             -# AddDataSource()/Init()/AddDataSink() (video)/AddDataSink() (audio)/AddDataSink() (text)
2686  *             -# Prepare()/ SetPlaybackRange() / Start()
2687  *             -# Wait for 5secs.
2688  *             -# Stop()/RemoveDataSink() (video)/RemoveDataSink() (audio)/RemoveDataSink() (text)/Reset()/RemoveDataSource()
2689  *             -# DeletePlayer()
2690  *
2691  */
2692 class pvplayer_async_test_setplaybackafterprepare : public pvplayer_async_test_base
2693 {
2694     public:
pvplayer_async_test_setplaybackafterprepare(PVPlayerAsyncTestParam aTestParam)2695         pvplayer_async_test_setplaybackafterprepare(PVPlayerAsyncTestParam aTestParam):
2696                 pvplayer_async_test_base(aTestParam)
2697                 , iPlayer(NULL)
2698                 , iDataSource(NULL)
2699                 , iDataSinkVideo(NULL)
2700                 , iIONodeVideo(NULL)
2701                 , iMIOFileOutVideo(NULL)
2702                 , iDataSinkAudio(NULL)
2703                 , iIONodeAudio(NULL)
2704                 , iMIOFileOutAudio(NULL)
2705                 , iDataSinkText(NULL)
2706                 , iIONodeText(NULL)
2707                 , iMIOFileOutText(NULL)
2708                 , iCurrentCmdId(0)
2709                 , iSourceContextData(NULL)
2710         {
2711             iTestCaseName = _STRLIT_CHAR("SetPlaybackRange After Prepare");
2712         }
2713 
~pvplayer_async_test_setplaybackafterprepare()2714         ~pvplayer_async_test_setplaybackafterprepare() {}
2715 
2716         void StartTest();
2717         void Run();
2718 
2719         void CommandCompleted(const PVCmdResponse& aResponse);
2720         void HandleErrorEvent(const PVAsyncErrorEvent& aEvent);
2721         void HandleInformationalEvent(const PVAsyncInformationalEvent& aEvent);
2722 
2723         enum PVTestState
2724         {
2725             STATE_CREATE,
2726             STATE_ADDDATASOURCE,
2727             STATE_INIT,
2728             STATE_ADDDATASINK_VIDEO,
2729             STATE_ADDDATASINK_AUDIO,
2730             STATE_ADDDATASINK_TEXT,
2731             STATE_PREPARE,
2732             STATE_SETPLAYBACKRANGE,
2733             STATE_START,
2734             STATE_STOP,
2735             STATE_REMOVEDATASINK_VIDEO,
2736             STATE_REMOVEDATASINK_AUDIO,
2737             STATE_REMOVEDATASINK_TEXT,
2738             STATE_RESET,
2739             STATE_REMOVEDATASOURCE,
2740             STATE_CLEANUPANDCOMPLETE
2741         };
2742 
2743         PVTestState iState;
2744 
2745         PVPlayerInterface* iPlayer;
2746         PVPlayerDataSourceURL* iDataSource;
2747         PVPlayerDataSink* iDataSinkVideo;
2748         PVMFNodeInterface* iIONodeVideo;
2749         PvmiMIOControl* iMIOFileOutVideo;
2750         PVPlayerDataSink* iDataSinkAudio;
2751         PVMFNodeInterface* iIONodeAudio;
2752         PvmiMIOControl* iMIOFileOutAudio;
2753         PVPlayerDataSink* iDataSinkText;
2754         PVMFNodeInterface* iIONodeText;
2755         PvmiMIOControl* iMIOFileOutText;
2756         PVCommandId iCurrentCmdId;
2757         Oscl_Vector<PVCommandId, OsclMemAllocator> iCmdIds;
2758 
2759         Oscl_FileServer iFS;
2760         Oscl_File iTimeLogFile;
2761 
2762     private:
2763         OSCL_wHeapString<OsclMemAllocator> wFileName;
2764         oscl_wchar output[512];
2765         PVMFSourceContextData* iSourceContextData;
2766 };
2767 
2768 /*!
2769  *  A test case to test if the player engine can handle multiple pause seek resume during playback
2770  *  - Data Source: Specified source
2771  *  - Data Sink(s): Video[FileOutputNode-test_player_multireposition_[SRCFILENAME]_video.dat]\n
2772  *                  Audio[FileOutputNode-test_player_multireposition_[SRCFILENAME]_audio.dat]\n
2773  *                  Text[FileOutputNode-test_player_multireposition_[SRCFILENAME]_text.dat]
2774  *  - Sequence:
2775  *             -# CreatePlayer()
2776  *             -# AddDataSource()/Init()/AddDataSink() (video)/AddDataSink() (audio)/AddDataSink() (text)/Prepare()/Start()
2777  *             -# WAIT Duration/10 sec.
2778  *             -# Pause()/SetPlaybackRange(Duration/4 sec, indeterminate)/Resume()
2779  *             -# WAIT Duration/10 sec.
2780  *             -# Pause()/SetPlaybackRange(Duration/4 sec, indeterminate)/Resume()
2781  *             -#   :
2782  *             -# EOS
2783  *             -# Stop()/RemoveDataSink() (video)/RemoveDataSink() (audio)/RemoveDataSink() (text)/Reset()/RemoveDataSource()
2784  *             -# DeletePlayer()
2785  *
2786  */
2787 class pvplayer_async_test_multipauseseekresume : public pvplayer_async_test_base
2788 {
2789     public:
pvplayer_async_test_multipauseseekresume(PVPlayerAsyncTestParam aTestParam)2790         pvplayer_async_test_multipauseseekresume(PVPlayerAsyncTestParam aTestParam):
2791                 pvplayer_async_test_base(aTestParam)
2792                 , iPlayer(NULL)
2793                 , iDataSource(NULL)
2794                 , iDataSinkVideo(NULL)
2795                 , iIONodeVideo(NULL)
2796                 , iMIOFileOutVideo(NULL)
2797                 , iDataSinkAudio(NULL)
2798                 , iIONodeAudio(NULL)
2799                 , iMIOFileOutAudio(NULL)
2800                 , iDataSinkText(NULL)
2801                 , iIONodeText(NULL)
2802                 , iMIOFileOutText(NULL)
2803                 , iCurrentCmdId(0)
2804                 , iSessionDuration(0)
2805                 , iSourceContextData(NULL)
2806         {
2807             iTestCaseName = _STRLIT_CHAR("Multiple Pause SetPlaybackRange Resume");
2808             iTargetNumPause = 1;
2809             iNumPause = 0;
2810         }
2811 
~pvplayer_async_test_multipauseseekresume()2812         ~pvplayer_async_test_multipauseseekresume() {}
2813 
2814         void StartTest();
2815         void Run();
2816 
2817         void CommandCompleted(const PVCmdResponse& aResponse);
2818         void HandleErrorEvent(const PVAsyncErrorEvent& aEvent);
2819         void HandleInformationalEvent(const PVAsyncInformationalEvent& aEvent);
2820 
2821         enum PVTestState
2822         {
2823             STATE_CREATE,
2824             STATE_ADDDATASOURCE,
2825             STATE_INIT,
2826             STATE_GETMETADATAKEYLIST,
2827             STATE_GETMETADATAVALUELIST,
2828             STATE_ADDDATASINK_VIDEO,
2829             STATE_ADDDATASINK_AUDIO,
2830             STATE_ADDDATASINK_TEXT,
2831             STATE_PREPARE,
2832             STATE_START,
2833             STATE_PAUSE,
2834             STATE_SETPLAYBACKRANGE,
2835             STATE_RESUME,
2836             STATE_STOP,
2837             STATE_REMOVEDATASINK_VIDEO,
2838             STATE_REMOVEDATASINK_AUDIO,
2839             STATE_REMOVEDATASINK_TEXT,
2840             STATE_RESET,
2841             STATE_REMOVEDATASOURCE,
2842             STATE_CLEANUPANDCOMPLETE
2843         };
2844 
2845         PVTestState iState;
2846 
2847         PVPlayerInterface* iPlayer;
2848         PVPlayerDataSourceURL* iDataSource;
2849         PVPlayerDataSink* iDataSinkVideo;
2850         PVMFNodeInterface* iIONodeVideo;
2851         PvmiMIOControl* iMIOFileOutVideo;
2852         PVPlayerDataSink* iDataSinkAudio;
2853         PVMFNodeInterface* iIONodeAudio;
2854         PvmiMIOControl* iMIOFileOutAudio;
2855         PVPlayerDataSink* iDataSinkText;
2856         PVMFNodeInterface* iIONodeText;
2857         PvmiMIOControl* iMIOFileOutText;
2858         PVCommandId iCurrentCmdId;
2859         Oscl_Vector<PVCommandId, OsclMemAllocator> iCmdIds;
2860 
setMultiplePauseMode(uint32 aNum)2861         void setMultiplePauseMode(uint32 aNum)
2862         {
2863             iTargetNumPause = aNum;
2864         }
2865 
2866     private:
2867         OSCL_wHeapString<OsclMemAllocator> wFileName;
2868         oscl_wchar output[512];
2869 
2870         PVPMetadataList iMetadataKeyList;
2871         Oscl_Vector<PvmiKvp, OsclMemAllocator> iMetadataValueList;
2872         int32 iNumValues;
2873 
2874         uint32 iTargetNumPause;
2875         uint32 iNumPause;
2876         uint32 iSessionDuration;
2877 
2878         PVMFSourceContextData* iSourceContextData;
2879 };
2880 
2881 /**
2882 * pvplayer_async_test_multiple_instance is an Open-Play-Stop test case
2883 * that launches a 2nd engine instance and plays the selected input
2884 * simultaneously from the two instances.
2885 */
2886 class PVMFLocalDataSource;
2887 class PvOmapVideo;
2888 class PVRefOmapAudioOutput;
2889 
2890 
2891 class pvplayer_async_test_multiple_instance : public pvplayer_async_test_base
2892 {
2893     public:
pvplayer_async_test_multiple_instance(PVPlayerAsyncTestParam aTestParam)2894         pvplayer_async_test_multiple_instance(PVPlayerAsyncTestParam aTestParam):
2895                 pvplayer_async_test_base(aTestParam)
2896                 , iPlayer(NULL)
2897                 , iDataSource(NULL)
2898                 , iDataSinkVideo(NULL)
2899                 , iDataSinkAudio(NULL)
2900                 , iDataSinkText(NULL)
2901                 , iIONodeVideo(NULL)
2902                 , iIONodeAudio(NULL)
2903                 , iIONodeText(NULL)
2904                 , iMOutVideo(NULL)
2905                 , iMOutAudio(NULL)
2906                 , iMOutText(NULL)
2907                 , iCurrentCmdId(0)
2908         {
2909             iSinkName = _STRLIT_WCHAR("pvplayer_async_test_multiple_instance_");
2910             iTestCaseName = _STRLIT_CHAR("Multiple Instance Open-Play-Stop");
2911             iLocalDataSource = NULL;
2912 
2913             iParentInstance = NULL;
2914             iChildThreadFailures = 0;
2915             iChildThreadLeave = 0;
2916             iChildThreadExit = false;
2917             //make a persistent copy of the test params.
2918             iParam = new PVPlayerAsyncTestParam();
2919             iParam->Copy(aTestParam);
2920         }
2921 
~pvplayer_async_test_multiple_instance()2922         ~pvplayer_async_test_multiple_instance()
2923         {
2924             delete iParam;
2925         }
2926 
2927         //To support the 2nd instance of the test case.
2928         pvplayer_async_test_multiple_instance* iParentInstance;
2929         int32 iChildThreadFailures;
2930         int32 iChildThreadLeave;
2931         bool iChildThreadExit;
2932         PVPlayerAsyncTestParam* iParam;
2933         void ChildTestIsTrue(bool);
2934         static void InThread(pvplayer_async_test_multiple_instance* parent);
2935         //An observer class for the 2nd instance of the test case.
2936         class ChildObserver: public pvplayer_async_test_observer
2937         {
2938             public:
2939                 void TestCompleted(test_case &tc);
2940         };
2941         //End 2nd instance support.
2942 
2943         void StartTest();
2944         void Run();
2945 
2946         void CommandCompleted(const PVCmdResponse& aResponse);
2947         void HandleErrorEvent(const PVAsyncErrorEvent& aEvent);
2948         void HandleInformationalEvent(const PVAsyncInformationalEvent& aEvent);
2949 
2950         enum PVTestState
2951         {
2952             STATE_CREATE,
2953             STATE_ADDDATASOURCE,
2954             STATE_INIT,
2955             STATE_GETMETADATAKEYLIST,
2956             STATE_GETMETADATAVALUELIST,
2957             STATE_ADDDATASINK_VIDEO,
2958             STATE_ADDDATASINK_AUDIO,
2959             STATE_ADDDATASINK_TEXT,
2960             STATE_PREPARE,
2961             STATE_START,
2962             STATE_STOP,
2963             STATE_REMOVEDATASINK_VIDEO,
2964             STATE_REMOVEDATASINK_AUDIO,
2965             STATE_REMOVEDATASINK_TEXT,
2966             STATE_RESET,
2967             STATE_REMOVEDATASOURCE,
2968             STATE_CLEANUPANDCOMPLETE
2969         };
2970 
2971         PVTestState iState;
2972 
2973         PVPlayerInterface* iPlayer;
2974         PVPlayerDataSourceURL* iDataSource;
2975         PVPlayerDataSink* iDataSinkVideo;
2976         PVPlayerDataSink* iDataSinkAudio;
2977         PVPlayerDataSink* iDataSinkText;
2978         PVMFNodeInterface* iIONodeVideo;
2979         PVMFNodeInterface* iIONodeAudio;
2980         PVMFNodeInterface* iIONodeText;
2981         PvmiMIOControl* iMOutVideo;
2982         PvmiMIOControl* iMOutAudio;
2983         PvmiMIOControl* iMOutText;
2984         PVCommandId iCurrentCmdId;
2985 
2986         OSCL_wHeapString<OsclMemAllocator> iFileNameWStr;
2987         oscl_wchar iTmpWCharBuffer[512];
2988 
2989         PVMFLocalDataSource* iLocalDataSource;
2990 
2991         void PrintMetadata();
2992         PVPMetadataList iMetadataKeyList;
2993         Oscl_Vector<PvmiKvp, OsclMemAllocator> iMetadataValueList;
2994         int32 iNumValues;
2995         OSCL_wHeapString<OsclMemAllocator> iSinkName;
2996 
2997 };
2998 
2999 /**
3000 * pvplayer_async_test_multiple_thread is an Open-Play-Stop test case
3001 * that launches engine instance in a second thread and tests controlling
3002 * engine from an app thread.
3003 */
3004 class PVMFLocalDataSource;
3005 class PvOmapVideo;
3006 class PVRefOmapAudioOutput;
3007 class OsclExecScheduler;
3008 
3009 #include "threadsafe_queue.h"
3010 
3011 class pvplayer_async_test_multiple_thread : public pvplayer_async_test_base
3012         , public ThreadSafeQueueObserver
3013 {
3014     public:
pvplayer_async_test_multiple_thread(PVPlayerAsyncTestParam aTestParam)3015         pvplayer_async_test_multiple_thread(PVPlayerAsyncTestParam aTestParam):
3016                 pvplayer_async_test_base(aTestParam)
3017                 , iPlayer(NULL)
3018                 , iDataSource(NULL)
3019                 , iDataSinkVideo(NULL)
3020                 , iDataSinkAudio(NULL)
3021                 , iDataSinkText(NULL)
3022                 , iIONodeVideo(NULL)
3023                 , iIONodeAudio(NULL)
3024                 , iIONodeText(NULL)
3025                 , iMOutVideo(NULL)
3026                 , iMOutAudio(NULL)
3027                 , iMOutText(NULL)
3028                 , iCurrentCmdId(0)
3029         {
3030             iSinkName = _STRLIT_WCHAR("pvplayer_async_test_multiple_thread_");
3031             iTestCaseName = _STRLIT_CHAR("Multiple Thread Open-Play-Stop");
3032             iLocalDataSource = NULL;
3033         }
3034 
~pvplayer_async_test_multiple_thread()3035         ~pvplayer_async_test_multiple_thread()
3036         {
3037         }
3038 
3039         void StartTest();
3040         void Run();
3041 
3042         void CommandCompleted(const PVCmdResponse& aResponse);
3043         void HandleErrorEvent(const PVAsyncErrorEvent& aEvent);
3044         void HandleInformationalEvent(const PVAsyncInformationalEvent& aEvent);
3045 
3046         enum PVTestState
3047         {
3048             STATE_CREATE,
3049             STATE_ADDDATASOURCE,
3050             STATE_INIT,
3051             STATE_GETMETADATAKEYLIST,
3052             STATE_GETMETADATAVALUELIST,
3053             STATE_RELEASEMETADATAVALUES,
3054             STATE_ADDDATASINK_VIDEO,
3055             STATE_ADDDATASINK_AUDIO,
3056             STATE_ADDDATASINK_TEXT,
3057             STATE_PREPARE,
3058             STATE_START,
3059             STATE_STOP,
3060             STATE_REMOVEDATASINK_VIDEO,
3061             STATE_REMOVEDATASINK_AUDIO,
3062             STATE_REMOVEDATASINK_TEXT,
3063             STATE_RESET,
3064             STATE_REMOVEDATASOURCE,
3065             STATE_WAIT_FOR_ERROR_HANDLING,
3066             STATE_CLEANUPANDCOMPLETE
3067         };
3068 
3069         PVTestState iState;
3070 
3071         PVPlayerInterface* iPlayer;
3072         PVPlayerDataSourceURL* iDataSource;
3073         PVPlayerDataSink* iDataSinkVideo;
3074         PVPlayerDataSink* iDataSinkAudio;
3075         PVPlayerDataSink* iDataSinkText;
3076         PVMFNodeInterface* iIONodeVideo;
3077         PVMFNodeInterface* iIONodeAudio;
3078         PVMFNodeInterface* iIONodeText;
3079         PvmiMIOControl* iMOutVideo;
3080         PvmiMIOControl* iMOutAudio;
3081         PvmiMIOControl* iMOutText;
3082         PVCommandId iCurrentCmdId;
3083 
3084         OSCL_wHeapString<OsclMemAllocator> iFileNameWStr;
3085         oscl_wchar iTmpWCharBuffer[512];
3086 
3087         PVMFLocalDataSource* iLocalDataSource;
3088 
3089         void PrintMetadata();
3090         PVPMetadataList iMetadataKeyList;
3091         Oscl_Vector<PvmiKvp, OsclMemAllocator> iMetadataValueList;
3092         int32 iNumValues;
3093         OSCL_wHeapString<OsclMemAllocator> iSinkName;
3094 
3095         ThreadSafeQueue iThreadSafeCommandQueue;
3096         ThreadSafeQueue iThreadSafeErrorQueue;
3097         ThreadSafeQueue iThreadSafeInfoQueue;
3098         void ThreadSafeQueueDataAvailable(ThreadSafeQueue*);
3099         OsclSemaphore iThreadReadySem;
3100         OsclSemaphore iThreadExitSem;
3101         int32 iThreadErrors;
3102         OsclExecScheduler* iThreadScheduler;
3103 };
3104 
3105 #endif // TEST_PV_PLAYER_ENGINE_TESTSET1_H_INCLUDED
3106 
3107