From gwright at real.com Thu Jan 1 14:55:43 2009
From: gwright at real.com (Greg Wright)
Date: Thu Jan 1 12:46:40 2009
Subject: [Protocol-dev] CR: Updates to RTP live ASMRuleBook generation
In-Reply-To: <495BEDED.6080603@real.com>
References: <495BEDED.6080603@real.com>
Message-ID: <495D49EF.6070409@real.com>
Looks good.
--greg.
Jamie Gordon wrote:
> Synopsis
> ========
> Updates to RTP live ASMRuleBook generation to work correctly with
> current and upcoming RSD queue and qtbcplin updates
>
> Branches: SERVER_12_1, HEAD (SERVER_CURRENT)
> Suggested Reviewer: anyone
>
>
> Description
> ===========
> Removes the RTCPRules, it is not correct. Neither rule is RTCP!! They
> are both media data, marker bit on/off
>
> Adds InterDepend values (necessary for proper RSD queue handling). (This
> required a minor restructuring to have the base rule known when creating
> the string).
>
> Also added some missing error checking, including using SafeSprintf,
> etc.
>
> Does not yet add rate partitioning.
>
> Files Affected
> ==============
> protocol/common/util/altgrputil.cpp
>
>
> Testing Performed
> =================
> Unit Tests:
>
> Integration Tests:
> Verified proper rulebook generation with single-rate and multi-rate.
>
> Leak Tests:
> None
>
> Performance Tests:
> None
>
> Platforms Tested: win32-i386-vc7
> Build verified: win32-i386-vc7, linux-rhel4-i686, sunos-5.10-sparc-server
>
>
> QA Hints
> ===============
>
> n/a
>
>
>
>
> ------------------------------------------------------------------------
>
> _______________________________________________
> Protocol-dev mailing list
> Protocol-dev@helixcommunity.org
> http://lists.helixcommunity.org/mailman/listinfo/protocol-dev
From gwright at real.com Thu Jan 1 15:00:28 2009
From: gwright at real.com (Greg Wright)
Date: Thu Jan 1 12:51:23 2009
Subject: [Protocol-dev] CR: Modify RTPInfoSynch to work with
updated architecture
In-Reply-To: <495C0EF8.30207@real.com>
References: <495C0EF8.30207@real.com>
Message-ID: <495D4B0C.9050505@real.com>
Looks good.
--greg.
Jamie Gordon wrote:
> Synopsis
> ========
> Modify RTPInfoSync (server-side RTP sync class) to work with
> RTP live reception handling updates
>
> Branches: SERVER_12_1, HEAD (SERVER_CURRENT)
> Suggested Reviewer: anyone
>
>
> Description
> ===========
> This required a major overhaul of the structure.
>
> Please note that this class is used only by the server, and only in the
> one place from which I am removing it (per prior CR).
>
> The usage is defined in an interface, however the interface is no longer
> usable or appropriate. The usage, furthermore, has no need to be an
> interface anyway, So I have removed the existing interface
> (IHXRTPInfoSynch) and am not creating a new one.
>
> The main change is that the current implementation takes IHXBuffers
> containing complete RTP and RTCP packets (including headers) but we
> now have parsed IHXRTPPacket etc. Also the information retrieval etc.
> were not quite right for what we actually need now.
>
> The diff is a bit tough to read, so I am also attaching the cpp file.
>
> Files Affected
> ==============
> common/include/hxiids.h
> protocol/transport/rtp/rtpinfosync.cpp
> protocol/transport/rtp/include/rtpinfosync.h
>
>
> Testing Performed
> =================
> Unit Tests:
>
> Integration Tests:
> Verified properly synced playback of single and multi rate RTP live
>
> Leak Tests:
> None
>
> Performance Tests:
> None
>
> Platforms Tested: win32-i386-vc7
> Build verified: linux-rhel4-i686, sunos-5.10-sparc-server,
> win32-i386-vc7
>
>
> QA Hints
> ===============
>
> n/a
>
>
>
>
> ------------------------------------------------------------------------
>
> _______________________________________________
> Protocol-dev mailing list
> Protocol-dev@helixcommunity.org
> http://lists.helixcommunity.org/mailman/listinfo/protocol-dev
From ckarusala at real.com Fri Jan 2 11:14:16 2009
From: ckarusala at real.com (Chytanya Karusala)
Date: Fri Jan 2 09:03:12 2009
Subject: [Protocol-dev] Re: CR: Updates to RTP live ASMRuleBook generation
In-Reply-To: <495BEDED.6080603@real.com>
References: <495BEDED.6080603@real.com>
Message-ID: <6.2.5.6.2.20090102111404.05280010@real.com>
Looks good.
Thanks,
Chytanya
At 02:10 PM 12/31/2008, Jamie Gordon wrote:
>Synopsis
>========
>Updates to RTP live ASMRuleBook generation to work correctly with
>current and upcoming RSD queue and qtbcplin updates
>
>Branches: SERVER_12_1, HEAD (SERVER_CURRENT)
>Suggested Reviewer: anyone
>
>
>Description
>===========
>Removes the RTCPRules, it is not correct. Neither rule is RTCP!! They
>are both media data, marker bit on/off
>
>Adds InterDepend values (necessary for proper RSD queue handling). (This
>required a minor restructuring to have the base rule known when creating
>the string).
>
>Also added some missing error checking, including using SafeSprintf,
>etc.
>
>Does not yet add rate partitioning.
>
>Files Affected
>==============
>protocol/common/util/altgrputil.cpp
>
>
>Testing Performed
>=================
>Unit Tests:
>
>Integration Tests:
>Verified proper rulebook generation with single-rate and multi-rate.
>
>Leak Tests:
>None
>
>Performance Tests:
>None
>
>Platforms Tested: win32-i386-vc7
>Build verified: win32-i386-vc7, linux-rhel4-i686, sunos-5.10-sparc-server
>
>
>QA Hints
>===============
>
>n/a
>
>
>
>
>
>Index: protocol/common/util/altgrputil.cpp
>===================================================================
>RCS file: /cvsroot/protocol/common/util/altgrputil.cpp,v
>retrieving revision 1.6.24.2
>diff -u -w -r1.6.24.2 altgrputil.cpp
>--- protocol/common/util/altgrputil.cpp 12 Dec 2008 17:53:56
>-0000 1.6.24.2
>+++ protocol/common/util/altgrputil.cpp 31 Dec 2008 21:07:30 -0000
>@@ -53,6 +53,7 @@
> #include "maxbwaltfilt.h"
> #include "highbwaltfilt.h"
> #include "mimealtfilt.h"
>+#include "safestring.h"
>
> #include "hxslist.h"
> #include "hxprefs.h"
>@@ -514,7 +515,7 @@
> strcpy(pRuleBook[i], "");
> }
>
>- UINT32 ulSwitchGrpID = 0;
>+ UINT32 ulSwitchGrp = 0;
> UINT32 ulAvgBW = 0;
>
> //To store the base rule number
>@@ -526,27 +527,36 @@
> ulAvgBW = 0;
> ppValues[i]->GetPropertyULONG32("AvgBitRate", ulAvgBW);
>
>- //Form ASM RuleBook
>- char pTemp[256];
>- UINT32 ulSize = 0;
>-
>- ulSize = sprintf(pTemp,
>- "RTCPRule=0, Marker=0, AverageBandwidth=%d,
>TimestampDelivery=TRUE;"
>- "RTCPRule=1, Marker=1, AverageBandwidth=0,
>TimestampDelivery=TRUE;",(int)ulAvgBW);
>-
>- //Get Switch ID
>- if (HXR_OK !=
>ppValues[i]->GetPropertyULONG32("SwitchGroupID", ulSwitchGrpID))
>+ //Get SwitchGroup ID and base rule
>+ // Assumes switch group IDs generated by CreateSwitchGroups, not just
>+ // any old ID from content!
>+ if
>(SUCCEEDED(ppValues[i]->GetPropertyULONG32("SwitchGroupID", ulSwitchGrp)) &&
>+ ulSwitchGrp > 0 && ulSwitchGrp <= nValues)
> {
>- //For single rate streams each stream is a separate switch grp
>- strncpy (pRuleBook[i], pTemp, (ulSize + 1));
>+ --ulSwitchGrp; // Get Switch Group index from ID
>+
>+ ulIndex = pBaseRuleIndex[ulSwitchGrp];
>+ ppValues[i]->SetPropertyULONG32("BaseRule", ulIndex);
>+ pBaseRuleIndex[ulSwitchGrp] = ulIndex + 2;
> }
> else
> {
>- strncat(pRuleBook[ulSwitchGrpID - 1], pTemp, (ulSize + 1));
>- ulIndex = pBaseRuleIndex[ulSwitchGrpID - 1];
>- ppValues[i]->SetPropertyULONG32("BaseRule",ulIndex);
>- pBaseRuleIndex[ulSwitchGrpID - 1] = ulIndex + 2;
>+ //For single rate streams each stream is a separate switch grp
>+ ulSwitchGrp = i;
>+ ulIndex = 0;
> }
>+
>+ //Form ASM RuleBook
>+ char pTemp[1024];
>+ UINT32 ulSize = 0;
>+
>+ // XXX TODO need to add bandwidth partitioning
>+ ulSize = SafeSprintf(pTemp, 1024,
>+ "Marker=0, AverageBandwidth=%u, TimestampDelivery=TRUE,
>InterDepend=%u;"
>+ "Marker=1, AverageBandwidth=0, TimestampDelivery=TRUE,
>InterDepend=%u;",
>+ (unsigned int)ulAvgBW, (unsigned int)ulIndex +
>1,(unsigned int)ulIndex);
>+
>+ SafeStrCat(pRuleBook[ulSwitchGrp], pTemp, MAX_RULE_BOOK);
> }
>
> for (i = 0 ; i < nValues; i++)
>@@ -559,14 +569,14 @@
> goto clean;
> }
>
>- if (HXR_OK !=
>ppValues[i]->GetPropertyULONG32("SwitchGroupID", ulSwitchGrpID))
>+ if (HXR_OK !=
>ppValues[i]->GetPropertyULONG32("SwitchGroupID", ulSwitchGrp))
> { //Single rate streams
> pASMRuleBook->Set((UCHAR*)pRuleBook[i],
> strlen(pRuleBook[i]) + 1);
> ppValues[i]->SetPropertyCString("ASMRuleBook", pASMRuleBook);
> }
> else
> {
>- pASMRuleBook->Set((UCHAR*)pRuleBook[ulSwitchGrpID - 1],
>strlen(pRuleBook[ulSwitchGrpID - 1]) + 1);
>+ pASMRuleBook->Set((UCHAR*)pRuleBook[ulSwitchGrp - 1],
>strlen(pRuleBook[ulSwitchGrp - 1]) + 1);
> ppValues[i]->SetPropertyCString("ASMRuleBook", pASMRuleBook);
> }
>
From ckarusala at real.com Fri Jan 2 12:29:27 2009
From: ckarusala at real.com (Chytanya Karusala)
Date: Fri Jan 2 10:18:14 2009
Subject: [Protocol-dev] Re: CR: Modify RTPInfoSynch to work with updated
architecture
In-Reply-To: <495C0EF8.30207@real.com>
References: <495C0EF8.30207@real.com>
Message-ID: <6.2.5.6.2.20090102121222.05bf7480@real.com>
Few minor comments. Looks good.
HX_RESULT
RTPInfoSynch::OnRTPPacket(IHXRTPPacket* pPacket)
{
UINT16 unStream = pPacket->GetStreamNumber() ;
if (!pPacket || unStream >= m_unStreamCount)
{
return HXR_INVALID_PARAMETER;
}
[Chytanya] You might want to check if pPacket is valid first.
if (!m_bSyncPacketReceived &&
(m_unSynchStream == HX_INVALID_STREAM || unStream == m_unSynchStream))
{
// This is our sync packet, record it
m_unSynchStream = unStream;
m_pSynchData[unStream].m_ulRTPInfoTime = pPacket->GetRTPTime();
m_bSyncPacketReceived = TRUE;
}
[Chytanya] In the above if(), do we really want to check for
m_unSynchStream == HX_INVALID_STREAM case? Shouldn't this
m_unSynchStream be initialized before OnRTPPacket() is called and
shouldn't we consider only that stream's packet as synch packet?
if (m_pSynchData[unStream].m_bHasSR)
{
return HXR_OK;
}
if (!(pPacket->packet_type == RTCP_SR) || m_pSynchData[unStream].m_bHasSR)
{
// If it's not an SR or is on a stream we already got an SR for
// then we don't need to do anything with it
return HXR_OK;
}
[Chytanya] You are checking if m_bHasSR is TRUE twice.
Thanks,
Chytanya
At 04:31 PM 12/31/2008, Jamie Gordon wrote:
>Synopsis
>========
>Modify RTPInfoSync (server-side RTP sync class) to work with
>RTP live reception handling updates
>
>Branches: SERVER_12_1, HEAD (SERVER_CURRENT)
>Suggested Reviewer: anyone
>
>
>Description
>===========
>This required a major overhaul of the structure.
>
>Please note that this class is used only by the server, and only in the
>one place from which I am removing it (per prior CR).
>
>The usage is defined in an interface, however the interface is no longer
>usable or appropriate. The usage, furthermore, has no need to be an
>interface anyway, So I have removed the existing interface
>(IHXRTPInfoSynch) and am not creating a new one.
>
>The main change is that the current implementation takes IHXBuffers
>containing complete RTP and RTCP packets (including headers) but we
>now have parsed IHXRTPPacket etc. Also the information retrieval etc.
>were not quite right for what we actually need now.
>
>The diff is a bit tough to read, so I am also attaching the cpp file.
>
>Files Affected
>==============
>common/include/hxiids.h
>protocol/transport/rtp/rtpinfosync.cpp
>protocol/transport/rtp/include/rtpinfosync.h
>
>
>Testing Performed
>=================
>Unit Tests:
>
>Integration Tests:
>Verified properly synced playback of single and multi rate RTP live
>
>Leak Tests:
>None
>
>Performance Tests:
>None
>
>Platforms Tested: win32-i386-vc7
>Build verified: linux-rhel4-i686, sunos-5.10-sparc-server,
>win32-i386-vc7
>
>
>QA Hints
>===============
>
>n/a
>
>
>
>
>
>Index: common/include/hxiids.h
>===================================================================
>RCS file: /cvsroot/common/include/hxiids.h,v
>retrieving revision 1.139.12.1
>diff -u -r1.139.12.1 hxiids.h
>--- common/include/hxiids.h 30 Jul 2008 01:52:53 -0000 1.139.12.1
>+++ common/include/hxiids.h 1 Jan 2009 00:26:00 -0000
>@@ -325,6 +325,8 @@
> DEFINE_GUID_ENUM(IID_IHXFastFileStats, 0x0000021e,
> 0x901, 0x11d1, 0x8b, 0x6, 0x0, 0xa0, 0x24, 0x40, 0x6d, 0x59)
> DEFINE_GUID_ENUM(IID_IHXFastFileFactory2, 0x0000021f,
> 0x901, 0x11d1, 0x8b, 0x6, 0x0, 0xa0, 0x24, 0x40, 0x6d, 0x59)
> // $EndPrivate.
>+DEFINE_GUID_ENUM(IID_IHXFileStat2, 0x00002f03,
>0x901, 0x11d1, 0x8b, 0x6, 0x0, 0xa0, 0x24, 0x40, 0x6d, 0x59)
>+DEFINE_GUID_ENUM(IID_IHXFileStat2Response, 0x00002f04,
>0x901, 0x11d1, 0x8b, 0x6, 0x0, 0xa0, 0x24, 0x40, 0x6d, 0x59)
> #endif // _HXFILES_H_
>
> #if ( !defined(_HXFILERECOGNIZER_H_) || !defined(HELIX_FEATURE_FULLGUID) )
>@@ -2011,12 +2013,6 @@
>
> #endif //_IHXTFILEOBSERVER_H
>
>-#if ( !defined(_RTP_INFO_SYNC_H_) || !defined(HELIX_FEATURE_FULLGUID) )
>-/* file protocol/transport/rtp/include/rtpinfosync.h */
>-DEFINE_GUID_ENUM(IID_IHXRTPInfoSynch,
>- 0x1d9df3ad, 0x7429, 0x4efc, 0xb5, 0x4d, 0xd6, 0x7e,
>0x25, 0x63, 0x4, 0xc4)
>-#endif
>-
> #if ( !defined(HXPLAYVELOCITY_H) || !defined(HELIX_FEATURE_FULLGUID) )
> DEFINE_GUID_ENUM(IID_IHXPlaybackVelocityCaps,
> 0xdadb9abf, 0x549e, 0x4a6a, 0xa3, 0x6a, 0x59,
> 0x7e, 0xe2, 0x70, 0xc6, 0xa0)
>@@ -2128,10 +2124,10 @@
> #endif
>
> #if ( !defined(_IHXMETAEDITOR_H) || !defined(HELIX_FEATURE_FULLGUID) )
>-DEFINE_GUID_ENUM(IID_IHXMetaDataProcessor, 0x241640a0, 0xe73c,
>0x46a3, 0xaa, 0x62, 0x6c, 0x13, 0x0b, 0xe8, 0x84, 0xd6)
>-DEFINE_GUID_ENUM(IID_IHXMetaDataSourceHandler, 0xb4888d83, 0x9a75,
>0x4331, 0xb2, 0x6c, 0xc1, 0xc3, 0x39, 0x08, 0x0a, 0xff)
>-DEFINE_GUID_ENUM(IID_IHXMetaDataEditorResponse, 0x14a0c2ca, 0x7b73,
>0x44e8, 0xb0, 0xe8, 0xff, 0xb3, 0xbd, 0x2d, 0x85, 0x90)
>-DEFINE_GUID_ENUM(IID_IHXMetaDataEditor, 0x7a26b924, 0x85b2, 0x42e1,
>0xb9, 0x81, 0xa6, 0xe2, 0x36, 0x3d, 0x54, 0xb7)
>+DEFINE_GUID_ENUM(IID_IHXMetaDataProcessor, 0x241640a0, 0xe73c,
>0x46a3, 0xaa, 0x62, 0x6c, 0x13, 0x0b, 0xe8, 0x84, 0xd6)
>+DEFINE_GUID_ENUM(IID_IHXMetaDataSourceHandler, 0xb4888d83, 0x9a75,
>0x4331, 0xb2, 0x6c, 0xc1, 0xc3, 0x39, 0x08, 0x0a, 0xff)
>+DEFINE_GUID_ENUM(IID_IHXMetaDataEditorResponse, 0x14a0c2ca, 0x7b73,
>0x44e8, 0xb0, 0xe8, 0xff, 0xb3, 0xbd, 0x2d, 0x85, 0x90)
>+DEFINE_GUID_ENUM(IID_IHXMetaDataEditor, 0x7a26b924, 0x85b2, 0x42e1,
>0xb9, 0x81, 0xa6, 0xe2, 0x36, 0x3d, 0x54, 0xb7)
> #endif
>
> #endif /* _HXIIDS_H_ */
>Index: protocol/transport/rtp/rtpinfosync.cpp
>===================================================================
>RCS file: /cvsroot/protocol/transport/rtp/rtpinfosync.cpp,v
>retrieving revision 1.8.36.1
>diff -u -r1.8.36.1 rtpinfosync.cpp
>--- protocol/transport/rtp/rtpinfosync.cpp 3 Jul 2008 20:33:51
>-0000 1.8.36.1
>+++ protocol/transport/rtp/rtpinfosync.cpp 1 Jan 2009 00:26:01 -0000
>@@ -58,6 +58,7 @@
>
> #include "hxtick.h"
> #include "rtppkt.h"
>+#include "rtpwrap.h"
> #include "rtpinfosync.h"
>
> #if defined (_SYMBIAN)
>@@ -112,8 +113,9 @@
> m_pSynchData (NULL),
> m_unStreamCount (0),
> m_unSRCount (0),
>- m_unSynchStream (0),
>+ m_unSynchStream (HX_INVALID_STREAM),
> m_bHaveAllSRs (FALSE),
>+ m_bSyncPacketReceived (FALSE),
> m_bRTPTimesGenerated (FALSE)
> {
> }
>@@ -123,33 +125,13 @@
> Done();
> }
>
>-STDMETHODIMP
>-RTPInfoSynch::QueryInterface(REFIID riid, void** ppvObj)
>-{
>- if (IsEqualIID(riid, IID_IUnknown))
>- {
>- AddRef();
>- *ppvObj = this;
>- return HXR_OK;
>- }
>- else if (IsEqualIID(riid, IID_IHXRTPInfoSynch))
>- {
>- AddRef();
>- *ppvObj = (IHXRTPInfoSynch*)this;
>- return HXR_OK;
>- }
>-
>- *ppvObj = NULL;
>- return HXR_NOINTERFACE;
>-}
>-
>-STDMETHODIMP_(UINT32)
>+UINT32
> RTPInfoSynch::AddRef()
> {
> return InterlockedIncrement(&m_lRefCount);
> }
>
>-STDMETHODIMP_(UINT32)
>+UINT32
> RTPInfoSynch::Release()
> {
> if(InterlockedDecrement(&m_lRefCount) > 0)
>@@ -160,13 +142,20 @@
> return 0;
> }
>
>-STDMETHODIMP
>-RTPInfoSynch::InitSynch (UINT16 nStreamCount)
>+HX_RESULT
>+RTPInfoSynch::InitSynch(UINT16 unStreamCount, UINT16 unMasterStream)
> {
>- m_unStreamCount = nStreamCount;
>+ Done();
>
>- HX_VECTOR_DELETE(m_pSynchData);
>- m_pSynchData = new RTPInfoSynchData [nStreamCount];
>+ if (unStreamCount == 0)
>+ {
>+ return HXR_INVALID_PARAMETER;
>+ }
>+
>+ m_unStreamCount = unStreamCount;
>+ m_unSynchStream = unMasterStream;
>+
>+ m_pSynchData = new RTPInfoSynchData [unStreamCount];
>
> return HXR_OK;
> }
>@@ -194,226 +183,160 @@
> return HXR_OK;
> }
>
>-
>-STDMETHODIMP
>-RTPInfoSynch::RTPSynch (UINT16 unMaster)
>+HX_RESULT
>+RTPInfoSynch::OnRTPPacket(IHXRTPPacket* pPacket)
> {
>- m_bHaveAllSRs = FALSE;
>- m_unSRCount = 0;
>- m_unSynchStream = unMaster;
>- m_bRTPTimesGenerated = FALSE;
>-
>- for (UINT16 i = 0; i < m_unStreamCount; i++)
>+ UINT16 unStream = pPacket->GetStreamNumber() ;
>+ if (!pPacket || unStream >= m_unStreamCount)
> {
>- m_pSynchData [i].Reset();
>+ return HXR_INVALID_PARAMETER;
> }
>-
>- return HXR_OK;
>-}
>-
>-STDMETHODIMP
>-RTPInfoSynch::IsStreamSynched (UINT16 unStream, REF(HXBOOL) bIsSynched)
>-{
> if (!m_pSynchData)
> {
> return HXR_NOT_INITIALIZED;
> }
>-
>- if (unStream >= m_unStreamCount)
>+ if (m_bRTPTimesGenerated)
> {
>- return HXR_INVALID_PARAMETER;
>- }
>-
>- bIsSynched = (m_pSynchData [unStream].m_bSynched);
>- return HXR_OK;
>-}
>-
>-STDMETHODIMP
>-RTPInfoSynch::OnRTPPacket (IHXBuffer* pRTPPacket,
>- UINT16 unStream,
>- REF(HXBOOL) bSynched,
>- REF(UINT32) ulSequenceNumber,
>- REF(UINT32) ulTimestamp)
>-{
>- if (!m_bHaveAllSRs)
>- {
>- bSynched = FALSE;
>- ulSequenceNumber = 0;
>- ulTimestamp = 0;
>- return HXR_OK;
>+ // We are already synced!! Why are you sending packets?
>+ HX_ASSERT(FALSE);
>+ return HXR_OK;
> }
>
>- if (!m_pSynchData)
>+ if (!m_bSyncPacketReceived &&
>+ (m_unSynchStream == HX_INVALID_STREAM || unStream ==
>m_unSynchStream))
> {
>- return HXR_NOT_INITIALIZED;
>+ // This is our sync packet, record it
>+ m_unSynchStream = unStream;
>+ m_pSynchData[unStream].m_ulRTPInfoTime = pPacket->GetRTPTime();
>+ m_bSyncPacketReceived = TRUE;
> }
>
>- if (!pRTPPacket)
>+ if (m_bSyncPacketReceived && (m_bHaveAllSRs || m_unStreamCount < 2))
> {
>- return HXR_INVALID_PARAMETER;
>+ // We have everything we need to calculate the sync offsets
>+ CalculateSyncTimes();
> }
>+ // else we are still waiting for SRs or a specific stream packet
>
>- //Header offset plus RTP time field must at least be present:
>- if (pRTPPacket->GetSize() < 8)
>+ return HXR_OK;
>+}
>+
>+HX_RESULT
>+RTPInfoSynch::OnRTCPPacket(RTCPPacket* pPacket, UINT16 unStream)
>+{
>+ if (!m_pSynchData)
> {
>- HX_ASSERT(0);
>- return HXR_INVALID_PARAMETER;
>+ return HXR_NOT_INITIALIZED;
> }
>-
>- BYTE* pByte = pRTPPacket->GetBuffer();
>-
>- if (!pByte)
>+ if (!pPacket || unStream >= m_unStreamCount)
> {
>- HX_ASSERT(0);
> return HXR_INVALID_PARAMETER;
> }
>-
>- if (unStream >= m_unStreamCount)
>+ if (m_pSynchData[unStream].m_bHasSR)
> {
>- return HXR_INVALID_PARAMETER;
>+ return HXR_OK;
> }
>
>- if (m_pSynchData [unStream].m_bSynched)
>+ if (!(pPacket->packet_type == RTCP_SR) ||
>m_pSynchData[unStream].m_bHasSR)
> {
>- HX_ASSERT(0); //shouldn't happen
>- bSynched = TRUE;
>- ulTimestamp = m_pSynchData [unStream].m_ulRTPInfoTime;
>- ulSequenceNumber = ntohs(*(UINT16*)((pByte+2)));
>+ // If it's not an SR or is on a stream we already got an SR for
>+ // then we don't need to do anything with it
>+ return HXR_OK;
> }
>
>- UINT32 ulRTPTime = ntohl(*(unsigned int*)(pByte+4));
>-
>- if (!m_bRTPTimesGenerated)
>- {
>- if (unStream != m_unSynchStream)
>- {
>- bSynched = FALSE;
>- ulSequenceNumber = 0;
>- ulTimestamp = 0;
>- return HXR_OK;
>- }
>+ NTPTime rtcpNTPTime;
>+ UINT32 rtcpRTPTimeMSec = 0;
>
>- //First packet of of the synch stream is the reference:
>- m_pSynchData [unStream].m_ulRTPInfoTime = ulRTPTime;
>+ /* Truncate NTP time to 32 bits from 64 bits to make room for
>expansion to milliseconds*/
>+ rtcpNTPTime.m_ulSecond = pPacket->ntp_sec & 0x0000ffff;
>+ rtcpNTPTime.m_ulFraction = pPacket->ntp_frac & 0xffff0000;
>
>- //Convert RTP time from RTP units to milliseconds:
>- UINT32 ulRTPTimeHX =
>- (m_pSynchData [unStream].m_pTSConverter) ?
>- m_pSynchData [unStream].m_pTSConverter->
>- rtp2hxa_raw(ulRTPTime)
>- : ulRTPTime;
>+ rtcpRTPTimeMSec =
>+ (m_pSynchData[unStream].m_pTSConverter) ?
>+ m_pSynchData[unStream].m_pTSConverter->
>+ rtp2hxa_raw(pPacket->rtp_ts) : pPacket->rtp_ts;
>
>- //Transform the RTP time from this packet to the
>corresponding NTP time in milliseconds:
>- UINT32 NTPMasterMSec = ulRTPTimeHX + m_pSynchData
>[unStream].m_lRTPtoNTPOffset;
>+ m_pSynchData [unStream].m_lRTPtoNTPOffset =
>+ (INT32)(rtcpNTPTime.toMSec() - rtcpRTPTimeMSec);
>
>- //For each stream map the master NTP time to the stream's RTP time:
>- for (UINT16 i = 0; i < m_unStreamCount; i++)
>- {
>- if (i != unStream)
>- {
>- //convert NTP to RTP using the arithmetic negation
>of the RTP to NTP mapping:
>- UINT32 RTPMSec = NTPMasterMSec + -(m_pSynchData
>[i].m_lRTPtoNTPOffset);
>-
>- //Convert mapped RTP from milliseconds to RTP time:
>- m_pSynchData [i].m_ulRTPInfoTime =
>- (m_pSynchData [i].m_pTSConverter) ?
>- m_pSynchData [i].m_pTSConverter->
>- hxa2rtp_raw(RTPMSec)
>- : RTPMSec;
>- }
>- }
>+ m_pSynchData[unStream].m_bHasSR = TRUE;
>+ m_bHaveAllSRs = (++m_unSRCount >= m_unStreamCount);
>
>- m_bRTPTimesGenerated = TRUE;
>- }
>- else if (m_pSynchData [unStream].m_ulRTPInfoTime > ulRTPTime)
>+ if (m_bHaveAllSRs && m_bSyncPacketReceived)
> {
>- // make sure the ts of the first packet is >= to rtptime in RTP-Info
>- // because some clients don't choke
>- bSynched = FALSE;
>- ulSequenceNumber = 0;
>- ulTimestamp = 0;
>- return HXR_OK;
>- }
>-
>-
>- bSynched = TRUE;
>- ulSequenceNumber = ntohs(*(UINT16*)(pByte+2));
>- ulTimestamp = m_pSynchData [unStream].m_ulRTPInfoTime;
>- m_pSynchData [unStream].m_bSynched = TRUE;
>-
>+ // This was the last thing we needed, calculate sync times now!
>+ CalculateSyncTimes();
>+ }
> return HXR_OK;
> }
>
>-STDMETHODIMP
>-RTPInfoSynch::OnRTCPPacket (IHXBuffer* pRTCPPacket,
>- UINT16 unStream)
>+void
>+RTPInfoSynch::CalculateSyncTimes()
> {
>- if (m_bHaveAllSRs)
>- {
>- return HXR_OK;
>- }
>- if (!m_pSynchData)
>- {
>- return HXR_NOT_INITIALIZED;
>- }
>+ m_bRTPTimesGenerated = TRUE;
>
>- if (unStream >= m_unStreamCount)
>+ if (m_unStreamCount == 1)
> {
>- return HXR_INVALID_PARAMETER;
>+ // For single-stream case we don't really need to do anything
>+ return;
> }
>
>- if (m_pSynchData [unStream].m_bHasSR)
>- {
>- return HXR_OK;
>- }
>-
>- if (pRTCPPacket->GetSize() < 20)
>- {
>- return HXR_INVALID_PARAMETER;
>- }
>+ // XXXJDG I think these conversions have some rollover issues,
>+ // probably should instead use the Timeval calculations used in FCS
>
>- BYTE* pcRTCP = pRTCPPacket->GetBuffer();
>+ //Convert RTP time from RTP units to milliseconds:
>+ UINT32 ulRTPTimeHX =
>+ (m_pSynchData[m_unSynchStream].m_pTSConverter) ?
>+ m_pSynchData[m_unSynchStream].m_pTSConverter->
>+ rtp2hxa_raw(m_pSynchData[m_unSynchStream].m_ulRTPInfoTime)
>+ : m_pSynchData[m_unSynchStream].m_ulRTPInfoTime;
>
>- if (!pcRTCP)
>+ //Transform the RTP time from this packet to the corresponding
>NTP time in milliseconds:
>+ UINT32 NTPMasterMSec = ulRTPTimeHX +
>m_pSynchData[m_unSynchStream].m_lRTPtoNTPOffset;
>+
>+ //For each stream map the master NTP time to the stream's RTP time:
>+ for (UINT16 i = 0; i < m_unStreamCount; i++)
> {
>- return HXR_INVALID_PARAMETER;
>- }
>+ if (i != m_unSynchStream)
>+ {
>+ //convert NTP to RTP using the arithmetic negation of
>the RTP to NTP mapping:
>+ UINT32 RTPMSec = NTPMasterMSec + -(m_pSynchData
>[i].m_lRTPtoNTPOffset);
>
>- // make sure it's SR
>- if (RTCP_SR != *(pcRTCP+1))
>- {
>- return HXR_IGNORE;
>+ //Convert mapped RTP from milliseconds to RTP time:
>+ m_pSynchData[i].m_ulRTPInfoTime =
>+ (m_pSynchData [i].m_pTSConverter) ?
>+ m_pSynchData [i].m_pTSConverter->
>+ hxa2rtp_raw(RTPMSec)
>+ : RTPMSec;
>+ }
> }
>+}
>
>- //Compute the RTP to NTP mapping from the RTCP SR for this stream::
>- pcRTCP += 8;
>-
>- NTPTime rtcpNTPTime;
>- UINT32 rtcpRTPTimeMSec = 0;
>-
>- /* Truncate NTP time to 32 bits from 64 bits to make room for
>expansion to milliseconds*/
>- rtcpNTPTime.m_ulSecond = (ntohl(*(unsigned int*)(pcRTCP))) & 0x0000ffff;
>- rtcpNTPTime.m_ulFraction = (ntohl(*(unsigned int*)(pcRTCP+4)))
>& 0xffff0000;
>-
>- rtcpRTPTimeMSec =
>- (m_pSynchData [unStream].m_pTSConverter) ?
>-
>- m_pSynchData [unStream].m_pTSConverter->
>- rtp2hxa_raw(ntohl(*(unsigned int*)(pcRTCP+8))) :
>-
>- ntohl(*(unsigned int*)(pcRTCP+8));
>-
>- m_pSynchData [unStream].m_lRTPtoNTPOffset =
>- (INT32)(rtcpNTPTime.toMSec() - rtcpRTPTimeMSec);
>+HX_RESULT
>+RTPInfoSynch::GetRTPStartTime(UINT16 unStream, REF(UINT32) ulStartTime)
>+{
>+ if (unStream < m_unStreamCount)
>+ {
>+ if (m_bRTPTimesGenerated)
>+ {
>+ ulStartTime = m_pSynchData[unStream].m_ulRTPInfoTime;
>+ return HXR_OK;
>+ }
>
>- m_pSynchData [unStream].m_bHasSR = TRUE;
>- m_bHaveAllSRs = (++m_unSRCount >= m_unStreamCount);
>- return HXR_OK;
>+ return HXR_NOT_INITIALIZED;
>+ }
>+
>+ return HXR_INVALID_PARAMETER;
> }
>
>-STDMETHODIMP
>+HX_RESULT
> RTPInfoSynch::Done ()
> {
>+ m_bHaveAllSRs = FALSE;
>+ m_unSRCount = 0;
>+ m_bSyncPacketReceived = FALSE;
>+ m_bRTPTimesGenerated = FALSE;
>+
> HX_VECTOR_DELETE(m_pSynchData);
>
> return HXR_OK;
>Index: protocol/transport/rtp/include/rtpinfosync.h
>===================================================================
>RCS file: /cvsroot/protocol/transport/rtp/include/rtpinfosync.h,v
>retrieving revision 1.3
>diff -u -r1.3 rtpinfosync.h
>--- protocol/transport/rtp/include/rtpinfosync.h 10 Mar 2005
>20:59:22 -0000 1.3
>+++ protocol/transport/rtp/include/rtpinfosync.h 1 Jan 2009
>00:26:01 -0000
>@@ -39,55 +39,10 @@
> #include "tconverter.h"
> #include "ntptime.h"
>
>-typedef _INTERFACE IHXRTPInfoSynch IHXRTPInfoSynch;
>+/* Forward Declarations */
>+class RTCPPacket;
>
>-/****************************************************************************
>- *
>- * Interface:
>- *
>- * IHXRTPInfoSynch
>- *
>- * Purpose:
>- *
>- *
>- * IID_IHXRTPInfoSynch:
>- *
>- * {1D9DF3AD-7429-4efc-B54D-D67E256304C4}
>- *
>- */
>-
>-DEFINE_GUID(IID_IHXRTPInfoSynch,
>- 0x1d9df3ad, 0x7429, 0x4efc, 0xb5, 0x4d, 0xd6, 0x7e,
>0x25, 0x63, 0x4, 0xc4);
>-
>-#undef INTERFACE
>-#define INTERFACE IHXRTPInfoSynch
>-
>-DECLARE_INTERFACE_(IHXRTPInfoSynch, IUnknown)
>-{
>- /*
>- * IUnknown Methods
>- */
>- STDMETHOD(QueryInterface) (THIS_ REFIID riid, void** ppvObj) PURE;
>- STDMETHOD_(ULONG32,AddRef) (THIS) PURE;
>- STDMETHOD_(ULONG32,Release) (THIS) PURE;
>-
>- STDMETHOD(InitSynch)(THIS_
>- UINT16 unStreamCount) PURE;
>- STDMETHOD(RTPSynch) (THIS_ UINT16 unMaster) PURE;
>- STDMETHOD(OnRTPPacket) (THIS_ IHXBuffer* pRTPPacket,
>- UINT16 unStream,
>- REF(HXBOOL) bSynched,
>- REF(UINT32) ulSequenceNumber,
>- REF(UINT32) ulTimestamp) PURE;
>- STDMETHOD(OnRTCPPacket)(THIS_ IHXBuffer* pRTCPPacket,
>- UINT16 unStream) PURE;
>- STDMETHOD(SetTSConverter)(THIS_
>- CHXTimestampConverter::ConversionFactors
>- conversionFactors,
>- UINT16 unStream) PURE;
>- STDMETHOD(IsStreamSynched)(THIS_ UINT16 unStream, REF(HXBOOL)
>bIsSynched) PURE;
>- STDMETHOD(Done) (THIS) PURE;
>-};
>+#define HX_INVALID_STREAM 0xFFFF
>
> class RTPInfoSynchData
> {
>@@ -97,52 +52,49 @@
>
> void Reset();
>
>- HXBOOL m_bHasSR;
>+ HXBOOL m_bHasSR;
> INT32 m_lRTPtoNTPOffset; //units: msec ; additive conversion
> from RTP to NTP for this stream
> UINT32 m_ulRTPInfoTime; //units: rtp time ; time to be
> placed in rtp info field
>- HXBOOL m_bSynched;
>+ HXBOOL m_bSynched;
>
> CHXTimestampConverter* m_pTSConverter;
> };
>
>
>-class RTPInfoSynch: public IHXRTPInfoSynch
>+class RTPInfoSynch
> {
> public:
>- RTPInfoSynch ();
>- ~RTPInfoSynch ();
>+ RTPInfoSynch();
>+ ~RTPInfoSynch();
>
>- STDMETHOD(QueryInterface) (THIS_
>- REFIID riid,
>- void** ppvObj);
>- STDMETHOD_(ULONG32,AddRef) (THIS);
>- STDMETHOD_(ULONG32,Release) (THIS);
>+ ULONG32 AddRef();
>+ ULONG32 Release();
>
>
>- STDMETHOD(InitSynch)(THIS_
>- UINT16 unStreamCount);
>- STDMETHOD(RTPSynch) (THIS_ UINT16 unMaster);
>- STDMETHOD(OnRTPPacket) (THIS_ IHXBuffer* pRTPPacket,
>- UINT16 unStream,
>- REF(HXBOOL) bSynched,
>- REF(UINT32) ulSequenceNumber,
>- REF(UINT32) ulTimestamp);
>- STDMETHOD(OnRTCPPacket)(THIS_ IHXBuffer* pRTCPPacket, UINT16 unStream);
>- STDMETHOD(SetTSConverter)(THIS_
>- CHXTimestampConverter::ConversionFactors
>+ HX_RESULT InitSynch(UINT16 unStreamCount,
>+ UINT16 unMasterStream = HX_INVALID_STREAM);
>+ HX_RESULT SetTSConverter(CHXTimestampConverter::ConversionFactors
> conversionFactors,
> UINT16 unStream);
>- STDMETHOD(IsStreamSynched)(THIS_ UINT16 unStream, REF(HXBOOL)
>bIsSynched);
>- STDMETHOD(Done) (THIS);
>+ HX_RESULT Done();
>+
>+ HX_RESULT OnRTPPacket (IHXRTPPacket* pPacket);
>+ HX_RESULT OnRTCPPacket (RTCPPacket* pPacket, UINT16 unStream);
>+ HX_RESULT GetRTPStartTime(UINT16 unStream, REF(UINT32) ulStartTime);
>+
>+ inline HXBOOL IsSynced() { return m_bRTPTimesGenerated; }
>
> private:
>- INT32 m_lRefCount;
>- RTPInfoSynchData* m_pSynchData;
>- UINT16 m_unStreamCount;
>- UINT16 m_unSRCount;
>- UINT16 m_unSynchStream;
>- HXBOOL m_bHaveAllSRs;
>- HXBOOL m_bRTPTimesGenerated;
>+ INT32 m_lRefCount;
>+ RTPInfoSynchData* m_pSynchData;
>+ UINT16 m_unStreamCount;
>+ UINT16 m_unSRCount;
>+ UINT16 m_unSynchStream;
>+ HXBOOL m_bHaveAllSRs;
>+ HXBOOL m_bSyncPacketReceived;
>+ HXBOOL m_bRTPTimesGenerated;
>+
>+ void CalculateSyncTimes();
> };
>
> #endif /*_RTP_INFO_SYNC_H_ */
>
>/* ***** BEGIN LICENSE BLOCK *****
> * Version: RCSL 1.0/RPSL 1.0
> *
> * Portions Copyright (c) 1995-2002 RealNetworks, Inc. All Rights Reserved.
> *
> * The contents of this file, and the files included with this file, are
> * subject to the current version of the RealNetworks Public Source License
> * Version 1.0 (the "RPSL") available at
> * http://www.helixcommunity.org/content/rpsl unless you have licensed
> * the file under the RealNetworks Community Source License Version 1.0
> * (the "RCSL") available at http://www.helixcommunity.org/content/rcsl,
> * in which case the RCSL will apply. You may also obtain the license terms
> * directly from RealNetworks. You may not use this file except in
> * compliance with the RPSL or, if you have a valid RCSL with RealNetworks
> * applicable to this file, the RCSL. Please see the applicable RPSL or
> * RCSL for the rights, obligations and limitations governing use of the
> * contents of the file.
> *
> * This file is part of the Helix DNA Technology. RealNetworks is the
> * developer of the Original Code and owns the copyrights in the portions
> * it created.
> *
> * This file, and the files included with this file, is distributed and made
> * available on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER
> * EXPRESS OR IMPLIED, AND REALNETWORKS HEREBY DISCLAIMS ALL SUCH WARRANTIES,
> * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, FITNESS
> * FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT.
> *
> * Technology Compatibility Kit Test Suite(s) Location:
> * http://www.helixcommunity.org/content/tck
> *
> * Contributor(s):
> *
> * ***** END LICENSE BLOCK ***** */
>#include "hxtypes.h"
>#include "hxassert.h"
>#include "debug.h"
>#include "hxcom.h"
>#include "hxmarsh.h"
>#include "hxstrutl.h"
>#include "netbyte.h"
>#include "hxengin.h"
>#include "ihxpckts.h"
>#include "hxsbuffer.h"
>#include "hxcomm.h"
>#include "netbyte.h"
>#include "hxstring.h"
>#include "chxpckts.h"
>#include "hxslist.h"
>#include "hxmap.h"
>#include "hxbitset.h"
>#include "timebuff.h"
>#include "timeval.h"
>#include "rtptypes.h"
>#include "bufnum.h"
>
>#include "ntptime.h"
>
>#include "hxtick.h"
>#include "rtppkt.h"
>#include "rtpwrap.h"
>#include "rtpinfosync.h"
>
>#if defined (_SYMBIAN)
>#include
>#endif
>#if defined (_LSB)
>#include
>#endif
>
>/*
> * This algorithm determines the RTP timestamp to present in the
> RTP-Info RTSP field.
> * The RTP-Info field presents to the client the RTP time that maps
> to the NPT time for the session.
> * The client uses this mapping to determine a reference point for
> the RTP timestamps in each stream.
> * For RTP reflection streams (live streams) the starting point for
> each client within the total timeline of the stream
> * is arbitrary.
> * In order to select a reference point for inter and intra stream
> synchronization the client must be able to map NPT to RTP to NTP
> * for the time at which the client enters the live session timeline.
> * To accomplish this the following algorithm is used:
> * 1) Get the NTP to RTP mapping for each stream from the RTCP SR
> for each of the streams.
> * 2) On the first packet after RTCP SRs for each stream have arrived:
> * a) Map the RTP time of that packet to NTP time; this is the
> reference NTP time that maps NPT to NTP.
> * b) Compute the corresponding RTP time to that NTP from 2a) for
> each stream.
> * 3) Set the resulting values from each stream in 2b) to the RTP-Info field.
> * The result is a mapping in terms of each stream's time domain to
> a common NTP time that represents the NPT of the session.
> */
>
>RTPInfoSynchData::RTPInfoSynchData() :
> m_bHasSR (FALSE),
> m_lRTPtoNTPOffset (0),
> m_ulRTPInfoTime (0),
> m_bSynched (FALSE),
> m_pTSConverter (NULL)
>{
>}
>
>RTPInfoSynchData::~RTPInfoSynchData()
>{
> HX_DELETE(m_pTSConverter);
>}
>
>void
>RTPInfoSynchData::Reset()
>{
> m_bHasSR = FALSE;
> m_bSynched = FALSE;
> m_lRTPtoNTPOffset = 0;
> m_ulRTPInfoTime = 0;
>}
>
>RTPInfoSynch::RTPInfoSynch() :
> m_lRefCount (0),
> m_pSynchData (NULL),
> m_unStreamCount (0),
> m_unSRCount (0),
> m_unSynchStream (HX_INVALID_STREAM),
> m_bHaveAllSRs (FALSE),
> m_bSyncPacketReceived (FALSE),
> m_bRTPTimesGenerated (FALSE)
>{
>}
>
>RTPInfoSynch::~RTPInfoSynch()
>{
> Done();
>}
>
>UINT32
>RTPInfoSynch::AddRef()
>{
> return InterlockedIncrement(&m_lRefCount);
>}
>
>UINT32
>RTPInfoSynch::Release()
>{
> if(InterlockedDecrement(&m_lRefCount) > 0)
> {
> return (UINT32)m_lRefCount;
> }
> delete this;
> return 0;
>}
>
>HX_RESULT
>RTPInfoSynch::InitSynch(UINT16 unStreamCount, UINT16 unMasterStream)
>{
> Done();
>
> if (unStreamCount == 0)
> {
> return HXR_INVALID_PARAMETER;
> }
>
> m_unStreamCount = unStreamCount;
> m_unSynchStream = unMasterStream;
>
> m_pSynchData = new RTPInfoSynchData [unStreamCount];
>
> return HXR_OK;
>}
>
>HX_RESULT
>RTPInfoSynch::SetTSConverter(CHXTimestampConverter::
> ConversionFactors conversionFactors,
> UINT16 unStream)
>{
> if (!m_pSynchData)
> {
> return HXR_NOT_INITIALIZED;
> }
>
> if (unStream >= m_unStreamCount)
> {
> return HXR_INVALID_PARAMETER;
> }
>
> HX_DELETE(m_pSynchData [unStream].m_pTSConverter);
>
> m_pSynchData [unStream].m_pTSConverter =
> new CHXTimestampConverter(conversionFactors);
>
> return HXR_OK;
>}
>
>HX_RESULT
>RTPInfoSynch::OnRTPPacket(IHXRTPPacket* pPacket)
>{
> UINT16 unStream = pPacket->GetStreamNumber() ;
> if (!pPacket || unStream >= m_unStreamCount)
> {
> return HXR_INVALID_PARAMETER;
> }
> if (!m_pSynchData)
> {
> return HXR_NOT_INITIALIZED;
> }
> if (m_bRTPTimesGenerated)
> {
> // We are already synced!! Why are you sending packets?
> HX_ASSERT(FALSE);
> return HXR_OK;
> }
>
> if (!m_bSyncPacketReceived &&
> (m_unSynchStream == HX_INVALID_STREAM || unStream ==
> m_unSynchStream))
> {
> // This is our sync packet, record it
> m_unSynchStream = unStream;
> m_pSynchData[unStream].m_ulRTPInfoTime = pPacket->GetRTPTime();
> m_bSyncPacketReceived = TRUE;
> }
>
> if (m_bSyncPacketReceived && (m_bHaveAllSRs || m_unStreamCount < 2))
> {
> // We have everything we need to calculate the sync offsets
> CalculateSyncTimes();
> }
> // else we are still waiting for SRs or a specific stream packet
>
> return HXR_OK;
>}
>
>HX_RESULT
>RTPInfoSynch::OnRTCPPacket(RTCPPacket* pPacket, UINT16 unStream)
>{
> if (!m_pSynchData)
> {
> return HXR_NOT_INITIALIZED;
> }
> if (!pPacket || unStream >= m_unStreamCount)
> {
> return HXR_INVALID_PARAMETER;
> }
> if (m_pSynchData[unStream].m_bHasSR)
> {
> return HXR_OK;
> }
>
> if (!(pPacket->packet_type == RTCP_SR) ||
> m_pSynchData[unStream].m_bHasSR)
> {
> // If it's not an SR or is on a stream we already got an SR for
> // then we don't need to do anything with it
> return HXR_OK;
> }
>
> NTPTime rtcpNTPTime;
> UINT32 rtcpRTPTimeMSec = 0;
>
> /* Truncate NTP time to 32 bits from 64 bits to make room for
> expansion to milliseconds*/
> rtcpNTPTime.m_ulSecond = pPacket->ntp_sec & 0x0000ffff;
> rtcpNTPTime.m_ulFraction = pPacket->ntp_frac & 0xffff0000;
>
> rtcpRTPTimeMSec =
> (m_pSynchData[unStream].m_pTSConverter) ?
> m_pSynchData[unStream].m_pTSConverter->
> rtp2hxa_raw(pPacket->rtp_ts) : pPacket->rtp_ts;
>
> m_pSynchData [unStream].m_lRTPtoNTPOffset =
> (INT32)(rtcpNTPTime.toMSec() - rtcpRTPTimeMSec);
>
> m_pSynchData[unStream].m_bHasSR = TRUE;
> m_bHaveAllSRs = (++m_unSRCount >= m_unStreamCount);
>
> if (m_bHaveAllSRs && m_bSyncPacketReceived)
> {
> // This was the last thing we needed, calculate sync times now!
> CalculateSyncTimes();
> }
> return HXR_OK;
>}
>
>void
>RTPInfoSynch::CalculateSyncTimes()
>{
> m_bRTPTimesGenerated = TRUE;
>
> if (m_unStreamCount == 1)
> {
> // For single-stream case we don't really need to do anything
> return;
> }
>
> // XXXJDG I think these conversions have some rollover issues,
> // probably should instead use the Timeval calculations used in FCS
>
> //Convert RTP time from RTP units to milliseconds:
> UINT32 ulRTPTimeHX =
> (m_pSynchData[m_unSynchStream].m_pTSConverter) ?
> m_pSynchData[m_unSynchStream].m_pTSConverter->
> rtp2hxa_raw(m_pSynchData[m_unSynchStream].m_ulRTPInfoTime)
> : m_pSynchData[m_unSynchStream].m_ulRTPInfoTime;
>
> //Transform the RTP time from this packet to the corresponding
> NTP time in milliseconds:
> UINT32 NTPMasterMSec = ulRTPTimeHX +
> m_pSynchData[m_unSynchStream].m_lRTPtoNTPOffset;
>
> //For each stream map the master NTP time to the stream's RTP time:
> for (UINT16 i = 0; i < m_unStreamCount; i++)
> {
> if (i != m_unSynchStream)
> {
> //convert NTP to RTP using the arithmetic negation of
> the RTP to NTP mapping:
> UINT32 RTPMSec = NTPMasterMSec + -(m_pSynchData
> [i].m_lRTPtoNTPOffset);
>
> //Convert mapped RTP from milliseconds to RTP time:
> m_pSynchData[i].m_ulRTPInfoTime =
> (m_pSynchData [i].m_pTSConverter) ?
> m_pSynchData [i].m_pTSConverter->
> hxa2rtp_raw(RTPMSec)
> : RTPMSec;
> }
> }
>}
>
>HX_RESULT
>RTPInfoSynch::GetRTPStartTime(UINT16 unStream, REF(UINT32) ulStartTime)
>{
> if (unStream < m_unStreamCount)
> {
> if (m_bRTPTimesGenerated)
> {
> ulStartTime = m_pSynchData[unStream].m_ulRTPInfoTime;
> return HXR_OK;
> }
>
> return HXR_NOT_INITIALIZED;
> }
>
> return HXR_INVALID_PARAMETER;
>}
>
>HX_RESULT
>RTPInfoSynch::Done ()
>{
> m_bHaveAllSRs = FALSE;
> m_unSRCount = 0;
> m_bSyncPacketReceived = FALSE;
> m_bRTPTimesGenerated = FALSE;
>
> HX_VECTOR_DELETE(m_pSynchData);
>
> return HXR_OK;
>}
From jgordon at real.com Mon Jan 5 12:36:07 2009
From: jgordon at real.com (Jamie Gordon)
Date: Mon Jan 5 10:26:06 2009
Subject: [Protocol-dev] Re: CR: Modify RTPInfoSynch to work with updated
architecture
In-Reply-To: <6.2.5.6.2.20090102121222.05bf7480@real.com>
References: <495C0EF8.30207@real.com>
<6.2.5.6.2.20090102121222.05bf7480@real.com>
Message-ID: <49626F37.1010006@real.com>
Chytanya Karusala wrote:
> Few minor comments. Looks good.
>
> HX_RESULT
> RTPInfoSynch::OnRTPPacket(IHXRTPPacket* pPacket)
> {
> UINT16 unStream = pPacket->GetStreamNumber() ;
> if (!pPacket || unStream >= m_unStreamCount)
> {
> return HXR_INVALID_PARAMETER;
> }
>
> [Chytanya] You might want to check if pPacket is valid first.
>
hah, oops, that check is a touch late there! Fixed to:
if (!pPacket)
{
return HXR_INVALID_PARAMETER;
}
UINT16 unStream = pPacket->GetStreamNumber() ;
if (unStream >= m_unStreamCount)
{
return HXR_INVALID_PARAMETER;
}
> if (!m_bSyncPacketReceived &&
> (m_unSynchStream == HX_INVALID_STREAM || unStream ==
> m_unSynchStream))
> {
> // This is our sync packet, record it
> m_unSynchStream = unStream;
> m_pSynchData[unStream].m_ulRTPInfoTime = pPacket->GetRTPTime();
> m_bSyncPacketReceived = TRUE;
> }
>
> [Chytanya] In the above if(), do we really want to check for
> m_unSynchStream == HX_INVALID_STREAM case? Shouldn't this
> m_unSynchStream be initialized before OnRTPPacket() is called and
> shouldn't we consider only that stream's packet as synch packet?
>
No. That is added specifically because the sync stream is not set up
until we receive a packet. We don't know or care which stream we are
syncing to; whatever packet comes first becomes the sync stream, hence
the check. I left in the OR to allow user of the class to specify a
specific stream in case it is needed but in the normal case
(specifically our case) we just want the first one.
> if (m_pSynchData[unStream].m_bHasSR)
> {
> return HXR_OK;
> }
>
> if (!(pPacket->packet_type == RTCP_SR) ||
> m_pSynchData[unStream].m_bHasSR)
> {
> // If it's not an SR or is on a stream we already got an SR for
> // then we don't need to do anything with it
> return HXR_OK;
> }
>
> [Chytanya] You are checking if m_bHasSR is TRUE twice.
>
Oops, first if block is removed.
Thanks,
Jamie
> Thanks,
> Chytanya
>
> At 04:31 PM 12/31/2008, Jamie Gordon wrote:
>> Synopsis
>> ========
>> Modify RTPInfoSync (server-side RTP sync class) to work with
>> RTP live reception handling updates
>>
>> Branches: SERVER_12_1, HEAD (SERVER_CURRENT)
>> Suggested Reviewer: anyone
>>
>>
>> Description
>> ===========
>> This required a major overhaul of the structure.
>>
>> Please note that this class is used only by the server, and only in the
>> one place from which I am removing it (per prior CR).
>>
>> The usage is defined in an interface, however the interface is no longer
>> usable or appropriate. The usage, furthermore, has no need to be an
>> interface anyway, So I have removed the existing interface
>> (IHXRTPInfoSynch) and am not creating a new one.
>>
>> The main change is that the current implementation takes IHXBuffers
>> containing complete RTP and RTCP packets (including headers) but we
>> now have parsed IHXRTPPacket etc. Also the information retrieval etc.
>> were not quite right for what we actually need now.
>>
>> The diff is a bit tough to read, so I am also attaching the cpp file.
>>
>> Files Affected
>> ==============
>> common/include/hxiids.h
>> protocol/transport/rtp/rtpinfosync.cpp
>> protocol/transport/rtp/include/rtpinfosync.h
>>
>>
>> Testing Performed
>> =================
>> Unit Tests:
>>
>> Integration Tests:
>> Verified properly synced playback of single and multi rate RTP live
>>
>> Leak Tests:
>> None
>>
>> Performance Tests:
>> None
>>
>> Platforms Tested: win32-i386-vc7
>> Build verified: linux-rhel4-i686, sunos-5.10-sparc-server,
>> win32-i386-vc7
>>
>>
>> QA Hints
>> ===============
>>
>> n/a
>>
>>
>>
>>
>>
>> Index: common/include/hxiids.h
>> ===================================================================
>> RCS file: /cvsroot/common/include/hxiids.h,v
>> retrieving revision 1.139.12.1
>> diff -u -r1.139.12.1 hxiids.h
>> --- common/include/hxiids.h 30 Jul 2008 01:52:53 -0000
>> 1.139.12.1
>> +++ common/include/hxiids.h 1 Jan 2009 00:26:00 -0000
>> @@ -325,6 +325,8 @@
>> DEFINE_GUID_ENUM(IID_IHXFastFileStats, 0x0000021e,
>> 0x901, 0x11d1, 0x8b, 0x6, 0x0, 0xa0, 0x24, 0x40, 0x6d, 0x59)
>> DEFINE_GUID_ENUM(IID_IHXFastFileFactory2, 0x0000021f,
>> 0x901, 0x11d1, 0x8b, 0x6, 0x0, 0xa0, 0x24, 0x40, 0x6d, 0x59)
>> // $EndPrivate.
>> +DEFINE_GUID_ENUM(IID_IHXFileStat2, 0x00002f03,
>> 0x901, 0x11d1, 0x8b, 0x6, 0x0, 0xa0, 0x24, 0x40, 0x6d, 0x59)
>> +DEFINE_GUID_ENUM(IID_IHXFileStat2Response, 0x00002f04,
>> 0x901, 0x11d1, 0x8b, 0x6, 0x0, 0xa0, 0x24, 0x40, 0x6d, 0x59)
>> #endif // _HXFILES_H_
>>
>> #if ( !defined(_HXFILERECOGNIZER_H_) ||
>> !defined(HELIX_FEATURE_FULLGUID) )
>> @@ -2011,12 +2013,6 @@
>>
>> #endif //_IHXTFILEOBSERVER_H
>>
>> -#if ( !defined(_RTP_INFO_SYNC_H_) || !defined(HELIX_FEATURE_FULLGUID) )
>> -/* file protocol/transport/rtp/include/rtpinfosync.h */
>> -DEFINE_GUID_ENUM(IID_IHXRTPInfoSynch,
>> - 0x1d9df3ad, 0x7429, 0x4efc, 0xb5, 0x4d, 0xd6, 0x7e,
>> 0x25, 0x63, 0x4, 0xc4)
>> -#endif
>> -
>> #if ( !defined(HXPLAYVELOCITY_H) || !defined(HELIX_FEATURE_FULLGUID) )
>> DEFINE_GUID_ENUM(IID_IHXPlaybackVelocityCaps,
>> 0xdadb9abf, 0x549e, 0x4a6a, 0xa3, 0x6a, 0x59, 0x7e,
>> 0xe2, 0x70, 0xc6, 0xa0)
>> @@ -2128,10 +2124,10 @@
>> #endif
>>
>> #if ( !defined(_IHXMETAEDITOR_H) || !defined(HELIX_FEATURE_FULLGUID) )
>> -DEFINE_GUID_ENUM(IID_IHXMetaDataProcessor, 0x241640a0, 0xe73c,
>> 0x46a3, 0xaa, 0x62, 0x6c, 0x13, 0x0b, 0xe8, 0x84, 0xd6)
>> -DEFINE_GUID_ENUM(IID_IHXMetaDataSourceHandler, 0xb4888d83, 0x9a75,
>> 0x4331, 0xb2, 0x6c, 0xc1, 0xc3, 0x39, 0x08, 0x0a, 0xff)
>> -DEFINE_GUID_ENUM(IID_IHXMetaDataEditorResponse, 0x14a0c2ca, 0x7b73,
>> 0x44e8, 0xb0, 0xe8, 0xff, 0xb3, 0xbd, 0x2d, 0x85, 0x90)
>> -DEFINE_GUID_ENUM(IID_IHXMetaDataEditor, 0x7a26b924, 0x85b2, 0x42e1,
>> 0xb9, 0x81, 0xa6, 0xe2, 0x36, 0x3d, 0x54, 0xb7)
>> +DEFINE_GUID_ENUM(IID_IHXMetaDataProcessor, 0x241640a0, 0xe73c,
>> 0x46a3, 0xaa, 0x62, 0x6c, 0x13, 0x0b, 0xe8, 0x84, 0xd6)
>> +DEFINE_GUID_ENUM(IID_IHXMetaDataSourceHandler, 0xb4888d83, 0x9a75,
>> 0x4331, 0xb2, 0x6c, 0xc1, 0xc3, 0x39, 0x08, 0x0a, 0xff)
>> +DEFINE_GUID_ENUM(IID_IHXMetaDataEditorResponse, 0x14a0c2ca, 0x7b73,
>> 0x44e8, 0xb0, 0xe8, 0xff, 0xb3, 0xbd, 0x2d, 0x85, 0x90)
>> +DEFINE_GUID_ENUM(IID_IHXMetaDataEditor, 0x7a26b924, 0x85b2, 0x42e1,
>> 0xb9, 0x81, 0xa6, 0xe2, 0x36, 0x3d, 0x54, 0xb7)
>> #endif
>>
>> #endif /* _HXIIDS_H_ */
>> Index: protocol/transport/rtp/rtpinfosync.cpp
>> ===================================================================
>> RCS file: /cvsroot/protocol/transport/rtp/rtpinfosync.cpp,v
>> retrieving revision 1.8.36.1
>> diff -u -r1.8.36.1 rtpinfosync.cpp
>> --- protocol/transport/rtp/rtpinfosync.cpp 3 Jul 2008 20:33:51
>> -0000 1.8.36.1
>> +++ protocol/transport/rtp/rtpinfosync.cpp 1 Jan 2009 00:26:01 -0000
>> @@ -58,6 +58,7 @@
>>
>> #include "hxtick.h"
>> #include "rtppkt.h"
>> +#include "rtpwrap.h"
>> #include "rtpinfosync.h"
>>
>> #if defined (_SYMBIAN)
>> @@ -112,8 +113,9 @@
>> m_pSynchData (NULL),
>> m_unStreamCount (0),
>> m_unSRCount (0),
>> - m_unSynchStream (0),
>> + m_unSynchStream (HX_INVALID_STREAM),
>> m_bHaveAllSRs (FALSE),
>> + m_bSyncPacketReceived (FALSE),
>> m_bRTPTimesGenerated (FALSE)
>> {
>> }
>> @@ -123,33 +125,13 @@
>> Done();
>> }
>>
>> -STDMETHODIMP
>> -RTPInfoSynch::QueryInterface(REFIID riid, void** ppvObj)
>> -{
>> - if (IsEqualIID(riid, IID_IUnknown))
>> - {
>> - AddRef();
>> - *ppvObj = this;
>> - return HXR_OK;
>> - }
>> - else if (IsEqualIID(riid, IID_IHXRTPInfoSynch))
>> - {
>> - AddRef();
>> - *ppvObj = (IHXRTPInfoSynch*)this;
>> - return HXR_OK;
>> - }
>> -
>> - *ppvObj = NULL;
>> - return HXR_NOINTERFACE;
>> -}
>> -
>> -STDMETHODIMP_(UINT32)
>> +UINT32
>> RTPInfoSynch::AddRef()
>> {
>> return InterlockedIncrement(&m_lRefCount);
>> }
>>
>> -STDMETHODIMP_(UINT32)
>> +UINT32
>> RTPInfoSynch::Release()
>> {
>> if(InterlockedDecrement(&m_lRefCount) > 0)
>> @@ -160,13 +142,20 @@
>> return 0;
>> }
>>
>> -STDMETHODIMP
>> -RTPInfoSynch::InitSynch (UINT16 nStreamCount)
>> +HX_RESULT
>> +RTPInfoSynch::InitSynch(UINT16 unStreamCount, UINT16 unMasterStream)
>> {
>> - m_unStreamCount = nStreamCount;
>> + Done();
>>
>> - HX_VECTOR_DELETE(m_pSynchData);
>> - m_pSynchData = new RTPInfoSynchData [nStreamCount];
>> + if (unStreamCount == 0)
>> + {
>> + return HXR_INVALID_PARAMETER;
>> + }
>> +
>> + m_unStreamCount = unStreamCount;
>> + m_unSynchStream = unMasterStream;
>> +
>> + m_pSynchData = new RTPInfoSynchData [unStreamCount];
>>
>> return HXR_OK;
>> }
>> @@ -194,226 +183,160 @@
>> return HXR_OK;
>> }
>>
>> -
>> -STDMETHODIMP
>> -RTPInfoSynch::RTPSynch (UINT16 unMaster)
>> +HX_RESULT
>> +RTPInfoSynch::OnRTPPacket(IHXRTPPacket* pPacket)
>> {
>> - m_bHaveAllSRs = FALSE;
>> - m_unSRCount = 0;
>> - m_unSynchStream = unMaster;
>> - m_bRTPTimesGenerated = FALSE;
>> -
>> - for (UINT16 i = 0; i < m_unStreamCount; i++)
>> + UINT16 unStream = pPacket->GetStreamNumber() ;
>> + if (!pPacket || unStream >= m_unStreamCount)
>> {
>> - m_pSynchData [i].Reset();
>> + return HXR_INVALID_PARAMETER;
>> }
>> -
>> - return HXR_OK;
>> -}
>> -
>> -STDMETHODIMP
>> -RTPInfoSynch::IsStreamSynched (UINT16 unStream, REF(HXBOOL) bIsSynched)
>> -{
>> if (!m_pSynchData)
>> {
>> return HXR_NOT_INITIALIZED;
>> }
>> -
>> - if (unStream >= m_unStreamCount)
>> + if (m_bRTPTimesGenerated)
>> {
>> - return HXR_INVALID_PARAMETER;
>> - }
>> -
>> - bIsSynched = (m_pSynchData [unStream].m_bSynched);
>> - return HXR_OK;
>> -}
>> -
>> -STDMETHODIMP
>> -RTPInfoSynch::OnRTPPacket (IHXBuffer* pRTPPacket,
>> - UINT16 unStream,
>> - REF(HXBOOL) bSynched,
>> - REF(UINT32) ulSequenceNumber,
>> - REF(UINT32) ulTimestamp)
>> -{
>> - if (!m_bHaveAllSRs)
>> - {
>> - bSynched = FALSE;
>> - ulSequenceNumber = 0;
>> - ulTimestamp = 0;
>> - return HXR_OK;
>> + // We are already synced!! Why are you sending packets?
>> + HX_ASSERT(FALSE);
>> + return HXR_OK;
>> }
>>
>> - if (!m_pSynchData)
>> + if (!m_bSyncPacketReceived &&
>> + (m_unSynchStream == HX_INVALID_STREAM || unStream ==
>> m_unSynchStream))
>> {
>> - return HXR_NOT_INITIALIZED;
>> + // This is our sync packet, record it
>> + m_unSynchStream = unStream;
>> + m_pSynchData[unStream].m_ulRTPInfoTime = pPacket->GetRTPTime();
>> + m_bSyncPacketReceived = TRUE;
>> }
>>
>> - if (!pRTPPacket)
>> + if (m_bSyncPacketReceived && (m_bHaveAllSRs || m_unStreamCount < 2))
>> {
>> - return HXR_INVALID_PARAMETER;
>> + // We have everything we need to calculate the sync offsets
>> + CalculateSyncTimes();
>> }
>> + // else we are still waiting for SRs or a specific stream packet
>>
>> - //Header offset plus RTP time field must at least be present:
>> - if (pRTPPacket->GetSize() < 8)
>> + return HXR_OK;
>> +}
>> +
>> +HX_RESULT
>> +RTPInfoSynch::OnRTCPPacket(RTCPPacket* pPacket, UINT16 unStream)
>> +{
>> + if (!m_pSynchData)
>> {
>> - HX_ASSERT(0);
>> - return HXR_INVALID_PARAMETER;
>> + return HXR_NOT_INITIALIZED;
>> }
>> -
>> - BYTE* pByte = pRTPPacket->GetBuffer();
>> -
>> - if (!pByte)
>> + if (!pPacket || unStream >= m_unStreamCount)
>> {
>> - HX_ASSERT(0);
>> return HXR_INVALID_PARAMETER;
>> }
>> -
>> - if (unStream >= m_unStreamCount)
>> + if (m_pSynchData[unStream].m_bHasSR)
>> {
>> - return HXR_INVALID_PARAMETER;
>> + return HXR_OK;
>> }
>>
>> - if (m_pSynchData [unStream].m_bSynched)
>> + if (!(pPacket->packet_type == RTCP_SR) ||
>> m_pSynchData[unStream].m_bHasSR)
>> {
>> - HX_ASSERT(0); //shouldn't happen
>> - bSynched = TRUE;
>> - ulTimestamp = m_pSynchData [unStream].m_ulRTPInfoTime;
>> - ulSequenceNumber = ntohs(*(UINT16*)((pByte+2)));
>> + // If it's not an SR or is on a stream we already got an SR for
>> + // then we don't need to do anything with it
>> + return HXR_OK;
>> }
>>
>> - UINT32 ulRTPTime = ntohl(*(unsigned int*)(pByte+4));
>> -
>> - if (!m_bRTPTimesGenerated)
>> - {
>> - if (unStream != m_unSynchStream)
>> - {
>> - bSynched = FALSE;
>> - ulSequenceNumber = 0;
>> - ulTimestamp = 0;
>> - return HXR_OK;
>> - }
>> + NTPTime rtcpNTPTime;
>> + UINT32 rtcpRTPTimeMSec = 0;
>>
>> - //First packet of of the synch stream is the reference:
>> - m_pSynchData [unStream].m_ulRTPInfoTime = ulRTPTime;
>> + /* Truncate NTP time to 32 bits from 64 bits to make room for
>> expansion to milliseconds*/
>> + rtcpNTPTime.m_ulSecond = pPacket->ntp_sec & 0x0000ffff;
>> + rtcpNTPTime.m_ulFraction = pPacket->ntp_frac & 0xffff0000;
>>
>> - //Convert RTP time from RTP units to milliseconds:
>> - UINT32 ulRTPTimeHX =
>> - (m_pSynchData [unStream].m_pTSConverter) ?
>> - m_pSynchData [unStream].m_pTSConverter->
>> - rtp2hxa_raw(ulRTPTime)
>> - : ulRTPTime;
>> + rtcpRTPTimeMSec =
>> + (m_pSynchData[unStream].m_pTSConverter) ?
>> + m_pSynchData[unStream].m_pTSConverter->
>> + rtp2hxa_raw(pPacket->rtp_ts) : pPacket->rtp_ts;
>>
>> - //Transform the RTP time from this packet to the corresponding
>> NTP time in milliseconds:
>> - UINT32 NTPMasterMSec = ulRTPTimeHX + m_pSynchData
>> [unStream].m_lRTPtoNTPOffset;
>> + m_pSynchData [unStream].m_lRTPtoNTPOffset =
>> + (INT32)(rtcpNTPTime.toMSec() - rtcpRTPTimeMSec);
>>
>> - //For each stream map the master NTP time to the stream's RTP
>> time:
>> - for (UINT16 i = 0; i < m_unStreamCount; i++)
>> - {
>> - if (i != unStream)
>> - {
>> - //convert NTP to RTP using the arithmetic negation of
>> the RTP to NTP mapping:
>> - UINT32 RTPMSec = NTPMasterMSec + -(m_pSynchData
>> [i].m_lRTPtoNTPOffset);
>> -
>> - //Convert mapped RTP from milliseconds to RTP time:
>> - m_pSynchData [i].m_ulRTPInfoTime =
>> - (m_pSynchData [i].m_pTSConverter) ?
>> - m_pSynchData [i].m_pTSConverter->
>> - hxa2rtp_raw(RTPMSec)
>> - : RTPMSec;
>> - }
>> - }
>> + m_pSynchData[unStream].m_bHasSR = TRUE;
>> + m_bHaveAllSRs = (++m_unSRCount >= m_unStreamCount);
>>
>> - m_bRTPTimesGenerated = TRUE;
>> - }
>> - else if (m_pSynchData [unStream].m_ulRTPInfoTime > ulRTPTime)
>> + if (m_bHaveAllSRs && m_bSyncPacketReceived)
>> {
>> - // make sure the ts of the first packet is >= to rtptime in
>> RTP-Info
>> - // because some clients don't choke
>> - bSynched = FALSE;
>> - ulSequenceNumber = 0;
>> - ulTimestamp = 0;
>> - return HXR_OK;
>> - }
>> -
>> -
>> - bSynched = TRUE;
>> - ulSequenceNumber = ntohs(*(UINT16*)(pByte+2));
>> - ulTimestamp = m_pSynchData [unStream].m_ulRTPInfoTime;
>> - m_pSynchData [unStream].m_bSynched = TRUE;
>> -
>> + // This was the last thing we needed, calculate sync times now!
>> + CalculateSyncTimes();
>> + }
>> return HXR_OK;
>> }
>>
>> -STDMETHODIMP
>> -RTPInfoSynch::OnRTCPPacket (IHXBuffer* pRTCPPacket,
>> - UINT16 unStream)
>> +void
>> +RTPInfoSynch::CalculateSyncTimes()
>> {
>> - if (m_bHaveAllSRs)
>> - {
>> - return HXR_OK;
>> - }
>> - if (!m_pSynchData)
>> - {
>> - return HXR_NOT_INITIALIZED;
>> - }
>> + m_bRTPTimesGenerated = TRUE;
>>
>> - if (unStream >= m_unStreamCount)
>> + if (m_unStreamCount == 1)
>> {
>> - return HXR_INVALID_PARAMETER;
>> + // For single-stream case we don't really need to do anything
>> + return;
>> }
>>
>> - if (m_pSynchData [unStream].m_bHasSR)
>> - {
>> - return HXR_OK;
>> - }
>> -
>> - if (pRTCPPacket->GetSize() < 20)
>> - {
>> - return HXR_INVALID_PARAMETER;
>> - }
>> + // XXXJDG I think these conversions have some rollover issues,
>> + // probably should instead use the Timeval calculations used in FCS
>>
>> - BYTE* pcRTCP = pRTCPPacket->GetBuffer();
>> + //Convert RTP time from RTP units to milliseconds:
>> + UINT32 ulRTPTimeHX =
>> + (m_pSynchData[m_unSynchStream].m_pTSConverter) ?
>> + m_pSynchData[m_unSynchStream].m_pTSConverter->
>> + rtp2hxa_raw(m_pSynchData[m_unSynchStream].m_ulRTPInfoTime)
>> + : m_pSynchData[m_unSynchStream].m_ulRTPInfoTime;
>>
>> - if (!pcRTCP)
>> + //Transform the RTP time from this packet to the corresponding
>> NTP time in milliseconds:
>> + UINT32 NTPMasterMSec = ulRTPTimeHX +
>> m_pSynchData[m_unSynchStream].m_lRTPtoNTPOffset;
>> +
>> + //For each stream map the master NTP time to the stream's RTP time:
>> + for (UINT16 i = 0; i < m_unStreamCount; i++)
>> {
>> - return HXR_INVALID_PARAMETER;
>> - }
>> + if (i != m_unSynchStream)
>> + {
>> + //convert NTP to RTP using the arithmetic negation of the
>> RTP to NTP mapping:
>> + UINT32 RTPMSec = NTPMasterMSec + -(m_pSynchData
>> [i].m_lRTPtoNTPOffset);
>>
>> - // make sure it's SR
>> - if (RTCP_SR != *(pcRTCP+1))
>> - {
>> - return HXR_IGNORE;
>> + //Convert mapped RTP from milliseconds to RTP time:
>> + m_pSynchData[i].m_ulRTPInfoTime =
>> + (m_pSynchData [i].m_pTSConverter) ?
>> + m_pSynchData [i].m_pTSConverter->
>> + hxa2rtp_raw(RTPMSec)
>> + : RTPMSec;
>> + }
>> }
>> +}
>>
>> - //Compute the RTP to NTP mapping from the RTCP SR for this stream::
>> - pcRTCP += 8;
>> -
>> - NTPTime rtcpNTPTime;
>> - UINT32 rtcpRTPTimeMSec = 0;
>> -
>> - /* Truncate NTP time to 32 bits from 64 bits to make room for
>> expansion to milliseconds*/
>> - rtcpNTPTime.m_ulSecond = (ntohl(*(unsigned int*)(pcRTCP))) &
>> 0x0000ffff;
>> - rtcpNTPTime.m_ulFraction = (ntohl(*(unsigned int*)(pcRTCP+4))) &
>> 0xffff0000;
>> -
>> - rtcpRTPTimeMSec =
>> - (m_pSynchData [unStream].m_pTSConverter) ?
>> -
>> - m_pSynchData [unStream].m_pTSConverter->
>> - rtp2hxa_raw(ntohl(*(unsigned int*)(pcRTCP+8))) :
>> -
>> - ntohl(*(unsigned int*)(pcRTCP+8));
>> -
>> - m_pSynchData [unStream].m_lRTPtoNTPOffset =
>> - (INT32)(rtcpNTPTime.toMSec() - rtcpRTPTimeMSec);
>> +HX_RESULT
>> +RTPInfoSynch::GetRTPStartTime(UINT16 unStream, REF(UINT32) ulStartTime)
>> +{
>> + if (unStream < m_unStreamCount)
>> + {
>> + if (m_bRTPTimesGenerated)
>> + {
>> + ulStartTime = m_pSynchData[unStream].m_ulRTPInfoTime;
>> + return HXR_OK;
>> + }
>>
>> - m_pSynchData [unStream].m_bHasSR = TRUE;
>> - m_bHaveAllSRs = (++m_unSRCount >= m_unStreamCount);
>> - return HXR_OK;
>> + return HXR_NOT_INITIALIZED;
>> + }
>> +
>> + return HXR_INVALID_PARAMETER;
>> }
>>
>> -STDMETHODIMP
>> +HX_RESULT
>> RTPInfoSynch::Done ()
>> {
>> + m_bHaveAllSRs = FALSE;
>> + m_unSRCount = 0;
>> + m_bSyncPacketReceived = FALSE;
>> + m_bRTPTimesGenerated = FALSE;
>> +
>> HX_VECTOR_DELETE(m_pSynchData);
>>
>> return HXR_OK;
>> Index: protocol/transport/rtp/include/rtpinfosync.h
>> ===================================================================
>> RCS file: /cvsroot/protocol/transport/rtp/include/rtpinfosync.h,v
>> retrieving revision 1.3
>> diff -u -r1.3 rtpinfosync.h
>> --- protocol/transport/rtp/include/rtpinfosync.h 10 Mar 2005
>> 20:59:22 -0000 1.3
>> +++ protocol/transport/rtp/include/rtpinfosync.h 1 Jan 2009
>> 00:26:01 -0000
>> @@ -39,55 +39,10 @@
>> #include "tconverter.h"
>> #include "ntptime.h"
>>
>> -typedef _INTERFACE IHXRTPInfoSynch IHXRTPInfoSynch;
>> +/* Forward Declarations */
>> +class RTCPPacket;
>>
>> -/****************************************************************************
>>
>> - *
>> - * Interface:
>> - *
>> - * IHXRTPInfoSynch
>> - *
>> - * Purpose:
>> - *
>> - *
>> - * IID_IHXRTPInfoSynch:
>> - *
>> - * {1D9DF3AD-7429-4efc-B54D-D67E256304C4}
>> - *
>> - */
>> -
>> -DEFINE_GUID(IID_IHXRTPInfoSynch,
>> - 0x1d9df3ad, 0x7429, 0x4efc, 0xb5, 0x4d, 0xd6, 0x7e, 0x25,
>> 0x63, 0x4, 0xc4);
>> -
>> -#undef INTERFACE
>> -#define INTERFACE IHXRTPInfoSynch
>> -
>> -DECLARE_INTERFACE_(IHXRTPInfoSynch, IUnknown)
>> -{
>> - /*
>> - * IUnknown Methods
>> - */
>> - STDMETHOD(QueryInterface) (THIS_ REFIID riid, void** ppvObj) PURE;
>> - STDMETHOD_(ULONG32,AddRef) (THIS) PURE;
>> - STDMETHOD_(ULONG32,Release) (THIS) PURE;
>> -
>> - STDMETHOD(InitSynch)(THIS_
>> - UINT16 unStreamCount) PURE;
>> - STDMETHOD(RTPSynch) (THIS_ UINT16 unMaster) PURE;
>> - STDMETHOD(OnRTPPacket) (THIS_ IHXBuffer* pRTPPacket,
>> - UINT16 unStream,
>> - REF(HXBOOL) bSynched,
>> - REF(UINT32) ulSequenceNumber,
>> - REF(UINT32) ulTimestamp) PURE;
>> - STDMETHOD(OnRTCPPacket)(THIS_ IHXBuffer* pRTCPPacket,
>> - UINT16 unStream) PURE;
>> - STDMETHOD(SetTSConverter)(THIS_
>> - CHXTimestampConverter::ConversionFactors
>> - conversionFactors,
>> - UINT16 unStream) PURE;
>> - STDMETHOD(IsStreamSynched)(THIS_ UINT16 unStream, REF(HXBOOL)
>> bIsSynched) PURE;
>> - STDMETHOD(Done) (THIS) PURE;
>> -};
>> +#define HX_INVALID_STREAM 0xFFFF
>>
>> class RTPInfoSynchData
>> {
>> @@ -97,52 +52,49 @@
>>
>> void Reset();
>>
>> - HXBOOL m_bHasSR;
>> + HXBOOL m_bHasSR;
>> INT32 m_lRTPtoNTPOffset; //units: msec ; additive conversion
>> from RTP to NTP for this stream
>> UINT32 m_ulRTPInfoTime; //units: rtp time ; time to be placed
>> in rtp info field
>> - HXBOOL m_bSynched;
>> + HXBOOL m_bSynched;
>>
>> CHXTimestampConverter* m_pTSConverter;
>> };
>>
>>
>> -class RTPInfoSynch: public IHXRTPInfoSynch
>> +class RTPInfoSynch
>> {
>> public:
>> - RTPInfoSynch ();
>> - ~RTPInfoSynch ();
>> + RTPInfoSynch();
>> + ~RTPInfoSynch();
>>
>> - STDMETHOD(QueryInterface) (THIS_
>> - REFIID riid,
>> - void** ppvObj);
>> - STDMETHOD_(ULONG32,AddRef) (THIS);
>> - STDMETHOD_(ULONG32,Release) (THIS);
>> + ULONG32 AddRef();
>> + ULONG32 Release();
>>
>>
>> - STDMETHOD(InitSynch)(THIS_
>> - UINT16 unStreamCount);
>> - STDMETHOD(RTPSynch) (THIS_ UINT16 unMaster);
>> - STDMETHOD(OnRTPPacket) (THIS_ IHXBuffer* pRTPPacket,
>> - UINT16 unStream,
>> - REF(HXBOOL) bSynched,
>> - REF(UINT32) ulSequenceNumber,
>> - REF(UINT32) ulTimestamp);
>> - STDMETHOD(OnRTCPPacket)(THIS_ IHXBuffer* pRTCPPacket, UINT16
>> unStream);
>> - STDMETHOD(SetTSConverter)(THIS_
>> - CHXTimestampConverter::ConversionFactors
>> + HX_RESULT InitSynch(UINT16 unStreamCount,
>> + UINT16 unMasterStream = HX_INVALID_STREAM);
>> + HX_RESULT SetTSConverter(CHXTimestampConverter::ConversionFactors
>> conversionFactors,
>> UINT16 unStream);
>> - STDMETHOD(IsStreamSynched)(THIS_ UINT16 unStream, REF(HXBOOL)
>> bIsSynched);
>> - STDMETHOD(Done) (THIS);
>> + HX_RESULT Done();
>> +
>> + HX_RESULT OnRTPPacket (IHXRTPPacket* pPacket);
>> + HX_RESULT OnRTCPPacket (RTCPPacket* pPacket, UINT16 unStream);
>> + HX_RESULT GetRTPStartTime(UINT16 unStream, REF(UINT32)
>> ulStartTime);
>> +
>> + inline HXBOOL IsSynced() { return m_bRTPTimesGenerated; }
>>
>> private:
>> - INT32 m_lRefCount;
>> - RTPInfoSynchData* m_pSynchData;
>> - UINT16 m_unStreamCount;
>> - UINT16 m_unSRCount;
>> - UINT16 m_unSynchStream;
>> - HXBOOL m_bHaveAllSRs;
>> - HXBOOL m_bRTPTimesGenerated;
>> + INT32 m_lRefCount;
>> + RTPInfoSynchData* m_pSynchData;
>> + UINT16 m_unStreamCount;
>> + UINT16 m_unSRCount;
>> + UINT16 m_unSynchStream;
>> + HXBOOL m_bHaveAllSRs;
>> + HXBOOL m_bSyncPacketReceived;
>> + HXBOOL m_bRTPTimesGenerated;
>> +
>> + void CalculateSyncTimes();
>> };
>>
>> #endif /*_RTP_INFO_SYNC_H_ */
>>
>> /* ***** BEGIN LICENSE BLOCK *****
>> * Version: RCSL 1.0/RPSL 1.0
>> *
>> * Portions Copyright (c) 1995-2002 RealNetworks, Inc. All Rights
>> Reserved.
>> *
>> * The contents of this file, and the files included with this file, are
>> * subject to the current version of the RealNetworks Public Source
>> License
>> * Version 1.0 (the "RPSL") available at
>> * http://www.helixcommunity.org/content/rpsl unless you have licensed
>> * the file under the RealNetworks Community Source License Version 1.0
>> * (the "RCSL") available at http://www.helixcommunity.org/content/rcsl,
>> * in which case the RCSL will apply. You may also obtain the license
>> terms
>> * directly from RealNetworks. You may not use this file except in
>> * compliance with the RPSL or, if you have a valid RCSL with
>> RealNetworks
>> * applicable to this file, the RCSL. Please see the applicable RPSL or
>> * RCSL for the rights, obligations and limitations governing use of the
>> * contents of the file.
>> *
>> * This file is part of the Helix DNA Technology. RealNetworks is the
>> * developer of the Original Code and owns the copyrights in the portions
>> * it created.
>> *
>> * This file, and the files included with this file, is distributed
>> and made
>> * available on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER
>> * EXPRESS OR IMPLIED, AND REALNETWORKS HEREBY DISCLAIMS ALL SUCH
>> WARRANTIES,
>> * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY,
>> FITNESS
>> * FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT.
>> *
>> * Technology Compatibility Kit Test Suite(s) Location:
>> * http://www.helixcommunity.org/content/tck
>> *
>> * Contributor(s):
>> *
>> * ***** END LICENSE BLOCK ***** */
>> #include "hxtypes.h"
>> #include "hxassert.h"
>> #include "debug.h"
>> #include "hxcom.h"
>> #include "hxmarsh.h"
>> #include "hxstrutl.h"
>> #include "netbyte.h"
>> #include "hxengin.h"
>> #include "ihxpckts.h"
>> #include "hxsbuffer.h"
>> #include "hxcomm.h"
>> #include "netbyte.h"
>> #include "hxstring.h"
>> #include "chxpckts.h"
>> #include "hxslist.h"
>> #include "hxmap.h"
>> #include "hxbitset.h"
>> #include "timebuff.h"
>> #include "timeval.h"
>> #include "rtptypes.h"
>> #include "bufnum.h"
>>
>> #include "ntptime.h"
>>
>> #include "hxtick.h"
>> #include "rtppkt.h"
>> #include "rtpwrap.h"
>> #include "rtpinfosync.h"
>>
>> #if defined (_SYMBIAN)
>> #include
>> #endif
>> #if defined (_LSB)
>> #include
>> #endif
>>
>> /*
>> * This algorithm determines the RTP timestamp to present in the
>> RTP-Info RTSP field.
>> * The RTP-Info field presents to the client the RTP time that maps to
>> the NPT time for the session.
>> * The client uses this mapping to determine a reference point for the
>> RTP timestamps in each stream.
>> * For RTP reflection streams (live streams) the starting point for
>> each client within the total timeline of the stream
>> * is arbitrary.
>> * In order to select a reference point for inter and intra stream
>> synchronization the client must be able to map NPT to RTP to NTP
>> * for the time at which the client enters the live session timeline.
>> * To accomplish this the following algorithm is used:
>> * 1) Get the NTP to RTP mapping for each stream from the RTCP SR for
>> each of the streams.
>> * 2) On the first packet after RTCP SRs for each stream have arrived:
>> * a) Map the RTP time of that packet to NTP time; this is the
>> reference NTP time that maps NPT to NTP.
>> * b) Compute the corresponding RTP time to that NTP from 2a) for
>> each stream.
>> * 3) Set the resulting values from each stream in 2b) to the RTP-Info
>> field.
>> * The result is a mapping in terms of each stream's time domain to a
>> common NTP time that represents the NPT of the session.
>> */
>>
>> RTPInfoSynchData::RTPInfoSynchData() :
>> m_bHasSR (FALSE),
>> m_lRTPtoNTPOffset (0),
>> m_ulRTPInfoTime (0),
>> m_bSynched (FALSE),
>> m_pTSConverter (NULL)
>> {
>> }
>>
>> RTPInfoSynchData::~RTPInfoSynchData()
>> {
>> HX_DELETE(m_pTSConverter);
>> }
>>
>> void
>> RTPInfoSynchData::Reset()
>> {
>> m_bHasSR = FALSE;
>> m_bSynched = FALSE;
>> m_lRTPtoNTPOffset = 0;
>> m_ulRTPInfoTime = 0;
>> }
>>
>> RTPInfoSynch::RTPInfoSynch() :
>> m_lRefCount (0),
>> m_pSynchData (NULL),
>> m_unStreamCount (0),
>> m_unSRCount (0),
>> m_unSynchStream (HX_INVALID_STREAM),
>> m_bHaveAllSRs (FALSE),
>> m_bSyncPacketReceived (FALSE),
>> m_bRTPTimesGenerated (FALSE)
>> {
>> }
>>
>> RTPInfoSynch::~RTPInfoSynch()
>> {
>> Done();
>> }
>>
>> UINT32
>> RTPInfoSynch::AddRef()
>> {
>> return InterlockedIncrement(&m_lRefCount);
>> }
>>
>> UINT32
>> RTPInfoSynch::Release()
>> {
>> if(InterlockedDecrement(&m_lRefCount) > 0)
>> {
>> return (UINT32)m_lRefCount;
>> }
>> delete this;
>> return 0;
>> }
>>
>> HX_RESULT
>> RTPInfoSynch::InitSynch(UINT16 unStreamCount, UINT16 unMasterStream)
>> {
>> Done();
>>
>> if (unStreamCount == 0)
>> {
>> return HXR_INVALID_PARAMETER;
>> }
>>
>> m_unStreamCount = unStreamCount;
>> m_unSynchStream = unMasterStream;
>>
>> m_pSynchData = new RTPInfoSynchData [unStreamCount];
>>
>> return HXR_OK;
>> }
>>
>> HX_RESULT
>> RTPInfoSynch::SetTSConverter(CHXTimestampConverter::
>> ConversionFactors conversionFactors,
>> UINT16 unStream)
>> {
>> if (!m_pSynchData)
>> {
>> return HXR_NOT_INITIALIZED;
>> }
>>
>> if (unStream >= m_unStreamCount)
>> {
>> return HXR_INVALID_PARAMETER;
>> }
>>
>> HX_DELETE(m_pSynchData [unStream].m_pTSConverter);
>>
>> m_pSynchData [unStream].m_pTSConverter =
>> new CHXTimestampConverter(conversionFactors);
>>
>> return HXR_OK;
>> }
>>
>> HX_RESULT
>> RTPInfoSynch::OnRTPPacket(IHXRTPPacket* pPacket)
>> {
>> UINT16 unStream = pPacket->GetStreamNumber() ;
>> if (!pPacket || unStream >= m_unStreamCount)
>> {
>> return HXR_INVALID_PARAMETER;
>> }
>> if (!m_pSynchData)
>> {
>> return HXR_NOT_INITIALIZED;
>> }
>> if (m_bRTPTimesGenerated)
>> {
>> // We are already synced!! Why are you sending packets?
>> HX_ASSERT(FALSE);
>> return HXR_OK;
>> }
>>
>> if (!m_bSyncPacketReceived &&
>> (m_unSynchStream == HX_INVALID_STREAM || unStream ==
>> m_unSynchStream))
>> {
>> // This is our sync packet, record it
>> m_unSynchStream = unStream;
>> m_pSynchData[unStream].m_ulRTPInfoTime = pPacket->GetRTPTime();
>> m_bSyncPacketReceived = TRUE;
>> }
>>
>> if (m_bSyncPacketReceived && (m_bHaveAllSRs || m_unStreamCount < 2))
>> {
>> // We have everything we need to calculate the sync offsets
>> CalculateSyncTimes();
>> }
>> // else we are still waiting for SRs or a specific stream packet
>>
>> return HXR_OK;
>> }
>>
>> HX_RESULT
>> RTPInfoSynch::OnRTCPPacket(RTCPPacket* pPacket, UINT16 unStream)
>> {
>> if (!m_pSynchData)
>> {
>> return HXR_NOT_INITIALIZED;
>> }
>> if (!pPacket || unStream >= m_unStreamCount)
>> {
>> return HXR_INVALID_PARAMETER;
>> }
>> if (m_pSynchData[unStream].m_bHasSR)
>> {
>> return HXR_OK;
>> }
>>
>> if (!(pPacket->packet_type == RTCP_SR) ||
>> m_pSynchData[unStream].m_bHasSR)
>> {
>> // If it's not an SR or is on a stream we already got an SR for
>> // then we don't need to do anything with it
>> return HXR_OK;
>> }
>>
>> NTPTime rtcpNTPTime;
>> UINT32 rtcpRTPTimeMSec = 0;
>>
>> /* Truncate NTP time to 32 bits from 64 bits to make room for
>> expansion to milliseconds*/
>> rtcpNTPTime.m_ulSecond = pPacket->ntp_sec & 0x0000ffff;
>> rtcpNTPTime.m_ulFraction = pPacket->ntp_frac & 0xffff0000;
>>
>> rtcpRTPTimeMSec =
>> (m_pSynchData[unStream].m_pTSConverter) ?
>> m_pSynchData[unStream].m_pTSConverter->
>> rtp2hxa_raw(pPacket->rtp_ts) : pPacket->rtp_ts;
>>
>> m_pSynchData [unStream].m_lRTPtoNTPOffset =
>> (INT32)(rtcpNTPTime.toMSec() - rtcpRTPTimeMSec);
>>
>> m_pSynchData[unStream].m_bHasSR = TRUE;
>> m_bHaveAllSRs = (++m_unSRCount >= m_unStreamCount);
>>
>> if (m_bHaveAllSRs && m_bSyncPacketReceived)
>> {
>> // This was the last thing we needed, calculate sync times now!
>> CalculateSyncTimes();
>> }
>> return HXR_OK;
>> }
>>
>> void
>> RTPInfoSynch::CalculateSyncTimes()
>> {
>> m_bRTPTimesGenerated = TRUE;
>>
>> if (m_unStreamCount == 1)
>> {
>> // For single-stream case we don't really need to do anything
>> return;
>> }
>>
>> // XXXJDG I think these conversions have some rollover issues,
>> // probably should instead use the Timeval calculations used in FCS
>>
>> //Convert RTP time from RTP units to milliseconds:
>> UINT32 ulRTPTimeHX =
>> (m_pSynchData[m_unSynchStream].m_pTSConverter) ?
>> m_pSynchData[m_unSynchStream].m_pTSConverter->
>> rtp2hxa_raw(m_pSynchData[m_unSynchStream].m_ulRTPInfoTime)
>> : m_pSynchData[m_unSynchStream].m_ulRTPInfoTime;
>>
>> //Transform the RTP time from this packet to the corresponding NTP
>> time in milliseconds:
>> UINT32 NTPMasterMSec = ulRTPTimeHX +
>> m_pSynchData[m_unSynchStream].m_lRTPtoNTPOffset;
>>
>> //For each stream map the master NTP time to the stream's RTP time:
>> for (UINT16 i = 0; i < m_unStreamCount; i++)
>> {
>> if (i != m_unSynchStream)
>> {
>> //convert NTP to RTP using the arithmetic negation of the
>> RTP to NTP mapping:
>> UINT32 RTPMSec = NTPMasterMSec + -(m_pSynchData
>> [i].m_lRTPtoNTPOffset);
>>
>> //Convert mapped RTP from milliseconds to RTP time:
>> m_pSynchData[i].m_ulRTPInfoTime =
>> (m_pSynchData [i].m_pTSConverter) ?
>> m_pSynchData [i].m_pTSConverter->
>> hxa2rtp_raw(RTPMSec)
>> : RTPMSec;
>> }
>> }
>> }
>>
>> HX_RESULT
>> RTPInfoSynch::GetRTPStartTime(UINT16 unStream, REF(UINT32) ulStartTime)
>> {
>> if (unStream < m_unStreamCount)
>> {
>> if (m_bRTPTimesGenerated)
>> {
>> ulStartTime = m_pSynchData[unStream].m_ulRTPInfoTime;
>> return HXR_OK;
>> }
>>
>> return HXR_NOT_INITIALIZED;
>> }
>>
>> return HXR_INVALID_PARAMETER;
>> }
>>
>> HX_RESULT
>> RTPInfoSynch::Done ()
>> {
>> m_bHaveAllSRs = FALSE;
>> m_unSRCount = 0;
>> m_bSyncPacketReceived = FALSE;
>> m_bRTPTimesGenerated = FALSE;
>>
>> HX_VECTOR_DELETE(m_pSynchData);
>>
>> return HXR_OK;
>> }
>
>
From jgordon at real.com Mon Jan 5 12:59:44 2009
From: jgordon at real.com (Jamie Gordon)
Date: Mon Jan 5 10:49:46 2009
Subject: [Protocol-dev] Checkin: Updates to RTP live ASMRuleBook generation
Message-ID: <496274C0.50107@real.com>
Synopsis
========
Updates to RTP live ASMRuleBook generation to work correctly with
current and upcoming RSD queue and qtbcplin updates
Branches: SERVER_12_1, HEAD (SERVER_CURRENT)
Reviewer: gwright, ckarusala
Description
===========
Removes the RTCPRules, it is not correct. Neither rule is RTCP!! They
are both media data, marker bit on/off
Adds InterDepend values (necessary for proper RSD queue handling). (This
required a minor restructuring to have the base rule known when creating
the string).
Also added some missing error checking, including using SafeSprintf,
etc.
Does not yet add rate partitioning.
Files Affected
==============
protocol/common/util/altgrputil.cpp
Testing Performed
=================
Unit Tests:
Integration Tests:
Verified proper rulebook generation with single-rate and multi-rate.
Leak Tests:
None
Performance Tests:
None
Platforms Tested: win32-i386-vc7
Build verified: win32-i386-vc7, linux-rhel4-i686, sunos-5.10-sparc-server
QA Hints
===============
n/a
From jgordon at real.com Mon Jan 5 13:04:20 2009
From: jgordon at real.com (Jamie Gordon)
Date: Mon Jan 5 10:54:18 2009
Subject: [Protocol-dev] Checkin: Modify RTPInfoSynch to work with updated
architecture
Message-ID: <496275D4.9080804@real.com>
Synopsis
========
Modify RTPInfoSync (server-side RTP sync class) to work with
RTP live reception handling updates
Branches: SERVER_12_1, HEAD (SERVER_CURRENT)
Reviewer: gwright, ckarusala
Description
===========
This required a major overhaul of the structure.
Please note that this class is used only by the server, and only in the
one place from which I am removing it (per prior CR).
The usage is defined in an interface, however the interface is no longer
usable or appropriate. The usage, furthermore, has no need to be an
interface anyway, So I have removed the existing interface
(IHXRTPInfoSynch) and am not creating a new one.
The main change is that the current implementation takes IHXBuffers
containing complete RTP and RTCP packets (including headers) but we
now have parsed IHXRTPPacket etc. Also the information retrieval etc.
were not quite right for what we actually need now.
The diff is a bit tough to read, so I am also attaching the cpp file.
Files Affected
==============
common/include/hxiids.h
protocol/transport/rtp/rtpinfosync.cpp
protocol/transport/rtp/include/rtpinfosync.h
Testing Performed
=================
Unit Tests:
Integration Tests:
Verified properly synced playback of single and multi rate RTP live
Leak Tests:
None
Performance Tests:
None
Platforms Tested: win32-i386-vc7
Build verified: linux-rhel4-i686, sunos-5.10-sparc-server,
win32-i386-vc7
QA Hints
===============
n/a
From alokj at real.com Wed Jan 7 05:26:23 2009
From: alokj at real.com (Alok Jain)
Date: Wed Jan 7 03:15:57 2009
Subject: [Protocol-dev] CR: Add support to handle the content-length upto
4GB (httpfsys communication with HTTP server)
Message-ID: <001b01c970cb$8b32e410$0901a8c0@AlokSystem>
Synopsis:
Add support to handle the content-length up to 4GB when httpfsys
communicate with HTTP server.
Overview:
Previously helix can support only up 2GB content-length when httpfys
communicate with HTTP server. Now add the support to handle up to 4GB data
when communicate with HTTP server while not using Transfer-Encoding =
chunked and enabled HELIX_FEATURE_HTTPFSYS_MEM_GROWTH_LIMIT feature so that
we can limt out of memory issue.
Files Modified:
/cvsroot/protocol/http/httpmsg.cpp
Files Added:
None
Image Size and Heap Use impact (Client -Only):
None.
Platforms and Profiles Affected:
None
Distribution Libraries Affected:
None.
Distribution library impact and planned action:
None.
Platforms and Profiles Build Verified:
Profile: helix-client-all-defines
BIF branch: Head
Target: splay
Thanks
Alok Jain
-------------- next part --------------
Index: httpmsg.cpp
===================================================================
RCS file: /cvsroot/protocol/http/httpmsg.cpp,v
retrieving revision 1.15
diff -u -r1.15 httpmsg.cpp
--- httpmsg.cpp 6 Jul 2007 20:51:34 -0000 1.15
+++ httpmsg.cpp 6 Jan 2009 05:05:49 -0000
@@ -246,7 +246,7 @@
CHXString strValue = getHeaderValue(pName);
if(strValue != "")
{
- value = (UINT32)strtol((const char*)strValue, 0, 10);
+ value = (UINT32)strtoul((const char*)strValue, 0, 10);
return 1;
}
return 0;
From gwright at real.com Wed Jan 7 10:11:47 2009
From: gwright at real.com (Greg Wright)
Date: Wed Jan 7 08:06:15 2009
Subject: [Protocol-dev] CR: Add support to handle the content-length upto
4GB (httpfsys communication with HTTP server)
In-Reply-To: <001b01c970cb$8b32e410$0901a8c0@AlokSystem>
References: <001b01c970cb$8b32e410$0901a8c0@AlokSystem>
Message-ID: <4964F063.1070603@real.com>
Looks good.
--greg.
Alok Jain wrote:
>
> Synopsis:
> Add support to handle the content-length up to 4GB when httpfsys
> communicate with HTTP server.
>
> Overview:
> Previously helix can support only up 2GB content-length when httpfys
> communicate with HTTP server. Now add the support to handle up to 4GB data
> when communicate with HTTP server while not using Transfer-Encoding =
> chunked and enabled HELIX_FEATURE_HTTPFSYS_MEM_GROWTH_LIMIT feature so
> that we can limt out of memory issue.
>
> Files Modified:
> /cvsroot/protocol/http/httpmsg.cpp
>
> Files Added:
> None
> Image Size and Heap Use impact (Client -Only):
> None.
>
> Platforms and Profiles Affected:
> None
>
> Distribution Libraries Affected:
> None.
>
> Distribution library impact and planned action:
> None.
>
> Platforms and Profiles Build Verified:
> Profile: helix-client-all-defines
>
> BIF branch: Head
> Target: splay
>
>
> Thanks
> Alok Jain
>
>
> Index: httpmsg.cpp
> ===================================================================
> RCS file: /cvsroot/protocol/http/httpmsg.cpp,v
> retrieving revision 1.15
> diff -u -r1.15 httpmsg.cpp
> --- httpmsg.cpp 6 Jul 2007 20:51:34 -0000 1.15
> +++ httpmsg.cpp 6 Jan 2009 05:05:49 -0000
> @@ -246,7 +246,7 @@
> CHXString strValue = getHeaderValue(pName);
> if(strValue != "")
> {
> - value = (UINT32)strtol((const char*)strValue, 0, 10);
> + value = (UINT32)strtoul((const char*)strValue, 0, 10);
> return 1;
> }
> return 0;
>
>
> ------------------------------------------------------------------------
>
> _______________________________________________
> Protocol-dev mailing list
> Protocol-dev@helixcommunity.org
> http://lists.helixcommunity.org/mailman/listinfo/protocol-dev
From alokj at real.com Wed Jan 7 22:39:05 2009
From: alokj at real.com (Alok Jain)
Date: Wed Jan 7 20:28:32 2009
Subject: [Protocol-dev] CN: Add support to handle the content-length upto
4GB (httpfsys communication with HTTP server)
References: <001b01c970cb$8b32e410$0901a8c0@AlokSystem>
<4964F063.1070603@real.com>
Message-ID: <001301c9715b$d0c9d2a0$0901a8c0@AlokSystem>
Thanks Greg,
This is now checked into HEAD.
Alok
----- Original Message -----
From: "Greg Wright"
To: "Alok Jain"
Cc:
Sent: Wednesday, January 07, 2009 11:41 PM
Subject: Re: [Protocol-dev] CR: Add support to handle the content-length
upto 4GB (httpfsys communication with HTTP server)
> Looks good.
> --greg.
>
>
> Alok Jain wrote:
>>
>> Synopsis:
>> Add support to handle the content-length up to 4GB when httpfsys
>> communicate with HTTP server.
>>
>> Overview:
>> Previously helix can support only up 2GB content-length when httpfys
>> communicate with HTTP server. Now add the support to handle up to 4GB
>> data
>> when communicate with HTTP server while not using Transfer-Encoding =
>> chunked and enabled HELIX_FEATURE_HTTPFSYS_MEM_GROWTH_LIMIT feature so
>> that we can limt out of memory issue.
>>
>> Files Modified:
>> /cvsroot/protocol/http/httpmsg.cpp
>>
>> Files Added:
>> None
>> Image Size and Heap Use impact (Client -Only):
>> None.
>>
>> Platforms and Profiles Affected:
>> None
>>
>> Distribution Libraries Affected:
>> None.
>>
>> Distribution library impact and planned action:
>> None.
>>
>> Platforms and Profiles Build Verified:
>> Profile: helix-client-all-defines
>>
>> BIF branch: Head
>> Target: splay
>>
>>
>> Thanks
>> Alok Jain
>>
>>
>> Index: httpmsg.cpp
>> ===================================================================
>> RCS file: /cvsroot/protocol/http/httpmsg.cpp,v
>> retrieving revision 1.15
>> diff -u -r1.15 httpmsg.cpp
>> --- httpmsg.cpp 6 Jul 2007 20:51:34 -0000 1.15
>> +++ httpmsg.cpp 6 Jan 2009 05:05:49 -0000
>> @@ -246,7 +246,7 @@
>> CHXString strValue = getHeaderValue(pName);
>> if(strValue != "")
>> {
>> - value = (UINT32)strtol((const char*)strValue, 0, 10);
>> + value = (UINT32)strtoul((const char*)strValue, 0, 10);
>> return 1;
>> }
>> return 0;
>>
>>
>> ------------------------------------------------------------------------
>>
>> _______________________________________________
>> Protocol-dev mailing list
>> Protocol-dev@helixcommunity.org
>> http://lists.helixcommunity.org/mailman/listinfo/protocol-dev
>
From tseaward at real.com Thu Jan 8 15:45:05 2009
From: tseaward at real.com (Tony Seaward)
Date: Fri Jan 9 09:54:15 2009
Subject: [Protocol-dev] Secure RTP Protocol Development Begins
Message-ID: <49669001.5040506@real.com>
Umakant-
Now that we are in full swing with this project, please use this alias
to communicate any further questions or comments surrounding the Secure
RTP development to allow the community to interact.
--
Tony Seaward
Program Manager
RealNetworks, Inc.
(206) 674-2391
From gahluwalia at real.com Mon Jan 12 05:02:34 2009
From: gahluwalia at real.com (Gurpreet)
Date: Mon Jan 12 02:53:41 2009
Subject: [Protocol-dev] CR: Adding implementation of lite SOAP Port
interface.
Message-ID: <496B3F6A.6090605@real.com>
Synopsis:
Adding implementation of lite SOAP client interface.
// IHXSoapPort
STDMETHOD(Init) (THIS_ IHXSoapPortResponse* pResponse,
const char* pszPortName,
const char* pszPortAddress,
IHXTPropertyBag* pBinding,
IHXTPropertyBag* pPortType,
IHXTPropertyBag* pMessages,
IHXTPropertyBag* pTypes);
STDMETHOD(Send) (THIS_ IHXTPropertyBag* pRequestData);
STDMETHOD(Close) (THIS);
Overview:
Three new classes have been added
CHXSoapPort: Base Soap Interface implementation
CHXSoapHttp: Soap Request generated by SoapPort is passed to this
object. CHXSoapHttp uses CHXHttp object for sending Post Request to server.
CHXSoapXML: The reply returned by the server is passed to this object.
It parses the reply & accordingly creates a property bag.
At present only simple requests are handled. i.e Arrays are not handled
in Soap Request sent to server.
Though the arrays are handled in replies returned by server.
PropertyBag containing Array have a special bool property "Array", which
is set to TRUE.
Each element of array start with same name as Parent + index of four
digit. i.e.
ArrayPropertyBag
Array:Bool
ArrayPropertyBag0000:Propertybag
ArrayPropertyBag0001:Propertybag
ArrayPropertyBag0002:Propertybag
Files Added:
protocol/soap/Umakefil
protocol/soap/chxsoaphttp.cpp
protocol/soap/chxsoapport.cpp
protocol/soap/chxsoapxml.cpp
protocol/soap/pub/chxsoapxml.h
protocol/soap/pub/chxsoapport.h
protocol/soap/pub/chxsoaphttp.h
Image Size and Heap Use impact (Client -Only):
None
Platforms and Profiles Build Verified:
BIF branch -> helix
Target(s) -> splay
Profile -> helix-client-all-defines
SYSTEM_ID -> win32-i386-vc7
Files Attached::
soap.zip
Thanks & Best Regards,
Gurpreet
-------------- next part --------------
A non-text attachment was scrubbed...
Name: soap.zip
Type: application/x-zip-compressed
Size: 18554 bytes
Desc: not available
Url : http://lists.helixcommunity.org/pipermail/protocol-dev/attachments/20090112/b17fc3fc/soap-0001.bin
From ehyche at real.com Tue Jan 13 09:54:35 2009
From: ehyche at real.com (Eric Hyche)
Date: Tue Jan 13 07:42:38 2009
Subject: [Protocol-dev] CR: Adding implementation of lite SOAP
Port interface.
In-Reply-To: <496B3F6A.6090605@real.com>
References: <496B3F6A.6090605@real.com>
Message-ID: <008201c975a8$000a2470$001e6d50$@com>
Gurpreet,
Here are my comments:
1) Umakefil:
project.AddModuleIncludes("./pub",
Don't need to add "pub" to the include list - ribosome
does this for you automatically.
"client/encodesvc/include",
"client/encodesvc/common/container/pub",
"client/encodesvc/plugins/util/pub")
- Need a carriage return on the very end of the file.
2) chxsoapport.cpp
- In GenerateRequestUsingParameterOrder() and GenerateRequestUsingInputMethod(),
you may want to consider using a CHXStringList instead of a CHXSimpleList.
This will simplify the code slightly, since CHXStringList takes care
of the CHXString allocation and destruction.
- In SoapHttpDone(), you pass a CHXSimpleList where the elements of the list
are added in one object and removed in another. This is probably not good
practice. I would recommend creating an IHXList in CHXSoapHttp and passing
that to SoapHttpDone(). Then the CHXSoapHttp class can release that object
after it calls SoapHttpDone(). It should not be the job of the CHXSoapPort
class to remove elements from the list.
Rest looks good.
Eric
=======================================
Eric Hyche (ehyche@real.com)
Principal Engineer
RealNetworks, Inc.
>-----Original Message-----
>From: protocol-dev-bounces@helixcommunity.org [mailto:protocol-dev-bounces@helixcommunity.org] On
>Behalf Of Gurpreet
>Sent: Monday, January 12, 2009 8:03 AM
>To: protocol-dev@helixcommunity.org
>Subject: [Protocol-dev] CR: Adding implementation of lite SOAP Port interface.
>
>Synopsis:
>Adding implementation of lite SOAP client interface.
>
>// IHXSoapPort
> STDMETHOD(Init) (THIS_ IHXSoapPortResponse* pResponse,
> const char* pszPortName,
> const char* pszPortAddress,
> IHXTPropertyBag* pBinding,
> IHXTPropertyBag* pPortType,
> IHXTPropertyBag* pMessages,
> IHXTPropertyBag* pTypes);
>
> STDMETHOD(Send) (THIS_ IHXTPropertyBag* pRequestData);
> STDMETHOD(Close) (THIS);
>
>Overview:
>Three new classes have been added
>CHXSoapPort: Base Soap Interface implementation
>CHXSoapHttp: Soap Request generated by SoapPort is passed to this object. CHXSoapHttp uses CHXHttp
>object for sending Post Request to server.
>CHXSoapXML: The reply returned by the server is passed to this object.
>It parses the reply & accordingly creates a property bag.
>
>At present only simple requests are handled. i.e Arrays are not handled in Soap Request sent to
>server.
>Though the arrays are handled in replies returned by server.
>PropertyBag containing Array have a special bool property "Array", which is set to TRUE.
>Each element of array start with same name as Parent + index of four digit. i.e.
>
>ArrayPropertyBag
> Array:Bool
> ArrayPropertyBag0000:Propertybag
> ArrayPropertyBag0001:Propertybag
> ArrayPropertyBag0002:Propertybag
>
>Files Added:
>protocol/soap/Umakefil
>protocol/soap/chxsoaphttp.cpp
>protocol/soap/chxsoapport.cpp
>protocol/soap/chxsoapxml.cpp
>protocol/soap/pub/chxsoapxml.h
>protocol/soap/pub/chxsoapport.h
>protocol/soap/pub/chxsoaphttp.h
>
>Image Size and Heap Use impact (Client -Only):
>None
>
>Platforms and Profiles Build Verified:
>BIF branch -> helix
>Target(s) -> splay
>Profile -> helix-client-all-defines
>SYSTEM_ID -> win32-i386-vc7
>
>Files Attached::
>soap.zip
>
>Thanks & Best Regards,
>Gurpreet
From gahluwalia at real.com Wed Jan 14 01:41:06 2009
From: gahluwalia at real.com (Gurpreet)
Date: Tue Jan 13 23:31:43 2009
Subject: [Protocol-dev] CN: Adding implementation of lite SOAP
Port interface.
In-Reply-To: <008201c975a8$000a2470$001e6d50$@com>
References: <496B3F6A.6090605@real.com> <008201c975a8$000a2470$001e6d50$@com>
Message-ID: <496DB332.2080704@real.com>
Thanks Eric,
This have been checked into head after incorporating your suggestions.
Best Regards,
Gurpreet
Eric Hyche wrote:
> Gurpreet,
>
> Here are my comments:
>
> 1) Umakefil:
>
> project.AddModuleIncludes("./pub",
>
> Don't need to add "pub" to the include list - ribosome
> does this for you automatically.
>
> "client/encodesvc/include",
> "client/encodesvc/common/container/pub",
> "client/encodesvc/plugins/util/pub")
>
> - Need a carriage return on the very end of the file.
>
> 2) chxsoapport.cpp
>
> - In GenerateRequestUsingParameterOrder() and GenerateRequestUsingInputMethod(),
> you may want to consider using a CHXStringList instead of a CHXSimpleList.
> This will simplify the code slightly, since CHXStringList takes care
> of the CHXString allocation and destruction.
>
> - In SoapHttpDone(), you pass a CHXSimpleList where the elements of the list
> are added in one object and removed in another. This is probably not good
> practice. I would recommend creating an IHXList in CHXSoapHttp and passing
> that to SoapHttpDone(). Then the CHXSoapHttp class can release that object
> after it calls SoapHttpDone(). It should not be the job of the CHXSoapPort
> class to remove elements from the list.
>
> Rest looks good.
>
> Eric
>
> =======================================
> Eric Hyche (ehyche@real.com)
> Principal Engineer
> RealNetworks, Inc.
>
>
>
>> -----Original Message-----
>> From: protocol-dev-bounces@helixcommunity.org [mailto:protocol-dev-bounces@helixcommunity.org] On
>> Behalf Of Gurpreet
>> Sent: Monday, January 12, 2009 8:03 AM
>> To: protocol-dev@helixcommunity.org
>> Subject: [Protocol-dev] CR: Adding implementation of lite SOAP Port interface.
>>
>> Synopsis:
>> Adding implementation of lite SOAP client interface.
>>
>> // IHXSoapPort
>> STDMETHOD(Init) (THIS_ IHXSoapPortResponse* pResponse,
>> const char* pszPortName,
>> const char* pszPortAddress,
>> IHXTPropertyBag* pBinding,
>> IHXTPropertyBag* pPortType,
>> IHXTPropertyBag* pMessages,
>> IHXTPropertyBag* pTypes);
>>
>> STDMETHOD(Send) (THIS_ IHXTPropertyBag* pRequestData);
>> STDMETHOD(Close) (THIS);
>>
>> Overview:
>> Three new classes have been added
>> CHXSoapPort: Base Soap Interface implementation
>> CHXSoapHttp: Soap Request generated by SoapPort is passed to this object. CHXSoapHttp uses CHXHttp
>> object for sending Post Request to server.
>> CHXSoapXML: The reply returned by the server is passed to this object.
>> It parses the reply & accordingly creates a property bag.
>>
>> At present only simple requests are handled. i.e Arrays are not handled in Soap Request sent to
>> server.
>> Though the arrays are handled in replies returned by server.
>> PropertyBag containing Array have a special bool property "Array", which is set to TRUE.
>> Each element of array start with same name as Parent + index of four digit. i.e.
>>
>> ArrayPropertyBag
>> Array:Bool
>> ArrayPropertyBag0000:Propertybag
>> ArrayPropertyBag0001:Propertybag
>> ArrayPropertyBag0002:Propertybag
>>
>> Files Added:
>> protocol/soap/Umakefil
>> protocol/soap/chxsoaphttp.cpp
>> protocol/soap/chxsoapport.cpp
>> protocol/soap/chxsoapxml.cpp
>> protocol/soap/pub/chxsoapxml.h
>> protocol/soap/pub/chxsoapport.h
>> protocol/soap/pub/chxsoaphttp.h
>>
>> Image Size and Heap Use impact (Client -Only):
>> None
>>
>> Platforms and Profiles Build Verified:
>> BIF branch -> helix
>> Target(s) -> splay
>> Profile -> helix-client-all-defines
>> SYSTEM_ID -> win32-i386-vc7
>>
>> Files Attached::
>> soap.zip
>>
>> Thanks & Best Regards,
>> Gurpreet
>>
>
>
>
From gahluwalia at real.com Wed Jan 14 02:22:15 2009
From: gahluwalia at real.com (Gurpreet)
Date: Wed Jan 14 00:12:50 2009
Subject: [Protocol-dev] CR: Fix for http object returning error in case http
file system
stat call return HXR_FAIL with HX_PROGDOWNLD_UNKNOWN_FILE_SIZE.
Message-ID: <496DBCD7.7050006@real.com>
Synopsis:
Fix for handling a case where Httpfsys sends HXR_ FAIL &
HX_PROGDOWNLD_UNKNOWN_FILE_SIZE in reply to stat call when the size of
the response is not known.
Overview:
In case httpsystem fails in stat call & returns
HX_PROGDOWNLD_UNKNOWN_FILE_SIZE, Then the content length should not be
updated.
Because if content length is updated with
HX_PROGDOWNLD_UNKNOWN_FILE_SIZE, then chxhttpfileresponse::initdone
fails as there is no case for handling this.
Files Modified:
protocol/http/chxhttp.cpp
Image Size and Heap Use impact (Client -Only):
None
Platforms and Profiles Build Verified:
BIF branch -> helix
Target(s) -> splay
Profile -> helix-client-all-defines
SYSTEM_ID -> win32-i386-vc7
Files Attached::
http.txt
Thanks & Best Regards,
Gurpreet
-------------- next part --------------
Index: chxhttp.cpp
===================================================================
RCS file: /cvsroot/protocol/http/chxhttp.cpp,v
retrieving revision 1.8
diff -u -w -r1.8 chxhttp.cpp
--- chxhttp.cpp 25 Aug 2008 21:15:19 -0000 1.8
+++ chxhttp.cpp 14 Jan 2009 10:16:03 -0000
@@ -787,8 +787,10 @@
UINT32 ulMode)
{
m_pHttp->m_statResult = status;
+ if(SUCCEEDED(status))
+ {
m_pHttp->m_nContentLength = ulSize;
-
+ }
return HXR_OK;
}
From ehyche at real.com Fri Jan 16 05:41:20 2009
From: ehyche at real.com (Eric Hyche)
Date: Fri Jan 16 03:33:43 2009
Subject: [Protocol-dev] CR: Fix for http object returning error in case
http file system stat call return HXR_FAIL with
HX_PROGDOWNLD_UNKNOWN_FILE_SIZE.
In-Reply-To: <496DBCD7.7050006@real.com>
References: <496DBCD7.7050006@real.com>
Message-ID: <004701c977e0$1e917a80$5bb46f80$@com>
Looks good.
=======================================
Eric Hyche (ehyche@real.com)
Principal Engineer
RealNetworks, Inc.
>-----Original Message-----
>From: protocol-dev-bounces@helixcommunity.org [mailto:protocol-dev-bounces@helixcommunity.org] On
>Behalf Of Gurpreet
>Sent: Wednesday, January 14, 2009 5:22 AM
>To: protocol-dev@helixcommunity.org
>Subject: [Protocol-dev] CR: Fix for http object returning error in case http file system stat call
>return HXR_FAIL with HX_PROGDOWNLD_UNKNOWN_FILE_SIZE.
>
>Synopsis:
>Fix for handling a case where Httpfsys sends HXR_ FAIL & HX_PROGDOWNLD_UNKNOWN_FILE_SIZE in reply to
>stat call when the size of the response is not known.
>
>Overview:
>In case httpsystem fails in stat call & returns HX_PROGDOWNLD_UNKNOWN_FILE_SIZE, Then the content
>length should not be updated.
>Because if content length is updated with HX_PROGDOWNLD_UNKNOWN_FILE_SIZE, then
>chxhttpfileresponse::initdone fails as there is no case for handling this.
>
>Files Modified:
>protocol/http/chxhttp.cpp
>
>Image Size and Heap Use impact (Client -Only):
>None
>
>Platforms and Profiles Build Verified:
>BIF branch -> helix
>Target(s) -> splay
>Profile -> helix-client-all-defines
>SYSTEM_ID -> win32-i386-vc7
>
>Files Attached::
>http.txt
>
>Thanks & Best Regards,
>Gurpreet
From gahluwalia at real.com Sun Jan 18 20:52:14 2009
From: gahluwalia at real.com (Gurpreet)
Date: Sun Jan 18 18:41:46 2009
Subject: [Protocol-dev] CN: Fix for http object returning error in case http
file system
stat call return HXR_FAIL with HX_PROGDOWNLD_UNKNOWN_FILE_SIZE.
In-Reply-To: <004701c977e0$1e917a80$5bb46f80$@com>
References: <496DBCD7.7050006@real.com> <004701c977e0$1e917a80$5bb46f80$@com>
Message-ID: <497406FE.10708@real.com>
Thanks Eric,
This is now checked into head.
Best Regards,
Gurpreet
Eric Hyche wrote:
> Looks good.
>
> =======================================
> Eric Hyche (ehyche@real.com)
> Principal Engineer
> RealNetworks, Inc.
>
>
>
>> -----Original Message-----
>> From: protocol-dev-bounces@helixcommunity.org [mailto:protocol-dev-bounces@helixcommunity.org] On
>> Behalf Of Gurpreet
>> Sent: Wednesday, January 14, 2009 5:22 AM
>> To: protocol-dev@helixcommunity.org
>> Subject: [Protocol-dev] CR: Fix for http object returning error in case http file system stat call
>> return HXR_FAIL with HX_PROGDOWNLD_UNKNOWN_FILE_SIZE.
>>
>> Synopsis:
>> Fix for handling a case where Httpfsys sends HXR_ FAIL & HX_PROGDOWNLD_UNKNOWN_FILE_SIZE in reply to
>> stat call when the size of the response is not known.
>>
>> Overview:
>> In case httpsystem fails in stat call & returns HX_PROGDOWNLD_UNKNOWN_FILE_SIZE, Then the content
>> length should not be updated.
>> Because if content length is updated with HX_PROGDOWNLD_UNKNOWN_FILE_SIZE, then
>> chxhttpfileresponse::initdone fails as there is no case for handling this.
>>
>> Files Modified:
>> protocol/http/chxhttp.cpp
>>
>> Image Size and Heap Use impact (Client -Only):
>> None
>>
>> Platforms and Profiles Build Verified:
>> BIF branch -> helix
>> Target(s) -> splay
>> Profile -> helix-client-all-defines
>> SYSTEM_ID -> win32-i386-vc7
>>
>> Files Attached::
>> http.txt
>>
>> Thanks & Best Regards,
>> Gurpreet
>>
>
>
>
From xiaolin.lliu at nokia.com Fri Jan 23 14:06:28 2009
From: xiaolin.lliu at nokia.com (xiaolin.lliu@nokia.com)
Date: Fri Jan 23 11:53:43 2009
Subject: [Protocol-dev] RTSP proxy is used for WLAN streaming
Message-ID:
Hello,
Helix has a single proxy setting that applies to all connection bearers. If a proxy has been set for 3G and the user wishes to use WLAN, then the user must disable the proxy.
If a user wishes to use WLAN without the proxy, but witout manully disabling the proxy, how should Helix handle it?
Thanks !
Xiaolin
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.helixcommunity.org/pipermail/protocol-dev/attachments/20090123/f5a882a1/attachment.html
From jgordon at real.com Wed Jan 28 17:06:33 2009
From: jgordon at real.com (Jamie Gordon)
Date: Wed Jan 28 14:50:51 2009
Subject: [Protocol-dev] CR: RTPInfoSync various updates
Message-ID: <49810119.7010708@real.com>
Synopsis
========
Updates RTPInfoSync to calculations and choose earliest
relative timestamped packet as the sync packet rather than
first received.
Branches: SERVER_12_1, HEAD (SERVER_CURRENT)
Suggested Reviewer: jzeng or ckarusala
Description
===========
Updates to use precise calculations with Timeval etc., mostly
the same as previously done in FCS handling. Fixes some issues
relating to casting and rollover and timestamp precision loss.
Wait for a packet on every stream and choose the earliest relative
time to sync to rather than just using the first packet received.
We will only check the first packet on each stream, so re-ordering
needs to happen earlier and if the datatype has out-of ordered
timestamps that can tough noogies the receiver needs
to handle that case.
Files Affected
==============
protocol/transport/rtp/rtpinfosync.cpp
protocol/transport/rtp/include/rtpinfosync.h
Testing Performed
=================
Unit Tests:
Integration Tests:
Verify numerous RTP live streams
Leak Tests:
None
Performance Tests:
None
Platforms Tested: win32-i386-vc7
Build verified: win32-i386-vc7; linux-rhel4-i686 and
sunos-5.10-sparc-server in progress
QA Hints
===============
n/a
-------------- next part --------------
Index: protocol/transport/rtp/rtpinfosync.cpp
===================================================================
RCS file: /cvsroot/protocol/transport/rtp/rtpinfosync.cpp,v
retrieving revision 1.8.36.2
diff -u -w -r1.8.36.2 rtpinfosync.cpp
--- protocol/transport/rtp/rtpinfosync.cpp 5 Jan 2009 21:02:39 -0000 1.8.36.2
+++ protocol/transport/rtp/rtpinfosync.cpp 28 Jan 2009 22:29:18 -0000
@@ -55,7 +55,7 @@
#include "bufnum.h"
#include "ntptime.h"
-
+#include "tscalc.h"
#include "hxtick.h"
#include "rtppkt.h"
#include "rtpwrap.h"
@@ -87,25 +87,30 @@
RTPInfoSynchData::RTPInfoSynchData() :
m_bHasSR (FALSE),
- m_lRTPtoNTPOffset (0),
- m_ulRTPInfoTime (0),
- m_bSynched (FALSE),
- m_pTSConverter (NULL)
+ m_bHasPacket(FALSE),
+ m_ntpTimeFromSR(0, 0),
+ m_ulRTPTimeFromSR(0),
+ m_ulRTPPacketTime(0),
+ m_ulRTPStartTime(0),
+ m_ulRTPFrequency(1000)
{
}
RTPInfoSynchData::~RTPInfoSynchData()
{
- HX_DELETE(m_pTSConverter);
}
void
RTPInfoSynchData::Reset()
{
m_bHasSR = FALSE;
- m_bSynched = FALSE;
- m_lRTPtoNTPOffset = 0;
- m_ulRTPInfoTime = 0;
+ m_bHasPacket = FALSE;
+ m_ntpTimeFromSR.m_ulSecond = 0;
+ m_ntpTimeFromSR.m_ulFraction = 0;
+ m_ulRTPTimeFromSR = 0;
+ m_ulRTPPacketTime = 0;
+ m_ulRTPStartTime = 0;
+ m_ulRTPFrequency = 1000;
}
RTPInfoSynch::RTPInfoSynch() :
@@ -114,8 +119,10 @@
m_unStreamCount (0),
m_unSRCount (0),
m_unSynchStream (HX_INVALID_STREAM),
+ m_bNeedSyncStream (TRUE),
m_bHaveAllSRs (FALSE),
- m_bSyncPacketReceived (FALSE),
+ m_bHaveAllPackets (FALSE),
+ m_unSyncPacketsReceived (0),
m_bRTPTimesGenerated (FALSE)
{
}
@@ -153,17 +160,27 @@
}
m_unStreamCount = unStreamCount;
- m_unSynchStream = unMasterStream;
+
m_pSynchData = new RTPInfoSynchData [unStreamCount];
+ if (unMasterStream != HX_INVALID_STREAM)
+ {
+ if (unMasterStream < m_unStreamCount)
+ {
+ m_bNeedSyncStream = FALSE;
+ }
+ else
+ {
+ HX_VECTOR_DELETE(m_pSynchData);
+ return HXR_INVALID_PARAMETER;
+ }
+ }
return HXR_OK;
}
HX_RESULT
-RTPInfoSynch::SetTSConverter(CHXTimestampConverter::
- ConversionFactors conversionFactors,
- UINT16 unStream)
+RTPInfoSynch::SetTSFrequency(UINT32 ulRTPFrequency, UINT16 unStream)
{
if (!m_pSynchData)
{
@@ -175,10 +192,7 @@
return HXR_INVALID_PARAMETER;
}
- HX_DELETE(m_pSynchData [unStream].m_pTSConverter);
-
- m_pSynchData [unStream].m_pTSConverter =
- new CHXTimestampConverter(conversionFactors);
+ m_pSynchData[unStream].m_ulRTPFrequency = ulRTPFrequency;
return HXR_OK;
}
@@ -207,21 +221,34 @@
return HXR_OK;
}
- if (!m_bSyncPacketReceived &&
- (m_unSynchStream == HX_INVALID_STREAM || unStream == m_unSynchStream))
+ if (!m_pSynchData[unStream].m_bHasPacket &&
+ (m_bNeedSyncStream || unStream == m_unSynchStream))
{
- // This is our sync packet, record it
+ m_pSynchData[unStream].m_bHasPacket = TRUE;
+ m_pSynchData[unStream].m_ulRTPPacketTime = pPacket->GetRTPTime();
+ ++m_unSyncPacketsReceived;
+
+ if (m_unSynchStream == HX_INVALID_STREAM)
+ {
+ // If this is the first packet received (and no user-specified
+ // master stream) then we will start by syncing to this stream
m_unSynchStream = unStream;
- m_pSynchData[unStream].m_ulRTPInfoTime = pPacket->GetRTPTime();
- m_bSyncPacketReceived = TRUE;
}
- if (m_bSyncPacketReceived && (m_bHaveAllSRs || m_unStreamCount < 2))
+ // Wait for a packet from each stream, unless master stream is
+ // user-specified
+ if (m_unSyncPacketsReceived >= m_unStreamCount || !m_bNeedSyncStream)
+ {
+ m_bHaveAllPackets = TRUE;
+ }
+ }
+
+ if (m_bHaveAllPackets && (m_bHaveAllSRs || m_unStreamCount < 2))
{
// We have everything we need to calculate the sync offsets
CalculateSyncTimes();
}
- // else we are still waiting for SRs or a specific stream packet
+ // else we are still waiting for SRs and/or packets
return HXR_OK;
}
@@ -245,29 +272,20 @@
return HXR_OK;
}
- NTPTime rtcpNTPTime;
- UINT32 rtcpRTPTimeMSec = 0;
-
- /* Truncate NTP time to 32 bits from 64 bits to make room for expansion to milliseconds*/
- rtcpNTPTime.m_ulSecond = pPacket->ntp_sec & 0x0000ffff;
- rtcpNTPTime.m_ulFraction = pPacket->ntp_frac & 0xffff0000;
-
- rtcpRTPTimeMSec =
- (m_pSynchData[unStream].m_pTSConverter) ?
- m_pSynchData[unStream].m_pTSConverter->
- rtp2hxa_raw(pPacket->rtp_ts) : pPacket->rtp_ts;
-
- m_pSynchData [unStream].m_lRTPtoNTPOffset =
- (INT32)(rtcpNTPTime.toMSec() - rtcpRTPTimeMSec);
-
+ m_pSynchData[unStream].m_ntpTimeFromSR.m_ulSecond = pPacket->ntp_sec;
+ m_pSynchData[unStream].m_ntpTimeFromSR.m_ulFraction = pPacket->ntp_frac;
+ m_pSynchData[unStream].m_ulRTPTimeFromSR = pPacket->rtp_ts;
m_pSynchData[unStream].m_bHasSR = TRUE;
+
m_bHaveAllSRs = (++m_unSRCount >= m_unStreamCount);
- if (m_bHaveAllSRs && m_bSyncPacketReceived)
+ if (m_bHaveAllSRs && m_bHaveAllPackets)
{
// This was the last thing we needed, calculate sync times now!
CalculateSyncTimes();
}
+ // else we are still waiting for SRs and/or packets
+
return HXR_OK;
}
@@ -278,37 +296,103 @@
if (m_unStreamCount == 1)
{
- // For single-stream case we don't really need to do anything
+ // For single-stream case we just need the first packet timestamp!
+ m_pSynchData[0].m_ulRTPStartTime = m_pSynchData[0].m_ulRTPPacketTime;
return;
}
- // XXXJDG I think these conversions have some rollover issues,
- // probably should instead use the Timeval calculations used in FCS
+ UINT16 i = 0;
+ UINT16 unInitStream = m_unSynchStream;
+ Timeval tvStrmOffset;
+ Timeval tvReSyncDiff = Timeval(0, 0);
+ INT32 lPktOffset = 0;
+
+ // Get the offset from the sync stream's SR to the first
+ // packet start time (packet_time - SR_time) (can be negative)
+ // Mind the units - calculate with sync stream's RTP timestamp
+ // rollover, then convert to Timeval for proper handling with
+ // other streams
+ INT32 lRTPSROffset = DiffTimeStamp(
+ m_pSynchData[unInitStream].m_ulRTPPacketTime,
+ m_pSynchData[unInitStream].m_ulRTPTimeFromSR);
+
+ Timeval tvSyncSROffset ((double)lRTPSROffset /
+ (double)(m_pSynchData[unInitStream].m_ulRTPFrequency));
- //Convert RTP time from RTP units to milliseconds:
- UINT32 ulRTPTimeHX =
- (m_pSynchData[m_unSynchStream].m_pTSConverter) ?
- m_pSynchData[m_unSynchStream].m_pTSConverter->
- rtp2hxa_raw(m_pSynchData[m_unSynchStream].m_ulRTPInfoTime)
- : m_pSynchData[m_unSynchStream].m_ulRTPInfoTime;
-
- //Transform the RTP time from this packet to the corresponding NTP time in milliseconds:
- UINT32 NTPMasterMSec = ulRTPTimeHX + m_pSynchData[m_unSynchStream].m_lRTPtoNTPOffset;
-
- //For each stream map the master NTP time to the stream's RTP time:
- for (UINT16 i = 0; i < m_unStreamCount; i++)
- {
- if (i != m_unSynchStream)
- {
- //convert NTP to RTP using the arithmetic negation of the RTP to NTP mapping:
- UINT32 RTPMSec = NTPMasterMSec + -(m_pSynchData [i].m_lRTPtoNTPOffset);
-
- //Convert mapped RTP from milliseconds to RTP time:
- m_pSynchData[i].m_ulRTPInfoTime =
- (m_pSynchData [i].m_pTSConverter) ?
- m_pSynchData [i].m_pTSConverter->
- hxa2rtp_raw(RTPMSec)
- : RTPMSec;
+ NTPTime ntpSyncTime = m_pSynchData[unInitStream].m_ntpTimeFromSR;
+
+ m_pSynchData[unInitStream].m_ulRTPStartTime = m_pSynchData[unInitStream].m_ulRTPPacketTime;
+
+ for (i = 0; i < m_unStreamCount; i++)
+ {
+ if (i != unInitStream)
+ {
+ // Get the offset from the stream SR to the packet start time.
+ // Can be negative! But watch the NTP handling, as NTP
+ // is unsigned
+ // This is SyncSROffset - (StreamSR - SyncSR)
+ tvStrmOffset = tvSyncSROffset;
+ if (m_pSynchData[i].m_ntpTimeFromSR >= ntpSyncTime)
+ {
+ tvStrmOffset -=
+ (m_pSynchData[i].m_ntpTimeFromSR - ntpSyncTime).toTimeval();
+ }
+ else
+ {
+ tvStrmOffset +=
+ (ntpSyncTime - m_pSynchData[i].m_ntpTimeFromSR).toTimeval();
+ }
+
+ // and now add this to the SR's RTP time (converted) to
+ // get the (raw) stream time at the sync packet time
+ tvStrmOffset += (Timeval)(m_pSynchData[i].m_ulRTPTimeFromSR /
+ (double)(m_pSynchData[i].m_ulRTPFrequency));
+
+ // and convert back to RTP TS units
+ m_pSynchData[i].m_ulRTPStartTime = ConvertToTimestamp(tvStrmOffset,
+ (INT32)(m_pSynchData[i].m_ulRTPFrequency));
+
+ // Check if the first packet's time is earlier than start time;
+ // If so, then we'll need to re-adjust offsets
+ if (m_bNeedSyncStream)
+ {
+ lPktOffset = DiffTimeStamp(m_pSynchData[i].m_ulRTPPacketTime,
+ m_pSynchData[i].m_ulRTPStartTime);
+
+ if (lPktOffset < 0)
+ {
+ // and check if this is the earliest one
+ tvStrmOffset = (Timeval)((double)lPktOffset /
+ (double)(m_pSynchData[i].m_ulRTPFrequency));
+
+ if (tvStrmOffset > tvReSyncDiff)
+ {
+ tvReSyncDiff = tvStrmOffset;
+ m_unSynchStream = i;
+ }
+ }
+ }
+ }
+ }
+
+ // Do we need to re-adjust our sync start point?
+ if (m_bNeedSyncStream && m_unSynchStream != unInitStream)
+ {
+ UINT32 ulRTPDiff;
+ for (i = 0; i < m_unStreamCount; i++)
+ {
+ if (i == m_unSynchStream)
+ {
+ m_pSynchData[i].m_ulRTPStartTime =
+ m_pSynchData[i].m_ulRTPPacketTime;
+ }
+ else
+ {
+ ulRTPDiff = ConvertToTimestamp(tvReSyncDiff,
+ (INT32)(m_pSynchData[i].m_ulRTPFrequency));
+
+ m_pSynchData[i].m_ulRTPStartTime += ulRTPDiff;
+ }
}
}
}
@@ -320,7 +404,7 @@
{
if (m_bRTPTimesGenerated)
{
- ulStartTime = m_pSynchData[unStream].m_ulRTPInfoTime;
+ ulStartTime = m_pSynchData[unStream].m_ulRTPStartTime;
return HXR_OK;
}
@@ -334,8 +418,9 @@
RTPInfoSynch::Done ()
{
m_bHaveAllSRs = FALSE;
+ m_bHaveAllPackets = FALSE;
m_unSRCount = 0;
- m_bSyncPacketReceived = FALSE;
+ m_unSyncPacketsReceived = 0;
m_bRTPTimesGenerated = FALSE;
HX_VECTOR_DELETE(m_pSynchData);
Index: protocol/transport/rtp/include/rtpinfosync.h
===================================================================
RCS file: /cvsroot/protocol/transport/rtp/include/rtpinfosync.h,v
retrieving revision 1.3.40.1
diff -u -w -r1.3.40.1 rtpinfosync.h
--- protocol/transport/rtp/include/rtpinfosync.h 5 Jan 2009 21:02:40 -0000 1.3.40.1
+++ protocol/transport/rtp/include/rtpinfosync.h 28 Jan 2009 22:29:18 -0000
@@ -53,11 +53,12 @@
void Reset();
HXBOOL m_bHasSR;
- INT32 m_lRTPtoNTPOffset; //units: msec ; additive conversion from RTP to NTP for this stream
- UINT32 m_ulRTPInfoTime; //units: rtp time ; time to be placed in rtp info field
- HXBOOL m_bSynched;
-
- CHXTimestampConverter* m_pTSConverter;
+ HXBOOL m_bHasPacket;
+ NTPTime m_ntpTimeFromSR;
+ UINT32 m_ulRTPTimeFromSR;
+ UINT32 m_ulRTPPacketTime;
+ UINT32 m_ulRTPStartTime; // units: rtp time
+ UINT32 m_ulRTPFrequency; // RTP timestamp frequency (per second)
};
@@ -70,12 +71,9 @@
ULONG32 AddRef();
ULONG32 Release();
-
HX_RESULT InitSynch(UINT16 unStreamCount,
UINT16 unMasterStream = HX_INVALID_STREAM);
- HX_RESULT SetTSConverter(CHXTimestampConverter::ConversionFactors
- conversionFactors,
- UINT16 unStream);
+ HX_RESULT SetTSFrequency(UINT32 ulRTPFrequency, UINT16 unStream);
HX_RESULT Done();
HX_RESULT OnRTPPacket (IHXRTPPacket* pPacket);
@@ -90,8 +88,10 @@
UINT16 m_unStreamCount;
UINT16 m_unSRCount;
UINT16 m_unSynchStream;
+ HXBOOL m_bNeedSyncStream;
HXBOOL m_bHaveAllSRs;
- HXBOOL m_bSyncPacketReceived;
+ HXBOOL m_bHaveAllPackets;
+ UINT16 m_unSyncPacketsReceived;
HXBOOL m_bRTPTimesGenerated;
void CalculateSyncTimes();
From jzeng at real.com Thu Jan 29 13:58:59 2009
From: jzeng at real.com (JJ Zeng)
Date: Thu Jan 29 11:42:58 2009
Subject: [Protocol-dev] RE: RTPInfoSync various updates
In-Reply-To: <49810119.7010708@real.com>
References: <49810119.7010708@real.com>
Message-ID: <091701c9825c$ca42d730$5b1617ac@dev.prognet.com>
Looks good.
As we discussed, " m_unSynchStream = unMasterStream;" need to be moved into
the if block.
>-----Original Message-----
>From: Jamie Gordon [mailto:jgordon@real.com]
>Sent: Wednesday, January 28, 2009 5:07 PM
>To: Server Dev; protocol-dev@helixcommunity.org
>Subject: CR: RTPInfoSync various updates
>
>Synopsis
>========
>Updates RTPInfoSync to calculations and choose earliest
>relative timestamped packet as the sync packet rather than
>first received.
>
>Branches: SERVER_12_1, HEAD (SERVER_CURRENT)
>Suggested Reviewer: jzeng or ckarusala
>
>
>Description
>===========
>Updates to use precise calculations with Timeval etc., mostly
>the same as previously done in FCS handling. Fixes some issues
>relating to casting and rollover and timestamp precision loss.
>
>Wait for a packet on every stream and choose the earliest relative
>time to sync to rather than just using the first packet received.
>We will only check the first packet on each stream, so re-ordering
>needs to happen earlier and if the datatype has out-of ordered
>timestamps that can tough noogies the receiver needs
>to handle that case.
>
>
>Files Affected
>==============
>protocol/transport/rtp/rtpinfosync.cpp
>protocol/transport/rtp/include/rtpinfosync.h
>
>
>Testing Performed
>=================
>Unit Tests:
>
>Integration Tests:
>Verify numerous RTP live streams
>
>Leak Tests:
>None
>
>Performance Tests:
>None
>
>Platforms Tested: win32-i386-vc7
>Build verified: win32-i386-vc7; linux-rhel4-i686 and
>sunos-5.10-sparc-server in progress
>
>
>
>QA Hints
>===============
>
>n/a
>
>
>
From jgordon at real.com Thu Jan 29 15:38:57 2009
From: jgordon at real.com (Jamie Gordon)
Date: Thu Jan 29 13:22:57 2009
Subject: [Protocol-dev] CR: RTPInfoSync various updates
Message-ID: <49823E11.2000905@real.com>
Synopsis
========
Updates RTPInfoSync to calculations and choose earliest
relative timestamped packet as the sync packet rather than
first received.
Branches: SERVER_12_1, HEAD (SERVER_CURRENT)
Reviewer: jzeng
Description
===========
Updates to use precise calculations with Timeval etc., mostly
the same as previously done in FCS handling. Fixes some issues
relating to casting and rollover and timestamp precision loss.
Wait for a packet on every stream and choose the earliest relative
time to sync to rather than just using the first packet received.
We will only check the first packet on each stream, so re-ordering
needs to happen earlier and if the datatype has out-of ordered
timestamps that can tough noogies the receiver needs
to handle that case.
Files Affected
==============
protocol/transport/rtp/rtpinfosync.cpp
protocol/transport/rtp/include/rtpinfosync.h
Testing Performed
=================
Unit Tests:
Integration Tests:
Verify numerous RTP live streams
Leak Tests:
None
Performance Tests:
None
Platforms Tested: win32-i386-vc7
Build verified: win32-i386-vc7, linux-rhel4-i686,
sunos-5.10-sparc-server in progress
QA Hints
===============
n/a
From jgordon at real.com Thu Jan 29 15:39:42 2009
From: jgordon at real.com (Jamie Gordon)
Date: Thu Jan 29 13:28:39 2009
Subject: [Protocol-dev] Checkin: RTPInfoSync various updates
Message-ID: <49823E3E.9070801@real.com>
Synopsis
========
Updates RTPInfoSync to calculations and choose earliest
relative timestamped packet as the sync packet rather than
first received.
Branches: SERVER_12_1, HEAD (SERVER_CURRENT)
Reviewer: jzeng
Description
===========
Updates to use precise calculations with Timeval etc., mostly
the same as previously done in FCS handling. Fixes some issues
relating to casting and rollover and timestamp precision loss.
Wait for a packet on every stream and choose the earliest relative
time to sync to rather than just using the first packet received.
We will only check the first packet on each stream, so re-ordering
needs to happen earlier and if the datatype has out-of ordered
timestamps that can tough noogies the receiver needs
to handle that case.
Files Affected
==============
protocol/transport/rtp/rtpinfosync.cpp
protocol/transport/rtp/include/rtpinfosync.h
Testing Performed
=================
Unit Tests:
Integration Tests:
Verify numerous RTP live streams
Leak Tests:
None
Performance Tests:
None
Platforms Tested: win32-i386-vc7
Build verified: win32-i386-vc7, linux-rhel4-i686,
sunos-5.10-sparc-server in progress
QA Hints
===============
n/a
Copyright © 1995-2007 RealNetworks, Inc. All rights reserved.
RealNetworks and Helix are trademarks of RealNetworks.
All other trademarks or registered trademarks are the property of their respective holders.