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

List:       helix-protocol-cvs
Subject:    [Protocol-cvs]
From:       bobclark () helixcommunity ! org
Date:       2005-03-22 19:06:17
[Download RAW message or body]

Update of /cvsroot/protocol/rtsp
In directory cvs-new:/tmp/cvs-serv13485

Modified Files:
      Tag: hxclient_1_2_1a_neptune
	Umakefil rtspclnt.cpp 
Added Files:
      Tag: hxclient_1_2_1a_neptune
	ntsrcbufstats.cpp ntsrcbufstats.h 
Log Message:
add net source buffer stats files and changes to 121a_neptune; cr ping

--- NEW FILE: ntsrcbufstats.h ---
/* ***** BEGIN LICENSE BLOCK *****  
 * Source last modified: $Id: ntsrcbufstats.h,v 1.2.2.1 2005/03/22 19:06:14 bobclark Exp $ 
 *   
 * Portions Copyright (c) 1995-2004 RealNetworks, Inc. All Rights Reserved.  
 *       
 * The contents of this file, and the files included with this file, 
 * are subject to the current version of the RealNetworks Public 
 * Source License (the "RPSL") available at 
 * http://www.helixcommunity.org/content/rpsl unless you have licensed 
 * the file under the current version of the RealNetworks Community 
 * Source License (the "RCSL") available at 
 * http://www.helixcommunity.org/content/rcsl, in which case the RCSL 
 * will apply. You may also obtain the license terms directly from 
 * RealNetworks.  You may not use this file except in compliance with 
 * the RPSL or, if you have a valid RCSL with RealNetworks applicable 
 * to this file, the RCSL.  Please see the applicable RPSL or RCSL for 
 * the rights, obligations and limitations governing use of the 
 * contents of the file. 
 *   
 * This file is part of the Helix DNA Technology. RealNetworks is the 
 * developer of the Original Code and owns the copyrights in the 
 * portions it created. 
 *   
 * This file, and the files included with this file, is distributed 
 * and made available on an 'AS IS' basis, WITHOUT WARRANTY OF ANY 
 * KIND, EITHER EXPRESS OR IMPLIED, AND REALNETWORKS HEREBY DISCLAIMS 
 * ALL SUCH WARRANTIES, INCLUDING WITHOUT LIMITATION, ANY WARRANTIES 
 * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, QUIET 
 * ENJOYMENT OR NON-INFRINGEMENT. 
 *  
 * Technology Compatibility Kit Test Suite(s) Location:  
 *    http://www.helixcommunity.org/content/tck  
 *  
 * Contributor(s):  
 *   
 * ***** END LICENSE BLOCK ***** */ 

#ifndef NTSRCBUFSTATS_H
#define NTSRCBUFSTATS_H

#include "hxsrcbufstats.h"

class RTSPClientProtocol;

class HXNetSourceBufStats : public HXSourceBufferStats
{
public:
    HXNetSourceBufStats(RTSPClientProtocol* pProto);

    // We need to override a few methods from the
    // base class
    
    virtual void Close();

    /*
     * IUnknown methods
     */
    STDMETHOD_(ULONG32,Release)	(THIS);

    /*
     * IHXSourceBufferingStats2 methods
     */
    STDMETHOD(GetCurrentBuffering)  (THIS_ UINT16  uStreamNumber,
				     REF(INT64)  llLowestTimestamp, 
				     REF(INT64)  llHighestTimestamp,
				     REF(UINT32) ulNumBytes,
				     REF(BOOL)   bDone);
protected:
    ~HXNetSourceBufStats();

    void DoClose();

private:
    RTSPClientProtocol* m_pProto;
};

#endif /* NTSRCBUFSTATS_H */

--- NEW FILE: ntsrcbufstats.cpp ---
/* ***** BEGIN LICENSE BLOCK *****  
 * Source last modified: $Id: ntsrcbufstats.cpp,v 1.2.2.1 2005/03/22 19:06:14 bobclark Exp $ 
 *   
 * Portions Copyright (c) 1995-2004 RealNetworks, Inc. All Rights Reserved.  
 *       
 * The contents of this file, and the files included with this file, 
 * are subject to the current version of the RealNetworks Public 
 * Source License (the "RPSL") available at 
 * http://www.helixcommunity.org/content/rpsl unless you have licensed 
 * the file under the current version of the RealNetworks Community 
 * Source License (the "RCSL") available at 
 * http://www.helixcommunity.org/content/rcsl, in which case the RCSL 
 * will apply. You may also obtain the license terms directly from 
 * RealNetworks.  You may not use this file except in compliance with 
 * the RPSL or, if you have a valid RCSL with RealNetworks applicable 
 * to this file, the RCSL.  Please see the applicable RPSL or RCSL for 
 * the rights, obligations and limitations governing use of the 
 * contents of the file. 
 *   
 * This file is part of the Helix DNA Technology. RealNetworks is the 
 * developer of the Original Code and owns the copyrights in the 
 * portions it created. 
 *   
 * This file, and the files included with this file, is distributed 
 * and made available on an 'AS IS' basis, WITHOUT WARRANTY OF ANY 
 * KIND, EITHER EXPRESS OR IMPLIED, AND REALNETWORKS HEREBY DISCLAIMS 
 * ALL SUCH WARRANTIES, INCLUDING WITHOUT LIMITATION, ANY WARRANTIES 
 * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, QUIET 
 * ENJOYMENT OR NON-INFRINGEMENT. 
 *  
 * Technology Compatibility Kit Test Suite(s) Location:  
 *    http://www.helixcommunity.org/content/tck  
 *  
 * Contributor(s):  
 *   
 * ***** END LICENSE BLOCK ***** */ 

#include "ntsrcbufstats.h"
#include "rtspclnt.h"

HXNetSourceBufStats::HXNetSourceBufStats(RTSPClientProtocol* pProto) :
    m_pProto(pProto)
{
    if (m_pProto)
    {
        m_pProto->AddRef();
    }
}

HXNetSourceBufStats::~HXNetSourceBufStats()
{
    DoClose();
}

void HXNetSourceBufStats::Close()
{
    DoClose();
}

// We need to overide Release() because
// the base class doesn't know how to
// delete this derived class

/*
 * IUnknown methods
 */
STDMETHODIMP_(ULONG32)
HXNetSourceBufStats::Release(THIS)
{
    ULONG32 ulRet = DecRefCount();

    if (!ulRet)
    {
        delete this;
    }

    return ulRet;
}

/*
 * IHXSourceBufferingStats2 methods
 */
STDMETHODIMP
HXNetSourceBufStats::GetCurrentBuffering(THIS_ UINT16  uStreamNumber,
                                         REF(INT64)  llLowestTimestamp, 
                                         REF(INT64)  llHighestTimestamp,
                                         REF(UINT32) ulNumBytes,
                                         REF(BOOL)   bDone)
{
    HX_RESULT res = HXR_INVALID_PARAMETER;

    if (GetPktBufInfo(uStreamNumber))
    {
        if (m_pProto)
        {
            res = m_pProto->GetCurrentBuffering(uStreamNumber,
                                                llLowestTimestamp, 
                                                llHighestTimestamp,
                                                ulNumBytes,
                                                bDone);
        }
        else
        {
            res = HXR_UNEXPECTED;
        }
    }

    return res;
}

void HXNetSourceBufStats::DoClose()
{
    HX_RELEASE(m_pProto);

    HXSourceBufferStats::DoClose();
}

Index: rtspclnt.cpp
===================================================================
RCS file: /cvsroot/protocol/rtsp/rtspclnt.cpp,v
retrieving revision 1.41.2.19.2.8
retrieving revision 1.41.2.19.2.8.4.1
diff -u -d -r1.41.2.19.2.8 -r1.41.2.19.2.8.4.1
--- rtspclnt.cpp	1 Dec 2004 23:56:20 -0000	1.41.2.19.2.8
+++ rtspclnt.cpp	22 Mar 2005 19:06:14 -0000	1.41.2.19.2.8.4.1
@@ -94,6 +94,7 @@
 #include "rtptypes.h"
 #include "httppost.h"
 #include "stream_desc_hlpr.h"
+#include "ntsrcbufstats.h"
 
 #include "hxheap.h"
 #ifdef _DEBUG
@@ -321,6 +322,11 @@
 	*ppvObj = (IHXTransportBufferLimit*)this;
 	return HXR_OK;
     }
+    else if (m_pSrcBufStats &&
+             HXR_OK == m_pSrcBufStats->QueryInterface(riid,ppvObj))
+    {
+        return HXR_OK;
+    }
     else if (m_pTransportStreamMap &&
 	     !m_pTransportStreamMap->IsEmpty() &&
 	     ((void *)((*m_pTransportStreamMap)[0])) &&
@@ -433,7 +439,8 @@
     m_ulServerTimeOut(DEFAULT_SERVER_TIMEOUT),
     m_ulCurrentTimeOut(0),
     m_pUAProfURI(NULL),
-    m_pUAProfDiff(NULL)
+    m_pUAProfDiff(NULL),
+    m_pSrcBufStats(NULL)
 #if defined(_MACINTOSH)
     , m_pCallback(NULL)
 #endif /* _MACINTOSH */
@@ -554,6 +561,26 @@
     hresult = m_pContext->QueryInterface(IID_IHXCommonClassFactory,
                                          (void**) &m_pCommonClassFactory);
 
+    if (HXR_OK == hresult)
+    {
+        HX_RELEASE(m_pSrcBufStats);
+        m_pSrcBufStats = new HXNetSourceBufStats(this);
+
+        if (m_pSrcBufStats)
+        {
+            m_pSrcBufStats->AddRef();
+
+            if (HXR_OK != m_pSrcBufStats->Init(m_pContext))
+            {
+                HX_RELEASE(m_pSrcBufStats);
+            }
+        }
+        else
+        {
+            hresult = HXR_OUTOFMEMORY;
+        }
+    }
+
     if (HXR_OK != hresult)
     {
         goto cleanup;
@@ -2362,7 +2389,14 @@
 	(RTSPTransport*)(*m_pTransportStreamMap)[uStreamNumber];
     if (pTrans)
     {
-	rc = pTrans->getPacket(uStreamNumber, pPacket);
+        UINT32 uSeqNum;
+	rc = pTrans->getPacket(uStreamNumber, pPacket, uSeqNum);
+
+        if ((HXR_OK == rc) && m_pSrcBufStats &&
+            (!pPacket->IsLost()))
+        {
+            m_pSrcBufStats->OnPacket(pPacket, uSeqNum);
+        }
     }
 
     m_pMutex->Unlock();
@@ -3500,6 +3534,11 @@
 	rc = pTransport ? pTransport->SeekFlush(streamNumber) : HXR_OK;
     }
 
+    if (m_pSrcBufStats)
+    {
+        m_pSrcBufStats->Reset();
+    }
+
     m_pMutex->Unlock();
     return rc;
 }
@@ -5812,6 +5851,13 @@
 
     HX_RELEASE(m_pTimeoutCallback);
     HX_DELETE(m_pSessionTimeout);
+
+    if (m_pSrcBufStats)
+    {
+        m_pSrcBufStats->Close();
+
+        HX_RELEASE(m_pSrcBufStats);
+    }
 }
 
 void
@@ -7179,6 +7225,12 @@
 	    pInfo->m_ulRtpRRBitRate = ulRtpRRBitRate;
 	    pInfo->m_ulRtpRSBitRate = ulRtpRSBitRate;
             pInfo->m_bRealMedia = bRealMedia;
+
+            if (m_pSrcBufStats)
+            {
+                m_pSrcBufStats->InitStream((UINT16)streamNumber,
+                                           pInfo->m_bIsLive);
+            }
 
             // get multicast address from the media description
             if (HXR_OK == ppRealHeaders[i]->GetPropertyCString("MulticastAddress", pIPAddress))

Index: Umakefil
===================================================================
RCS file: /cvsroot/protocol/rtsp/Umakefil,v
retrieving revision 1.6.12.1.8.1
retrieving revision 1.6.12.1.8.1.4.1
diff -u -d -r1.6.12.1.8.1 -r1.6.12.1.8.1.4.1
--- Umakefil	13 Nov 2004 00:34:39 -0000	1.6.12.1.8.1
+++ Umakefil	22 Mar 2005 19:06:14 -0000	1.6.12.1.8.1.4.1
@@ -64,6 +64,7 @@
 project.AddSources('rtspclnt.cpp', 'rtspbase.cpp',
 		   'rtspmsg.cpp', 'rtspmdsc.cpp',
 		   'rtsppars.cpp', 'mhprop.cpp',
-		   'servrsnd.cpp', 'httppost.cpp')
+		   'servrsnd.cpp', 'httppost.cpp',
+		   'ntsrcbufstats.cpp')
 
 LibraryTarget('rtsplib')



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

Configure | About | News | Add a list | Sponsored by KoreLogic