diff options
author | PacketVideo CM <engbuild@pv.com> | 2010-03-19 17:52:54 -0700 |
---|---|---|
committer | PacketVideo CM <engbuild@pv.com> | 2010-03-19 17:52:54 -0700 |
commit | 8f20a01a8e585da0d011cc78e568efdcf84d5867 (patch) | |
tree | b1b2e61fcfeb7aff87e9cd1fb44f9565a089941a /engines/player/test | |
parent | 42bf96f7086c1c7c67f352e8495bd74b5ec38496 (diff) | |
download | opencore-8f20a01a8e585da0d011cc78e568efdcf84d5867.tar.gz |
RIO-8791: Addition of new event PVMFInfoSourceFormatUpdated
Change-Id: I235385b7a9f18e2f01a6d774e7fb81616d264158
Diffstat (limited to 'engines/player/test')
4 files changed, 47 insertions, 5 deletions
diff --git a/engines/player/test/src/test_pv_player_engine.cpp b/engines/player/test/src/test_pv_player_engine.cpp index 43888f7c7..ae4da5ffd 100644 --- a/engines/player/test/src/test_pv_player_engine.cpp +++ b/engines/player/test/src/test_pv_player_engine.cpp @@ -2963,6 +2963,9 @@ void pvplayer_engine_test::test() case PreparedStopTest: iCurrentTest = new pvplayer_async_test_preparedstop(testparam); break; + case SourceFormatUpdatedTest: + iCurrentTest = new pvplayer_async_test_preparedstop(testparam, true); + break; case VideoOnlyPlay7Seconds: iCurrentTest = new pvplayer_async_test_videoonlyplay7seconds(testparam); diff --git a/engines/player/test/src/test_pv_player_engine.h b/engines/player/test/src/test_pv_player_engine.h index 86ecfe77e..f5a5d150d 100644 --- a/engines/player/test/src/test_pv_player_engine.h +++ b/engines/player/test/src/test_pv_player_engine.h @@ -692,8 +692,8 @@ class pvplayer_engine_test : public test_case, OpenPlayStopResetCPMRecognizeTest = 89, //Start of testing recognizer using DataStream input SetPlaybackBeforePrepare, - SetPlaybackRate2XWithIFrameModePlybk, + SourceFormatUpdatedTest, LastLocalTest,//placeholder FirstDownloadTest = 100, //placeholder diff --git a/engines/player/test/src/test_pv_player_engine_testset1.cpp b/engines/player/test/src/test_pv_player_engine_testset1.cpp index 93cdae5e3..c4009d372 100644 --- a/engines/player/test/src/test_pv_player_engine_testset1.cpp +++ b/engines/player/test/src/test_pv_player_engine_testset1.cpp @@ -3997,6 +3997,7 @@ void pvplayer_async_test_preparedstop::StartTest() { AddToScheduler(); iState = STATE_CREATE; + iFormatUpdatedEventReceived = false; RunIfNotReady(); } @@ -4030,10 +4031,15 @@ void pvplayer_async_test_preparedstop::Run() iDataSource = new PVPlayerDataSourceURL; OSCL_wHeapString<OsclMemAllocator> sourcefile = SOURCENAME_PREPEND_WSTRING; + if (!iCheckForFormatUpdatedEvent) + { + // Set the format type only if we want to force recognition + // for the PVMFInfoSourceFormatUpdated event. + iDataSource->SetDataSourceFormatType(PVMF_MIME_MPEG4FF); + } sourcefile += _STRLIT_WCHAR("test.mp4"); iDataSource->SetDataSourceURL(sourcefile); - iDataSource->SetDataSourceFormatType(PVMF_MIME_MPEG4FF); OSCL_TRY(error, iCurrentCmdId = iPlayer->AddDataSource(*iDataSource, (OsclAny*) & iContextObject)); OSCL_FIRST_CATCH_ANY(error, PVPATB_TEST_IS_TRUE(false); iState = STATE_CLEANUPANDCOMPLETE; RunIfNotReady()); } @@ -4086,6 +4092,12 @@ void pvplayer_async_test_preparedstop::Run() case STATE_STOP: { + if (iCheckForFormatUpdatedEvent) + { + // We should have received the event by now. + // Report failure if not. + PVPATB_TEST_IS_TRUE(iFormatUpdatedEventReceived); + } OSCL_TRY(error, iCurrentCmdId = iPlayer->Stop((OsclAny*) & iContextObject)); OSCL_FIRST_CATCH_ANY(error, PVPATB_TEST_IS_TRUE(false); iState = STATE_CLEANUPANDCOMPLETE; RunIfNotReady()); } @@ -4387,8 +4399,24 @@ void pvplayer_async_test_preparedstop::HandleErrorEvent(const PVAsyncErrorEvent& } -void pvplayer_async_test_preparedstop::HandleInformationalEvent(const PVAsyncInformationalEvent& /*aEvent*/) +void pvplayer_async_test_preparedstop::HandleInformationalEvent(const PVAsyncInformationalEvent& aEvent) { + if (iCheckForFormatUpdatedEvent) + { + switch (aEvent.GetEventType()) + { + case PVMFInfoSourceFormatUpdated: + { + fprintf(iTestMsgOutputFile, "\n\nPVMFInfoSourceFormatUpdated event received\n"); + const char* localBuf = (const char*)aEvent.GetLocalBuffer(); + fprintf(iTestMsgOutputFile, "Format: %s\n\n", localBuf); + iFormatUpdatedEventReceived = true; + } + break; + default: + break; + } + } } diff --git a/engines/player/test/src/test_pv_player_engine_testset1.h b/engines/player/test/src/test_pv_player_engine_testset1.h index 15de48b99..8858a82df 100644 --- a/engines/player/test/src/test_pv_player_engine_testset1.h +++ b/engines/player/test/src/test_pv_player_engine_testset1.h @@ -638,7 +638,7 @@ class pvplayer_async_test_invalidstate : public pvplayer_async_test_base class pvplayer_async_test_preparedstop : public pvplayer_async_test_base { public: - pvplayer_async_test_preparedstop(PVPlayerAsyncTestParam aTestParam): + pvplayer_async_test_preparedstop(PVPlayerAsyncTestParam aTestParam, bool aCheckForFormatUpdatedEvent = false): pvplayer_async_test_base(aTestParam) , iPlayer(NULL) , iDataSource(NULL) @@ -649,8 +649,16 @@ class pvplayer_async_test_preparedstop : public pvplayer_async_test_base , iMIOFileOutVideo(NULL) , iMIOFileOutAudio(NULL) , iCurrentCmdId(0) + , iCheckForFormatUpdatedEvent(aCheckForFormatUpdatedEvent) { - iTestCaseName = _STRLIT_CHAR("Stop When Prepared"); + if (iCheckForFormatUpdatedEvent) + { + iTestCaseName = _STRLIT_CHAR("Source Format Updated Event test"); + } + else + { + iTestCaseName = _STRLIT_CHAR("Stop When Prepared"); + } } ~pvplayer_async_test_preparedstop() {} @@ -689,6 +697,9 @@ class pvplayer_async_test_preparedstop : public pvplayer_async_test_base PvmiMIOControl* iMIOFileOutVideo; PvmiMIOControl* iMIOFileOutAudio; PVCommandId iCurrentCmdId; + + bool iCheckForFormatUpdatedEvent; + bool iFormatUpdatedEventReceived; }; |