rtspif.h
上传用户:dangjiwu
上传日期:2013-07-19
资源大小:42019k
文件大小:44k
源码类别:

Symbian

开发平台:

Visual C++

  1. /* ***** BEGIN LICENSE BLOCK *****
  2.  * Source last modified: $Id: rtspif.h,v 1.14.4.1 2004/07/09 02:04:37 hubbe Exp $
  3.  * 
  4.  * Portions Copyright (c) 1995-2004 RealNetworks, Inc. All Rights Reserved.
  5.  * 
  6.  * The contents of this file, and the files included with this file,
  7.  * are subject to the current version of the RealNetworks Public
  8.  * Source License (the "RPSL") available at
  9.  * http://www.helixcommunity.org/content/rpsl unless you have licensed
  10.  * the file under the current version of the RealNetworks Community
  11.  * Source License (the "RCSL") available at
  12.  * http://www.helixcommunity.org/content/rcsl, in which case the RCSL
  13.  * will apply. You may also obtain the license terms directly from
  14.  * RealNetworks.  You may not use this file except in compliance with
  15.  * the RPSL or, if you have a valid RCSL with RealNetworks applicable
  16.  * to this file, the RCSL.  Please see the applicable RPSL or RCSL for
  17.  * the rights, obligations and limitations governing use of the
  18.  * contents of the file.
  19.  * 
  20.  * Alternatively, the contents of this file may be used under the
  21.  * terms of the GNU General Public License Version 2 or later (the
  22.  * "GPL") in which case the provisions of the GPL are applicable
  23.  * instead of those above. If you wish to allow use of your version of
  24.  * this file only under the terms of the GPL, and not to allow others
  25.  * to use your version of this file under the terms of either the RPSL
  26.  * or RCSL, indicate your decision by deleting the provisions above
  27.  * and replace them with the notice and other provisions required by
  28.  * the GPL. If you do not delete the provisions above, a recipient may
  29.  * use your version of this file under the terms of any one of the
  30.  * RPSL, the RCSL or the GPL.
  31.  * 
  32.  * This file is part of the Helix DNA Technology. RealNetworks is the
  33.  * developer of the Original Code and owns the copyrights in the
  34.  * portions it created.
  35.  * 
  36.  * This file, and the files included with this file, is distributed
  37.  * and made available on an 'AS IS' basis, WITHOUT WARRANTY OF ANY
  38.  * KIND, EITHER EXPRESS OR IMPLIED, AND REALNETWORKS HEREBY DISCLAIMS
  39.  * ALL SUCH WARRANTIES, INCLUDING WITHOUT LIMITATION, ANY WARRANTIES
  40.  * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, QUIET
  41.  * ENJOYMENT OR NON-INFRINGEMENT.
  42.  * 
  43.  * Technology Compatibility Kit Test Suite(s) Location:
  44.  *    http://www.helixcommunity.org/content/tck
  45.  * 
  46.  * Contributor(s):
  47.  * 
  48.  * ***** END LICENSE BLOCK ***** */
  49. #ifndef _RTSPIF_H_
  50. #define _RTSPIF_H_
  51. //XXX...the following 2 includes should go away
  52. #include "hxpends.h"
  53. #include "hxcomm.h"
  54. // Don't remove this include!
  55. #include "hxstring.h"
  56. #include "basepkt.h"
  57. #include "servrsnd.h"
  58. struct IHXTCPSocket;
  59. class RTSPServerState;
  60. class RTSPClientState;
  61. class RawPacketFilter;
  62. struct IHXBuffer;
  63. class CHXSimpleList;
  64. class RTSPTransport;
  65. class RTSPStreamHandler;
  66. struct IHXPacket;
  67. struct IHXValues;
  68. struct IHXPacketResend;
  69. class BasePacket;
  70. _INTERFACE IHXFileFormatHeaderAdvise;
  71. /* client initialization flags */
  72. #define RTSP_INIT_NO_AUTHORIZATION 0
  73. #define RTSP_INIT_HXPRIVATE_AUTHORIZATION 1
  74. #define RTSP_INIT_WWW_AUTHORIZATION 2
  75. typedef enum _RTSPTransportSubTypeEnum
  76. {
  77.     RTSP_SUBTR_NONE = 0, /* unknown */
  78.     RTSP_SUBTR_UDP = 1, /* udp */
  79.     RTSP_SUBTR_TCP = 2, /* tcp */
  80.     RTSP_SUBTR_MCAST = 3, /* multicast */
  81.     RTSP_SUBTR_NULLSET = 4 /* null setup */
  82. } RTSPTransportSubTypeEnum;
  83. typedef enum _RTSPTransportTypeEnum
  84. {
  85.     RTSP_TR_NONE        = 0,    /* No transport */
  86.     RTSP_TR_RDT_MCAST,          /* x-real-rdt/mcast */
  87.     RTSP_TR_RDT_UDP,            /* x-real-rdt/udp */
  88.     RTSP_TR_RDT_TCP,            /* x-real-rdt/tcp */
  89.     RTSP_TR_TNG_UDP,            /* x-pn-tng/udp, Supported, Deprecated */
  90.     RTSP_TR_TNG_TCP,            /* x-pn-tng/tcp, Supported, Deprecated */
  91.     RTSP_TR_TNG_MCAST,          /* x-pn-tng/mcast, Not Supported / Deprecated */
  92.     RTSP_TR_RTP_UDP,            /* rtp/avp/udp;unicast */
  93.     RTSP_TR_RTP_MCAST,          /* rtp/avp/udp;multicast */
  94.     RTSP_TR_RTP_TCP,            /* rtp/avp/tcp;unicast */
  95.     RTSP_TR_RTCP,               /* Not valid in SETUP */
  96.     RTSP_TR_NULLSET,            /* x-real-nullsetup, for RealProxy */
  97.     RTSP_TR_BCNG_UDP,
  98.     RTSP_TR_BCNG_MCAST,
  99.     RTSP_TR_BCNG_TCP,
  100.     RTSP_TR_LAST
  101. } RTSPTransportTypeEnum;
  102. typedef enum _RTSPTransportModeEnum
  103. {
  104.     RTSP_TRMODE_NONE    = 0,    /* No mode, uninitialized */
  105.     RTSP_TRMODE_PLAY,           /* mode=play, default per 2326 */
  106.     RTSP_TRMODE_RECORD,         /* mode=record */
  107.     RTSP_TRMODE_OTHER           /* unrecognized */
  108. } RTSPTransportModeEnum;
  109. typedef enum _RTSPPrerollTypeEnum
  110. {
  111.     RTSP_PREROLL_NONE            = 0, /* unknown */
  112.     RTSP_PREROLL_PREDECBUFPERIOD = 1, /* x-initpredecbufperiod */
  113. } RTSPPrerollTypeEnum;
  114. /*
  115.  * Various macros for determining the type of transport:
  116.  *
  117.  *   IS_CLIENT_TRANSPORT: a player transport (eg. not server-to-server)
  118.  *   IS_RDT_TRANSPORT   : an RDT or TNG transport
  119.  *   IS_RTP_TRANSPORT   : an RTP (rfc1889) transport
  120.  *   IS_TCP_TRANSPORT   : any TCP transport (client or not)
  121.  *   IS_MCAST_TRANSPORT : any multicast transport (client or not)
  122.  *
  123.  * Note that nullsetup does not fall into any of these categories.
  124.  */
  125. #define IS_CLIENT_TRANSPORT(t) 
  126.     ((t) >= RTSP_TR_RDT_MCAST && (t) <= RTSP_TR_RTCP)
  127. #define IS_RDT_TRANSPORT(t) 
  128.     ((t) >= RTSP_TR_RDT_MCAST && (t) <= RTSP_TR_TNG_MCAST)
  129. #define IS_RTP_TRANSPORT(t) 
  130.     ((t) >= RTSP_TR_RTP_UDP && (t) <= RTSP_TR_RTCP)
  131. #define IS_TCP_TRANSPORT(t) 
  132.     ((t) == RTSP_TR_RDT_TCP || (t) == RTSP_TR_TNG_TCP || 
  133.      (t) == RTSP_TR_RTP_TCP || (t) == RTSP_TR_BCNG_TCP)
  134. #define IS_MCAST_TRANSPORT(t) 
  135.     ((t) == RTSP_TR_RDT_MCAST || (t) == RTSP_TR_TNG_MCAST || 
  136.      (t) == RTSP_TR_RTP_MCAST || (t) == RTSP_TR_BCNG_MCAST)
  137. enum  /* parameter types */
  138. {
  139.     RTSP_PARAM_STRING = 0,
  140.     RTSP_PARAM_LONG = 1,
  141.     RTSP_PARAM_BINARY = 2
  142. };
  143. enum RTPInfoEnum
  144. {
  145.     RTPINFO_ERROR, /* error */
  146.     RTPINFO_SEQ, /* only Seq found */
  147.     RTPINFO_RTPTIME, /* only rtptime found */    
  148.     RTPINFO_SEQ_RTPTIME, /* both seq & rtptime found */
  149.     RTPINFO_EMPTY /* neither seq nor rtptime found */
  150. };
  151. typedef enum
  152. {
  153.     RTSPMEDIA_TYPE_UNKNOWN,
  154.     RTSPMEDIA_TYPE_AUDIO,
  155.     RTSPMEDIA_TYPE_VIDEO,
  156.     RTSPMEDIA_TYPE_APP
  157. } RTSPMediaType;
  158. typedef struct _RTSPASMRule
  159. {
  160.     UINT16 m_ruleNumber;
  161.     UINT16 m_streamNumber;
  162. } RTSPASMRule;
  163. typedef struct _RTSPSubscription
  164. {
  165.     UINT16 m_ruleNumber;
  166.     UINT16 m_streamNumber;
  167.     BOOL m_bIsSubscribe; // Only used in RuleChanges()
  168. } RTSPSubscription;
  169. typedef struct _RTSPStreamInfo
  170. {
  171.     _RTSPStreamInfo()
  172. : m_rtpPayloadType(101)
  173. , m_bHasMarkerRule(0)
  174. , m_markerRule(1)
  175. , m_bHasRTCPRule(0)
  176. , m_ulPayloadWirePacket(0)
  177. , m_RTCPRule(1)
  178. , m_sampleRate(1)
  179. , m_sampleSize(1)
  180. , m_RTPFactor(1)
  181. , m_HXFactor(1)
  182. , m_bIsLive(0)
  183. , m_bExtensionSupport(0)
  184. , m_bActive(TRUE)
  185. , m_bForceRTP(FALSE)
  186. , m_bHasOutOfOrderTS(FALSE)
  187. , m_ulAvgBitRate(0)
  188. , m_ulRtpRRBitRate((UINT32)-1)
  189. , m_ulRtpRSBitRate((UINT32)-1)
  190.         , m_bRealMedia(FALSE)
  191.     {}  
  192.     
  193.     UINT16 m_streamNumber;
  194.     BOOL m_bNeedReliablePackets;
  195.     CHXString m_streamControl;
  196.     UINT16 m_sPort;
  197.     BOOL        m_bForceRTP;
  198.     BOOL m_bHasOutOfOrderTS;
  199.     RTSPMediaType m_eMediaType;
  200.     // rest of them are only for RTP
  201.     INT16 m_rtpPayloadType;
  202.     BOOL m_bHasMarkerRule;
  203.     UINT16 m_markerRule;
  204.     BOOL m_bHasRTCPRule;
  205.     UINT32 m_ulPayloadWirePacket;
  206.     BOOL m_bIsSyncMaster;
  207.     UINT16 m_RTCPRule;
  208.     UINT32      m_sampleRate;
  209.     UINT32      m_sampleSize;
  210.     UINT32 m_RTPFactor;
  211.     UINT32 m_HXFactor;
  212.     BOOL m_bIsLive;
  213.     BOOL m_bExtensionSupport;
  214.     BOOL m_bActive;
  215.     UINT32      m_ulAvgBitRate;
  216.     UINT32      m_ulRtpRRBitRate;
  217.     UINT32      m_ulRtpRSBitRate;
  218.     BOOL        m_bRealMedia;
  219. } RTSPStreamInfo;
  220. typedef struct _RTSPSocketInfo
  221. {
  222.     IHXTCPSocket* m_pSocket;
  223.     UINT32 m_ulForeignAddr;
  224. } RTSPSocketInfo;
  225. /* 
  226.  * XXXBAB - compatibility struct until I change the interface
  227.  * to SendSetupRequest
  228.  */
  229. class RTSPTransportType
  230. {
  231. public:
  232.     RTSPTransportType() :
  233.         m_lTransportType(RTSP_TR_NONE),
  234.         m_Mode(RTSP_TRMODE_NONE),
  235.         m_sPort(0),
  236.         m_streamNumber(0),
  237.         m_ulBufferDepth(0),
  238.         m_RTSPDestinationAddress(NULL)
  239.     {
  240.         // Empty
  241.     }
  242.     RTSPTransportType(const RTSPTransportType& other)
  243.     {
  244.         *this = other;
  245.     }
  246.     ~RTSPTransportType()
  247.     {
  248.         delete[] m_RTSPDestinationAddress;
  249.     }
  250.     RTSPTransportType& operator=(const RTSPTransportType& other)
  251.     {
  252.         m_lTransportType = other.m_lTransportType;
  253.         m_Mode = other.m_Mode;
  254.         m_sPort = other.m_sPort;
  255.         m_streamNumber = other.m_streamNumber;
  256.         m_ulBufferDepth = other.m_ulBufferDepth;
  257.         m_RTSPDestinationAddress = other.m_RTSPDestinationAddress ? 
  258.             new_string(other.m_RTSPDestinationAddress) : NULL;
  259.         return *this;
  260.     }
  261.     RTSPTransportTypeEnum       m_lTransportType;
  262.     RTSPTransportModeEnum       m_Mode;
  263.     UINT16                      m_sPort;
  264.     UINT16                      m_streamNumber;
  265.     UINT32                      m_ulBufferDepth;
  266.     char*                       m_RTSPDestinationAddress;
  267. };
  268. DECLARE_INTERFACE_(IHXRTSPServerProtocolResponse, IUnknown)
  269. {
  270.     /*
  271.      * IUnknown methods
  272.      */
  273.     STDMETHOD(QueryInterface) (THIS_
  274. REFIID riid,
  275. void** ppvObj) PURE;
  276.     STDMETHOD_(ULONG32,AddRef) (THIS) PURE;
  277.     STDMETHOD_(ULONG32,Release) (THIS) PURE;
  278.     /************************************************************************ 
  279.      *  Method:
  280.      *      IHXRTSPServerProtocolResponse::HandleAuthentication
  281.      *  
  282.      * Purpose:
  283.      *     Called to indicate success/failure of authentication
  284.      */
  285. /*XXXkshoop Removed, it was deadweight
  286.     STDMETHOD(HandleAuthentication) (THIS_
  287. HX_RESULT status
  288.                                 ) PURE;
  289. */
  290.     /*************************************************************************
  291.      *  Method:
  292.      *      IHXRTSPServerProtocolResponse::HandleWWWAuthentication
  293.      *
  294.      *  Purpose:
  295.      *      Called when a WWW-Authenticate header is received.
  296.      */
  297. /*XXXkshoop Removed, it was deadweight
  298.     STDMETHOD(HandleWWWAuthentication)  (THIS_
  299.  IHXValues* pAuthValues
  300.  ) PURE;
  301. */
  302.     /************************************************************************
  303.      * Method:
  304.      *     IHXRTSPServerProtocolResponse::HandleStreamDescriptionRequest
  305.      * Purpose:
  306.      *     Called to get stream description for an URL
  307.      */
  308.     STDMETHOD(HandleStreamDescriptionRequest)
  309. (THIS_
  310. const char* pURL,
  311. IHXValues* pRequestHeaders,
  312. const char* pSessionID,
  313. BOOL bUseRTP
  314. ) PURE;
  315.     STDMETHOD(HandleStreamRecordDescriptionRequest)
  316. (THIS_
  317. const char* pURL,
  318. const char* pSessionID,
  319. IHXValues* pFileHeader,
  320. CHXSimpleList* pHeaders,
  321. IHXValues* pRequestHeaders
  322. ) PURE;
  323.     /************************************************************************
  324.      * Method:
  325.      *     IHXRTSPServerProtocolResponse::HandleSetupRequest
  326.      * Purpose:
  327.      *     Called to indicate success/failure of setting up a transport
  328.      */
  329.     STDMETHOD(HandleSetupRequest) (THIS_
  330. HX_RESULT status
  331. ) PURE;
  332.     /************************************************************************
  333.      * Method:
  334.      *     IHXRTSPServerProtocolResponse::HandleSetParameterRequest
  335.      * Purpose:
  336.      *     Called to tell the client to set a parameter
  337.      */
  338.     STDMETHOD(HandleSetParameterRequest) (THIS_
  339. UINT32 lParamType,
  340. const char* pParamName,
  341. IHXBuffer* pParamValue
  342. ) PURE;
  343.     
  344.     STDMETHOD(HandleSetParameterRequest) (THIS_
  345.      const char* pSessionID,
  346.      const char* pParamName,
  347. const char* pParamValue,
  348. const char* pContent) PURE;
  349.     STDMETHOD(HandleSetParameterResponse) (THIS_
  350.      HX_RESULT status
  351. ) PURE;
  352.     /************************************************************************
  353.      * Method:
  354.      *     IHXRTSPServerProtocolResponse::HandleGetParameterRequest
  355.      * Purpose:
  356.      *     Called to tell the client to get a parameter
  357.      */
  358.     STDMETHOD(HandleGetParameterRequest) (THIS_
  359. UINT32 lParamType,
  360. const char* pParamName,
  361. IHXBuffer** pParamValue
  362. ) PURE;
  363.     STDMETHOD(HandleGetParameterResponse) (THIS_
  364.      HX_RESULT status,
  365.      IHXBuffer* pParamValue
  366. ) PURE;
  367.     /************************************************************************
  368.      * Method:
  369.      *     IHXRTSPServerProtocolResponse::HandlePlayRequest
  370.      * Purpose:
  371.      *     Called to start packet delivery - lFrom is start time in msecs,
  372.      *      lTo is end time in msecs.
  373.      */
  374.     STDMETHOD(HandlePlayRequest) (THIS_
  375. UINT32 lFrom,
  376. UINT32 lTo,
  377. CHXSimpleList* pSubscriptions,
  378.     /*RTSPSubscription*/
  379. const char* pSessionID
  380. ) PURE;
  381.     STDMETHOD(HandleRecordRequest) (THIS_
  382.      const char* pSessionID) PURE; 
  383.     /************************************************************************
  384.      * Method:
  385.      *     IHXRTSPServerProtocolResponse::HandlePauseRequest
  386.      * Purpose:
  387.      *     Called to pause packet delivery 
  388.      */
  389.     STDMETHOD(HandlePauseRequest) (THIS_
  390.      const char* pSessionID) PURE;
  391.     /************************************************************************
  392.      * Method:
  393.      *     IHXRTSPServerProtocolResponse::HandleResumeRequest
  394.      * Purpose:
  395.      *     Called to resume packet delivery 
  396.      */
  397.     STDMETHOD(HandleResumeRequest) (THIS_
  398.      const char* pSessionID) PURE;
  399.     /************************************************************************
  400.      * Method:
  401.      *     IHXRTSPServerProtocolResponse::HandleTeardownResponse
  402.      * Purpose:
  403.      *     Called to confirm release of connection resources
  404.      */
  405.     STDMETHOD(HandleTeardownResponse) (THIS_
  406. HX_RESULT status
  407. ) PURE;
  408.     STDMETHOD(HandleTeardownRequest) (THIS_
  409.      const char* pSessionID) PURE;
  410.     /************************************************************************
  411.      * Method:
  412.      *     IHXRTSPServerProtocolResponse::HandlePacket
  413.      * Purpose:
  414.      *     Called when transport layer has received a data packet
  415.      */
  416.     STDMETHOD(HandlePacket) (THIS_
  417.      HX_RESULT status,
  418. const char* pSessionID,
  419. IHXPacket* pPacket
  420. ) PURE;
  421.     STDMETHOD(HandleSubscribe) (THIS_
  422.      CHXSimpleList* pSubscriptions,
  423. /*RTSPSubscription*/
  424. const char* pSessionID
  425. ) PURE;
  426.     STDMETHOD(HandleUnsubscribe) (THIS_
  427.      CHXSimpleList* pUnsubscriptions,
  428. /*RTSPSubscription*/
  429. const char* pSessionID
  430. ) PURE;
  431.     STDMETHOD(HandleSubscriptionDone) (THIS_
  432.     REF(UINT32) ulAddress,
  433.     REF(UINT32) ulSourcePort,
  434.     REF(UINT32) ulPort,
  435.     const char* pSessionID,
  436.     REF(RTSPStreamHandler*) pHandler)
  437.     { return HXR_NOTIMPL; }
  438.     STDMETHOD(HandleBackChannel) (THIS_
  439. IHXPacket* pPacket,
  440. const char* pSessionID
  441. ) PURE;
  442.     STDMETHOD(HandleBWReport) (THIS_
  443.      HX_RESULT status,
  444. const char* pSessionID,
  445. INT32 aveBandwidth,
  446. INT32 packetLoss,
  447. INT32 bandwidthWanted
  448. ) PURE;
  449.     STDMETHOD(HandlePlayerStats) (THIS_
  450.      const char* pStats,
  451. const char* pSessionID
  452. ) PURE;
  453.     STDMETHOD(HandleSessionHeaders) (THIS_
  454.      IHXValues* pSessionHeaders
  455. ) PURE;
  456.     STDMETHOD(HandleSpeedParam) (THIS_
  457. const char* pSessionID,
  458.      FIXED32 fSpeed
  459. ) PURE;
  460.     STDMETHOD(HandleScaleParam) (THIS_
  461. const char* pSessionID,
  462.      FIXED32 fScale
  463. ) PURE;
  464.     /************************************************************************
  465.      * Method:
  466.      *     IHXRTSPServerProtocolResponse::HandleProtocolError
  467.      * Purpose:
  468.      *     Called to notify client of protocol error conditions
  469.      */
  470.     STDMETHOD(HandleProtocolError) (THIS_
  471.      HX_RESULT status
  472. ) PURE;
  473.     STDMETHOD(AddSession) (THIS_
  474.      const char* pURLText,
  475. UINT32 ulSeqNo,
  476. REF(CHXString) sessionID,
  477.                                         BOOL bRetainEntityForSetup) PURE;
  478.     
  479.     STDMETHOD(AddSessionWithID) (THIS_
  480.      const char* pURLText,
  481. UINT32 ulSeqNo,
  482.                                         REF(CHXString) sessionID,
  483.                                         BOOL bRetainEntityForSetup) PURE;
  484.     STDMETHOD(AddTransport) (THIS_
  485. RTSPTransport* pTransport,
  486.      const char* pSessionID,
  487. UINT16 streamNumber,
  488. UINT32 ulReliability) PURE;
  489.     STDMETHOD(SetupTransports) (THIS_
  490. const char* pSessionID) PURE;
  491.     STDMETHOD(HandleLimitBandwidthByDropping)
  492. (THIS_
  493. UINT16 streamNumber,
  494. const char* pSessionID,
  495. UINT32 ulBandwidthLimit) PURE;
  496.     STDMETHOD(HandleSetDeliveryBandwidth)
  497. (THIS_
  498.  UINT32 ulBackOff,
  499.  const char* pSessionID,
  500.  UINT32 ulBandwidth) PURE;
  501.     STDMETHOD(HandleStreamDone) (THIS_
  502. HX_RESULT status,
  503. UINT16 uStreamNumber) PURE;
  504.     STDMETHOD(GenerateNewSessionID) (THIS_
  505. REF(CHXString) sessionID,
  506. UINT32 ulSeqNo) PURE;
  507.     STDMETHOD(HandleRetainEntityForSetup)
  508. (THIS_
  509. const char* pSessionID,
  510. BOOL bRequired) PURE;
  511.     STDMETHOD(SetMidBox)
  512. (THIS_
  513. const char* pSessionID,
  514. BOOL bIsMidBox) PURE;
  515. };
  516.      
  517. DECLARE_INTERFACE_(IHXRTSPServerProtocol, IUnknown)
  518. {
  519.     /*
  520.      * IUnknown methods
  521.      */
  522.     STDMETHOD(QueryInterface) (THIS_
  523. REFIID riid,
  524. void** ppvObj) PURE;
  525.     STDMETHOD_(ULONG32,AddRef) (THIS) PURE;
  526.     STDMETHOD_(ULONG32,Release) (THIS) PURE;
  527.     /************************************************************************
  528.      * Method:
  529.      *     IHXRTSPServerProtocol::Init
  530.      * Purpose:
  531.      *     Initialize context pointer
  532.      */
  533.     STDMETHOD(Init) (THIS_
  534.      IUnknown* pContext
  535. ) PURE;
  536.     STDMETHOD(SetBuildVersion) (THIS_
  537.      const char* pVersionString) PURE;
  538.     STDMETHOD(SetOptionsRespHeaders)(THIS_
  539.     IHXValues* pHeaders) PURE;
  540.     /************************************************************************
  541.      * Method:
  542.      *     IHXRTSPServerProtocol::Done
  543.      * Purpose:
  544.      *     Close protocol objects
  545.      */
  546.     STDMETHOD(Done) (THIS) PURE;
  547.     /************************************************************************
  548.      * Method:
  549.      *     IHXRTSPServerProtocol::SetControl
  550.      * Purpose:
  551.      *     Set control channel and response handler for protocol
  552.      */
  553.     STDMETHOD(SetControl) (THIS_
  554. IHXTCPSocket* pCtrl,
  555.                                 IHXRTSPServerProtocolResponse* pResp,
  556.                                 IHXBuffer* pBuffer) PURE;
  557.     STDMETHOD(AddSession) (THIS_
  558.      const char* pSessionID,
  559. const char* pURL,
  560. UINT32 ulSeqNo) PURE;
  561.     /************************************************************************
  562.      * Method:
  563.      *     IHXRTSPServerProtocol::SetControl
  564.      * Purpose:
  565.      *     Set response handler for protocol
  566.      */
  567.     STDMETHOD(SetResponse) (THIS_
  568. IHXTCPSocket* pCtrl,
  569.      IHXRTSPServerProtocolResponse* pResp) PURE;
  570.     /************************************************************************
  571.      * Method:
  572.      *     IHXRTSPServerProtocol::Disconnect
  573.      * Purpose:
  574.      *     Disconnect client session
  575.      */
  576.     STDMETHOD(Disconnect) (THIS_
  577. const char* pSessionID) PURE;
  578.     /************************************************************************
  579.      * Method:
  580.      *     IHXRTSPServerProtocol::SendAlertRequest
  581.      * Purpose:
  582.      *     Send alert request
  583.      */
  584.     STDMETHOD(SendAlertRequest) (THIS_
  585. const char* pSessionID,
  586. INT32 lAlertNumber,
  587. const char* pAlertText) PURE;
  588.     STDMETHOD(SendKeepAlive) (THIS) PURE;
  589.     /************************************************************************
  590.      * Method:
  591.      *     IHXRTSPServerProtocol::SendTeardownRequest
  592.      * Purpose:
  593.      *     Send request to release connection resources
  594.      */
  595.     STDMETHOD(SendTeardownRequest) (THIS_
  596.      const char* pSessionID) PURE;
  597.     STDMETHOD(SendRedirectRequest) (THIS_
  598. const char* pSessionID,
  599.      const char* pURL,
  600. UINT32 mSecsFromNow) PURE;
  601.     STDMETHOD(SendSetParameterRequest)  (THIS_
  602.                                         const char* pSessionID,
  603.                                         const char* pURL,
  604.                                         const char* pParamName,
  605.                                         IHXBuffer* pParamValue) PURE;
  606.     STDMETHOD(SendSetParameterRequest)  (THIS_
  607.      const char* pSessionID,
  608. const char* pURL,
  609. const char* pParamName,
  610. const char* pParamValue,
  611. const char* pMimeType,
  612. const char* pContent) PURE;
  613.     STDMETHOD(SendGetParameterRequest) (THIS_
  614.      UINT32 lParamType,
  615. const char* pParamName
  616. ) PURE;
  617.     /************************************************************************
  618.      * Method:
  619.      *     IHXRTSPServerProtocol::SetupSequenceNumberResponse
  620.      * Purpose:
  621.      *     Setup the sequence number response header
  622.      */
  623.     STDMETHOD(SetupSequenceNumberResponse) (THIS_
  624. const char* pSessionID
  625. ) PURE;
  626.     /************************************************************************
  627.      * Method:
  628.      *     IHXRTSPServerProtocol::SendStreamResponse
  629.      * Purpose:
  630.      *     Send stream Setup or Describe response to client
  631.      */
  632.     STDMETHOD(SendStreamResponse)
  633.     (
  634. THIS_
  635. HX_RESULT status,
  636. const char* pSessionID,
  637. IHXValues* pFileHeader,
  638. CHXSimpleList* pHeaders,
  639. IHXValues* pOptionalValues,
  640. IHXValues* pResponseHeaders,
  641. BOOL bMulticastOK,
  642. BOOL bRequireMulticast,
  643. BOOL bIsRealDataType
  644.     ) PURE;
  645.     STDMETHOD(SendStreamRecordDescriptionResponse)
  646.     (
  647. HX_RESULT status,
  648. const char* pSessionID,
  649. IHXValues* pAuthValues,
  650. IHXValues* pResponseHeaders
  651.     ) PURE;
  652.     /************************************************************************
  653.      * Method:
  654.      *     IHXRTSPServerProtocol::SendPacket
  655.      * Purpose:
  656.      *     Send data packet to client
  657.      */
  658.     STDMETHOD(SendPacket) (THIS_ 
  659.  BasePacket* pPacket,
  660.  const char* pSessionID
  661. ) PURE;
  662.     STDMETHOD(StartPackets) (THIS_
  663. UINT16 uStreamNumber,
  664. const char* pSessionID
  665. ) PURE;
  666.     STDMETHOD(StopPackets) (THIS_
  667. UINT16 uStreamNumber,
  668. const char* pSessionID
  669. ) PURE;
  670.     /************************************************************************
  671.      * Method:
  672.      *     IHXRTSPServerProtocol::SetPacketResend
  673.      * Purpose:
  674.      *     Set pointer to object which will handle resending of packets
  675.      */
  676.     STDMETHOD(SetPacketResend) (THIS_
  677. IHXPacketResend* pPacketResend,
  678. const char* pSessionID
  679. ) PURE;
  680.     STDMETHOD(SendRTTResponse) (THIS_
  681.      UINT32 secs,
  682. UINT32 uSecs,
  683. const char* pSessionID
  684. ) PURE;
  685.     STDMETHOD(SendCongestionInfo) (THIS_
  686.      INT32 xmitMultiplier,
  687. INT32 recvMultiplier,
  688. const char* pSessionID
  689. ) PURE;
  690.     STDMETHOD(SendStreamDone) (THIS_
  691.      UINT16 streamID, 
  692. const char* pSessionID
  693. ) PURE;
  694.     STDMETHOD(SetConnectionTimeout) (THIS_
  695. UINT32 uSeconds
  696. ) PURE;
  697.     STDMETHOD(SetFFHeaderAdvise) (THIS_
  698. IHXFileFormatHeaderAdvise* pAdvise,
  699.                                         const char * pSessionID
  700. ) PURE;
  701. };
  702. DECLARE_INTERFACE_(IHXRTSPServerSessionManagerResponse, IUnknown)
  703. {
  704.     /*
  705.      * IUnknown methods
  706.      */
  707.     STDMETHOD(QueryInterface) (THIS_
  708. REFIID riid,
  709. void** ppvObj) PURE;
  710.     STDMETHOD_(ULONG32,AddRef) (THIS) PURE;
  711.     STDMETHOD_(ULONG32,Release) (THIS) PURE;
  712.     STDMETHOD(GetSessionInstanceDone) (THIS_
  713. HX_RESULT status,
  714.      IHXRTSPServerProtocol* pProt,
  715.      IHXTCPSocket* pSocket,
  716.      IHXBuffer* pBuffer) PURE;
  717. };
  718. class RTSPResponseMessage;
  719. DECLARE_INTERFACE_(IHXRTSPClientProtocolResponse, IUnknown)
  720. {
  721.     /*
  722.      * IUnknown methods
  723.      */
  724.     STDMETHOD(QueryInterface) (THIS_
  725. REFIID riid,
  726. void** ppvObj) PURE;
  727.     STDMETHOD_(ULONG32,AddRef) (THIS) PURE;
  728.     STDMETHOD_(ULONG32,Release) (THIS) PURE;
  729.     /*
  730.      * IHXRTSPClientProtocolResponse methods
  731.      */
  732.     STDMETHOD(InitDone) (THIS_
  733.      HX_RESULT status
  734. ) PURE;
  735.     /************************************************************************
  736.      * Method:
  737.      *     IHXRTSPClientProtocolResponse::HandleAuthentication
  738.      * Purpose:
  739.      *     Called to indicate success/failure of authentication
  740.      */
  741.     STDMETHOD(HandleOptionsResponse)
  742.     (
  743. THIS_
  744. HX_RESULT status,
  745. IHXValues* pHeaders
  746.     ) PURE;
  747.     STDMETHOD(HandleWWWAuthentication) (THIS_
  748.  HX_RESULT status,
  749.  IHXValues* pAuthInfo
  750.                                 ) PURE;
  751.     /************************************************************************
  752.      * Method:
  753.      *     IHXRTSPClientProtocolResponse::HandleStreamDescriptionResponse
  754.      * Purpose:
  755.      *     Called to handle a stream description for an URL
  756.      */
  757.     STDMETHOD(HandleStreamDescriptionResponse)
  758.     (
  759. THIS_
  760. HX_RESULT status,
  761. IHXValues* pFileHeader,
  762. CHXSimpleList* pStreams,
  763. IHXValues* pResponseHeaders
  764.     ) PURE;
  765.     STDMETHOD(HandleStreamRecordDescriptionResponse)
  766. (THIS_
  767. HX_RESULT status,
  768. IHXValues* pResponseHeaders
  769. ) PURE;
  770.     /************************************************************************
  771.      * Method:
  772.      *     IHXRTSPClientProtocolResponse::HandleSetupResponse
  773.      * Purpose:
  774.      *     Called to indicate success/failure of setting up a transport
  775.      */
  776.     STDMETHOD(HandleSetupResponse) (THIS_
  777. HX_RESULT status
  778. ) PURE;
  779.     /************************************************************************
  780.      * Method:
  781.      *     IHXRTSPClientProtocolResponse::HandlePlayResponse
  782.      * Purpose:
  783.      *     Called to indicate play status
  784.      */
  785.     STDMETHOD(HandlePlayResponse) (THIS_
  786. HX_RESULT status
  787. ) PURE;
  788.     STDMETHOD(HandleRecordResponse) (THIS_
  789. HX_RESULT status
  790. ) PURE;
  791.     /************************************************************************
  792.      * Method:
  793.      *     IHXRTSPClientProtocolResponse::HandleTeardownResponse
  794.      * Purpose:
  795.      *     Called to confirm release of connection resources
  796.      */
  797.     STDMETHOD(HandleTeardownResponse) (THIS_
  798. HX_RESULT status
  799. ) PURE;
  800.     
  801.     STDMETHOD(HandleSetParameterRequest) (THIS_
  802. UINT32 lParamType,
  803. const char* pParamName,
  804. IHXBuffer* pParamValue
  805. ) PURE;
  806.     
  807.     STDMETHOD(HandleSetParameterRequest) (THIS_
  808.      const char* pParamName,
  809. const char* pParamValue,
  810. const char* pContent) PURE;
  811.     
  812.     STDMETHOD(HandleSetParameterResponse) (THIS_
  813.      HX_RESULT status
  814. ) PURE;
  815.     STDMETHOD(HandleSetParameterResponseWithValues) (THIS_
  816.      HX_RESULT status,
  817. IHXValues* pValues
  818. )
  819.     { return HandleSetParameterResponse(status);};
  820.     STDMETHOD(HandleGetParameterRequest) (THIS_
  821. UINT32 lParamType,
  822. const char* pParamName,
  823. IHXBuffer** pParamValue
  824. ) PURE;
  825.     STDMETHOD(HandleGetParameterResponse) (THIS_
  826. HX_RESULT status,
  827. IHXBuffer* pParamValue
  828. ) PURE;
  829.     STDMETHOD(HandleRedirectRequest) (THIS_
  830.      const char* pURL,
  831. UINT32 msecsFromNow
  832. ) PURE;
  833.     STDMETHOD(HandleUseProxyRequest) (THIS_
  834. const char* pProxyURL
  835. )
  836.     {
  837. // default behavior is NOTIMPL
  838. return HXR_NOTIMPL;
  839.     }
  840.     /************************************************************************
  841.      * Method:
  842.      *     IHXRTSPClientProtocolResponse::HandleAlertRequest
  843.      * Purpose:
  844.      *     Called to notify client of alert request
  845.      */
  846.     STDMETHOD(HandleAlertRequest) (THIS_
  847. HX_RESULT status,
  848. INT32 lAlertNumber,
  849. const char* pAlertText
  850. ) PURE;
  851.     /************************************************************************
  852.      * Method:
  853.      *     IHXRTSPClientProtocolResponse::HandlePacket
  854.      * Purpose:
  855.      *     Called when transport layer has received a data packet
  856.      */
  857.     STDMETHOD(HandlePacket) (THIS_
  858.      HX_RESULT status,
  859. const char* pSessionID,
  860. IHXPacket* pPacket
  861. ) PURE;
  862.     /************************************************************************
  863.      * Method:
  864.      *     IHXRTSPClientProtocolResponse::HandleProtocolError
  865.      * Purpose:
  866.      *     Called to notify client of protocol error conditions
  867.      */
  868.     STDMETHOD(HandleProtocolError) (THIS_
  869.      HX_RESULT status
  870. ) PURE;
  871.     STDMETHOD(HandleRTTResponse) (THIS_
  872.      HX_RESULT status,
  873. const char* pSessionID,
  874. UINT32 ulSecs,
  875. UINT32 ulUSecs
  876. ) PURE;
  877.     STDMETHOD(HandleCongestion) (THIS_
  878. HX_RESULT status,
  879. const char* pSessionID,
  880.      INT32 xmitMultiplier,
  881. INT32 recvMultiplier
  882. ) PURE;
  883.     STDMETHOD(HandleStreamDone) (THIS_
  884. HX_RESULT status,
  885. UINT16 uStreamNumber
  886. ) PURE;
  887.     /* This only indicates that all packets have been received from the
  888.      * server. We still need to read packets from the transport buffer
  889.      * StreamDone will indicate when there are no more packets to be
  890.      * read from Transport buffer
  891.      */
  892.     STDMETHOD(HandleSourceDone) (THIS) PURE;
  893.     STDMETHOD(HandlePrerollChange) (THIS_ 
  894.  RTSPPrerollTypeEnum prerollType,
  895.  UINT32 ulPreroll
  896.                                 ) PURE;
  897. };
  898. DECLARE_INTERFACE_(IHXRTSPClientProtocol, IUnknown)
  899. {
  900.     /*
  901.      * IUnknown methods
  902.      */
  903.     STDMETHOD(QueryInterface) (THIS_
  904. REFIID riid,
  905. void** ppvObj) PURE;
  906.     STDMETHOD_(ULONG32,AddRef) (THIS) PURE;
  907.     STDMETHOD_(ULONG32,Release) (THIS) PURE;
  908.     /************************************************************************
  909.      * Method:
  910.      *     IHXRTSPClientProtocol::Init
  911.      * Purpose:
  912.      *     Initialize an IHXTCPSocket and connect to pAddr:port
  913.      */
  914.     STDMETHOD(Init)
  915.      (THIS_
  916. IUnknown* pContext,
  917. const char* pAddr,
  918. UINT16 port,
  919. IHXRTSPClientProtocolResponse* pClient,
  920. UINT32 initializationType,
  921. IHXValues* pSessionHeaders,
  922. IHXValues* pInfo,
  923. BOOL bHTTPCloak,
  924. UINT16 uCloakPort,
  925. BOOL bNoReuseConnection
  926. ) PURE;
  927.     STDMETHOD(SetBuildVersion) (THIS_
  928.      const char* pVersionString) PURE;
  929.     /************************************************************************
  930.      * Method:
  931.      *     IHXRTSPClientProtocol::Done
  932.      * Purpose:
  933.      *     Close protocol objects
  934.      */
  935.     STDMETHOD(Done) (THIS) PURE;
  936.     /************************************************************************
  937.      * Method:
  938.      *     IHXRTSPClientProtocol::SendStreamDescriptionRequest
  939.      * Purpose:
  940.      *     Request stream description from URL
  941.      */
  942.     STDMETHOD(SendStreamDescriptionRequest)
  943.      (THIS_
  944. const char* pURL,
  945. IHXValues* pRequestHeaders
  946. ) PURE;
  947.     STDMETHOD(SendStreamRecordDescriptionRequest)
  948.      (THIS_
  949. const char* pURL,
  950. IHXValues* pFileHeader,
  951. CHXSimpleList* pStreams,
  952. IHXValues* pRequestHeaders
  953. ) PURE;
  954.     /************************************************************************
  955.      * Method:
  956.      *     IHXRTSPClientProtocol::SendTransportRequest
  957.      * Purpose:
  958.      *     Request a transport type for data stream from an array of
  959.      *      available transport types
  960.      */
  961.     STDMETHOD(SendSetupRequest)
  962.     (
  963. THIS_
  964. RTSPTransportType* pTransType,
  965. UINT16 nTransTypes,
  966. IHXValues* pIHXValuesRequestHeaders
  967.     ) PURE;
  968.     STDMETHOD(SendSetParameterRequest) (THIS_
  969.      UINT32 lParamType,
  970. const char* pParamName,
  971. IHXBuffer* pParamValue
  972. ) PURE;
  973.     
  974.     STDMETHOD(SendSetParameterRequest)  (THIS_
  975.      const char* pParamName,
  976. const char* pParamValue,
  977. const char* pMimeType,
  978. const char* pContent) PURE;
  979.     STDMETHOD(SendGetParameterRequest) (THIS_
  980.      UINT32 lParamType,
  981. const char* pParamName
  982. ) PURE;
  983.     /************************************************************************
  984.      * Method:
  985.      *     IHXRTSPClientProtocol::SendPlayRequest
  986.      * Purpose:
  987.      *     Request start of packet delivery
  988.      */
  989.     STDMETHOD(SendPlayRequest) (THIS_
  990. UINT32 lFrom,
  991. UINT32 lTo,
  992. CHXSimpleList* pSubList
  993.     /* RTSPSubscription */
  994. ) PURE;
  995.     STDMETHOD(SendPauseRequest) (THIS) PURE;
  996.     STDMETHOD(SendResumeRequest) (THIS) PURE;
  997.     STDMETHOD(SendRecordRequest) (THIS) PURE;
  998.     
  999.     /************************************************************************
  1000.      * Method:
  1001.      *     IHXRTSPClientProtocol::SendTeardownRequest
  1002.      * Purpose:
  1003.      *     Request release of connection resources
  1004.      */
  1005.     STDMETHOD(SendTeardownRequest) (THIS) PURE;
  1006.     /************************************************************************
  1007.      * Method:
  1008.      *     IHXRTSPClientProtocol::SendPacket
  1009.      * Purpose:
  1010.      *     Send data packet to server (for RECORD)
  1011.      */
  1012.     STDMETHOD(SendPacket) (THIS_
  1013. BasePacket* pPacket
  1014. ) PURE;
  1015.     /************************************************************************
  1016.      * Method:
  1017.      *     IHXRTSPClientProtocol::SendStreamDone
  1018.      * Purpose:
  1019.      *     Send data end packet to server (for RECORD)
  1020.      */
  1021.     STDMETHOD(SendStreamDone) (THIS_
  1022.      UINT16 streamID
  1023. ) PURE;
  1024.     /************************************************************************
  1025.      * Method:
  1026.      *     IHXRTSPClientProtocol::SendStatistics
  1027.      * Purpose:
  1028.      *     Send cumulative stats from player to server
  1029.      */
  1030.     STDMETHOD(SendPlayerStats) (THIS_
  1031.      const char* pStats
  1032. ) PURE;
  1033.     /************************************************************************
  1034.      * Method:
  1035.      *     IHXRTSPClientProtocol::SendKeepAlive
  1036.      * Purpose:
  1037.      *     Send keep alive request to server
  1038.      */
  1039.     STDMETHOD(SendKeepAlive) (THIS) PURE;
  1040.     /************************************************************************
  1041.      * Method:
  1042.      *     IHXRTSPClientProtocol::GetPacket
  1043.      * Purpose:
  1044.      *     Get data packet from transport layer
  1045.      */
  1046.     STDMETHOD(GetPacket) (THIS_
  1047. UINT16 uStreamNumber,
  1048. REF(IHXPacket*) pPacket
  1049. ) PURE;
  1050.     STDMETHOD(StartPackets) (THIS_
  1051. UINT16 uStreamNumber
  1052. ) PURE;
  1053.     STDMETHOD(StopPackets) (THIS_
  1054. UINT16 uStreamNumber
  1055. ) PURE;
  1056.     STDMETHOD(SetProxy) (THIS_
  1057. const char* pProxyHost,
  1058. UINT16 proxyPort
  1059. ) PURE;
  1060.     STDMETHOD(SetResponse) (THIS_
  1061. IHXRTSPClientProtocolResponse* pResp
  1062. ) PURE;
  1063.     STDMETHOD(InitSockets) (THIS) PURE;
  1064.     STDMETHOD(GetCurrentBuffering) (THIS_
  1065. UINT16     uStreamNumber,
  1066. REF(INT64)  llLowestTimestamp, 
  1067. REF(INT64)  llHighestTimestamp,
  1068. REF(UINT32) ulNumBytes,
  1069. REF(BOOL)   bDone) PURE;
  1070.     STDMETHOD(SeekFlush) (THIS) PURE;
  1071.     STDMETHOD_(BOOL, IsDataReceived) (THIS) PURE;
  1072.     STDMETHOD_(BOOL,IsSourceDone) (THIS) PURE;
  1073.     /*
  1074.      * XXX...The following 3 functions had better be removed under
  1075.      *       full IRMA
  1076.      */
  1077.     STDMETHOD_(IHXPendingStatus*, GetPendingStatus) (THIS) PURE;
  1078.     STDMETHOD_(IHXStatistics*, GetStatistics) (THIS) PURE;
  1079.     STDMETHOD_(BOOL, HttpOnly) (THIS) PURE;
  1080.     
  1081.     /*****************************************
  1082.      * Methods specific to TNG/ASM transport
  1083.      *
  1084.      */
  1085.     STDMETHOD(Subscribe) (THIS_
  1086.      CHXSimpleList* pSubscriptions
  1087.     /* RTSPSubscription */
  1088. ) PURE;
  1089.     STDMETHOD(Unsubscribe) (THIS_
  1090.      CHXSimpleList* pUnsubscriptions
  1091.     /* RTSPSubscription */
  1092. ) PURE;
  1093.     STDMETHOD(RuleChange) (THIS_
  1094.      CHXSimpleList* pChanges) PURE;
  1095.     STDMETHOD(BackChannelPacketReady)   (THIS_
  1096.                                         IHXPacket* pPacket) PURE;
  1097.     STDMETHOD(SendRTTRequest) (THIS) PURE;
  1098.     STDMETHOD(SendBWReport) (THIS_
  1099.      INT32 aveBandwidth,
  1100. INT32 packetLoss,
  1101. INT32 bandwidthWanted
  1102. ) PURE;
  1103.     STDMETHOD(SetFirstSeqNum) (THIS_
  1104. UINT16 uStreamNumber,
  1105. UINT16 uSeqNum
  1106. ) PURE;
  1107.     STDMETHOD(SetRTPInfo) (THIS_
  1108. UINT16 uStreamNumber,
  1109. UINT16 uSeqNum,
  1110. UINT32 ulRTPTime,
  1111. RTPInfoEnum info
  1112. ) PURE;
  1113.     STDMETHOD(SetConnectionTimeout) (THIS_
  1114. UINT32 uSeconds
  1115. ) PURE;
  1116.     /* This is a quick fix to correctly display UDPMode in the client.
  1117.      * We currently always show Multicast since the rtsp library
  1118.      * never tells the reponse object that the protocol that actually
  1119.      * succeeded is UDP and not Mutlicast.
  1120.      *
  1121.      * This is an interim soluton. 
  1122.      * Correct solution is to add transport type in HandleSetupResponse(). 
  1123.      * Will do after B2 since I do not break any builds - XXXRA
  1124.      *
  1125.      * MULTICAST_MODE = 1,
  1126.      * UDP_MODE = 2,
  1127.      * TCP_MODE = 3,
  1128.      * 
  1129.      */
  1130.     STDMETHOD_(UINT16, GetProtocolType) (THIS) PURE;
  1131.     STDMETHOD(InitPacketFilter) (THIS_
  1132.  RawPacketFilter* pFilter) PURE;
  1133. };
  1134. DECLARE_INTERFACE_(IHXRTSPTransportResponse, IUnknown)
  1135. {
  1136.     /*
  1137.      * IUnknown methods
  1138.      */
  1139.     STDMETHOD(QueryInterface) (THIS_
  1140. REFIID riid,
  1141. void** ppvObj) PURE;
  1142.     STDMETHOD_(ULONG32,AddRef) (THIS) PURE;
  1143.     STDMETHOD_(ULONG32,Release) (THIS) PURE;
  1144.     /*
  1145.      * PacketReady() is for control packets only. Data packets should
  1146.      * be retrieved with the getPacket() call exported by RTSPTransport
  1147.      */
  1148.     STDMETHOD(PacketReady) (THIS_
  1149. HX_RESULT status,
  1150. const char* pSessionID,
  1151. IHXPacket* pPacket
  1152. ) PURE;
  1153.     STDMETHOD(OnRTTRequest) (THIS_
  1154.      HX_RESULT status,
  1155. const char* pSessionID
  1156. ) PURE;
  1157.     STDMETHOD(OnRTTResponse) (THIS_
  1158.      HX_RESULT status,
  1159. const char* pSessionID,
  1160. UINT32 ulSecs,
  1161. UINT32 ulUSecs
  1162. ) PURE;
  1163.     STDMETHOD(OnBWReport) (THIS_
  1164.      HX_RESULT status,
  1165. const char* pSessionID,
  1166. INT32 aveBandwidth,
  1167. INT32 packetLoss,
  1168. INT32 bandwidthWanted
  1169. ) PURE;
  1170.     STDMETHOD(OnCongestion) (THIS_
  1171.      HX_RESULT status,
  1172. const char* pSessionID,
  1173. INT32 xmitMultiplier,
  1174. INT32 recvMultiplier
  1175. ) PURE;
  1176.     STDMETHOD(OnStreamDone) (THIS_
  1177. HX_RESULT status,
  1178. UINT16 uStreamNumber
  1179. ) PURE;
  1180.     STDMETHOD(OnSourceDone) (THIS) PURE;
  1181.     STDMETHOD(OnACK) (THIS_
  1182. HX_RESULT status,
  1183. RTSPResendBuffer* pResendBuffer,
  1184. UINT16 uStreamNumber,
  1185. const char* pSessionID,
  1186. UINT16* pAckList,
  1187. UINT32 uAckListCount,
  1188. UINT16* pNakList,
  1189. UINT32 uNakListCount
  1190. ) PURE;
  1191.     STDMETHOD(OnProtocolError) (THIS_
  1192.      HX_RESULT status
  1193. ) PURE;
  1194. };
  1195. DECLARE_INTERFACE_(IHXRTSPServerTransportResponse, IHXRTSPTransportResponse)
  1196. {
  1197.     STDMETHOD(OnRTTRequest) (THIS_
  1198.      HX_RESULT status,
  1199. const char* pSessionID
  1200. ) PURE;
  1201.     STDMETHOD(OnRTTResponse) (THIS_
  1202.      HX_RESULT status,
  1203. const char* pSessionID,
  1204. UINT32 ulSecs,
  1205. UINT32 ulUSecs
  1206. ) PURE;
  1207.     STDMETHOD(OnBWReport) (THIS_
  1208.      HX_RESULT status,
  1209. const char* pSessionID,
  1210. INT32 aveBandwidth,
  1211. INT32 packetLoss,
  1212. INT32 bandwidthWanted
  1213. ) PURE;
  1214.     STDMETHOD(OnCongestion) (THIS_
  1215.      HX_RESULT status,
  1216. const char* pSessionID,
  1217. INT32 xmitMultiplier,
  1218. INT32 recvMultiplier
  1219. ) PURE;
  1220.     STDMETHOD(OnStreamDone) (THIS_
  1221. HX_RESULT status,
  1222. UINT16 uStreamNumber
  1223. ) PURE;
  1224.     STDMETHOD(OnSourceDone) (THIS) PURE;
  1225.     STDMETHOD(OnACK) (THIS_
  1226. HX_RESULT status,
  1227. RTSPResendBuffer* pResendBuffer,
  1228. UINT16 uStreamNumber,
  1229. const char* pSessionID,
  1230. UINT16* pAckList,
  1231. UINT32 uAckListCount,
  1232. UINT16* pNakList,
  1233. UINT32 uNakListCount
  1234. ) PURE;
  1235.     STDMETHOD(OnProtocolError) (THIS_
  1236.      HX_RESULT status
  1237. ) PURE;
  1238. };
  1239. DECLARE_INTERFACE_(IHXRTSPClientTransportResponse, IHXRTSPTransportResponse)
  1240. {
  1241.     STDMETHOD(OnRTTRequest) (THIS_
  1242.      HX_RESULT status,
  1243. const char* pSessionID
  1244. ) PURE;
  1245.     STDMETHOD(OnRTTResponse) (THIS_
  1246.      HX_RESULT status,
  1247. const char* pSessionID,
  1248. UINT32 ulSecs,
  1249. UINT32 ulUSecs
  1250. ) PURE;
  1251.     STDMETHOD(OnBWReport) (THIS_
  1252.      HX_RESULT status,
  1253. const char* pSessionID,
  1254. INT32 aveBandwidth,
  1255. INT32 packetLoss,
  1256. INT32 bandwidthWanted
  1257. ) PURE;
  1258.     STDMETHOD(OnCongestion) (THIS_
  1259.      HX_RESULT status,
  1260. const char* pSessionID,
  1261. INT32 xmitMultiplier,
  1262. INT32 recvMultiplier
  1263. ) PURE;
  1264.     STDMETHOD(OnStreamDone) (THIS_
  1265. HX_RESULT status,
  1266. UINT16 uStreamNumber
  1267. ) PURE;
  1268.     /* This only indicates that all packets have been received from the
  1269.      * server. We still need to read packets from the transport buffer
  1270.      * StreamDone will indicate when there are no more packets to be
  1271.      * read from Transport buffer
  1272.      */
  1273.     STDMETHOD(OnSourceDone) (THIS) PURE;
  1274.     STDMETHOD(OnACK) (THIS_
  1275. HX_RESULT status,
  1276. RTSPResendBuffer* pResendBuffer,
  1277. UINT16 uStreamNumber,
  1278. const char* pSessionID,
  1279. UINT16* pAckList,
  1280. UINT32 uAckListCount,
  1281. UINT16* pNakList,
  1282. UINT32 uNakListCount
  1283. ) PURE;
  1284.     STDMETHOD(OnProtocolError) (THIS_
  1285.      HX_RESULT status
  1286. ) PURE;
  1287. };
  1288. DEFINE_GUID(IID_IHXPacketResend,     0x00000400, 0xb4c8, 0x11d0, 0x99, 0x95, 0x0, 0xa0, 0x24, 0x8d, 0xa5, 0xf0);
  1289. DECLARE_INTERFACE_(IHXPacketResend, IUnknown)
  1290. {
  1291.     /*
  1292.      * IUnknown methods
  1293.      */
  1294.     STDMETHOD(QueryInterface) (THIS_
  1295. REFIID riid,
  1296. void** ppvObj) PURE;
  1297.     STDMETHOD_(ULONG32,AddRef) (THIS) PURE;
  1298.     STDMETHOD_(ULONG32,Release) (THIS) PURE;
  1299.     STDMETHOD(OnPacket) (THIS_
  1300. UINT16 uStreamNumber,
  1301. BasePacket** ppPacket) PURE;
  1302. };
  1303. DEFINE_GUID(IID_IHXRTSPContext,     0x00000401, 0xb4c8, 0x11d0, 0x99, 0x95, 0x0, 0xa0, 0x24, 0x8d, 0xa5, 0xf0);
  1304. DECLARE_INTERFACE_(IHXRTSPContext, IUnknown)
  1305. {
  1306.     /*
  1307.      * IUnknown methods
  1308.      */
  1309.     STDMETHOD(QueryInterface) (THIS_
  1310. REFIID riid,
  1311. void** ppvObj) PURE;
  1312.     STDMETHOD_(ULONG32,AddRef) (THIS) PURE;
  1313.     STDMETHOD_(ULONG32,Release) (THIS) PURE;
  1314.     STDMETHOD(GetCurrentSequenceNumber)
  1315.     (
  1316. THIS_
  1317. REF(UINT32) ulSequenceNumber
  1318.     ) PURE;
  1319.     STDMETHOD(GetSessionID)
  1320.     (
  1321. THIS_
  1322. REF(IHXBuffer*) pIHXBufferSessionID
  1323.     ) PURE;
  1324. };
  1325. DEFINE_GUID(IID_IHXTimeStampSync,     0x00000402, 0xb4c8, 0x11d0, 0x99, 0x95, 0x0, 0xa0, 0x24, 0x8d, 0xa5, 0xf0);
  1326. DECLARE_INTERFACE_(IHXTimeStampSync, IUnknown)
  1327. {
  1328.     /*
  1329.      * IUnknown methods
  1330.      */
  1331.     STDMETHOD(QueryInterface) (THIS_
  1332. REFIID riid,
  1333. void** ppvObj) PURE;
  1334.     STDMETHOD_(ULONG32,AddRef) (THIS) PURE;
  1335.     STDMETHOD_(ULONG32,Release) (THIS) PURE;
  1336.     STDMETHOD(SetInitialTS(const char* pSessionID, UINT32 ulInitialTS)) PURE;
  1337.     STDMETHOD_(BOOL, NeedInitialTS(const char* pSessionID)) PURE;
  1338.     STDMETHOD_(UINT32, GetInitialTS(const char* pSessionID)) PURE;
  1339.     STDMETHOD(ClearInitialTS(const char* pSessionID)) PURE;
  1340. };
  1341. DEFINE_GUID(IID_IHXTransportSyncServer, 0x16b420d0, 0xf4d0, 0x11d5, 0xaa, 
  1342.     0xc0, 0x0, 0x1, 0x2, 0x51, 0xb3, 0x40);
  1343. DECLARE_INTERFACE_(IHXTransportSyncServer, IUnknown)
  1344. {
  1345.     /*
  1346.      * IUnknown methods
  1347.      */
  1348.     STDMETHOD(QueryInterface) (THIS_
  1349. REFIID riid,
  1350. void** ppvObj) PURE;
  1351.     STDMETHOD_(ULONG32,AddRef) (THIS) PURE;
  1352.     STDMETHOD_(ULONG32,Release) (THIS) PURE;
  1353.     STDMETHOD(DistributeSyncAnchor) (THIS_
  1354.     ULONG32 ulHXTime, 
  1355.     ULONG32 ulNTPTime) PURE;
  1356.     STDMETHOD(DistributeSync)     (ULONG32 ulHXTime, 
  1357.     LONG32 lHXTimeOffset) PURE;
  1358.     STDMETHOD(DistributeStartTime)  (ULONG32 ulHXRefTime) PURE;
  1359. };
  1360. DECLARE_INTERFACE_(IHXRTSPServerPauseResponse, IUnknown)
  1361. {
  1362.     /*
  1363.      * IUnknown methods
  1364.      */
  1365.     STDMETHOD(QueryInterface) (THIS_ REFIID riid, void** ppvObj) PURE;
  1366.     STDMETHOD_(ULONG32,AddRef) (THIS) PURE;
  1367.     STDMETHOD_(ULONG32,Release) (THIS) PURE;
  1368.     
  1369.     STDMETHOD(HandlePauseRequest) (THIS_ const char* pSessionID, 
  1370.                                            UINT32 ulPausePoint) PURE;
  1371. };
  1372. #endif /* _RTSPIF_H_ */