OSDN Git Service

RIO-6819: Add player engine test to perform repositioning in downloaded area during PDL
authorPacketVideo CM <engbuild@pv.com>
Wed, 21 Oct 2009 16:46:33 +0000 (09:46 -0700)
committerPacketVideo CM <engbuild@pv.com>
Wed, 21 Oct 2009 16:46:33 +0000 (09:46 -0700)
engines/2way/src/pv_2way_sdkinfo.h
engines/author/src/pv_author_sdkinfo.h
engines/player/src/pv_player_sdkinfo.h
engines/player/test/src/test_pv_player_engine.cpp
engines/player/test/src/test_pv_player_engine.h
engines/player/test/src/test_pv_player_engine_testset5.cpp
engines/player/test/src/test_pv_player_engine_testset5.h

index 9c29b2b..991edec 100644 (file)
@@ -21,7 +21,7 @@
 // This header file is automatically generated at build-time
 // *** OFFICIAL RELEASE INFO -- Will not auto update
 
-#define PV2WAY_ENGINE_SDKINFO_LABEL "1019187"
+#define PV2WAY_ENGINE_SDKINFO_LABEL "1019482"
 #define PV2WAY_ENGINE_SDKINFO_DATE 0x20091014
 
 #endif //PV_2WAY_SDKINFO_H_INCLUDED
index f85dda5..f38e528 100644 (file)
@@ -21,7 +21,7 @@
 // This header file is automatically generated at build-time
 // *** OFFICIAL RELEASE INFO -- Will not auto update
 
-#define PVAUTHOR_ENGINE_SDKINFO_LABEL "1019187"
+#define PVAUTHOR_ENGINE_SDKINFO_LABEL "1019482"
 #define PVAUTHOR_ENGINE_SDKINFO_DATE 0x20091014
 
 #endif //PV_AUTHOR_SDKINFO_H_INCLUDED
index d92c260..1f68c45 100644 (file)
@@ -21,7 +21,7 @@
 // This header file is automatically generated at build-time
 // *** OFFICIAL RELEASE INFO -- Will not auto update
 
-#define PVPLAYER_ENGINE_SDKINFO_LABEL "1019187"
+#define PVPLAYER_ENGINE_SDKINFO_LABEL "1019482"
 #define PVPLAYER_ENGINE_SDKINFO_DATE 0x20091014
 
 #endif //PV_PLAYER_SDKINFO_H_INCLUDED
index 6ebcce5..f4c6b6b 100644 (file)
@@ -3284,6 +3284,12 @@ void pvplayer_engine_test::test()
                 ((pvplayer_async_test_3gppdlnormal*)iCurrentTest)->enablePlayUntilEOS();
                 break;
 
+            case ProgDownloadPlayRepositionDuringDownloadTest:
+                testparam.iFileType = PVMF_MIME_MPEG4FF;
+                iCurrentTest = new pvplayer_async_test_3gppdlnormal_dlthenplay(testparam);
+                ((pvplayer_async_test_3gppdlnormal_dlthenplay*)iCurrentTest)->enableReposDuringDownload();
+                break;
+
             case ProgPlaybackMP4UntilEOSTest:
                 testparam.iFileType = PVMF_MIME_MPEG4FF;
                 iCurrentTest = new pvplayer_async_test_ppb_normal(testparam);
index 43ae6af..5e24b9a 100644 (file)
@@ -788,6 +788,12 @@ class pvplayer_engine_test : public test_case,
             * Output (partially) downloaded media file and YUV and PCM data files from Playback.
             */
             ProgDownloadPlayStopPlayTest, //117
+            /**
+            * @test (118) Progressive Download Play-Reposition During Download Test.
+            * Input http url to a progressively downloadable file.
+            * Output (partially) downloaded media file and YUV and PCM data files from Playback.
+            */
+            ProgDownloadPlayRepositionDuringDownloadTest, //118
 
             LastDownloadTest, //placeholder
 
index 77d7f4f..ff1ae63 100644 (file)
@@ -274,7 +274,6 @@ void pvplayer_async_test_downloadbase::Run()
             fprintf(iTestMsgOutputFile, "***Configuring Params...\n");
 
             //set user-agent, make sure to set as "PVPLAYER VersionNumber" to satisfy Fast Track PV server for Fast Track test
-
             iKeyStringSetAsync = _STRLIT_CHAR("x-pvmf/net/user-agent;valtype=wchar*;mode=download");
             iKVPSetAsync.key = iKeyStringSetAsync.get_str();
 
@@ -308,7 +307,6 @@ void pvplayer_async_test_downloadbase::Run()
             iErrorKVP = NULL;
             OSCL_TRY(error, iPlayerCapConfigIF->setParametersSync(NULL, &iKVPSetAsync, 1, iErrorKVP));
             OSCL_FIRST_CATCH_ANY(error, PVPATB_TEST_IS_TRUE(false); iState = STATE_CLEANUPANDCOMPLETE; RunIfNotReady(); return);
-
             // set extension header
             // set arbitrary extension header one by one
             iKeyStringSetAsync = _STRLIT_CHAR("x-pvmf/net/protocol-extension-header;valtype=char*");
@@ -322,21 +320,27 @@ void pvplayer_async_test_downloadbase::Run()
 
             iKeyStringSetAsync = _STRLIT_CHAR("x-pvmf/net/protocol-extension-header;valtype=char*");
             iKVPSetAsync.key = iKeyStringSetAsync.get_str();
-            OSCL_HeapString<OsclMemAllocator> protocolExtensionHeaderGet(_STRLIT_CHAR("key=PVPlayerCoreEngineTest;value=GetHeader;method=GET"));
-            iKVPSetAsync.value.pChar_value = protocolExtensionHeaderGet.get_str();
-            iKVPSetAsync.capacity = protocolExtensionHeaderGet.get_size();
+            OSCL_HeapString<OsclMemAllocator> protocolExtensionHeaderHead(_STRLIT_CHAR("key=PVPlayerCoreEngineTest;value=HeadHeader;method=HEAD"));
+            iKVPSetAsync.value.pChar_value = protocolExtensionHeaderHead.get_str();
+            iKVPSetAsync.capacity = protocolExtensionHeaderHead.get_size();
             iErrorKVP = NULL;
             OSCL_TRY(error, iPlayerCapConfigIF->setParametersSync(NULL, &iKVPSetAsync, 1, iErrorKVP));
-            OSCL_FIRST_CATCH_ANY(error, PVPATB_TEST_IS_TRUE(false); iState = STATE_CLEANUPANDCOMPLETE; RunIfNotReady(); return);
+            OSCL_FIRST_CATCH_ANY(error, PVPATB_TEST_IS_TRUE(false);
+                                 iState = STATE_CLEANUPANDCOMPLETE;
+                                 RunIfNotReady();
+                                 return);
 
             iKeyStringSetAsync = _STRLIT_CHAR("x-pvmf/net/protocol-extension-header;valtype=char*");
             iKVPSetAsync.key = iKeyStringSetAsync.get_str();
-            OSCL_HeapString<OsclMemAllocator> protocolExtensionHeaderHead(_STRLIT_CHAR("key=PVPlayerCoreEngineTest;value=HeadHeader;method=HEAD"));
-            iKVPSetAsync.value.pChar_value = protocolExtensionHeaderHead.get_str();
-            iKVPSetAsync.capacity = protocolExtensionHeaderHead.get_size();
+            OSCL_HeapString<OsclMemAllocator> protocolExtensionHeaderGet(_STRLIT_CHAR("key=PVPlayerCoreEngineTest;value=GetHeader;method=GET"));
+            iKVPSetAsync.value.pChar_value = protocolExtensionHeaderGet.get_str();
+            iKVPSetAsync.capacity = protocolExtensionHeaderGet.get_size();
             iErrorKVP = NULL;
             OSCL_TRY(error, iPlayerCapConfigIF->setParametersSync(NULL, &iKVPSetAsync, 1, iErrorKVP));
-            OSCL_FIRST_CATCH_ANY(error, PVPATB_TEST_IS_TRUE(false); iState = STATE_CLEANUPANDCOMPLETE; RunIfNotReady(); return);
+            OSCL_FIRST_CATCH_ANY(error, PVPATB_TEST_IS_TRUE(false);
+                                 iState = STATE_CLEANUPANDCOMPLETE;
+                                 RunIfNotReady();
+                                 return);
 
             // Unnecessary Header should not display
             iKeyStringSetAsync = _STRLIT_CHAR("x-pvmf/net/protocol-extension-header;valtype=char*");
@@ -346,9 +350,26 @@ void pvplayer_async_test_downloadbase::Run()
             iKVPSetAsync.capacity = protocolExtensionHeaderPost.get_size();
             iErrorKVP = NULL;
             OSCL_TRY(error, iPlayerCapConfigIF->setParametersSync(NULL, &iKVPSetAsync, 1, iErrorKVP));
-            OSCL_FIRST_CATCH_ANY(error, PVPATB_TEST_IS_TRUE(false); iState = STATE_CLEANUPANDCOMPLETE; RunIfNotReady(); return);
+            OSCL_FIRST_CATCH_ANY(error, PVPATB_TEST_IS_TRUE(false);
+                                 iState = STATE_CLEANUPANDCOMPLETE;
+                                 RunIfNotReady();
+                                 return);
 
+            // download progress in percentage of time downloaded
+            if (iRepositionDuringDownload)
+            {
+                //Requesting buffering status in time percentage by setting key "x-pvmf/net/download-progress-info;valtype=char*"
+                //We will get notified about buffering status event in HandleInformationalEvent and issue seek requests based
+                //on this time percentage,
 
+                char tmp;
+                iKeyStringSetAsync = _STRLIT_CHAR("x-pvmf/net/download-progress-info;valtype=char*");
+                iKVPSetAsync.key = iKeyStringSetAsync.get_str();
+                iKVPSetAsync.value.pChar_value = &tmp;
+                iErrorKVP = NULL;
+                OSCL_TRY(error, iPlayerCapConfigIF->setParametersSync(NULL, &iKVPSetAsync, 1, iErrorKVP));
+                OSCL_FIRST_CATCH_ANY(error, PVPATB_TEST_IS_TRUE(false); iState = STATE_CLEANUPANDCOMPLETE; RunIfNotReady(); return);
+            }
             // set extension header
             // set arbitrary extension headers all together
             PvmiKvp kvpheader[3];
@@ -375,7 +396,10 @@ void pvplayer_async_test_downloadbase::Run()
             kvpheader[2].capacity = protocolExtensionHeaderHead1.get_size();
 
             OSCL_TRY(error, iPlayerCapConfigIF->setParametersSync(NULL, kvpheader, 3, iErrorKVP));
-            OSCL_FIRST_CATCH_ANY(error, PVPATB_TEST_IS_TRUE(false); iState = STATE_CLEANUPANDCOMPLETE; RunIfNotReady(); return);
+            OSCL_FIRST_CATCH_ANY(error, PVPATB_TEST_IS_TRUE(false);
+                                 iState = STATE_CLEANUPANDCOMPLETE;
+                                 RunIfNotReady();
+                                 return);
 
             // enable or disable HEAD request
             iKeyStringSetAsync = _STRLIT_CHAR("x-pvmf/net/http-header-request-disabled;valtype=bool");
@@ -383,14 +407,20 @@ void pvplayer_async_test_downloadbase::Run()
             iKVPSetAsync.value.bool_value = true;
             iErrorKVP = NULL;
             OSCL_TRY(error, iPlayerCapConfigIF->setParametersSync(NULL, &iKVPSetAsync, 1, iErrorKVP));
-            OSCL_FIRST_CATCH_ANY(error, PVPATB_TEST_IS_TRUE(false); iState = STATE_CLEANUPANDCOMPLETE; RunIfNotReady(); return);
+            OSCL_FIRST_CATCH_ANY(error, PVPATB_TEST_IS_TRUE(false);
+                                 iState = STATE_CLEANUPANDCOMPLETE;
+                                 RunIfNotReady();
+                                 return);
 
             iKeyStringSetAsync = _STRLIT_CHAR("x-pvmf/net/max-tcp-recv-buffer-size-download;valtype=uint32");
             iKVPSetAsync.key = iKeyStringSetAsync.get_str();
             iKVPSetAsync.value.uint32_value = 64000;
             iErrorKVP = NULL;
             OSCL_TRY(error, iPlayerCapConfigIF->setParametersSync(NULL, &iKVPSetAsync, 1, iErrorKVP));
-            OSCL_FIRST_CATCH_ANY(error, PVPATB_TEST_IS_TRUE(false); iState = STATE_CLEANUPANDCOMPLETE; RunIfNotReady(); return);
+            OSCL_FIRST_CATCH_ANY(error, PVPATB_TEST_IS_TRUE(false);
+                                 iState = STATE_CLEANUPANDCOMPLETE;
+                                 RunIfNotReady();
+                                 return);
 
             //set number of TCP recv buffers for progressive playback.
             if (iDownloadContextData
@@ -413,7 +443,10 @@ void pvplayer_async_test_downloadbase::Run()
             iKVPSetAsync.capacity = protocolExtensionHeaderCookie.get_size();
             iErrorKVP = NULL;
             OSCL_TRY(error, iPlayerCapConfigIF->setParametersSync(NULL, &iKVPSetAsync, 1, iErrorKVP));
-            OSCL_FIRST_CATCH_ANY(error, PVPATB_TEST_IS_TRUE(false); iState = STATE_CLEANUPANDCOMPLETE; RunIfNotReady(); return);
+            OSCL_FIRST_CATCH_ANY(error, PVPATB_TEST_IS_TRUE(false);
+                                 iState = STATE_CLEANUPANDCOMPLETE;
+                                 RunIfNotReady();
+                                 return);
             /////////////////////////////////////////////////////////
 
 
@@ -571,12 +604,21 @@ void pvplayer_async_test_downloadbase::Run()
         {
             if (iSessionDuration > 0)
             {
-                fprintf(iTestMsgOutputFile, "***Repositioning to %d ms\n", (iSessionDuration / 4));
                 PVPPlaybackPosition start, end;
                 start.iIndeterminate = false;
                 start.iPosUnit = PVPPBPOSUNIT_MILLISEC;
                 start.iMode = PVPPBPOS_MODE_NOW;
-                start.iPosValue.millisec_value = iSessionDuration / 4;
+                if (iRepositionDuringDownload)
+                {
+                    start.iPosValue.millisec_value = ((iLastBufferingStatusVal) * iSessionDuration) / 100;
+                    fprintf(iTestMsgOutputFile, "\n\r***Repositioning to %d ms\n\r", start.iPosValue.millisec_value);
+                }
+                else
+                {
+                    start.iPosValue.millisec_value = iSessionDuration / 4;
+                    fprintf(iTestMsgOutputFile, "\n\r***Repositioning to %d ms\n\r", (iSessionDuration / 4));
+                }
+
                 end.iIndeterminate = true;
                 OSCL_TRY(error, iCurrentCmdId = iPlayer->SetPlaybackRange(start, end, false, (OsclAny*) & iContextObject));
                 OSCL_FIRST_CATCH_ANY(error, PVPATB_TEST_IS_TRUE(false); iState = STATE_CLEANUPANDCOMPLETE; RunIfNotReady());
@@ -948,6 +990,15 @@ void pvplayer_async_test_downloadbase::CommandCompleted(const PVCmdResponse& aRe
                         RunIfNotReady(10*1000*1000);
                     break;
                 }
+                if (iRepositionDuringDownload)
+                {
+                    if (iLastBufferingStatusVal < 90)
+                    {
+                        iState = STATE_SETPLAYBACKRANGE;
+                        RunIfNotReady();
+                    }
+                    break;
+                }
                 //most other cases wait for buff complete.
                 if (iNumBufferingComplete)
                 {
@@ -1060,10 +1111,17 @@ void pvplayer_async_test_downloadbase::CommandCompleted(const PVCmdResponse& aRe
         case STATE_SETPLAYBACKRANGE:
             if (aResponse.GetCmdStatus() == PVMFSuccess)
             {
-                fprintf(iTestMsgOutputFile, "***Repositioning Success...\n");
-                //just play for 10 seconds then stop
-                iState = STATE_STOP;
-                RunIfNotReady(10*1000*1000);
+                fprintf(iTestMsgOutputFile, "***Repositioning Success...\n\r");
+                if (iRepositionDuringDownload && !iNumBufferingComplete)
+                {
+                    RunIfNotReady(5*1000*1000);
+                }
+                else
+                {
+                    //just play for 10 seconds then stop
+                    iState = STATE_STOP;
+                    RunIfNotReady(10*1000*1000);
+                }
             }
             else
             {
@@ -1635,6 +1693,19 @@ void pvplayer_async_test_downloadbase::HandleInformationalEvent(const PVAsyncInf
             }
         }
         break;
+
+        case PVMFInfoActualPlaybackPosition:
+        {
+            PVExclusivePtr aPtr;
+            aEvent.GetEventData(aPtr);
+            PVPPlaybackPosition* actualpos = (PVPPlaybackPosition*)aPtr;
+            if (actualpos != NULL)
+            {
+                fprintf(iTestMsgOutputFile, "###PVMFInfoActualPlaybackPosition (in ms) = %d\n",
+                        actualpos->iPosValue.millisec_value);
+            }
+        }
+        break;
         default:
             break;
     }
@@ -1885,8 +1956,6 @@ void pvplayer_async_test_3gppdlnormal_dlthenplay::CreateDataSource()
     uint32 iMaxFileSize = 0x7FFFFFFF;
     bool aIsNewSession = true;
 
-    iDownloadThenPlay = true;
-
     iDownloadContextData = new PVMFSourceContextData();
     iDownloadContextData->EnableCommonSourceContext();
     iDownloadContextData->EnableDownloadHTTPSourceContext();
@@ -1896,7 +1965,14 @@ void pvplayer_async_test_3gppdlnormal_dlthenplay::CreateDataSource()
     iDownloadContextData->DownloadHTTPData()->iMaxFileSize = iMaxFileSize;
     iDownloadContextData->DownloadHTTPData()->iProxyName = iDownloadProxy;
     iDownloadContextData->DownloadHTTPData()->iProxyPort = iDownloadProxyPort;
-    iDownloadContextData->DownloadHTTPData()->iPlaybackControl = PVMFSourceContextDataDownloadHTTP::EAfterDownload;
+
+    if (iRepositionDuringDownload)
+        iDownloadContextData->DownloadHTTPData()->iPlaybackControl = PVMFSourceContextDataDownloadHTTP::EAsap;
+    else
+    {
+        iDownloadContextData->DownloadHTTPData()->iPlaybackControl = PVMFSourceContextDataDownloadHTTP::EAfterDownload;
+        iDownloadThenPlay = true;
+    }
 
     iDataSource->SetDataSourceContextData(iDownloadContextData);
 }
index 598258d..fe54c97 100644 (file)
@@ -63,6 +63,7 @@ class pvplayer_async_test_downloadbase : public pvplayer_async_test_base
                 , iCurrentCmdId(0)
                 , iProtocolRollOver(false)
                 , iRepositionAfterDownloadComplete(false)
+                , iRepositionDuringDownload(false)
                 , iPauseAfterDownloadComplete(false)
                 , iPlayUntilEOS(false)
                 , iPauseResumeAfterUnderflow(false)
@@ -162,7 +163,14 @@ class pvplayer_async_test_downloadbase : public pvplayer_async_test_base
         {
             iRepositionAfterDownloadComplete = true;
         }
+
+        void enableReposDuringDownload()
+        {
+            iRepositionDuringDownload = true;
+        }
+
         bool iRepositionAfterDownloadComplete;
+        bool iRepositionDuringDownload;
 
         void enablePauseAfterDownloadComplete()
         {