[prev in list] [next in list] [prev in thread] [next in thread]
List: helix-protocol-cvs
Subject: [Protocol-cvs] transport/common/system rtsptran.cpp, 1.52,
From: milko () helixcommunity ! org
Date: 2007-01-11 21:19:44
Message-ID: 200701112120.l0BLKce7022554 () dombackupmx1 ! xen ! 10east ! com
[Download RAW message or body]
Update of /cvsroot/protocol/transport/common/system
In directory cvs01.internal.helixcommunity.org:/tmp/cvs-serv14780/common/system
Modified Files:
rtsptran.cpp transbuf.cpp
Log Message:
Overview:
This check-in provides tools for deterministic testing of time-stamp wrap-around \
issues of live streams and corrects few issues discovered via such tools.
1.) The live stream testing tool:
The tools provided in this check-in allow testing of time-stamp wrap-around \
handling of live streams starting with source object and in all other down-stream \
objects (renderer, audio stream, audio player, audio session, audio device, site, \
surface).
2.) Fixes for live-stream timestamp wrap-around.
One test revelead few errors in time-stamp wrap-around handling that required \
modfications:
- Audio stream time-stamp mapping code (specific to RealAudio streams) use to \
correct files produced with inaccurate ressampling was causing constant-rebuffering \
after time-stamp wrap around due to failure to properly map the time-stamp. Mapping \
failure resulted in time line in up-stream player objects to halt. The mapping \
failure was caused by improper computation of 64 bit time-stamps in the mapping code \
by using time-stamp wrap around counter from the future (beginning of audio stream) \
at the time of audio mixing (end of audio stream). The issues was corrected by \
eliminating the use of 64 bit time-stamps in the mapping code since it is \
unnecessary.
- Corrected HXSource::CalcEventTime which attempted to clip event times against \
m_ulFirstPacketTime for live streams. This code is conceptually wrong and simply \
does not work in general. The code was simplified and rid of special case clipping \
logic.
- Corrected RealVideo depacketizer logic which handles incorrectly produced content \
missing the proper time-stamp size field setting (14 or 30 bits). The detection of \
such scenario was based on comparison of packet (32bit) and frame (14 or 30bit) \
time-stamps. The logic failed to discrad the upper 2 bits from the packet time-stamp \
thus possibly producing wrong conclusions for time-stamps > 30bits.
- Time-stamp wrap-around caused improper water-mark based rate throttling. The \
cause was inadequate implementation of IHXSourceBufferingStats::GetCurrentBuffering \
method in the transport buffer which did not continue to return the proper lowest and \
highest 64bit time-stamps after the wrap-around. While the relationship between the \
returned lowest and highest time-stamp was correct for a particular stream, the \
relationship to other stream was not guaranteed thus causing higher level code to \
establish incorrect time ranges on wrap-around condition.
- RealMedia file format and dtdriver framework halted on encounter with 0xFFFFFFFF \
time-stamp due to assumption made in the lowest time-stamp search algorithm that \
0xFFFFFFFF time-stamp is larger than any encountered time-stamp. This was true for \
the most part until the containment of live streams was introduced.
Other modification include addition of logging statements and eliminationn od \
circular QI in dtdriver framework.
Index: transbuf.cpp
===================================================================
RCS file: /cvsroot/protocol/transport/common/system/transbuf.cpp,v
retrieving revision 1.34
retrieving revision 1.35
diff -u -d -r1.34 -r1.35
--- transbuf.cpp 8 Jan 2007 17:36:04 -0000 1.34
+++ transbuf.cpp 11 Jan 2007 21:19:42 -0000 1.35
@@ -1857,16 +1857,16 @@
}
HX_RESULT
-RTSPTransportBuffer::GetCurrentBuffering(INT64& llLowestTimestamp,
- INT64& llHighestTimestamp,
+RTSPTransportBuffer::GetCurrentBuffering(UINT32& ulLowestTimestamp,
+ UINT32& ulHighestTimestamp,
UINT32& ulNumBytes,
- HXBOOL& bDone)
+ HXBOOL& bDone)
{
UINT32 ulFrontTimeStamp = 0;
UINT32 ulRearTimeStamp = 0;
- llLowestTimestamp = 0;
- llHighestTimestamp = 0;
+ ulLowestTimestamp = 0;
+ ulHighestTimestamp = 0;
ulNumBytes = 0;
bDone = m_bIsEnded;
@@ -1897,17 +1897,8 @@
goto cleanup;
}
- llLowestTimestamp = CAST_TO_INT64 ulFrontTimeStamp;
-
- if (ulFrontTimeStamp > ulRearTimeStamp &&
- ((ulFrontTimeStamp - ulRearTimeStamp) > MAX_TIMESTAMP_GAP))
- {
- llHighestTimestamp = CAST_TO_INT64 MAX_UINT32 + CAST_TO_INT64 \
ulRearTimeStamp;
- }
- else
- {
- llHighestTimestamp = CAST_TO_INT64 ulRearTimeStamp;
- }
+ ulLowestTimestamp = ulFrontTimeStamp;
+ ulHighestTimestamp = ulRearTimeStamp;
ulNumBytes = m_ulCurrentQueueByteCount + m_ulCurrentCacheByteCount;
}
@@ -2311,19 +2302,19 @@
UINT32& ulHighestTimestamp,
UINT32& ulBytesBuffered)
{
- INT64 llLowTS;
- INT64 llHighTS;
+ UINT32 ulLowTS;
+ UINT32 ulHighTS;
HXBOOL bDone;
- HX_RESULT res = GetCurrentBuffering(llLowTS, llHighTS,
+ HX_RESULT res = GetCurrentBuffering(ulLowTS, ulHighTS,
ulBytesBuffered, bDone);
if (HXR_OK == res)
{
if (ulBytesBuffered)
{
- ulLowestTimestamp = INT64_TO_UINT32(llLowTS);
- ulHighestTimestamp= INT64_TO_UINT32(llHighTS);
+ ulLowestTimestamp = ulLowTS;
+ ulHighestTimestamp = ulHighTS;
}
else
{
Index: rtsptran.cpp
===================================================================
RCS file: /cvsroot/protocol/transport/common/system/rtsptran.cpp,v
retrieving revision 1.52
retrieving revision 1.53
diff -u -d -r1.52 -r1.53
--- rtsptran.cpp 16 Nov 2006 22:30:58 -0000 1.52
+++ rtsptran.cpp 11 Jan 2007 21:19:42 -0000 1.53
@@ -1419,11 +1419,11 @@
}
HX_RESULT
-RTSPTransport::GetCurrentBuffering(UINT16 uStreamNumber,
- INT64& llLowestTimestamp,
- INT64& llHighestTimestamp,
+RTSPTransport::GetCurrentBuffering(UINT16 uStreamNumber,
+ UINT32& ulLowestTimestamp,
+ UINT32& ulHighestTimestamp,
UINT32& ulNumBytes,
- HXBOOL& bDone)
+ HXBOOL& bDone)
{
if (!m_pStreamHandler)
{
@@ -1438,8 +1438,8 @@
return pStreamData ?
pStreamData->m_pTransportBuffer->GetCurrentBuffering(
- llLowestTimestamp,
- llHighestTimestamp,
+ ulLowestTimestamp,
+ ulHighestTimestamp,
ulNumBytes,
bDone) : HXR_OK;
}
@@ -1771,17 +1771,17 @@
if (m_pSrcBufferStats)
{
- INT64 llLowestTimeStamp;
- INT64 llHighestTimeStamp;
+ UINT32 ulLowestTimeStamp;
+ UINT32 ulHighestTimeStamp;
UINT32 ulNumberOfBytes;
HXBOOL bDone;
HX_RESULT hxr = \
m_pSrcBufferStats->GetTotalBuffering(pStreamData->m_streamNumber,
- llLowestTimeStamp, llHighestTimeStamp, ulNumberOfBytes, \
bDone); + ulLowestTimeStamp, ulHighestTimeStamp, \
ulNumberOfBytes, bDone);
if (SUCCEEDED(hxr))
{
- \
pStreamStats->m_pFirstTimestamp->SetInt(INT64_TO_INT32(llLowestTimeStamp));
- \
pStreamStats->m_pLastTimestamp->SetInt(INT64_TO_INT32(llHighestTimeStamp)); + \
pStreamStats->m_pFirstTimestamp->SetInt(ulLowestTimeStamp); + \
pStreamStats->m_pLastTimestamp->SetInt(ulHighestTimeStamp);
\
pStreamStats->m_pFilledBufferSize->SetInt((INT32)ulNumberOfBytes); }
}
@@ -2010,7 +2010,7 @@
pContext->QueryInterface(IID_IHXPlayerState,
(void**)&m_pPlayerState);
- pContext->QueryInterface(IID_IHXSourceBufferingStats2,
+ pContext->QueryInterface(IID_IHXSourceBufferingStats3,
(void**)&m_pSrcBufferStats);
pContext->QueryInterface(IID_IHXSourceLatencyStats,
_______________________________________________
Protocol-cvs mailing list
Protocol-cvs@helixcommunity.org
http://lists.helixcommunity.org/mailman/listinfo/protocol-cvs
[prev in list] [next in list] [prev in thread] [next in thread]
Configure |
About |
News |
Add a list |
Sponsored by KoreLogic