[hxprotocol] CR: Pass RTCP buffer state packets to QoS Signal bus

[hxprotocol] CR: Pass RTCP buffer state packets to QoS Signal bus

Damon Lanphear damonlan at real.com
Tue Jul 15 13:46:49 PDT 2003


These changes allow the RTCP handling code to pass buffer state
information gained from the RTCP HELX APP packets to the media delivery
stack using the QoS Signal bus.

Index: common/include/hxqossig.h
===================================================================
RCS file: /cvs/common/include/hxqossig.h,v
retrieving revision 1.2
diff -u -w -r1.2 hxqossig.h
--- common/include/hxqossig.h	11 Jul 2003 17:55:01 -0000	1.2
+++ common/include/hxqossig.h	15 Jul 2003 20:46:58 -0000
@@ -86,9 +86,10 @@
 #define HX_QOS_SIGNAL_COMMON_PKT_SZ            3
 
 /* RTP Common Profile Signals */
-#define HX_QOS_SIGNAL_RTP_COUNT                2
+#define HX_QOS_SIGNAL_RTP_COUNT                3
 #define HX_QOS_SIGNAL_RTCP_CC_MAX_BURST       
HX_QOS_SIGNAL_COMMON_COUNT + 1
 #define HX_QOS_SIGNAL_RTCP_RR                 
HX_QOS_SIGNAL_COMMON_COUNT + 2
+#define HX_QOS_SIGNAL_BUF_STATE               
HX_QOS_SIGNAL_COMMON_COUNT + 3
 
 /* Total of all signals */
 #define HX_QOS_SIGNAL_COUNT                   
HX_QOS_SIGNAL_COMMON_COUNT + HX_QOS_SIGNAL_RTP_COUNT
Index: protocol/transport/rtp/rtptran.cpp
===================================================================
RCS file: /cvs/protocol/transport/rtp/rtptran.cpp,v
retrieving revision 1.24
diff -u -w -r1.24 rtptran.cpp
--- protocol/transport/rtp/rtptran.cpp	7 Jul 2003 22:23:59 -0000	1.24
+++ protocol/transport/rtp/rtptran.cpp	15 Jul 2003 20:46:59 -0000
@@ -1940,7 +1940,8 @@
     m_pTSConverter(NULL),
     m_streamNumber(0xffff),
     m_pSignalBus(NULL),
-    m_pQoSSignal(NULL),
+    m_pQoSSignal_RR(NULL),
+    m_pQoSSignal_APP(NULL),
     m_pSessionId(NULL)
 {
 }
@@ -1995,7 +1996,8 @@
     HX_VECTOR_DELETE(m_pcCNAME);
     HX_DELETE(m_pReportHandler);
 
-    HX_RELEASE(m_pQoSSignal);
+    HX_RELEASE(m_pQoSSignal_RR);
+    HX_RELEASE(m_pQoSSignal_APP);
     HX_RELEASE(m_pSignalBus);
     HX_RELEASE(m_pSessionId);
 }
@@ -2130,16 +2132,29 @@
     m_pSignalBus->AddRef();
 
     if
(SUCCEEDED(m_pCommonClassFactory->CreateInstance(CLSID_IHXQoSSignal,
-							(void**)&m_pQoSSignal)))
+							(void**)&m_pQoSSignal_RR)))
     {
-	m_pQoSSignal->SetId(MAKE_HX_QOS_SIGNAL_ID(HX_QOS_SIGNAL_LAYER_FRAMING_TRANSPORT,
+	m_pQoSSignal_RR->SetId(MAKE_HX_QOS_SIGNAL_ID(HX_QOS_SIGNAL_LAYER_FRAMING_TRANSPORT,
 						  HX_QOS_SIGNAL_RELEVANCE_METRIC,
 						  HX_QOS_SIGNAL_RTCP_RR));
     }
     else
     {
 	HX_ASSERT(0);
-	m_pQoSSignal = NULL;
+	m_pQoSSignal_RR = NULL;
+    }
+
+    if
(SUCCEEDED(m_pCommonClassFactory->CreateInstance(CLSID_IHXQoSSignal,
+							(void**)&m_pQoSSignal_APP)))
+    {
+	m_pQoSSignal_APP->SetId(MAKE_HX_QOS_SIGNAL_ID(HX_QOS_SIGNAL_LAYER_SESSION,
+						      HX_QOS_SIGNAL_RELEVANCE_METRIC,
+						      HX_QOS_SIGNAL_BUF_STATE));
+    }
+    else
+    {
+	HX_ASSERT(0);
+	m_pQoSSignal_APP = NULL;
     }
 
     return HXR_OK;
@@ -2275,8 +2290,8 @@
 							      (void**)&pTmp)))
 		  {
 		      pTmp->Set((UCHAR*)pPkt, pBuffer->GetSize());
-		      m_pQoSSignal->SetValue(pTmp);
-		      m_pSignalBus->Send(m_pQoSSignal);
+		      m_pQoSSignal_RR->SetValue(pTmp);
+		      m_pSignalBus->Send(m_pQoSSignal_RR);
 		      HX_RELEASE(pTmp);
 		  }
 	    }
@@ -2323,7 +2338,24 @@
                     theErr = HXR_OUTOFMEMORY;
                     break;
                 }
+
+		if ((pPkt->m_pAPPItems[0]).app_type == APP_BUFINFO)
+		{
+		    IHXBuffer* pTmp = NULL;
+		    if((m_pSignalBus) && SUCCEEDED(m_pCommonClassFactory->
+						   CreateInstance(CLSID_IHXBuffer,
+								  (void**)&pTmp)))
+		    {
+			pTmp->Set((UCHAR*)(&pPkt->m_pAPPItems[0]), sizeof(APPItem));
+			m_pQoSSignal_APP->SetValue(pTmp);
+			m_pSignalBus->Send(m_pQoSSignal_APP);
+			HX_RELEASE(pTmp);
+		    }
+		}
+		else
+		{
 	    	memcpy(pAppPkt, &pPkt->m_pAPPItems[0], sizeof(APPItem)); /*
Flawfinder: ignore */
+		}
 	    }
 	    break;
     
Index: protocol/transport/rtp/pub/rtptran.h
===================================================================
RCS file: /cvs/protocol/transport/rtp/pub/rtptran.h,v
retrieving revision 1.12
diff -u -w -r1.12 rtptran.h
--- protocol/transport/rtp/pub/rtptran.h	17 Jun 2003 23:51:01 -0000	1.12
+++ protocol/transport/rtp/pub/rtptran.h	15 Jul 2003 20:46:59 -0000
@@ -496,7 +496,8 @@
 
     /* For placing recevier reports on QoS Signal Bus */
     IHXQoSSignalBus*                    m_pSignalBus;
-    IHXQoSSignal*                       m_pQoSSignal;
+    IHXQoSSignal*                       m_pQoSSignal_RR;
+    IHXQoSSignal*                       m_pQoSSignal_APP;
     IHXBuffer*                          m_pSessionId;
 



---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe at protocol.helixcommunity.org
For additional commands, e-mail: dev-help at protocol.helixcommunity.org




More information about the Protocol-dev mailing list
 

Site Map   |   Terms of Use   |   Privacy Policy   |   Contact Us

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.