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

List:       helix-server-cvs
Subject:    [Server-cvs] common/util pktqmgr.cpp,1.8,1.9
From:       mingda () helixcommunity ! org
Date:       2011-10-27 2:08:05
[Download RAW message or body]

Update of /cvsroot/server/common/util
In directory cvs01.internal.helixcommunity.org:/tmp/cvs-serv21171

Modified Files:
	pktqmgr.cpp 
Log Message:
Synopsis
========
RTP Live - A/V Sync error message too generic

Branch : HEAD
Reviewed by : Chytanya

Description:
==========
When the A/V drift is too large and the stream should be dropped, print the queue \
size and queue depth for every streams of the feed. When the A/V drift reaches the \
half of the maximum acceptable value, print the queue size and queue depth of the \
current stream as a warning.


Files affected:
=========
server/common/util/pktqmgr.cpp
server/common/util/pub/pktqmgr.h


Testing Performed:
================
Unit Tests: 
1) start rmserver and wait for the A/V drift occurs.
2) the following error messages should be in the rmerror.log:


19-Oct-2011 16:01:01.870 tmplgpln(7844): RTPLive: live.sdp: Live session is invalid \
or has excessive A/V sync drift. Current stream No 0: queue size: 341,  queue depth: \
7168.  Other Stream No 1: queue size: 0, queue Depth: 0.

      19-Oct-2011 16:01:01.871 tmplgpln(7844): RTPLive: live.sdp: Presentation \
                deactivated
      19-Oct-2011 16:01:04.511 tmplgpln(7844): RTPLive: live.sdp: Presentation active
      19-Oct-2011 16:01:47.092 tmplgpln(7844): RTPLive: live.sdp: Warning: A/V drift \
reaches the half of the queue size or queue depth. Current stream No: 0, Queue size \
is: 154. Queue Depth is: 3233  19-Oct-2011 16:01:51.660 tmplgpln(7844): RTPLive: \
live.sdp: Warning: A/V drift reaches the half of the queue size or queue depth. \
Current stream No: 0, Queue size is: 175. Queue Depth is: 3603  19-Oct-2011 \
16:01:51.726 tmplgpln(7844): RTPLive: live.sdp: Warning: A/V drift reaches the half \
of the queue size or queue depth. Current stream No: 0, Queue size is: 243. Queue \
Depth is: 4768  19-Oct-2011 16:01:51.792 tmplgpln(7844): RTPLive: live.sdp: Warning: \
A/V drift reaches the half of the queue size or queue depth. Current stream No: 0, \
Queue size is: 244. Queue Depth is: 4768

      Leak Tests: None
      Performance Tests: N/A

      Platforms Tested: linux-rhel5-x86_64

      QA Hints
      ========
      None.



Index: pktqmgr.cpp
===================================================================
RCS file: /cvsroot/server/common/util/pktqmgr.cpp,v
retrieving revision 1.8
retrieving revision 1.9
diff -u -d -r1.8 -r1.9
--- pktqmgr.cpp	21 May 2010 18:04:50 -0000	1.8
+++ pktqmgr.cpp	27 Oct 2011 02:08:02 -0000	1.9
@@ -52,6 +52,8 @@
 #include "ihxpckts.h"
 #include "hxmon.h"
 #include "hxerror.h"
+#include "hxstring.h"
+#include "hxstrutl.h"
 
 #include "tscalc.h"
 
@@ -344,10 +346,35 @@
 #endif /* PACKET_BUFFER_DEBUG */
 
         ClearCallback();
+        CHXString szMsg;
+        szMsg.AppendFormat("Live session is invalid or has excessive A/V sync drift. \
Current stream No %lu: queue size: %lu,  queue depth: %lu.\n", +                      \
unInStream, pStream->GetQueueSize(), pStream->GetQueueDepth()); +
+        UINT16 unStreamNo;
+        for(unStreamNo = 0; unStreamNo < m_unNumStreams; unStreamNo++)
+        {
+            if(unStreamNo != unInStream)
+            {
+                StreamQueueInfo* pOtherQueueInfo = m_ppQueueInfo[unStreamNo];
+                CLivePacketQueue* pOtherStream = pOtherQueueInfo->pQueue;
+                HX_ASSERT(pOtherStream);
+                szMsg.AppendFormat("      Other Stream No %lu: queue size: %lu, \
queue Depth: %lu.\n", unStreamNo, pOtherStream->GetQueueSize(), \
pOtherStream->GetQueueDepth()); +            }
+        }
+
         m_pSession->OnError(HXLOG_WARNING, HXR_FAIL,
-                "Live session is invalid or has excessive A/V sync drift.");
+                szMsg);
         m_pSession->StopReceiving();
         return HXR_OK;
+    }//log a warning message if it hits the half queue size or queue depth
+    else if(pStream->GetQueueSize() > m_ulMaxQueueSize*QUEUE_WARNING_RATIO ||
+            pStream->GetQueueDepth() > m_ulMaxDepth*QUEUE_WARNING_RATIO)
+    {
+        NEW_FAST_TEMP_STR(pMsg, 256, 256);
+        sprintf(pMsg, "Warning: A/V drift reaches the half of the queue size or \
queue depth. Current stream No: %lu, Queue size is: %lu. Queue Depth is: %lu",  +     \
unInStream, pStream->GetQueueSize(), pStream->GetQueueDepth()); +        \
m_pSession->OnError(HXLOG_WARNING, HXR_IGNORE, pMsg); +        \
DELETE_FAST_TEMP_STR(pMsg);  }
 
     IHXPacket* pNext = pStream->PeekHead();


_______________________________________________
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