[prev in list] [next in list] [prev in thread] [next in thread] 

List:       helix-server-cvs
Subject:    [Server-cvs] protocol/transport/rdt rdt_base.cpp, 1.13,
From:       jzeng () helixcommunity ! org
Date:       2011-01-29 0:39:26
Message-ID: 201101290039.p0T0dDlO010629 () mailer ! progressive-comp ! com
[Download RAW message or body]

Update of /cvsroot/server/protocol/transport/rdt
In directory cvs01.internal.helixcommunity.org:/tmp/cvs-serv10309/server/protocol/transport/rdt

Modified Files:
	rdt_base.cpp rdt_tcp.cpp rdt_udp.cpp 
Log Message:
Synopsis
============
Bug 269174: With RDT, content plays with only video and no audio with slta uptime of
around 1-2 days
Branches:  head, server_14_2
Suggested Reviewer: Chytanya

Description
===========
The problem is that we convert rtp time into rdt timestamp.  When the rtp time roll over the 4g
limit, the conversion is not correct anymore.

The fix the to use media time if it is presented.

But there is still a player bug.  for live 3gp content, when the rdt timestamp is larger than 30000
seconds, the player(at least my player) won't show the video while audio is playing okay.  Realmedia
clips have no such issue.

I verify this player bug by manipulating the ts on the server.  When I add 20000 seconds to the rdt
ts, the video plays.  But if I added 30000 seconds, the video won't play.

So in the end we decided to start the ts from 0 if it is greater than 20000 seconds.



Files Affected
==============
protocol/transport/common/system/rtsptran.cpp,v
protocol/transport/common/system/pub/rtsptran.h,v
server/protocol/transport/rdt/rdt_tcp.cpp,v
server/protocol/transport/rdt/rdt_udp.cpp,v

Testing Performed
=================

Unit Tests:
None.

Integration Tests:
verify the live content play over udp/tcp.

Leak Tests:
None.

Performance Tests:
- None

Platforms Tested: win-x86_64-vc10
Build verified: win-x86_64-vc10



Index: rdt_udp.cpp
===================================================================
RCS file: /cvsroot/server/protocol/transport/rdt/rdt_udp.cpp,v
retrieving revision 1.14
retrieving revision 1.15
diff -u -d -r1.14 -r1.15
--- rdt_udp.cpp	2 Nov 2010 20:58:05 -0000	1.14
+++ rdt_udp.cpp	29 Jan 2011 00:39:24 -0000	1.15
@@ -590,6 +590,25 @@
      */
     if (pStreamData->m_bFirstPacket)
     {
+        IHXServerPacketExt* pExt = NULL;
+        if(pPacket->QueryInterface(IID_IHXServerPacketExt, (void**)&pExt) == HXR_OK)
+        {
+            UINT32 ts = pExt->GetMilliSecondTS();
+            if(ts > 0)
+            {
+                //the magic number 20000000 here is to workaround a client bug: when
+                //ts > 20000 seconds, the client won't display the video of h264 content.
+                if(m_ulMediaTimeStart == 0 && ts > 20000000)
+                {
+                    m_ulMediaTimeStart = ts;
+                }
+                pStreamData->m_bUsesServerPacketExt = TRUE;
+            }
+            pExt->Release();
+        }
+
+        if(!pStreamData->m_bUsesServerPacketExt)
+        {
         IHXRTPPacket* pRTPPacket = NULL;
         pStreamData->m_bUsesRTPPackets = (pPacket->QueryInterface(
                                             IID_IHXRTPPacket,
@@ -606,6 +625,7 @@
             }
         }
         HX_RELEASE(pRTPPacket);
+        }
         pStreamData->m_bFirstPacket = FALSE;
     }
 
@@ -673,7 +693,20 @@
      *  Timestamp: use rtp timestamp as presentation
      *  timestamp, if available.
      */
-    if ((pStreamData->m_bUsesRTPPackets) && (pStreamData->m_pTSConverter))
+    if(pStreamData->m_bUsesServerPacketExt)
+    {
+        UINT32 ulMediaTime = ((IHXServerPacketExt*)pPacket)->GetMilliSecondTS();
+        if(ulMediaTime >= m_ulMediaTimeStart)
+        {
+            ulMediaTime -= m_ulMediaTimeStart;
+        }
+        else
+        {
+            ulMediaTime = 0;
+        }
+        pkt.timestamp = pStreamData->m_lastTimestamp = ulMediaTime;
+    }
+    else if ((pStreamData->m_bUsesRTPPackets) && (pStreamData->m_pTSConverter))
     {
         pkt.timestamp = pStreamData->m_lastTimestamp = pStreamData->m_pTSConverter->
           rtp2hxa( ((IHXRTPPacket*) pPacket)->GetRTPTime() );

Index: rdt_tcp.cpp
===================================================================
RCS file: /cvsroot/server/protocol/transport/rdt/rdt_tcp.cpp,v
retrieving revision 1.15
retrieving revision 1.16
diff -u -d -r1.15 -r1.16
--- rdt_tcp.cpp	27 Mar 2008 23:08:50 -0000	1.15
+++ rdt_tcp.cpp	29 Jan 2011 00:39:24 -0000	1.16
@@ -342,6 +342,25 @@
      */
     if (pStreamData->m_bFirstPacket)
     {
+        IHXServerPacketExt* pExt = NULL;
+        if(pPacket->QueryInterface(IID_IHXServerPacketExt, (void**)&pExt) == HXR_OK)
+        {
+            UINT32 ts = pExt->GetMilliSecondTS();
+            if(ts > 0)
+            {
+                //the magic number 20000000 here is to workaround a client bug: when
+                //ts > 20000 seconds, the client won't display the video of h264 content.
+                if(m_ulMediaTimeStart == 0 && ts > 20000000)
+                {
+                    m_ulMediaTimeStart = ts;
+                }
+                pStreamData->m_bUsesServerPacketExt = TRUE;
+            }
+            pExt->Release();
+        }
+
+        if(!pStreamData->m_bUsesServerPacketExt)
+        {
         IHXRTPPacket* pRTPPacket = NULL;
         pStreamData->m_bUsesRTPPackets = (pPacket->QueryInterface(
                                             IID_IHXRTPPacket,
@@ -356,6 +375,7 @@
             }
         }
         HX_RELEASE(pRTPPacket);
+        }
         pStreamData->m_bFirstPacket = FALSE;
     }
 
@@ -443,7 +463,20 @@
      *  Timestamp: use rtp timestamp as presentation
      *  timestamp, if available.
      */
-    if ((pStreamData->m_bUsesRTPPackets) && (pStreamData->m_pTSConverter))
+    if(pStreamData->m_bUsesServerPacketExt)
+    {
+        UINT32 ulMediaTime = ((IHXServerPacketExt*)pPacket)->GetMilliSecondTS();
+        if(ulMediaTime >= m_ulMediaTimeStart)
+        {
+            ulMediaTime -= m_ulMediaTimeStart;
+        }
+        else
+        {
+            ulMediaTime = 0;
+        }
+        pkt.timestamp = pStreamData->m_lastTimestamp = ulMediaTime;
+    }
+    else if ((pStreamData->m_bUsesRTPPackets) && (pStreamData->m_pTSConverter))
     {
         pkt.timestamp = pStreamData->m_lastTimestamp = pStreamData->m_pTSConverter->
           rtp2hxa( ((IHXRTPPacket*) pPacket)->GetRTPTime() );

Index: rdt_base.cpp
===================================================================
RCS file: /cvsroot/server/protocol/transport/rdt/rdt_base.cpp,v
retrieving revision 1.13
retrieving revision 1.14
diff -u -d -r1.13 -r1.14
--- rdt_base.cpp	2 Nov 2010 20:58:05 -0000	1.13
+++ rdt_base.cpp	29 Jan 2011 00:39:24 -0000	1.14
@@ -130,6 +130,7 @@
     , m_pSocket(NULL)
     , m_bUseExtPkts(FALSE)
     , m_ulRDTSessionID(0)
+    , m_ulMediaTimeStart(0)
 {
     m_pPacketQueue = new ServerPacket*[PACKET_QUEUE_SIZE];
 


_______________________________________________
Server-cvs mailing list
Server-cvs@helixcommunity.org
http://lists.helixcommunity.org/mailman/listinfo/server-cvs
[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic