[Server-cvs] protocol/transport/rtp/pub rtcp_demux.h,NONE,1.1

[Server-cvs] protocol/transport/rtp/pub rtcp_demux.h,NONE,1.1

seansmith at helixcommunity.org seansmith at helixcommunity.org
Wed Jan 31 10:07:29 PST 2007


Update of /cvsroot/server/protocol/transport/rtp/pub
In directory cvs01.internal.helixcommunity.org:/tmp/cvs-serv8141/pub

Added Files:
	rtcp_demux.h 
Log Message:
Synopsis
========
The RTCP demux code on the server was originally intended to be flexible and general enough to also work on the client. Having moved to the client RTP SOD writing phase of the project, it is clear that the demux designs will have far to little in common for having a shared base class to make sense.

The other deciding factor is the goal to have a light and efficient demux on the server that isn't cluttered with if/switch statements or child classes, casts, etc. Here are the main differences between client and server demux functionality:

Server:
* RTPUDPTransport is an IHXSocketResponse, so the demux needs to act as the response for PN3 (EventPending).
* if a packet is passed to the demux and the SSRC is not valid, the demux discards the packet and returns immediately.
* demux keeps a map of SSRCs ServerRTCPBaseTransports

* Client:
* for RTP/UDP socket reads, there is a socket read handler.
* all incoming packets are passed through the RTSPClientProtocol, where they are demuxed (currently) by port number!
* the PN3 client (UDP) needs to queue packets whose SSRC is not valid, but only when a PLAYNOW response is pending.
* demux keeps 2 maps, SSRCs to RTCPBaseTransports and SSRCs to RTPBaseTransports

Branches: head
Reviewer: jgordon


Description
===========
Now that I've explained the motivation, the changes are really simple. I've changed the name of the class from RTPDemux to ServerRTCPDemux, since we aren't sharing any code with the client.


Files Affected
==============
server/protocol/transport/rtp/Umakefil
server/protocol/transport/rtp/pub/rtcp_demux.h    // was rtp_demux.h
server/protocol/transport/rtp/rtcp_demux.cpp    // was rtp_demux.cpp
server/protocol/transport/rtp/unittest/Umakefil
server/protocol/transport/rtp/unittest/pub/ut_rtcpdemux.h // was ut_rtp...
server/protocol/transport/rtp/unittest/ut_rtcpdemux.cpp // was ut_rtp...

note that the diff shows the old filenames. i had to keep the old names temporarily to get cvs diff to recognize the files. 


--- NEW FILE: rtcp_demux.h ---
/* ***** BEGIN LICENSE BLOCK *****
 * Source last modified: $Id:
 * 
 * Portions Copyright (c) 1995-2006 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.
 * 
 * Alternatively, the contents of this file may be used under the
 * terms of the GNU General Public License Version 2 or later (the
 * "GPL") in which case the provisions of the GPL are applicable
 * instead of those above. If you wish to allow use of your version of
 * this file only under the terms of the GPL, and not to allow others
 * to use your version of this file under the terms of either the RPSL
 * or RCSL, indicate your decision by deleting the provisions above
 * and replace them with the notice and other provisions required by
 * the GPL. If you do not delete the provisions above, a recipient may
 * use your version of this file under the terms of any one of the
 * RPSL, the RCSL or the GPL.
 * 
 * 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 RTCP_DEMUX_H
#define RTCP_DEMUX_H


class ServerRTCPDemux : public IHXSocketResponse 
{
public:

    ServerRTCPDemux                 ();
    ~ServerRTCPDemux                ();

    // IUnknown
    STDMETHOD(QueryInterface)       (THIS_ REFIID riid, void** ppvObj);
    STDMETHOD_(ULONG32,AddRef)      (THIS);
    STDMETHOD_(ULONG32,Release)     (THIS);

    // IHXSocketResponse
    STDMETHOD(EventPending)         (THIS_ UINT32 uEvent, HX_RESULT status);

    // RTCPHandler
    STDMETHOD(AddTransport)         (UINT32 uSSRC, ServerRTCPBaseTransport* pTrans);
    STDMETHOD(SetSocket)            (IHXSocket* pSock);
    STDMETHOD(SetPeerAddr)          (IHXSockAddr* pAddr);

private:
    STDMETHOD(HandlePacket)         (SPIHXBuffer& spBuffer);

    UINT32                          m_ulRefCount;
    CHXMapLongToObj*                m_pTransMap;
    SPIHXSocket                     m_spSock;
    SPIHXSockAddr                   m_spPeerAddr;

    friend class CUTRTCPDemuxTestDriver;
};


#endif




More information about the Server-cvs 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.