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_TESTSET6_H_INCLUDED 19 #define TEST_PV_PLAYER_ENGINE_TESTSET6_H_INCLUDED 20 21 /** 22 * @file test_pv_player_engine_testset6.h 23 * @brief This file contains the class definitions for the sixth set of 24 * test cases for PVPlayerEngine - Streaming tests 25 * 26 */ 27 28 #ifndef TEST_PV_PLAYER_ENGINE_H_INCLUDED 29 #include "test_pv_player_engine.h" 30 #endif 31 32 #ifndef TEST_PV_PLAYER_ENGINE_CONFIG_H_INCLUDED 33 #include "test_pv_player_engine_config.h" 34 #endif 35 36 #ifndef PVMF_STREAMING_DATA_SOURCE_H_INCLUDED 37 #include "pvmf_streaming_data_source.h" 38 #endif 39 40 #ifndef PVMF_SOURCE_CONTEXT_DATA_H_INCLUDED 41 #include "pvmf_source_context_data.h" 42 #endif 43 44 #if PVR_SUPPORT 45 #ifndef PVMF_PVR_CONTROL_INTERFACE_H_INCLUDED 46 #include "pvmf_pvr_control_interface.h" 47 #endif 48 #ifndef PVPVRFFPARSER_H_INCLUDED 49 #include "pvpvrffparser.h" 50 #endif 51 #endif 52 53 54 #define AMR_MPEG4_RTSP_URL "rtsp://pvserveroha.pv.com/public/Interop/3GPP/pv2/pv-amr-475_mpeg4-20.3gp" 55 #define AMR_MPEG4_RTSP_URL_2 "rtsp://pvserveroha.pv.com/public/metadata/pvmetadata.mp4" 56 #define H263_AMR_RTSP_URL "rtsp://pvserveroha.pv.com/public/Interop/3GPP/pv2/pv-amr-122_h263-64.3gp" 57 #define MPEG4_RTSP_URL "rtsp://pvserveroha.pv.com/public/Interop/3GPP/pv2/pv-mpeg4rdatapartr64.3gp" 58 #define MPEG4_SHRT_HDR_RTSP_URL "rtsp://pvserveroha.pv.com/public/Interop/3GPP/pv2/pv-mpeg4shorthdrr64.3gp" 59 #define AAC_RTSP_URL "rtsp://pvserveroha.pv.com/public/Interop/3GPP/pv2/pv-aac64_novisual.3gp" 60 #define MPEG4_AAC_RTSP_URL "rtsp://pvserveroha.pv.com/public/Interop/3GPP/pv2/pv2-aac64_mpeg4-rvlcs-64.3gp" 61 #define AMR_MPEG4_SDP_FILE "pv_amr_mpeg4.sdp" 62 #define WM_BSS_URL "http://pvwmsoha.pv.com:8020/WMContent/MBR/mbr_8tracks.wmv" 63 #if PVR_SUPPORT 64 #define DEFAULT_PV_PLAYLIST_URL "rtsp://pvserver6.pv.com:554/public/playlist/va_playlists/ply_av_01_mp4_aac.ply" 65 #endif 66 67 class PVPlayerDataSourceURL; 68 class PVPlayerDataSink; 69 class PVPlayerDataSink; 70 class PVPlayerDataSinkFilename; 71 class PvmfFileOutputNodeConfigInterface; 72 class PvmiCapabilityAndConfig; 73 74 #define DEFAULT_LIVE_BUFFER_DURATION 20 75 /*! 76 * A test case to test the normal engine sequence of playing an rtsp url 77 * - Data Source: RTSP URL 78 * - Data Sink(s): Video[FileOutputNode-test_player_rtspurl_video.dat]\n 79 * Audio[FileOutputNode-test_player_rtspurl_audio.dat] 80 * - Sequence: 81 * -# CreatePlayer() 82 * -# AddDataSource() 83 * -# Init() 84 * -# AddDataSink() (video) 85 * -# AddDataSink() (audio) 86 * -# Prepare() 87 * -# Start() 88 * -# WAIT 20 sec. 89 * -# Stop() 90 * -# RemoveDataSink() (video) 91 * -# RemoveDataSink() (audio) 92 * -# Reset() 93 * -# RemoveDataSource() 94 * -# DeletePlayer() 95 * 96 */ 97 class pvplayer_async_test_streamingopenplaystop : public pvplayer_async_test_base 98 { 99 public: 100 pvplayer_async_test_streamingopenplaystop(PVPlayerAsyncTestParam aTestParam, 101 PVMFFormatType aVideoSinkFormat, 102 PVMFFormatType aAudioSinkFormat, 103 uint32 aTestID, 104 bool aPauseResumeEnable, 105 bool aSeekEnable, 106 bool aWaitForEOS, 107 bool aCloaking, 108 bool aCancelDuringPrepare, 109 bool aForwardEnable, 110 bool aUseFileHandle = false, 111 bool aMultipleSeekToEndOfClipEnable = false) pvplayer_async_test_base(aTestParam)112 : pvplayer_async_test_base(aTestParam) 113 , iPlayer(NULL) 114 , iDataSource(NULL) 115 , iDataSinkVideo(NULL) 116 , iDataSinkAudio(NULL) 117 , iIONodeVideo(NULL) 118 , iIONodeAudio(NULL) 119 , iMIOFileOutVideo(NULL) 120 , iMIOFileOutAudio(NULL) 121 , iCurrentCmdId(0) 122 , iCancelAllCmdId(0) 123 , iSeekAfterEOSEnable(false) 124 , iSessionDuration(0) 125 , bcloaking(aCloaking) 126 , oLiveSession(false) 127 , iProtocolRollOver(false) 128 , iProtocolRollOverWithUnknownURLType(false) 129 , iPlayListURL(false) 130 , iStreamDataSource(NULL) 131 , iSourceContextData(NULL) 132 , iPlayListSwitchMode(0) 133 , iErrorCodeTest(false) 134 , iErrorCode(0) 135 , iUseFileHandle(false) 136 , iPauseDenied(false) 137 , iTotalValuesRetrieved(0) 138 , iStartingIndex(0) 139 , iBlockSize(5) 140 #if PVR_SUPPORT 141 , m_PVRControl(NULL) 142 , iLiveBufferDurationInSec(DEFAULT_LIVE_BUFFER_DURATION) 143 , iLiveBufferStorage(PVRConfig::EMemory) 144 #endif 145 { 146 iSeekAfterPause = false; 147 iVideoSinkFormatType = aVideoSinkFormat; 148 iAudioSinkFormatType = aAudioSinkFormat; 149 oPauseResumeEnable = aPauseResumeEnable; 150 oSeekEnable = aSeekEnable; 151 oWaitForEOS = aWaitForEOS; 152 iUseFileHandle = aUseFileHandle; 153 ifilehandle = NULL; 154 oCancelDuringPrepare = aCancelDuringPrepare; 155 oForwardEnable = aForwardEnable; 156 oMultipleSeekToEndOfClipEnable = aMultipleSeekToEndOfClipEnable; 157 iTestID = aTestID; 158 iNumPlay = 0; 159 iTargetNumPlay = 1; 160 iNumPause = 0; 161 iTargetNumPause = 1; 162 iPauseDurationInMS = 10000; //10 seconds by default 163 } 164 ~pvplayer_async_test_streamingopenplaystop()165 ~pvplayer_async_test_streamingopenplaystop() {} 166 167 void StartTest(); 168 void Run(); 169 170 void CommandCompleted(const PVCmdResponse& aResponse); 171 void HandleErrorEvent(const PVAsyncErrorEvent& aEvent); 172 void HandleInformationalEvent(const PVAsyncInformationalEvent& aEvent); 173 174 enum PVTestState 175 { 176 STATE_CREATE, 177 STATE_QUERYINTERFACE, 178 STATE_ADDDATASOURCE, 179 STATE_CONFIGPARAMS, 180 STATE_INIT, 181 STATE_GETMETADATAKEYLIST, 182 STATE_GETMETADATAVALUELIST, 183 STATE_ADDDATASINK_VIDEO, 184 STATE_ADDDATASINK_AUDIO, 185 STATE_PREPARE, 186 STATE_CANCELALL, 187 STATE_WAIT_FOR_CANCELALL, 188 STATE_START, 189 STATE_SETPLAYBACKRANGE, 190 STATE_PAUSE, 191 STATE_RESUME, 192 STATE_EOSNOTREACHED, 193 STATE_STOP, 194 STATE_REMOVEDATASINK_VIDEO, 195 STATE_REMOVEDATASINK_AUDIO, 196 STATE_RESET, 197 STATE_REMOVEDATASOURCE, 198 STATE_CLEANUPANDCOMPLETE, 199 STATE_SETFORWARD, 200 STATE_SETPLAYBACKRANGE_2 201 }; 202 203 PVTestState iState; 204 205 PVPlayerInterface* iPlayer; 206 PVPlayerDataSourceURL* iDataSource; 207 PVPlayerDataSink* iDataSinkVideo; 208 PVPlayerDataSink* iDataSinkAudio; 209 PVMFNodeInterface* iIONodeVideo; 210 PVMFNodeInterface* iIONodeAudio; 211 PvmiMIOControl* iMIOFileOutVideo; 212 PvmiMIOControl* iMIOFileOutAudio; 213 PVCommandId iCurrentCmdId; 214 PVCommandId iCancelAllCmdId; 215 setMultiplePlayMode(uint32 aNum)216 void setMultiplePlayMode(uint32 aNum) 217 { 218 iMultiplePlay = true; 219 iTargetNumPlay = aNum; 220 } 221 setMultiplePauseMode(uint32 aNum)222 void setMultiplePauseMode(uint32 aNum) 223 { 224 iMultiplePause = true; 225 iTargetNumPause = aNum; 226 } 227 setProtocolRollOverMode()228 void setProtocolRollOverMode() 229 { 230 iProtocolRollOver = true; 231 } 232 setProtocolRollOverModeWithUnknownURL()233 void setProtocolRollOverModeWithUnknownURL() 234 { 235 iProtocolRollOverWithUnknownURLType = true; 236 } 237 setPlayListMode()238 void setPlayListMode() 239 { 240 iPlayListURL = true; 241 } 242 setSeekAfterEOSMode()243 void setSeekAfterEOSMode() 244 { 245 iSeekAfterEOSEnable = true; 246 } 247 setPauseDurationInMS(uint32 aDuration)248 void setPauseDurationInMS(uint32 aDuration) 249 { 250 iPauseDurationInMS = aDuration; 251 } 252 setPauseSetPlayBackRangeResumeSequence()253 void setPauseSetPlayBackRangeResumeSequence() 254 { 255 iSeekAfterPause = true; 256 } 257 setErrorCodeTest()258 void setErrorCodeTest() 259 { 260 iErrorCodeTest = true; 261 iErrorCode = 404; 262 } 263 264 private: 265 void HandleSocketNodeErrors(int32 aErr); 266 void HandleRTSPNodeErrors(int32 aErr); 267 void HandleStreamingManagerNodeErrors(int32 aErr); 268 void HandleJitterBufferNodeErrors(int32 aErr); 269 void HandleMediaLayerNodeErrors(int32 aErr); 270 void HandleProtocolEngineNodeErrors(int32 aErr, OsclAny* aEventData); 271 272 273 void PrintMetadataInfo(); 274 275 PVMFFormatType iVideoSinkFormatType; 276 PVMFFormatType iAudioSinkFormatType; 277 OSCL_wHeapString<OsclMemAllocator> wFileName; 278 oscl_wchar output[512]; 279 bool oPauseResumeEnable; 280 bool oSeekEnable; 281 bool oCancelDuringPrepare; 282 bool oWaitForEOS; 283 uint32 iTestID; 284 bool iSeekAfterEOSEnable; 285 bool oForwardEnable; 286 bool oMultipleSeekToEndOfClipEnable; 287 288 PVPMetadataList iMetadataKeyList; 289 Oscl_Vector<PvmiKvp, OsclMemAllocator> iMetadataValueList; 290 int32 iNumValues; 291 292 uint32 iSessionDuration; 293 bool bcloaking; 294 bool oLiveSession; 295 296 bool iMultiplePause; 297 int32 iNumPause; 298 int32 iTargetNumPause; 299 uint32 iPauseDurationInMS; 300 301 bool iMultiplePlay; 302 uint32 iNumPlay; 303 uint32 iTargetNumPlay; 304 305 bool iProtocolRollOver; 306 bool iProtocolRollOverWithUnknownURLType; 307 bool iPlayListURL; 308 309 PVMFStreamingDataSource* iStreamDataSource; 310 PVMFSourceContextData* iSourceContextData; 311 int32 iPlayListSwitchMode; 312 bool iErrorCodeTest; 313 uint32 iErrorCode; 314 bool iUseFileHandle; 315 316 PvmiCapabilityAndConfig* iPlayerCapConfigIF; 317 PvmiKvp* iErrorKVP; 318 PvmiKvp iKVPSetAsync; 319 OSCL_StackString<128> iKeyStringSetAsync; 320 OSCL_StackString<128> iURLToTest404; 321 OSCL_StackString<128> iURLToTest415; 322 bool iPauseDenied; //governed by the pause-denied metadata 323 uint32 iTotalValuesRetrieved; 324 uint32 iStartingIndex; 325 const uint32 iBlockSize; 326 bool iSeekAfterPause; 327 #if PVR_SUPPORT 328 PVMFPVRControl* m_PVRControl; 329 uint32 iLiveBufferDurationInSec; 330 PVRConfig::TLiveBufferStorage iLiveBufferStorage; 331 #endif 332 333 OsclFileHandle* ifilehandle; 334 }; 335 336 /*! 337 * A test case to test the normal engine sequence of playing an rtsp url 338 * - Data Source: RTSP URL 339 * - Data Sink(s): Video[FileOutputNode-test_player_rtspurl_video.dat]\n 340 * Audio[FileOutputNode-test_player_rtspurl_audio.dat] 341 * - Sequence: 342 * -# CreatePlayer() 343 * -# AddDataSource() 344 * -# Init() 345 * -# AddDataSink() (video) 346 * -# AddDataSink() (audio) 347 * -# Prepare() 348 * -# Start() 349 * -# WAIT 20 sec. 350 * -# Stop() 351 * -# RemoveDataSink() (video) 352 * -# RemoveDataSink() (audio) 353 * -# Reset() 354 * -# RemoveDataSource() 355 * -# DeletePlayer() 356 * 357 */ 358 class pvplayer_async_test_streamingJBadjust: public pvplayer_async_test_base 359 { 360 public: pvplayer_async_test_streamingJBadjust(PVPlayerAsyncTestParam aTestParam,PVMFFormatType aVideoSinkFormat,PVMFFormatType aAudioSinkFormat,uint32 aTestID,bool aPauseResumeEnable,bool aSeekEnable,bool aWaitForEOS)361 pvplayer_async_test_streamingJBadjust(PVPlayerAsyncTestParam aTestParam, 362 PVMFFormatType aVideoSinkFormat, 363 PVMFFormatType aAudioSinkFormat, 364 uint32 aTestID, 365 bool aPauseResumeEnable, 366 bool aSeekEnable, 367 bool aWaitForEOS) 368 : pvplayer_async_test_base(aTestParam) 369 , iPlayer(NULL) 370 , iDataSource(NULL) 371 , iDataSinkVideo(NULL) 372 , iDataSinkAudio(NULL) 373 , iIONodeVideo(NULL) 374 , iIONodeAudio(NULL) 375 , iMIOFileOutVideo(NULL) 376 , iMIOFileOutAudio(NULL) 377 , iCurrentCmdId(0) 378 , iStreamDataSource(NULL) 379 { 380 iVideoSinkFormatType = aVideoSinkFormat; 381 iAudioSinkFormatType = aAudioSinkFormat; 382 oPauseResumeEnable = aPauseResumeEnable; 383 oSeekEnable = aSeekEnable; 384 oWaitForEOS = aWaitForEOS; 385 iTestID = aTestID; 386 } 387 ~pvplayer_async_test_streamingJBadjust()388 ~pvplayer_async_test_streamingJBadjust() {} 389 390 void StartTest(); 391 void Run(); 392 393 void CommandCompleted(const PVCmdResponse& aResponse); 394 void HandleErrorEvent(const PVAsyncErrorEvent& aEvent); 395 void HandleInformationalEvent(const PVAsyncInformationalEvent& aEvent); 396 397 enum PVTestState 398 { 399 STATE_CREATE, 400 STATE_QUERYINTERFACE, 401 STATE_ADDDATASOURCE, 402 STATE_CONFIGPARAMS, 403 STATE_INIT, 404 STATE_GETMETADATAKEYLIST, 405 STATE_GETMETADATAVALUELIST, 406 STATE_ADDDATASINK_VIDEO, 407 STATE_ADDDATASINK_AUDIO, 408 STATE_PREPARE, 409 STATE_RECONFIGJITTERBUFFER, 410 STATE_PREPARING, 411 STATE_START, 412 STATE_SETPLAYBACKRANGE, 413 STATE_PAUSE, 414 STATE_RESUME, 415 STATE_EOSNOTREACHED, 416 STATE_STOP, 417 STATE_REMOVEDATASINK_VIDEO, 418 STATE_REMOVEDATASINK_AUDIO, 419 STATE_RESET, 420 STATE_REMOVEDATASOURCE, 421 STATE_CLEANUPANDCOMPLETE 422 }; 423 424 PVTestState iState; 425 426 PVPlayerInterface* iPlayer; 427 PVPlayerDataSourceURL* iDataSource; 428 PVPlayerDataSink* iDataSinkVideo; 429 PVPlayerDataSink* iDataSinkAudio; 430 PVMFNodeInterface* iIONodeVideo; 431 PVMFNodeInterface* iIONodeAudio; 432 PvmiMIOControl* iMIOFileOutVideo; 433 PvmiMIOControl* iMIOFileOutAudio; 434 PVCommandId iCurrentCmdId; 435 436 private: 437 void HandleSocketNodeErrors(int32 aErr); 438 void HandleRTSPNodeErrors(int32 aErr); 439 void HandleStreamingManagerNodeErrors(int32 aErr); 440 void HandleJitterBufferNodeErrors(int32 aErr); 441 void HandleMediaLayerNodeErrors(int32 aErr); 442 443 PVMFFormatType iVideoSinkFormatType; 444 PVMFFormatType iAudioSinkFormatType; 445 OSCL_wHeapString<OsclMemAllocator> wFileName; 446 oscl_wchar output[512]; 447 bool oPauseResumeEnable; 448 bool oSeekEnable; 449 bool oWaitForEOS; 450 uint32 iTestID; 451 452 PvmiCapabilityAndConfig* iPlayerCapConfigIF; 453 454 455 PVPMetadataList iMetadataKeyList; 456 Oscl_Vector<PvmiKvp, OsclMemAllocator> iMetadataValueList; 457 int32 iNumValues; 458 459 PvmiKvp* iErrorKVP; 460 PvmiKvp iKVPSetAsync; 461 OSCL_StackString<64> iKeyStringSetAsync; 462 463 PVMFStreamingDataSource* iStreamDataSource; 464 }; 465 466 /*! 467 * A test case to test bitstream switching 468 * - Data Source: RTSP URL, SDP File, MS HTTP URL 469 * - Data Sink(s): Video[FileOutputNode-test_player_rtspurl_video.dat]\n 470 * Audio[FileOutputNode-test_player_rtspurl_audio.dat] 471 * - Sequence: 472 * -# CreatePlayer() 473 * -# AddDataSource() 474 * -# Init() 475 * -# AddDataSink() (video) 476 * -# AddDataSink() (audio) 477 * -# Prepare() 478 * -# Start() 479 * -# WAIT 20 sec. 480 * -# Stop() 481 * -# RemoveDataSink() (video) 482 * -# RemoveDataSink() (audio) 483 * -# Reset() 484 * -# RemoveDataSource() 485 * -# DeletePlayer() 486 * 487 */ 488 class pvplayer_async_test_streaming_bitstream_switch: public pvplayer_async_test_base 489 { 490 public: pvplayer_async_test_streaming_bitstream_switch(PVPlayerAsyncTestParam aTestParam,PVMFFormatType aVideoSinkFormat,PVMFFormatType aAudioSinkFormat,uint32 aTestID,bool aWaitForEOS)491 pvplayer_async_test_streaming_bitstream_switch(PVPlayerAsyncTestParam aTestParam, 492 PVMFFormatType aVideoSinkFormat, 493 PVMFFormatType aAudioSinkFormat, 494 uint32 aTestID, 495 bool aWaitForEOS) 496 : pvplayer_async_test_base(aTestParam) 497 , iPlayer(NULL) 498 , iDataSource(NULL) 499 , iDataSinkVideo(NULL) 500 , iDataSinkAudio(NULL) 501 , iIONodeVideo(NULL) 502 , iIONodeAudio(NULL) 503 , iMIOFileOutVideo(NULL) 504 , iMIOFileOutAudio(NULL) 505 , iCurrentCmdId(0) 506 , iStreamDataSource(NULL) 507 { 508 iVideoSinkFormatType = aVideoSinkFormat; 509 iAudioSinkFormatType = aAudioSinkFormat; 510 oPauseResumeEnable = false; 511 oSeekEnable = false; 512 oWaitForEOS = aWaitForEOS; 513 iTestID = aTestID; 514 } 515 ~pvplayer_async_test_streaming_bitstream_switch()516 ~pvplayer_async_test_streaming_bitstream_switch() {} 517 518 void StartTest(); 519 void Run(); 520 521 void CommandCompleted(const PVCmdResponse& aResponse); 522 void HandleErrorEvent(const PVAsyncErrorEvent& aEvent); 523 void HandleInformationalEvent(const PVAsyncInformationalEvent& aEvent); 524 525 enum PVTestState 526 { 527 STATE_CREATE, 528 STATE_QUERYINTERFACE, 529 STATE_ADDDATASOURCE, 530 STATE_INIT, 531 STATE_SET_STREAM_SPEED, 532 STATE_GETMETADATAKEYLIST, 533 STATE_GETMETADATAVALUELIST, 534 STATE_ADDDATASINK_VIDEO, 535 STATE_ADDDATASINK_AUDIO, 536 STATE_PREPARE, 537 STATE_START, 538 STATE_SWITCH_STREAMS, 539 STATE_SWITCH_STREAMS_DONE, 540 STATE_SETPLAYBACKRANGE, 541 STATE_PAUSE, 542 STATE_RESUME, 543 STATE_EOSNOTREACHED, 544 STATE_STOP, 545 STATE_REMOVEDATASINK_VIDEO, 546 STATE_REMOVEDATASINK_AUDIO, 547 STATE_RESET, 548 STATE_REMOVEDATASOURCE, 549 STATE_CLEANUPANDCOMPLETE 550 }; 551 552 PVTestState iState; 553 554 PVPlayerInterface* iPlayer; 555 PVPlayerDataSourceURL* iDataSource; 556 PVPlayerDataSink* iDataSinkVideo; 557 PVPlayerDataSink* iDataSinkAudio; 558 PVMFNodeInterface* iIONodeVideo; 559 PVMFNodeInterface* iIONodeAudio; 560 PvmiMIOControl* iMIOFileOutVideo; 561 PvmiMIOControl* iMIOFileOutAudio; 562 PVCommandId iCurrentCmdId; 563 564 private: 565 void HandleSocketNodeErrors(int32 aErr); 566 void HandleRTSPNodeErrors(int32 aErr); 567 void HandleStreamingManagerNodeErrors(int32 aErr); 568 void HandleJitterBufferNodeErrors(int32 aErr); 569 void HandleMediaLayerNodeErrors(int32 aErr); 570 void HandleProtocolEngineNodeErrors(int32 aErr); 571 572 PVMFFormatType iVideoSinkFormatType; 573 PVMFFormatType iAudioSinkFormatType; 574 OSCL_wHeapString<OsclMemAllocator> wFileName; 575 oscl_wchar output[512]; 576 bool oPauseResumeEnable; 577 bool oSeekEnable; 578 bool oWaitForEOS; 579 uint32 iTestID; 580 581 PvmiCapabilityAndConfig* iPlayerCapConfigIF; 582 583 void PrintMetadataInfo(); 584 585 PVPMetadataList iMetadataKeyList; 586 Oscl_Vector<PvmiKvp, OsclMemAllocator> iMetadataValueList; 587 int32 iNumValues; 588 589 PvmiKvp* iErrorKVP; 590 PvmiKvp iKVPSetAsync; 591 OSCL_StackString<64> iKeyStringSetAsync; 592 593 bool oLiveSession; 594 uint32 iSessionDuration; 595 596 PVMFStreamingDataSource* iStreamDataSource; 597 }; 598 599 /*! 600 * A test case to test stop->prepare behavior when playing an rtsp url 601 * - Data Source: RTSP URL 602 * - Data Sink(s): Video[FileOutputNode-test_player_rtspurl_video.dat]\n 603 * Audio[FileOutputNode-test_player_rtspurl_audio.dat] 604 * - Sequence: 605 * -# CreatePlayer() 606 * -# AddDataSource() 607 * -# Init() 608 * -# AddDataSink() (video) 609 * -# AddDataSink() (audio) 610 * -# Prepare() 611 * -# Start() 612 * -# WAIT 20 sec. 613 * -# Stop() 614 * -# Prepare() 615 * -# Start() 616 * -# WAIT 20 sec. 617 * -# Stop() 618 * -# RemoveDataSink() (video) 619 * -# RemoveDataSink() (audio) 620 * -# Reset() 621 * -# RemoveDataSource() 622 * -# DeletePlayer() 623 * 624 */ 625 class pvplayer_async_test_streamingopenplaystoppreparelaystop : public pvplayer_async_test_base 626 { 627 public: pvplayer_async_test_streamingopenplaystoppreparelaystop(PVPlayerAsyncTestParam aTestParam,PVMFFormatType aVideoSinkFormat,PVMFFormatType aAudioSinkFormat,uint32 aTestID,bool aPauseResumeEnable,bool aSeekEnable,bool aWaitForEOS,bool aCloaking,bool aCancelDuringPrepare,bool aForwardEnable)628 pvplayer_async_test_streamingopenplaystoppreparelaystop(PVPlayerAsyncTestParam aTestParam, 629 PVMFFormatType aVideoSinkFormat, 630 PVMFFormatType aAudioSinkFormat, 631 uint32 aTestID, 632 bool aPauseResumeEnable, 633 bool aSeekEnable, 634 bool aWaitForEOS, 635 bool aCloaking, 636 bool aCancelDuringPrepare, 637 bool aForwardEnable) 638 : pvplayer_async_test_base(aTestParam) 639 , iPlayer(NULL) 640 , iDataSource(NULL) 641 , iDataSinkVideo(NULL) 642 , iDataSinkAudio(NULL) 643 , iIONodeVideo(NULL) 644 , iIONodeAudio(NULL) 645 , iMIOFileOutVideo(NULL) 646 , iMIOFileOutAudio(NULL) 647 , iCurrentCmdId(0) 648 , iCancelAllCmdId(0) 649 , iSeekAfterEOSEnable(false) 650 , iSessionDuration(0) 651 , bcloaking(aCloaking) 652 , oLiveSession(false) 653 , iProtocolRollOver(false) 654 , iProtocolRollOverWithUnknownURLType(false) 655 , iPlayListURL(false) 656 , iStreamDataSource(NULL) 657 , iSourceContextData(NULL) 658 { 659 iVideoSinkFormatType = aVideoSinkFormat; 660 iAudioSinkFormatType = aAudioSinkFormat; 661 oPauseResumeEnable = aPauseResumeEnable; 662 oSeekEnable = aSeekEnable; 663 oWaitForEOS = aWaitForEOS; 664 oCancelDuringPrepare = aCancelDuringPrepare; 665 oForwardEnable = aForwardEnable; 666 iTestID = aTestID; 667 iNumPlay = 0; 668 iTargetNumPlay = 1; 669 iNumPause = 0; 670 iTargetNumPause = 1; 671 } 672 ~pvplayer_async_test_streamingopenplaystoppreparelaystop()673 ~pvplayer_async_test_streamingopenplaystoppreparelaystop() {} 674 675 void StartTest(); 676 void Run(); 677 678 void CommandCompleted(const PVCmdResponse& aResponse); 679 void HandleErrorEvent(const PVAsyncErrorEvent& aEvent); 680 void HandleInformationalEvent(const PVAsyncInformationalEvent& aEvent); 681 682 enum PVTestState 683 { 684 STATE_CREATE, 685 STATE_QUERYINTERFACE, 686 STATE_ADDDATASOURCE, 687 STATE_CONFIGPARAMS, 688 STATE_INIT, 689 STATE_GETMETADATAKEYLIST, 690 STATE_GETMETADATAVALUELIST, 691 STATE_ADDDATASINK_VIDEO, 692 STATE_ADDDATASINK_AUDIO, 693 STATE_PREPARE, 694 STATE_CANCELALL, 695 STATE_WAIT_FOR_CANCELALL, 696 STATE_START, 697 STATE_SETPLAYBACKRANGE, 698 STATE_PAUSE, 699 STATE_RESUME, 700 STATE_EOSNOTREACHED, 701 STATE_STOP, 702 STATE_REMOVEDATASINK_VIDEO, 703 STATE_REMOVEDATASINK_AUDIO, 704 STATE_RESET, 705 STATE_REMOVEDATASOURCE, 706 STATE_CLEANUPANDCOMPLETE, 707 STATE_SETFORWARD, 708 STATE_PREPARE1, 709 STATE_START1, 710 STATE_STOP1 711 }; 712 713 PVTestState iState; 714 715 PVPlayerInterface* iPlayer; 716 PVPlayerDataSourceURL* iDataSource; 717 PVPlayerDataSink* iDataSinkVideo; 718 PVPlayerDataSink* iDataSinkAudio; 719 PVMFNodeInterface* iIONodeVideo; 720 PVMFNodeInterface* iIONodeAudio; 721 PvmiMIOControl* iMIOFileOutVideo; 722 PvmiMIOControl* iMIOFileOutAudio; 723 PVCommandId iCurrentCmdId; 724 PVCommandId iCancelAllCmdId; 725 setMultiplePlayMode(uint32 aNum)726 void setMultiplePlayMode(uint32 aNum) 727 { 728 iMultiplePlay = true; 729 iTargetNumPlay = aNum; 730 } 731 setMultiplePauseMode(uint32 aNum)732 void setMultiplePauseMode(uint32 aNum) 733 { 734 iMultiplePause = true; 735 iTargetNumPause = aNum; 736 } 737 setProtocolRollOverMode()738 void setProtocolRollOverMode() 739 { 740 iProtocolRollOver = true; 741 } 742 setProtocolRollOverModeWithUnknownURL()743 void setProtocolRollOverModeWithUnknownURL() 744 { 745 iProtocolRollOverWithUnknownURLType = true; 746 } 747 setPlayListMode()748 void setPlayListMode() 749 { 750 iPlayListURL = true; 751 } 752 setSeekAfterEOSMode()753 void setSeekAfterEOSMode() 754 { 755 iSeekAfterEOSEnable = true; 756 } 757 758 private: 759 void HandleSocketNodeErrors(int32 aErr); 760 void HandleRTSPNodeErrors(int32 aErr); 761 void HandleStreamingManagerNodeErrors(int32 aErr); 762 void HandleJitterBufferNodeErrors(int32 aErr); 763 void HandleMediaLayerNodeErrors(int32 aErr); 764 void HandleProtocolEngineNodeErrors(int32 aErr); 765 766 767 void PrintMetadataInfo(); 768 769 PVMFFormatType iVideoSinkFormatType; 770 PVMFFormatType iAudioSinkFormatType; 771 OSCL_wHeapString<OsclMemAllocator> wFileName; 772 oscl_wchar output[512]; 773 bool oPauseResumeEnable; 774 bool oSeekEnable; 775 bool oCancelDuringPrepare; 776 bool oWaitForEOS; 777 uint32 iTestID; 778 bool iSeekAfterEOSEnable; 779 bool oForwardEnable; 780 781 PVPMetadataList iMetadataKeyList; 782 Oscl_Vector<PvmiKvp, OsclMemAllocator> iMetadataValueList; 783 int32 iNumValues; 784 785 uint32 iSessionDuration; 786 bool bcloaking; 787 bool oLiveSession; 788 789 bool iMultiplePause; 790 int32 iNumPause; 791 uint32 iTargetNumPause; 792 793 bool iMultiplePlay; 794 uint32 iNumPlay; 795 uint32 iTargetNumPlay; 796 797 bool iProtocolRollOver; 798 bool iProtocolRollOverWithUnknownURLType; 799 bool iPlayListURL; 800 801 PvmiCapabilityAndConfig* iPlayerCapConfigIF; 802 PvmiKvp* iErrorKVP; 803 PvmiKvp iKVPSetAsync; 804 OSCL_StackString<128> iKeyStringSetAsync; 805 806 PVMFStreamingDataSource* iStreamDataSource; 807 808 PVMFSourceContextData* iSourceContextData; 809 }; 810 811 /*! 812 * A test case to test the normal engine sequence of playing an sdp file 813 * that uses the RTP packet source node as a data source 814 * TO DO - UPDATE DESCRIPTION TO MATCH DVB TEST BEHAVIOR 815 * - Data Source: sdp file 816 * - Data Sink(s): Video[FileOutputNode-test_player_rtspurl_video.dat]\n 817 * Audio[FileOutputNode-test_player_rtspurl_audio.dat] 818 * - Sequence: 819 * -# CreatePlayer() 820 * -# AddDataSource() 821 * -# Init() 822 * -# AddDataSink() (video) 823 * -# AddDataSink() (audio) 824 * -# Prepare() 825 * -# Start() 826 * -# WAIT 20 sec. 827 * -# Stop() 828 * -# RemoveDataSink() (video) 829 * -# RemoveDataSink() (audio) 830 * -# Reset() 831 * -# RemoveDataSource() 832 * -# DeletePlayer() 833 * 834 */ 835 class pvplayer_async_test_dvbh_streamingopenplaystop : public pvplayer_async_test_base// , pvplayer_async_test_streamingopenplaystop 836 { 837 public: pvplayer_async_test_dvbh_streamingopenplaystop(PVPlayerAsyncTestParam aTestParam,PVMFFormatType aVideoSinkFormat,PVMFFormatType aAudioSinkFormat,uint32 aTestID,bool aPauseResumeEnable,bool aSeekEnable,bool aWaitForEOS,bool aCloaking,bool aCancelDuringPrepare)838 pvplayer_async_test_dvbh_streamingopenplaystop(PVPlayerAsyncTestParam aTestParam, 839 PVMFFormatType aVideoSinkFormat, 840 PVMFFormatType aAudioSinkFormat, 841 uint32 aTestID, 842 bool aPauseResumeEnable, 843 bool aSeekEnable, 844 bool aWaitForEOS, 845 bool aCloaking, 846 bool aCancelDuringPrepare) 847 : pvplayer_async_test_base(aTestParam) 848 , iPlayer(NULL) 849 , iDataSource(NULL) 850 , iDataSinkVideo(NULL) 851 , iDataSinkAudio(NULL) 852 , iIONodeVideo(NULL) 853 , iIONodeAudio(NULL) 854 , iMIOFileOutVideo(NULL) 855 , iMIOFileOutAudio(NULL) 856 , iCurrentCmdId(0) 857 , iCancelAllCmdId(0) 858 , iSessionDuration(0) 859 , bcloaking(aCloaking) 860 , oLiveSession(false) 861 , iProtocolRollOver(false) 862 , iProtocolRollOverWithUnknownURLType(false) 863 , iPlayListURL(false) 864 , iStreamDataSource(NULL) 865 , iSourceContextData(NULL) 866 , m_PVRControl(NULL) 867 , ps(NULL) 868 { 869 iVideoSinkFormatType = aVideoSinkFormat; 870 iAudioSinkFormatType = aAudioSinkFormat; 871 oPauseResumeEnable = aPauseResumeEnable; 872 oSeekEnable = aSeekEnable; 873 oWaitForEOS = aWaitForEOS; 874 oCancelDuringPrepare = aCancelDuringPrepare; 875 iTestID = aTestID; 876 iNumPlay = 0; 877 iTargetNumPlay = 1; 878 } 879 ~pvplayer_async_test_dvbh_streamingopenplaystop()880 ~pvplayer_async_test_dvbh_streamingopenplaystop() {} 881 882 void StartTest(); 883 void Run(); 884 885 void CommandCompleted(const PVCmdResponse& aResponse); 886 void HandleErrorEvent(const PVAsyncErrorEvent& aEvent); 887 void HandleInformationalEvent(const PVAsyncInformationalEvent& aEvent); 888 889 enum PVTestState 890 { 891 STATE_CREATE, 892 STATE_QUERYINTERFACE, 893 STATE_ADDDATASOURCE, 894 STATE_CONFIGPARAMS, 895 STATE_INIT, 896 STATE_GETMETADATAKEYLIST, 897 STATE_GETMETADATAVALUELIST, 898 STATE_ADDDATASINK_VIDEO, 899 STATE_ADDDATASINK_AUDIO, 900 STATE_PREPARE, 901 STATE_CANCELALL, 902 STATE_WAIT_FOR_CANCELALL, 903 STATE_START, 904 STATE_SETPLAYBACKRANGE, 905 STATE_PAUSE, 906 STATE_RESUME, 907 STATE_EOSNOTREACHED, 908 STATE_STOP, 909 STATE_REMOVEDATASINK_VIDEO, 910 STATE_REMOVEDATASINK_AUDIO, 911 STATE_RESET, 912 STATE_REMOVEDATASOURCE, 913 STATE_CLEANUPANDCOMPLETE 914 }; 915 916 PVTestState iState; 917 918 PVPlayerInterface* iPlayer; 919 PVPlayerDataSourceURL* iDataSource; 920 921 922 PVPlayerDataSink* iDataSinkVideo; 923 PVPlayerDataSink* iDataSinkAudio; 924 PVMFNodeInterface* iIONodeVideo; 925 PVMFNodeInterface* iIONodeAudio; 926 PvmiMIOControl* iMIOFileOutVideo; 927 PvmiMIOControl* iMIOFileOutAudio; 928 PVCommandId iCurrentCmdId; 929 PVCommandId iCancelAllCmdId; 930 setMultiplePlayMode(uint32 aNum)931 void setMultiplePlayMode(uint32 aNum) 932 { 933 iMultiplePlay = true; 934 iTargetNumPlay = aNum; 935 } 936 setProtocolRollOverMode()937 void setProtocolRollOverMode() 938 { 939 iProtocolRollOver = true; 940 } 941 setProtocolRollOverModeWithUnknownURL()942 void setProtocolRollOverModeWithUnknownURL() 943 { 944 iProtocolRollOverWithUnknownURLType = true; 945 } 946 setPlayListMode()947 void setPlayListMode() 948 { 949 iPlayListURL = true; 950 } 951 952 private: 953 void HandleSocketNodeErrors(int32 aErr); 954 void HandleRTSPNodeErrors(int32 aErr); 955 void HandleStreamingManagerNodeErrors(int32 aErr); 956 void HandleJitterBufferNodeErrors(int32 aErr); 957 void HandleMediaLayerNodeErrors(int32 aErr); 958 void HandleProtocolEngineNodeErrors(int32 aErr); 959 960 961 void PrintMetadataInfo(); 962 963 PVMFFormatType iVideoSinkFormatType; 964 PVMFFormatType iAudioSinkFormatType; 965 OSCL_wHeapString<OsclMemAllocator> wFileName; 966 oscl_wchar output[512]; 967 bool oPauseResumeEnable; 968 bool oSeekEnable; 969 bool oCancelDuringPrepare; 970 bool oWaitForEOS; 971 uint32 iTestID; 972 973 PVPMetadataList iMetadataKeyList; 974 Oscl_Vector<PvmiKvp, OsclMemAllocator> iMetadataValueList; 975 int32 iNumValues; 976 977 uint32 iSessionDuration; 978 bool bcloaking; 979 bool oLiveSession; 980 981 bool iMultiplePlay; 982 uint32 iNumPlay; 983 uint32 iTargetNumPlay; 984 985 bool iProtocolRollOver; 986 bool iProtocolRollOverWithUnknownURLType; 987 bool iPlayListURL; 988 int32 iPriority; 989 PvmiCapabilityAndConfig* iPlayerCapConfigIF; 990 PvmiKvp* iErrorKVP; 991 PvmiKvp iKVPSetAsync; 992 OSCL_StackString<128> iKeyStringSetAsync; 993 994 PVMFStreamingDataSource* iStreamDataSource; 995 996 PVMFSourceContextData* iSourceContextData; 997 PVMFSourceContextData m_sourceContext; 998 999 PVMFPVRControl* m_PVRControl; 1000 1001 PVMFPacketSource* ps; 1002 }; 1003 1004 1005 1006 #endif // TEST_PV_PLAYER_ENGINE_TESTSET6_H_INCLUDED 1007 1008 1009 1010