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

List:       helix-server-cvs
Subject:    [Server-cvs] protocol/rtsp crtspbase.cpp,1.20.2.13,1.20.2.14
From:       dsingh () helixcommunity ! org
Date:       2008-01-31 8:47:12
Message-ID: 200801310847.m0V8lKbB026687 () mailer ! progressive-comp ! com
[Download RAW message or body]

Update of /cvsroot/server/protocol/rtsp
In directory cvs01.internal.helixcommunity.org:/tmp/cvs-serv9052

Modified Files:
      Tag: SERVER_12
	crtspbase.cpp 
Log Message:
Synopsis
========
Fix for [Bug 210441] With TCP transport, playback through proxy stalls after few \
seconds of streaming.

Branch: HEAD , SERVER_12_RN.
Suggested Reviewer: Darrick, Sean, Anyone.

Description
===========
The problem was that, when TCP socket buffered the data, the getpacket->packetready \
sequence halted due to call to PPM::Session::WouldBlock(). To restart the \
GetPacket->PacketReady sequence, function PPM::Session::WouldBlockCleared() should \
get called. The functon should be called when HX_SOCK_EVENT_WRITE event comes at \
RTSPProxyProtocol::EventPending. But HX_SOCK_EVENT_WRITE event was blocked at this \
socket. The event is enabled by removing 
m_pSock->SelectEvents(HX_SOCK_EVENT_READ | HX_SOCK_EVENT_CLOSE); from \
RTSPProxyProtocol::EventPending.

Also notification code is added to notify the HX_SOCK_EVENT_WRITE event to \
RDTTCPTransport::EventPending(), which in turn call PPM::Session::WouldBlockCleared \
and play will be called. 

with this fix still Play() was not getting called due to m_bPktBufQProcessed was \
always found FALSE. So m_bPktBufQProcessed is now checked only for live, for which it \
was added originaly.


Files Affected
==============

server/engine/dataflow/ppm.cpp
server-restricted/proxy/rproxy/rtspprxy.cpp
server/protocol/rtsp/crtspbase.cpp
server/protocol/rtsp/rtspserv.cpp
server/protocol/rtsp/pub/crtspbase.h 


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

Unit Tests:
- None

Integration Tests:
- Tested by playing through proxy over TCP and observed that clip is playing up to \
end.

Leak Tests:
- None.

Performance Tests:
- None

Platforms Tested: linux-rhel14-i686.
Build verified: linux-rhel14-i686.

QA Hints
===============
- Beacuse the fix also affects server code so please test server and proxy  for OD \
over TCP, live over TCP.

Regards
-Dalvinder


Index: crtspbase.cpp
===================================================================
RCS file: /cvsroot/server/protocol/rtsp/crtspbase.cpp,v
retrieving revision 1.20.2.13
retrieving revision 1.20.2.14
diff -u -d -r1.20.2.13 -r1.20.2.14
--- crtspbase.cpp	21 Jan 2008 06:01:04 -0000	1.20.2.13
+++ crtspbase.cpp	31 Jan 2008 08:47:09 -0000	1.20.2.14
@@ -10615,7 +10615,42 @@
 
     return hxr;
 }
+HX_RESULT
+CRTSPBaseProtocol::NotifyWriteEvent()
+{
 
+    if ((m_pWriteNotifyMap) && !(m_pWriteNotifyMap->IsEmpty()))
+    {
+        HXBOOL bBlocked = FALSE;
+        CHXMapPtrToPtr::Iterator iter = \
m_pWriteNotifyMap->Find(m_pWriteNotifyLastKey); +        if (m_pWriteNotifyLastKey == \
NULL || iter == m_pWriteNotifyMap->End()) +        {
+            iter = m_pWriteNotifyMap->Begin();
+        }
+        m_pWriteNotifyLastKey = reinterpret_cast<IUnknown*>(iter.get_key());
+        do
+        {
+            IUnknown* punkItem = reinterpret_cast<IUnknown*>(*iter);
+            HX_ASSERT(punkItem != NULL);
+            IHXSocketResponse* pResp = NULL;
+            punkItem->QueryInterface(IID_IHXSocketResponse,
+                    (void**)&pResp);
+            HX_ASSERT(pResp);
+            bBlocked = (pResp->EventPending(HX_SOCK_EVENT_WRITE, HXR_OK) ==
+                    HXR_BLOCKED);
+            pResp->Release();
+
+            if (++iter == m_pWriteNotifyMap->End())
+            {
+                iter = m_pWriteNotifyMap->Begin();
+            }
+        }
+        while (!(bBlocked || (iter.get_key() == m_pWriteNotifyLastKey)));
+
+        m_pWriteNotifyLastKey = reinterpret_cast<IUnknown*>(iter.get_key());
+    }    
+    return HXR_OK;
+}
 
 /**
  * \brief SetupPlay - kick playback by calling HandlePlayRequest


_______________________________________________
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