Android-x86
Fork
Donation

  • R/O
  • HTTP
  • SSH
  • HTTPS

external-opencore: Commit

external/opencore


Commit MetaInfo

Revisión0e09ad4eb901a2143541eda3ca42ee3c5b08a1b3 (tree)
Tiempo2010-04-06 05:20:44
AutorPacketVideo CM <engbuild@pv.c...>
CommiterPacketVideo CM

Log Message

RIO-8390: Disconnect-Seek mode support for pause/resume

Change-Id: I49a6ba9247fe1ac8958c745d9b34f1e62465a48a

Cambiar Resumen

Diferencia

--- a/engines/2way/src/pv_2way_sdkinfo.h
+++ b/engines/2way/src/pv_2way_sdkinfo.h
@@ -21,7 +21,7 @@
2121 // This header file is automatically generated at build-time
2222 // *** OFFICIAL RELEASE INFO -- Will not auto update
2323
24-#define PV2WAY_ENGINE_SDKINFO_LABEL "CORE_8.507.1.1"
25-#define PV2WAY_ENGINE_SDKINFO_DATE 0x20100327
24+#define PV2WAY_ENGINE_SDKINFO_LABEL "1349500"
25+#define PV2WAY_ENGINE_SDKINFO_DATE 0x20100330
2626
2727 #endif //PV_2WAY_SDKINFO_H_INCLUDED
--- a/engines/author/src/pv_author_sdkinfo.h
+++ b/engines/author/src/pv_author_sdkinfo.h
@@ -21,7 +21,7 @@
2121 // This header file is automatically generated at build-time
2222 // *** OFFICIAL RELEASE INFO -- Will not auto update
2323
24-#define PVAUTHOR_ENGINE_SDKINFO_LABEL "CORE_8.507.1.1"
25-#define PVAUTHOR_ENGINE_SDKINFO_DATE 0x20100327
24+#define PVAUTHOR_ENGINE_SDKINFO_LABEL "1349500"
25+#define PVAUTHOR_ENGINE_SDKINFO_DATE 0x20100330
2626
2727 #endif //PV_AUTHOR_SDKINFO_H_INCLUDED
--- a/engines/player/src/pv_player_sdkinfo.h
+++ b/engines/player/src/pv_player_sdkinfo.h
@@ -21,7 +21,7 @@
2121 // This header file is automatically generated at build-time
2222 // *** OFFICIAL RELEASE INFO -- Will not auto update
2323
24-#define PVPLAYER_ENGINE_SDKINFO_LABEL "CORE_8.507.1.1"
25-#define PVPLAYER_ENGINE_SDKINFO_DATE 0x20100327
24+#define PVPLAYER_ENGINE_SDKINFO_LABEL "1349500"
25+#define PVPLAYER_ENGINE_SDKINFO_DATE 0x20100330
2626
2727 #endif //PV_PLAYER_SDKINFO_H_INCLUDED
--- a/engines/player/test/src/test_pv_player_engine_testset5.cpp
+++ b/engines/player/test/src/test_pv_player_engine_testset5.cpp
@@ -3900,6 +3900,13 @@ void pvplayer_async_test_ppb_base::CommandCompleted(const PVCmdResponse& aRespon
39003900 iState = STATE_GETMETADATAKEYLIST;
39013901 RunIfNotReady();
39023902 }
3903+ else if ((iSeekBeforeStart) && (aResponse.GetCmdStatus() == PVMFFailure))
3904+ {
3905+ /* Do reset, in case when Seek was called before Start and Prepare's command
3906+ completed with PVMFFailure */
3907+ iState = STATE_RESET;
3908+ RunIfNotReady();
3909+ }
39033910 else
39043911 {
39053912 // Prepare failed
--- a/nodes/common/include/pvmf_download_progress_interface.h
+++ b/nodes/common/include/pvmf_download_progress_interface.h
@@ -40,6 +40,9 @@
4040 #define PVMF_DOWNLOAD_PROGRESS_INTERFACE_MIMETYPE "x-pvmf/pvmf/download/progress"
4141 #define PVMF_DOWNLOAD_PROGRESS_INTERFACE_UUID PVUuid(0x01da7746, 0x7d6b, 0x4673, 0xb9, 0x0c, 0x63, 0x2c, 0x82, 0xdd, 0x33, 0xad)
4242
43+// For byte-seek support during PPB
44+#define PROGRESSIVE_STREAMING_IS_BYTE_SEEK_NOT_SUPPORTED_STRING "x-pvmf/net/is-byte-seek-not-supported"
45+
4346 class PVMFMP4ProgDownloadSupportInterface;
4447 class PVMFFormatProgDownloadSupportInterface;
4548
--- a/nodes/common/include/pvmf_source_context_data.h
+++ b/nodes/common/include/pvmf_source_context_data.h
@@ -53,6 +53,13 @@ class PVMFCPMPluginAccessInterfaceFactory;
5353 #define BITMASK_PVMF_SOURCE_INTENT_THUMBNAILS 0x00000008
5454 #define BITMASK_PVMF_SOURCE_INTENT_SUPPRESS_REMOTE_NOTIFICATIONS 0x00000010
5555
56+enum ByteSeekMode
57+{
58+ BYTE_SEEK_UNSUPPORTED = 0,
59+ BYTE_SEEK_SUPPORTED,
60+ BYTE_SEEK_NOTSET
61+};
62+
5663 class PVMFSourceContextDataCommon : public PVInterface
5764 {
5865 public:
@@ -229,6 +236,7 @@ class PVMFSourceContextDataDownloadHTTP : public PVInterface
229236 bIsNewSession = true;
230237 iMaxFileSize = 0;
231238 iMaxHttpHeaderFieldSize = 0x7fffffff;
239+ iByteSeekMode = BYTE_SEEK_NOTSET; // By default set to enum value: BYTE_SEEK_NOTSET
232240 };
233241
234242 PVMFSourceContextDataDownloadHTTP(const PVMFSourceContextDataDownloadHTTP& aSrc) : PVInterface(aSrc)
@@ -279,6 +287,10 @@ class PVMFSourceContextDataDownloadHTTP : public PVInterface
279287 int32 iProxyPort; //HTTP proxy port
280288 int32 iMaxHttpHeaderFieldSize; //HTTP header field size, in DLNA PPB size is 998
281289
290+ ByteSeekMode iByteSeekMode; /* param to determine byte-seek support for PPB, by default set to enum value: BYTE_SEEK_NOTSET if
291+ App doesn't set any value inside context data, set to enum value: BYTE_SEEK_SUPPORTED if byte-seek
292+ supported, set to enum value: BYTE_SEEK_UNSUPPORTED if byte-seek not supported */
293+
282294 typedef enum // For Download only
283295 {
284296 ENoPlayback = 0,
@@ -306,6 +318,7 @@ class PVMFSourceContextDataDownloadHTTP : public PVInterface
306318 iUserID = aSrc.iUserID;
307319 iUserPasswd = aSrc.iUserPasswd;
308320 iMaxHttpHeaderFieldSize = aSrc.iMaxHttpHeaderFieldSize;
321+ iByteSeekMode = aSrc.iByteSeekMode;
309322 };
310323 };
311324
--- a/nodes/pvdownloadmanagernode/src/pvmf_downloadmanager_node.cpp
+++ b/nodes/pvdownloadmanagernode/src/pvmf_downloadmanager_node.cpp
@@ -489,6 +489,15 @@ PVMFStatus PVMFDownloadManagerNode::SetSourceInitializationData(OSCL_wString& aS
489489 iPlaybackMode = EPlayAsap;
490490 break;
491491 }
492+
493+ iContextDataByteSeek = data->iByteSeekMode;
494+
495+ /* During PPB, set the byte-seek mode from the context data inside the PE node. If App doesn't
496+ sets the byte-seek mode inside the context data, then it is set as 'BYTE_SEEK_NOTSET' inside PE node */
497+ if (iPlaybackMode == EPlaybackOnly)
498+ {
499+ (iProtocolEngineNode.ProtocolEngineExtension())->SetByteSeekMode(iContextDataByteSeek);
500+ }
492501 }
493502 else
494503 {//invalid source data
@@ -1569,6 +1578,10 @@ PVMFStatus PVMFDownloadManagerNode::ScheduleSubNodeCommands()
15691578 //Start or re-start parser node (unless download-only)
15701579 if (iFormatParserNode.iNode)
15711580 Push(iFormatParserNode, PVMFDownloadManagerSubNodeContainerBase::EStart);
1581+ // Start the PE node after it was paused for PPB, in case when byte-seek is enabled.
1582+ if (((iProtocolEngineNode.ProtocolEngineExtension())->GetByteSeekMode() == BYTE_SEEK_SUPPORTED)
1583+ && (iProtocolEngineNode.iNode->GetState() == EPVMFNodePaused) && (iPlaybackMode == EPlaybackOnly) && (!iDownloadComplete))
1584+ Push(iProtocolEngineNode, PVMFDownloadManagerSubNodeContainerBase::EStart);
15721585 break;
15731586
15741587 case PVMF_GENERIC_NODE_STOP:
@@ -1597,6 +1610,10 @@ PVMFStatus PVMFDownloadManagerNode::ScheduleSubNodeCommands()
15971610 //note: pause/resume download is not supported.
15981611 if (iFormatParserNode.iNode)
15991612 Push(iFormatParserNode, PVMFDownloadManagerSubNodeContainerBase::EPause);
1613+ // Pause the PE node when engine is Paused, in case of PPB when byte-seek is enabled.
1614+ if (((iProtocolEngineNode.ProtocolEngineExtension())->GetByteSeekMode() == BYTE_SEEK_SUPPORTED) &&
1615+ (iPlaybackMode == EPlaybackOnly) && (!iDownloadComplete))
1616+ Push(iProtocolEngineNode, PVMFDownloadManagerSubNodeContainerBase::EPause);
16001617 break;
16011618
16021619 case PVMF_GENERIC_NODE_RESET:
--- a/nodes/pvdownloadmanagernode/src/pvmf_downloadmanager_node.h
+++ b/nodes/pvdownloadmanagernode/src/pvmf_downloadmanager_node.h
@@ -635,6 +635,8 @@ class PVMFDownloadManagerNode
635635
636636 bool iInitFailedLicenseRequired; //set when PVMFErrDrmLicenseNotFound failed
637637
638+ ByteSeekMode iContextDataByteSeek;
639+
638640 void ContinueInitAfterTrackSelectDecision();
639641 void ContinueFromDownloadTrackSelectionPoint();
640642 void ContinueAfterMovieAtom();
--- a/nodes/pvmp3ffparsernode/src/pvmf_mp3ffparser_node.cpp
+++ b/nodes/pvmp3ffparsernode/src/pvmf_mp3ffparser_node.cpp
@@ -70,6 +70,7 @@ PVMFMP3FFParserNode::PVMFMP3FFParserNode(int32 aPriority)
7070 iCheckForMP3HeaderDuringInit = false;
7171 iDurationCalcAO = NULL;
7272 iUseCPMPluginRegistry = false;
73+ iIsByteSeekNotSupported = false;
7374
7475 int32 err;
7576 OSCL_TRY(err,
@@ -1032,11 +1033,24 @@ int32 PVMFMP3FFParserNode::convertSizeToTime(uint32 aFileSize, uint32& aNPTInMS)
10321033
10331034 bool PVMFMP3FFParserNode::setProtocolInfo(Oscl_Vector<PvmiKvp*, OsclMemAllocator>& aInfoKvpVec)
10341035 {
1035-
10361036 if (aInfoKvpVec.empty())
10371037 {
10381038 return false;
10391039 }
1040+ for (uint32 j = 0; j < aInfoKvpVec.size(); j++)
1041+ {
1042+ if (!aInfoKvpVec[j])
1043+ {
1044+ return false;
1045+ }
1046+
1047+ if (oscl_strstr(aInfoKvpVec[j]->key, PROGRESSIVE_STREAMING_IS_BYTE_SEEK_NOT_SUPPORTED_STRING))
1048+ {
1049+ iIsByteSeekNotSupported = aInfoKvpVec[j]->value.bool_value; // value set only for byte-seek unsupported mode during PPB.
1050+ }
1051+ }
1052+
1053+
10401054 for (uint32 i = 0; i < aInfoKvpVec.size(); i++)
10411055 {
10421056 if (!aInfoKvpVec[i])
@@ -1056,7 +1070,6 @@ bool PVMFMP3FFParserNode::setProtocolInfo(Oscl_Vector<PvmiKvp*, OsclMemAllocator
10561070 {
10571071 }
10581072 }
1059-
10601073 return true;
10611074 }
10621075
@@ -2696,6 +2709,25 @@ PVMFStatus PVMFMP3FFParserNode::SetPlaybackStartupTime(uint32& aTargetNPT,
26962709 iDownloadComplete = false;
26972710 }
26982711
2712+ /* In PPB, Seek is not permitted in case when byte-seek is not supported. */
2713+ if ((aTargetNPT != 0) && (iDataStreamInterface != NULL))
2714+ {
2715+ if ((iDataStreamInterface->QueryBufferingCapacity() != 0)
2716+ && (iIsByteSeekNotSupported == true))
2717+ {
2718+ if (iInterfaceState == EPVMFNodePrepared)
2719+ {
2720+ /*This means engine is trying to start the playback session at a non-zero NPT.
2721+ In case of PPB, this is not possible if server does not support byte-seek. */
2722+ return PVMFFailure;
2723+ }
2724+ else
2725+ {
2726+ return PVMFErrNotSupported;
2727+ }
2728+ }
2729+ }
2730+
26992731 iStreamID = aStreamID;
27002732 iTrack.iSendBOS = true;
27012733 iTrack.iFirstFrame = true;
--- a/nodes/pvmp3ffparsernode/src/pvmf_mp3ffparser_node.h
+++ b/nodes/pvmp3ffparsernode/src/pvmf_mp3ffparser_node.h
@@ -658,6 +658,8 @@ class PVMFMP3FFParserNode : public PVMFNodeInterfaceImpl,
658658 friend class PVMFCPMContainerMp3;
659659 friend class PVMFMP3FFParserPort;
660660 friend class PVMp3DurationCalculator;
661+
662+ bool iIsByteSeekNotSupported;
661663 };
662664
663665 #endif // PVMF_MP3FFPARSER_NODE_H_INCLUDED
--- a/nodes/pvmp4ffparsernode/src/pvmf_mp4ffparser_node.cpp
+++ b/nodes/pvmp4ffparsernode/src/pvmf_mp4ffparser_node.cpp
@@ -112,6 +112,7 @@ PVMFMP4FFParserNode::PVMFMP4FFParserNode(int32 aPriority) :
112112 iAuthorizationDataKvp.key = NULL;
113113 oWaitingOnLicense = false;
114114 iPoorlyInterleavedContentEventSent = false;
115+ iIsByteSeekNotSupported = false;
115116
116117
117118 iParsingMode = PVMF_MP4FF_PARSER_NODE_ENABLE_PARSER_OPTIMIZATION;
@@ -2630,6 +2631,28 @@ PVMFStatus PVMFMP4FFParserNode::SetPlaybackStartupTime(uint32& aTargetNPT,
26302631 iDownloadComplete = false;
26312632 }
26322633
2634+ /* Check for repositioning request support in case of PPB.
2635+ In PPB, Seek is not permitted in case when byte-seek is disabled. */
2636+ if ((aTargetNPT != 0) && (iDataStreamInterface != NULL))
2637+ {
2638+ if ((iDataStreamInterface->QueryBufferingCapacity() != 0)
2639+ && (iIsByteSeekNotSupported == true))
2640+ {
2641+ if (iInterfaceState == EPVMFNodePrepared)
2642+ {
2643+ /*This means engine is trying to start the playback session at a non-zero NPT.
2644+ In case of PPB, this is not possible if server does not support byte-seek. */
2645+ PVMF_BASE_NODE_ARRAY_DELETE(trackList);
2646+ return PVMFFailure;
2647+ }
2648+ else
2649+ {
2650+ PVMF_BASE_NODE_ARRAY_DELETE(trackList);
2651+ return PVMFErrNotSupported;
2652+ }
2653+ }
2654+ }
2655+
26332656 // Validate the parameters
26342657 if (aActualNPT == NULL || aActualMediaDataTS == NULL)
26352658 {
@@ -2904,6 +2927,7 @@ PVMFStatus PVMFMP4FFParserNode::SetPlaybackStartupTime(uint32& aTargetNPT,
29042927 {
29052928 PVLOGGER_LOGMSG(PVLOGMSG_INST_HLDBG, iLogger, PVLOGMSG_ERR,
29062929 (0, "PVMFMP4FFParserNode::SetPlaybackStartupTime() Memory alloc for array to keep the timestamp of the samples failed"));
2930+ PVMF_BASE_NODE_ARRAY_DELETE(trackList);
29072931 OSCL_FREE(trackTSAfterRepo);
29082932 trackTSAfterRepo = NULL;
29092933 OSCL_FREE(retValPerTrack);
@@ -8672,6 +8696,10 @@ bool PVMFMP4FFParserNode::setProtocolInfo(Oscl_Vector<PvmiKvp*, OsclMemAllocator
86728696 {
86738697 mfra = *((PVMFMP4MfraInfoUpdate*)aInfoKvpVec[i]->value.key_specific_value);
86748698 }
8699+ else if (oscl_strstr(aInfoKvpVec[i]->key, PROGRESSIVE_STREAMING_IS_BYTE_SEEK_NOT_SUPPORTED_STRING))
8700+ {
8701+ iIsByteSeekNotSupported = aInfoKvpVec[i]->value.bool_value;
8702+ }
86758703 }
86768704 }
86778705
--- a/nodes/pvmp4ffparsernode/src/pvmf_mp4ffparser_node.h
+++ b/nodes/pvmp4ffparsernode/src/pvmf_mp4ffparser_node.h
@@ -686,6 +686,7 @@ class PVMFMP4FFParserNode
686686 uint32 iTotalMoofFrags;
687687
688688 Oscl_Vector<PVMFMP4MfraInfoUpdate, OsclMemAllocator> iMoofInfoUpdateVec;
689+ bool iIsByteSeekNotSupported;
689690 };
690691
691692
--- a/nodes/pvprotocolenginenode/base/src/pvmf_protocol_engine_node.cpp
+++ b/nodes/pvprotocolenginenode/base/src/pvmf_protocol_engine_node.cpp
@@ -1238,6 +1238,11 @@ PVMFStatus PVMFProtocolEngineNode::PostProcessForMsgSentSuccess(PVMFPortInterfac
12381238 LOGINFODATAPATH((0, "PVMFProtocolEngineNode::PostProcessForMsgSentSuccess() Send() SUCCESS: SOCKET CONNECT SENT! SEQNUM= %d, MsgID=%d, port=0x%x", aMsg->getSeqNum(), aMsg->getFormatID(), aPort));
12391239 bool status = iProtocolContainer->completeRepositionRequest();
12401240 if (status) LOGINFODATAPATH((0, "PVMFProtocolEngineNode::PostProcessForMsgSentSuccess() Send() SOCKET CONNECT cmd SUCCESS: complete data stream reposition request"));
1241+
1242+ /* Complete the start command of PE node issued after it was paused, during PPB
1243+ when byte-seek is enabled inside the PE node.*/
1244+ bool retval = iProtocolContainer->completeStartCmd();
1245+ if (retval) LOGINFODATAPATH((0, "PVMFProtocolEngineNode::PostProcessForMsgSentSuccess() Send() SOCKET CONNECT cmd SUCCESS: complete data stream start request"));
12411246 }
12421247 else
12431248 {
--- a/nodes/pvprotocolenginenode/base/src/pvmf_protocol_engine_node.h
+++ b/nodes/pvprotocolenginenode/base/src/pvmf_protocol_engine_node.h
@@ -178,6 +178,16 @@ class PVMFProtocolEngineNode : public PVMFNodeInterfaceImpl,
178178 return iProtocolContainer->getMaxTotalClipBitrate();
179179 }
180180
181+ void SetByteSeekMode(const ByteSeekMode aByteSeekMode = BYTE_SEEK_UNSUPPORTED)
182+ {
183+ if (iProtocol) iProtocol->setByteSeekMode(aByteSeekMode);
184+ }
185+ uint32 GetByteSeekMode()
186+ {
187+ if (iProtocol) return iProtocol->getByteSeekMode();
188+ else return BYTE_SEEK_NOTSET;
189+ }
190+
181191 bool GetASFHeader(Oscl_Vector<OsclRefCounterMemFrag, OsclMemAllocator> &aHeader)
182192 {
183193 return iProtocol->getHeader(aHeader);
--- a/nodes/pvprotocolenginenode/download_protocols/common/src/pvmf_protocol_engine_node_download_common.cpp
+++ b/nodes/pvprotocolenginenode/download_protocols/common/src/pvmf_protocol_engine_node_download_common.cpp
@@ -1118,6 +1118,7 @@ void PVMFDownloadDataSourceContainer::copy(const PVMFSourceContextDataDownloadHT
11181118 iUserID = aSourceData.iUserID;
11191119 iUserPasswd = aSourceData.iUserPasswd;
11201120 iPvxInfo = NULL;
1121+ iByteSeekMode = aSourceData.iByteSeekMode;
11211122 }
11221123
11231124 void PVMFDownloadDataSourceContainer::copy(const PVMFSourceContextDataDownloadPVX& aSourceData)
--- a/nodes/pvprotocolenginenode/download_protocols/common/src/pvmf_protocol_engine_node_download_common.h
+++ b/nodes/pvprotocolenginenode/download_protocols/common/src/pvmf_protocol_engine_node_download_common.h
@@ -423,6 +423,7 @@ class PVMFDownloadDataSourceContainer
423423 public:
424424 bool iHasDataSource; // true means the constainer is already filled in the data source
425425 bool iIsNewSession; // true if the downloading a new file, false if keep downloading a partial downloading file
426+ uint32 iByteSeekMode; // 1 if byte-seek supported by server, 0 if not supported, 2 if value is not set by App or server not DMS.
426427 uint32 iMaxFileSize; // the max size of the file.
427428 uint32 iPlaybackControl; // correspond to PVMFDownloadDataSourceHTTP::TPVPlaybackControl, PVMFSourceContextDataDownloadHTTP::TPVPlaybackControl
428429 OSCL_wHeapString<OsclMemAllocator> iConfigFileName; // download config file
--- a/nodes/pvprotocolenginenode/download_protocols/progressive_streaming/src/pvmf_protocol_engine_node_progressive_streaming.cpp
+++ b/nodes/pvprotocolenginenode/download_protocols/progressive_streaming/src/pvmf_protocol_engine_node_progressive_streaming.cpp
@@ -28,7 +28,7 @@
2828 ////// ProgressiveStreamingContainer implementation
2929 ////////////////////////////////////////////////////////////////////////////////////
3030 OSCL_EXPORT_REF ProgressiveStreamingContainer::ProgressiveStreamingContainer(PVMFProtocolEngineNode *aNode) :
31- ProgressiveDownloadContainer(aNode), iEnableInfoUpdate(true)
31+ ProgressiveDownloadContainer(aNode), iEnableInfoUpdate(true), iStartAfterPause(false)
3232 {
3333 ;
3434 }
@@ -141,6 +141,27 @@ OSCL_EXPORT_REF bool ProgressiveStreamingContainer::completeRepositionRequest()
141141 return true;
142142 }
143143
144+OSCL_EXPORT_REF bool ProgressiveStreamingContainer::completeStartCmd()
145+{
146+ PVMFNodeCommand *pCmd = iObserver->FindPendingCmd(PVMF_GENERIC_NODE_START);
147+ if (pCmd == NULL) return false;
148+
149+ // During PPB when byte-seek enabled inside PE node, if the current pending Start command was issued after Pause, then complete the pending command.
150+ if ((iProtocol->getByteSeekMode() == BYTE_SEEK_SUPPORTED) && (iStartAfterPause == true))
151+ {
152+ iObserver->CompletePendingCmd(PVMFSuccess);
153+ iObserver->SetObserverState((uint32)EPVMFNodeStarted);
154+ iStartAfterPause = false;
155+ return true;
156+ }
157+ return false;
158+}
159+
160+OSCL_EXPORT_REF bool ProgressiveStreamingContainer::downloadUpdateForHttpHeaderAvailable()
161+{
162+ return iProtocol->updateSeekMode();
163+}
164+
144165 void ProgressiveStreamingContainer::moveToStartedState()
145166 {
146167 DownloadContainer::setEventReporterSupportObjects();
@@ -185,6 +206,19 @@ OSCL_EXPORT_REF bool ProgressiveStreamingContainer::doInfoUpdate(const uint32 do
185206 return DownloadContainer::doInfoUpdate(downloadStatus);
186207 }
187208
209+OSCL_EXPORT_REF bool ProgressiveStreamingContainer::doPause()
210+{
211+ // Pause the PE node alongwith disconnection with the server, in case of PPB when byte-seek param is enabled inside PE node.
212+ if (iProtocol->getByteSeekMode() == BYTE_SEEK_SUPPORTED)
213+ {
214+ // Disconnection caused with the server
215+ ProtocolContainer::sendSocketDisconnectCmd();
216+
217+ iStartAfterPause = true;
218+ }
219+ return true;
220+}
221+
188222 ////////////////////////////////////////////////////////////////////////////////////
189223 ////// pvProgressiveStreamingOutput implementation
190224 ///////////////////////////////////////////////////////////////////////////////////
@@ -368,7 +402,7 @@ OSCL_EXPORT_REF bool pvProgressiveStreamingOutput::seekDataStream(const uint32 a
368402 ////////////////////////////////////////////////////////////////////////////////////
369403 ////// progressiveStreamingControl implementation
370404 ////////////////////////////////////////////////////////////////////////////////////
371-OSCL_EXPORT_REF progressiveStreamingControl::progressiveStreamingControl() : progressiveDownloadControl()
405+OSCL_EXPORT_REF progressiveStreamingControl::progressiveStreamingControl() : progressiveDownloadControl(), iSetProtocolInfo(false)
372406 {
373407 ;
374408 }
@@ -394,6 +428,34 @@ OSCL_EXPORT_REF void progressiveStreamingControl::clearPerRequest()
394428 iSendDownloadCompleteNotification = false;
395429 }
396430
431+void progressiveStreamingControl::setProtocolInfo()
432+{
433+ if (iSetProtocolInfo) return;
434+ if (!iProgDownloadSI || !iProtocol) return;
435+
436+ iInfoKvpVec.clear();
437+
438+ bool aIsByteSeekNotSupported;
439+ ByteSeekMode aByteSeekMode = iProtocol->getByteSeekMode();
440+
441+ if (aByteSeekMode == BYTE_SEEK_UNSUPPORTED)
442+ {
443+ aIsByteSeekNotSupported = true;
444+ }
445+ else
446+ return;
447+
448+ // byte seek mode
449+ PvmiKvp byteSeekModeKVP;
450+ OSCL_StackString<256> byteSeekModeKVPString = _STRLIT_CHAR("x-pvmf/net/is-byte-seek-not-supported;valtype=bool");
451+ byteSeekModeKVP.key = byteSeekModeKVPString.get_str();
452+ byteSeekModeKVP.value.bool_value = aIsByteSeekNotSupported;
453+ iInfoKvpVec.push_back(&byteSeekModeKVP);
454+
455+ iProgDownloadSI->setProtocolInfo(iInfoKvpVec);
456+ iSetProtocolInfo = true;
457+}
458+
397459 ////////////////////////////////////////////////////////////////////////////////////
398460 ////// ProgressiveStreamingProgress implementation
399461 ////////////////////////////////////////////////////////////////////////////////////
--- a/nodes/pvprotocolenginenode/download_protocols/progressive_streaming/src/pvmf_protocol_engine_node_progressive_streaming.h
+++ b/nodes/pvprotocolenginenode/download_protocols/progressive_streaming/src/pvmf_protocol_engine_node_progressive_streaming.h
@@ -34,7 +34,9 @@ class ProgressiveStreamingContainer : public ProgressiveDownloadContainer
3434 OSCL_IMPORT_REF PVMFStatus doStop();
3535 OSCL_IMPORT_REF PVMFStatus doSeek(PVMFNodeCommand& aCmd);
3636 OSCL_IMPORT_REF bool completeRepositionRequest();
37+ OSCL_IMPORT_REF bool completeStartCmd();
3738 OSCL_IMPORT_REF bool doInfoUpdate(const uint32 downloadStatus);
39+ OSCL_IMPORT_REF virtual bool downloadUpdateForHttpHeaderAvailable();
3840 void enableInfoUpdate(const bool aEnabled = true)
3941 {
4042 iEnableInfoUpdate = aEnabled;
@@ -42,6 +44,7 @@ class ProgressiveStreamingContainer : public ProgressiveDownloadContainer
4244
4345 // constructor
4446 OSCL_IMPORT_REF ProgressiveStreamingContainer(PVMFProtocolEngineNode *aNode = NULL);
47+ OSCL_IMPORT_REF virtual bool doPause();
4548
4649 protected:
4750 // called by DoSeek()
@@ -55,6 +58,7 @@ class ProgressiveStreamingContainer : public ProgressiveDownloadContainer
5558
5659 private:
5760 void moveToStartedState();
61+ bool iStartAfterPause;
5862 };
5963
6064
@@ -130,6 +134,11 @@ class progressiveStreamingControl : public progressiveDownloadControl
130134
131135 // constructor
132136 OSCL_IMPORT_REF progressiveStreamingControl();
137+
138+ private:
139+ void setProtocolInfo();
140+ bool iSetProtocolInfo;
141+ Oscl_Vector<PvmiKvp*, OsclMemAllocator> iInfoKvpVec;
133142 };
134143
135144 ////////////////////////////////////////////////////////////////////////////////////
--- a/nodes/pvprotocolenginenode/include/pvmf_protocol_engine_node_extension.h
+++ b/nodes/pvprotocolenginenode/include/pvmf_protocol_engine_node_extension.h
@@ -48,6 +48,8 @@
4848 #include "pvmf_port_interface.h"
4949 #endif
5050
51+#include "pvmf_source_context_data.h"
52+
5153 // default number of redirect trials
5254 #define PVPROTOCOLENGINE_DEFAULT_NUMBER_OF_REDIRECT_TRIALS 10
5355 #define PVPROTOCOLENGINE_DEFAULT_MAXIMUM_ASF_HEADER_SIZE 262144 // 256K
@@ -174,6 +176,20 @@ class PVMFProtocolEngineNodeExtensionInterface : public PVInterface
174176 */
175177 virtual uint32 GetMaxTotalClipBitrate() = 0;
176178
179+ /**
180+ * Set the byte-seek param inside the PE node from the DM node.
181+ *
182+ * @param aByteSeekEnable, specifies the byte-seek param.
183+ */
184+ virtual void SetByteSeekMode(const ByteSeekMode aByteSeekMode = BYTE_SEEK_UNSUPPORTED) = 0;
185+
186+ /**
187+ * Retrieves the byte-seek param from the PE node.
188+ *
189+ * @return 1 when byte-seek param enabled inside the PE node.
190+ * 0 when byte-seek param disabled inside the PE node.
191+ */
192+ virtual uint32 GetByteSeekMode() = 0;
177193 };
178194
179195 #define PVMF_PROTOCOL_ENGINE_MSHTTP_STREAMING_EXTENSION_MIMETYPE "pvxxx/PVMFProtocolEngineNod/MSHTTPStreamingExtensionInterface"
--- a/nodes/pvprotocolenginenode/protocol_common/src/pvmf_protocol_engine_common.cpp
+++ b/nodes/pvprotocolenginenode/protocol_common/src/pvmf_protocol_engine_common.cpp
@@ -984,6 +984,61 @@ OSCL_EXPORT_REF void ProtocolState::deleteRedirectComposer()
984984 }
985985 }
986986
987+bool HttpBasedProtocol::updateSeekMode()
988+{
989+ /* Set byte-seek param inside PE node, based on HEAD request response check in case when byte-seek
990+ param was not set by the App inside the context data. */
991+ if ((iComposer->getMethod() == HTTP_METHOD_HEAD) &&
992+ (getByteSeekMode() == BYTE_SEEK_NOTSET))
993+ {
994+ /* Check whether protocolInfo is present inside the HEAD request's response i.e. we check
995+ whether the header: 'contentFeatures.dlna.org' is present inside the response. */
996+ StrCSumPtrLen protocolInfokey = "contentFeatures.dlna.org";
997+ StrPtrLen protocolInfoValue;
998+ iParser->getHttpParser()->getField(protocolInfokey, protocolInfoValue);
999+ if (protocolInfoValue.size() <= 0)
1000+ {
1001+ // If protocolInfo header not present inside the response, we check for the presence of header: "Accept-Ranges".
1002+ StrCSumPtrLen checkRangesHeaderKey = "Accept-Ranges";
1003+ StrPtrLen checkRangesHeaderValue;
1004+ iParser->getHttpParser()->getField(checkRangesHeaderKey, checkRangesHeaderValue);
1005+ if (checkRangesHeaderValue.size() <= 0)
1006+ {
1007+ // If "Accept-Ranges" header also not present, we disable the byte-seek param inside PE node.
1008+ setByteSeekMode(BYTE_SEEK_UNSUPPORTED);
1009+ }
1010+ else
1011+ {
1012+ if (oscl_strcmp((char *)checkRangesHeaderValue.c_str(), "bytes") == 0)
1013+ {
1014+ // If "Accept-Ranges: bytes" present, we enable the byte-seek param inside the PE node.
1015+ setByteSeekMode(BYTE_SEEK_SUPPORTED);
1016+ }
1017+ else
1018+ {
1019+ setByteSeekMode(BYTE_SEEK_UNSUPPORTED);
1020+ }
1021+ }
1022+ }
1023+ else
1024+ {
1025+ if (oscl_strstr((char *)protocolInfoValue.c_str(), "DLNA.ORG_OP=01") != NULL)
1026+ {
1027+ /* If protocolInfo header present with 'DLNA.ORG_OP=01' as one of it's value,
1028+ we enable the byte-seek param inside the PE node. */
1029+ setByteSeekMode(BYTE_SEEK_SUPPORTED);
1030+ }
1031+ else
1032+ {
1033+ setByteSeekMode(BYTE_SEEK_UNSUPPORTED);
1034+ }
1035+
1036+ }
1037+
1038+ }
1039+ return true;
1040+}
1041+
9871042 void RedirectComposer::storeRedirectUrl()
9881043 {
9891044 OSCL_HeapString<OsclMemAllocator> newUrl;
--- a/nodes/pvprotocolenginenode/protocol_common/src/pvmf_protocol_engine_common.h
+++ b/nodes/pvprotocolenginenode/protocol_common/src/pvmf_protocol_engine_common.h
@@ -355,6 +355,15 @@ class ProtocolState : public HttpParsingBasicObjectObserver,
355355
356356 void storeRedirectUrl(int32 errorCode);
357357
358+ void setByteSeekMode(ByteSeekMode aByteSeekMode = BYTE_SEEK_NOTSET)
359+ {
360+ iByteSeekMode = aByteSeekMode;
361+ }
362+ ByteSeekMode getByteSeekMode()
363+ {
364+ return iByteSeekMode;
365+ }
366+
358367 protected:
359368 // From HttpParsingBasicObjectObserver
360369 virtual int32 OutputDataAvailable(OUTPUT_DATA_QUEUE *aOutputQueue, const bool isHttpHeader)
@@ -459,6 +468,8 @@ class ProtocolState : public HttpParsingBasicObjectObserver,
459468
460469 OSCL_IMPORT_REF void deleteRedirectComposer();
461470
471+ ByteSeekMode iByteSeekMode;
472+
462473 protected:
463474 // http composer and parser should be life-time long, shouldn't be affected by state transition.
464475 // So protocol object owns these two objects.
@@ -731,6 +742,31 @@ class HttpBasedProtocol : public ProtocolStateObserver,
731742 ;
732743 }
733744
745+ HTTPComposer *getComposer()
746+ {
747+ return iComposer;
748+ }
749+
750+ HttpParsingBasicObject *getHttpParsingBasicObject()
751+ {
752+ return iParser;
753+ }
754+
755+ void setByteSeekMode(ByteSeekMode aByteSeekMode = BYTE_SEEK_NOTSET)
756+ {
757+ iCurrState->setByteSeekMode(aByteSeekMode);
758+ ProtocolState *state = NULL;
759+ // set byte-seek mode for all the protocol states.
760+ while ((state = getNextState()) != iCurrState) state->setByteSeekMode(aByteSeekMode);
761+ }
762+
763+ ByteSeekMode getByteSeekMode()
764+ {
765+ return iCurrState->getByteSeekMode();
766+ }
767+
768+ bool updateSeekMode();
769+
734770 protected:
735771 virtual ProtocolState* getNextState() = 0;
736772
--- a/nodes/pvprotocolenginenode/protocol_common/src/pvmf_protocol_engine_node_common.h
+++ b/nodes/pvprotocolenginenode/protocol_common/src/pvmf_protocol_engine_node_common.h
@@ -385,6 +385,12 @@ class ProtocolContainer
385385 {
386386 return false;
387387 }
388+ /* for completing the start command after Pause/Resume in case of PPB,
389+ when byte-seek is enabled inside the PE node */
390+ virtual bool completeStartCmd()
391+ {
392+ return false;
393+ }
388394 virtual void checkSendResumeNotification()
389395 {
390396 ;
--- a/protocols/http_parcom/include/http_composer.h
+++ b/protocols/http_parcom/include/http_composer.h
@@ -66,6 +66,10 @@ class HTTPComposer
6666 {
6767 iMethod = aMethod;
6868 }
69+ char getMethod()
70+ {
71+ return iMethod;
72+ }
6973 void setVersion(const HTTPVersion aVersion)
7074 {
7175 iVersion = aVersion;
Show on old repository browser