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

List:       helix-server-cvs
Subject:    [Server-cvs] engine/core _main.cpp,1.216.2.8,1.216.2.9
From:       mingda () helixcommunity ! org
Date:       2013-02-28 10:58:15
[Download RAW message or body]

Update of /cvsroot/server/engine/core
In directory cvs01.internal.helixcommunity.org:/tmp/cvs-serv16862

Modified Files:
      Tag: SERVER_15_0
	_main.cpp 
Log Message:
Committed to: SERVER_15_0_RN, HEAD

Reviewed by: Xiaocheng

Verification Build: 


Synopsis: 
===============
RSS: In RSS log the % RTP and the % RDT didn't add up to 100%

Branch: HEAD

Reviewed by: Xiaocheng

Description: 
===============
The problem is:
1, In RSS log, the total of  % of RTP client and % of RDT clients should be 100% 2, \
when one single RTP player connected, the value m_pProc->pc->server_info->m_RTPCount \
will be increased by 2. 3, % MDP is the percentage for all connections, not only RTSP \
connection.

Analysis:
1, in _main.cpp, it uses the lTotalTrans as the total number of RTSP players, which \
is incorrect. 2, When connecting, assume there are 2 streams, the client will send 2 \
RTSP SETUP packets. So function RTSPTransportInstantiator::SetupTransportRTPUdp will \
be called twice. Each time, it creates a new transport and increase the RTP client \
count by 1. See code below:  
RTSPTransportInstantiator::SetupTransportRTPUdp()
{
	...........
	ServerRTPUDPTransport* pTransport = new \
                ServerRTPUDPTransport(!m_pBaseProt->m_bSetupRecord, bOldRTPTS);
  ..........
  pTransport->IncrProtocolCount();
	...........
}

My fix:
1, When calculating RTP/RDT client percentage, use the m_RTSPClientCount as the total \
number. 2, in RTSPTransportInstantiator::SetupTransportRTPUdp and \
RTSPTransportInstantiator::SetupTransportRTPTcp, check pSession->m_sSetupCount. If it \
is 1, the current stream is the first stream of the feed. Then increase the RTP \
client count by 1. 3, If a Transport didn't increase the RTP count, we must not \
decrease the RTP count in function Transport::DecrProtocolCount().  add a new bool \
variable "m_bProtInfoSet" to Transport. If it's true, then the IncrProtocolCount() \
has been called.   Transport::DecrProtocolCount() is also modified, only when \
m_bProtInfoSet is TRUE, it will actually decrease the RTP client count. 4, change the \
formula to calculate %MDP to lMDPPct     = 100 * m_pProc->pc->server_info->m_MDPCount \
/ m_pProc->pc->server_info->m_RTSPClientCount;

Files affected:
=========
server/engine/core/_main.cpp
server/protocol/transport/common/transport.cpp
server/protocol/transport/common/pub/transport.h
server/protocol/rtsp/transportparams.cpp


Testing Performed: 
===============
Integration Tests:
N/A

Performance Tests: 
N/A

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



Index: _main.cpp
===================================================================
RCS file: /cvsroot/server/engine/core/_main.cpp,v
retrieving revision 1.216.2.8
retrieving revision 1.216.2.9
diff -u -d -r1.216.2.8 -r1.216.2.9
--- _main.cpp	6 Jan 2013 08:05:03 -0000	1.216.2.8
+++ _main.cpp	28 Feb 2013 10:58:05 -0000	1.216.2.9
@@ -3217,17 +3217,12 @@
         lUDPPct     = 100 * m_pProc->pc->server_info->m_UDPTransCount / lTotalTrans;
         lMCastPct   = 100 * m_pProc->pc->server_info->m_MulticastTransCount / \
lTotalTrans;  }
-    if (m_pProc->pc->server_info->m_MDPCount +
-        m_pProc->pc->server_info->m_PPMCount > 0)
+    if (m_pProc->pc->server_info->m_RTSPClientCount > 0)
     {
         lMDPPct     = 100 * m_pProc->pc->server_info->m_MDPCount / 
-                      (m_pProc->pc->server_info->m_MDPCount + 
-                      m_pProc->pc->server_info->m_PPMCount);
-    }
-    if (lTotalTrans)
-    {
-        lRTPPct     = 100 * m_pProc->pc->server_info->m_RTPCount / lTotalTrans;
-        lRDTPct     = 100 * m_pProc->pc->server_info->m_RDTCount / lTotalTrans;
+                            m_pProc->pc->server_info->m_RTSPClientCount;       
+        lRTPPct     = 100 * m_pProc->pc->server_info->m_RTPCount / \
m_pProc->pc->server_info->m_RTSPClientCount; +        lRDTPct     = 100 * \
m_pProc->pc->server_info->m_RDTCount / m_pProc->pc->server_info->m_RTSPClientCount;  \
}  
     pBufPointer += sprintf(pBufPointer, "    Players: %lu (New Players: %lu, \
%0.2f/sec, Players Leaving: %lu, %0.2f/sec)\n",


_______________________________________________
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