rtspif.h
上传用户:zhongxx05
上传日期:2007-06-06
资源大小:33641k
文件大小:43k
源码类别:

Symbian

开发平台:

C/C++

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