[Protocol-dev] Fw: Changes in protocol/rtsp for porting Atlas for Windows Mobile 5.0

[Protocol-dev] Fw: Changes in protocol/rtsp for porting Atlas for Windows Mobile 5.0

anshuman asingh at adroit-inc.com
Tue Aug 14 06:39:37 PDT 2007


Skipped content of type multipart/alternative-------------- next part --------------
Index: rtspclnt.cpp
===================================================================
RCS file: /cvsroot/protocol/rtsp/rtspclnt.cpp,v
retrieving revision 1.220
diff -u -r1.220 rtspclnt.cpp
--- rtspclnt.cpp	14 Jun 2007 04:52:47 -0000	1.220
+++ rtspclnt.cpp	14 Aug 2007 13:32:31 -0000
@@ -160,6 +160,9 @@
 #define DEFAULT_SERVER_TIMEOUT          90          // in seconds
 #define MINIMUM_TIMEOUT                 5           // in seconds
 
+#define MINIMUM_KEEPALIVE_DURING_PAUSE_TIMEOUT  500         // in milliseconds
+#define DEFAULT_KEEPALIVE_DURING_PAUSE_TIMEOUT  1000         // in milliseconds
+
 #if defined(HELIX_FEATURE_MIN_HEAP)
 #define DEFAULT_TRANSPORT_BYTE_LIMIT	1024000	    // 1MByte
 #else	// HELIX_FEATURE_MIN_HEAP
@@ -2406,6 +2409,10 @@
     m_bUseLegacyTimeOutMsg(TRUE),
     m_ulServerTimeOut(DEFAULT_SERVER_TIMEOUT),
     m_ulCurrentTimeOut(0),
+#ifdef HELIX_FEATURE_FORCE_KEEPALIVE_DURING_PAUSE
+    m_ulForceKeepAliveDuringPauseTimout(DEFAULT_KEEPALIVE_DURING_PAUSE_TIMEOUT),
+    m_bKeepAliveTimeouToBeReset(FALSE),
+#endif
     m_pRateAdaptInfo(NULL),
     m_pSrcBufStats(NULL),
     m_ulRegistryID(0),
@@ -2798,6 +2805,14 @@
     }
     m_ulServerTimeOut *= MILLISECS_PER_SECOND;
 
+#ifdef HELIX_FEATURE_FORCE_KEEPALIVE_DURING_PAUSE
+    ReadPrefUINT32(m_pPreferences, "KeepAliveDuringPauseTimeOut", m_ulForceKeepAliveDuringPauseTimout);
+    if (m_ulForceKeepAliveDuringPauseTimout < MINIMUM_KEEPALIVE_DURING_PAUSE_TIMEOUT)
+    {
+	m_ulForceKeepAliveDuringPauseTimout = MINIMUM_KEEPALIVE_DURING_PAUSE_TIMEOUT;
+    }
+#endif /*HELIX_FEATURE_FORCE_KEEPALIVE_DURING_PAUSE*/
+
     ReadPrefBOOL(m_pPreferences, "RTSPMessageDebug", m_bMessageDebug);
     if (m_bMessageDebug)
     {
@@ -4269,6 +4284,18 @@
     {
         rc = HXR_OUTOFMEMORY;
     }
+
+#ifdef HELIX_FEATURE_FORCE_KEEPALIVE_DURING_PAUSE
+    if (m_bKeepAliveTimeouToBeReset && m_pSessionTimeout && m_pScheduler && m_pKeepAliveCallback && m_ulCurrentTimeOut > 0)
+    {
+	m_bKeepAliveTimeouToBeReset = FALSE;
+
+        m_pSessionTimeout->Init(m_pScheduler,
+                                m_ulCurrentTimeOut/2,
+                                (IHXCallback*)m_pKeepAliveCallback);
+    }
+#endif /* HELIX_FEATURE_FORCE_KEEPALIVE_DURING_PAUSE */
+
     m_pMutex->Unlock();
     return rc;
 }
@@ -4369,6 +4396,16 @@
 
     HX_RESULT rc = SendMsgToServer(RTSP_PAUSE);
 
+#ifdef HELIX_FEATURE_FORCE_KEEPALIVE_DURING_PAUSE
+    if (m_pSessionTimeout && m_pScheduler && m_pKeepAliveCallback)
+    {
+	m_bKeepAliveTimeouToBeReset = TRUE;
+        m_pSessionTimeout->Init(m_pScheduler,
+                                m_ulForceKeepAliveDuringPauseTimout,
+                                (IHXCallback*)m_pKeepAliveCallback);
+    }
+#endif /* HELIX_FEATURE_FORCE_KEEPALIVE_DURING_PAUSE */
+
     m_pMutex->Unlock();
     return rc;
 }
@@ -4412,7 +4449,18 @@
 					    ulMsgSeqNum);
     }
     
-    m_pMutex->Unlock();
+  #ifdef HELIX_FEATURE_FORCE_KEEPALIVE_DURING_PAUSE
+     if (m_bKeepAliveTimeouToBeReset && m_pSessionTimeout && m_pScheduler && m_pKeepAliveCallback && m_ulCurrentTimeOut > 0)
+     {
+ 	m_bKeepAliveTimeouToBeReset = FALSE;
+ 
+       m_pSessionTimeout->Init(m_pScheduler,
+                                 m_ulCurrentTimeOut/2,
+                                 (IHXCallback*)m_pKeepAliveCallback);
+     }
+ #endif /* HELIX_FEATURE_FORCE_KEEPALIVE_DURING_PAUSE */
+
+     m_pMutex->Unlock();
     return rc;
 }
 
Index: pub/rtspclnt.h
===================================================================
RCS file: /cvsroot/protocol/rtsp/pub/rtspclnt.h,v
retrieving revision 1.95
diff -u -r1.95 rtspclnt.h
--- pub/rtspclnt.h	23 Feb 2007 00:42:48 -0000	1.95
+++ pub/rtspclnt.h	14 Aug 2007 13:32:39 -0000
@@ -1312,6 +1312,10 @@
     HXBOOL                              m_bUseLegacyTimeOutMsg;
     UINT32                              m_ulServerTimeOut;
     UINT32                              m_ulCurrentTimeOut;
+#ifdef HELIX_FEATURE_FORCE_KEEPALIVE_DURING_PAUSE
+    UINT32				m_ulForceKeepAliveDuringPauseTimout;
+    HXBOOL				m_bKeepAliveTimeouToBeReset;
+#endif
     CHXRateAdaptationInfo*              m_pRateAdaptInfo;
     HXNetSourceBufStats*                m_pSrcBufStats;
     UINT32                              m_ulRegistryID;


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.