📄 rtspif.h
字号:
UINT32 ulReliability) PURE;
STDMETHOD(SetupTransports) (THIS_
const char* pSessionID) PURE;
STDMETHOD(HandleLimitBandwidthByDropping)
(THIS_
UINT16 streamNumber,
const char* pSessionID,
UINT32 ulBandwidthLimit) PURE;
STDMETHOD(HandleSetDeliveryBandwidth)
(THIS_
UINT32 ulBackOff,
const char* pSessionID,
UINT32 ulBandwidth) PURE;
STDMETHOD(HandleStreamDone) (THIS_
HX_RESULT status,
UINT16 uStreamNumber) PURE;
STDMETHOD(GenerateNewSessionID) (THIS_
REF(CHXString) sessionID,
UINT32 ulSeqNo) PURE;
STDMETHOD(HandleRetainEntityForSetup)
(THIS_
const char* pSessionID,
BOOL bRequired) PURE;
STDMETHOD(SetMidBox)
(THIS_
const char* pSessionID,
BOOL bIsMidBox) PURE;
};
DECLARE_INTERFACE_(IHXRTSPServerProtocol, IUnknown)
{
/*
* IUnknown methods
*/
STDMETHOD(QueryInterface) (THIS_
REFIID riid,
void** ppvObj) PURE;
STDMETHOD_(ULONG32,AddRef) (THIS) PURE;
STDMETHOD_(ULONG32,Release) (THIS) PURE;
/************************************************************************
* Method:
* IHXRTSPServerProtocol::Init
* Purpose:
* Initialize context pointer
*/
STDMETHOD(Init) (THIS_
IUnknown* pContext
) PURE;
STDMETHOD(SetBuildVersion) (THIS_
const char* pVersionString) PURE;
STDMETHOD(SetOptionsRespHeaders)(THIS_
IHXValues* pHeaders) PURE;
/************************************************************************
* Method:
* IHXRTSPServerProtocol::Done
* Purpose:
* Close protocol objects
*/
STDMETHOD(Done) (THIS) PURE;
/************************************************************************
* Method:
* IHXRTSPServerProtocol::SetControl
* Purpose:
* Set control channel and response handler for protocol
*/
STDMETHOD(SetControl) (THIS_
IHXTCPSocket* pCtrl,
IHXRTSPServerProtocolResponse* pResp,
IHXBuffer* pBuffer) PURE;
STDMETHOD(AddSession) (THIS_
const char* pSessionID,
const char* pURL,
UINT32 ulSeqNo) PURE;
/************************************************************************
* Method:
* IHXRTSPServerProtocol::SetControl
* Purpose:
* Set response handler for protocol
*/
STDMETHOD(SetResponse) (THIS_
IHXTCPSocket* pCtrl,
IHXRTSPServerProtocolResponse* pResp) PURE;
/************************************************************************
* Method:
* IHXRTSPServerProtocol::Disconnect
* Purpose:
* Disconnect client session
*/
STDMETHOD(Disconnect) (THIS_
const char* pSessionID) PURE;
/************************************************************************
* Method:
* IHXRTSPServerProtocol::SendAlertRequest
* Purpose:
* Send alert request
*/
STDMETHOD(SendAlertRequest) (THIS_
const char* pSessionID,
INT32 lAlertNumber,
const char* pAlertText) PURE;
STDMETHOD(SendKeepAlive) (THIS) PURE;
/************************************************************************
* Method:
* IHXRTSPServerProtocol::SendTeardownRequest
* Purpose:
* Send request to release connection resources
*/
STDMETHOD(SendTeardownRequest) (THIS_
const char* pSessionID) PURE;
STDMETHOD(SendRedirectRequest) (THIS_
const char* pSessionID,
const char* pURL,
UINT32 mSecsFromNow) PURE;
STDMETHOD(SendSetParameterRequest) (THIS_
const char* pSessionID,
const char* pURL,
const char* pParamName,
IHXBuffer* pParamValue) PURE;
STDMETHOD(SendSetParameterRequest) (THIS_
const char* pSessionID,
const char* pURL,
const char* pParamName,
const char* pParamValue,
const char* pMimeType,
const char* pContent) PURE;
STDMETHOD(SendGetParameterRequest) (THIS_
UINT32 lParamType,
const char* pParamName
) PURE;
/************************************************************************
* Method:
* IHXRTSPServerProtocol::SetupSequenceNumberResponse
* Purpose:
* Setup the sequence number response header
*/
STDMETHOD(SetupSequenceNumberResponse) (THIS_
const char* pSessionID
) PURE;
/************************************************************************
* Method:
* IHXRTSPServerProtocol::SendStreamResponse
* Purpose:
* Send stream Setup or Describe response to client
*/
STDMETHOD(SendStreamResponse)
(
THIS_
HX_RESULT status,
const char* pSessionID,
IHXValues* pFileHeader,
CHXSimpleList* pHeaders,
IHXValues* pOptionalValues,
IHXValues* pResponseHeaders,
BOOL bMulticastOK,
BOOL bRequireMulticast,
BOOL bIsRealDataType
) PURE;
STDMETHOD(SendStreamRecordDescriptionResponse)
(
HX_RESULT status,
const char* pSessionID,
IHXValues* pAuthValues,
IHXValues* pResponseHeaders
) PURE;
/************************************************************************
* Method:
* IHXRTSPServerProtocol::SendPacket
* Purpose:
* Send data packet to client
*/
STDMETHOD(SendPacket) (THIS_
BasePacket* pPacket,
const char* pSessionID
) PURE;
STDMETHOD(StartPackets) (THIS_
UINT16 uStreamNumber,
const char* pSessionID
) PURE;
STDMETHOD(StopPackets) (THIS_
UINT16 uStreamNumber,
const char* pSessionID
) PURE;
/************************************************************************
* Method:
* IHXRTSPServerProtocol::SetPacketResend
* Purpose:
* Set pointer to object which will handle resending of packets
*/
STDMETHOD(SetPacketResend) (THIS_
IHXPacketResend* pPacketResend,
const char* pSessionID
) PURE;
STDMETHOD(SendRTTResponse) (THIS_
UINT32 secs,
UINT32 uSecs,
const char* pSessionID
) PURE;
STDMETHOD(SendCongestionInfo) (THIS_
INT32 xmitMultiplier,
INT32 recvMultiplier,
const char* pSessionID
) PURE;
STDMETHOD(SendStreamDone) (THIS_
UINT16 streamID,
const char* pSessionID
) PURE;
STDMETHOD(SetConnectionTimeout) (THIS_
UINT32 uSeconds
) PURE;
STDMETHOD(SetFFHeaderAdvise) (THIS_
IHXFileFormatHeaderAdvise* pAdvise,
const char * pSessionID
) PURE;
};
DECLARE_INTERFACE_(IHXRTSPServerSessionManagerResponse, IUnknown)
{
/*
* IUnknown methods
*/
STDMETHOD(QueryInterface) (THIS_
REFIID riid,
void** ppvObj) PURE;
STDMETHOD_(ULONG32,AddRef) (THIS) PURE;
STDMETHOD_(ULONG32,Release) (THIS) PURE;
STDMETHOD(GetSessionInstanceDone) (THIS_
HX_RESULT status,
IHXRTSPServerProtocol* pProt,
IHXTCPSocket* pSocket,
IHXBuffer* pBuffer) PURE;
};
class RTSPResponseMessage;
DECLARE_INTERFACE_(IHXRTSPClientProtocolResponse, IUnknown)
{
/*
* IUnknown methods
*/
STDMETHOD(QueryInterface) (THIS_
REFIID riid,
void** ppvObj) PURE;
STDMETHOD_(ULONG32,AddRef) (THIS) PURE;
STDMETHOD_(ULONG32,Release) (THIS) PURE;
/*
* IHXRTSPClientProtocolResponse methods
*/
STDMETHOD(InitDone) (THIS_
HX_RESULT status
) PURE;
/************************************************************************
* Method:
* IHXRTSPClientProtocolResponse::HandleAuthentication
* Purpose:
* Called to indicate success/failure of authentication
*/
STDMETHOD(HandleOptionsResponse)
(
THIS_
HX_RESULT status,
IHXValues* pHeaders
) PURE;
STDMETHOD(HandleWWWAuthentication) (THIS_
HX_RESULT status,
IHXValues* pAuthInfo
) PURE;
/************************************************************************
* Method:
* IHXRTSPClientProtocolResponse::HandleStreamDescriptionResponse
* Purpose:
* Called to handle a stream description for an URL
*/
STDMETHOD(HandleStreamDescriptionResponse)
(
THIS_
HX_RESULT status,
IHXValues* pFileHeader,
CHXSimpleList* pStreams,
IHXValues* pResponseHeaders
) PURE;
STDMETHOD(HandleStreamRecordDescriptionResponse)
(THIS_
HX_RESULT status,
IHXValues* pResponseHeaders
) PURE;
/************************************************************************
* Method:
* IHXRTSPClientProtocolResponse::HandleSetupResponse
* Purpose:
* Called to indicate success/failure of setting up a transport
*/
STDMETHOD(HandleSetupResponse) (THIS_
HX_RESULT status
) PURE;
/************************************************************************
* Method:
* IHXRTSPClientProtocolResponse::HandlePlayResponse
* Purpose:
* Called to indicate play status
*/
STDMETHOD(HandlePlayResponse) (THIS_
HX_RESULT status
) PURE;
STDMETHOD(HandleRecordResponse) (THIS_
HX_RESULT status
) PURE;
/************************************************************************
* Method:
* IHXRTSPClientProtocolResponse::HandleTeardownResponse
* Purpose:
* Called to confirm release of connection resources
*/
STDMETHOD(HandleTeardownResponse) (THIS_
HX_RESULT status
) PURE;
STDMETHOD(HandleSetParameterRequest) (THIS_
UINT32 lParamType,
const char* pParamName,
IHXBuffer* pParamValue
) PURE;
STDMETHOD(HandleSetParameterRequest) (THIS_
const char* pParamName,
const char* pParamValue,
const char* pContent) PURE;
STDMETHOD(HandleSetParameterResponse) (THIS_
HX_RESULT status
) PURE;
STDMETHOD(HandleSetParameterResponseWithValues) (THIS_
HX_RESULT status,
IHXValues* pValues
)
{ return HandleSetParameterResponse(status);};
STDMETHOD(HandleGetParameterRequest) (THIS_
UINT32 lParamType,
const char* pParamName,
IHXBuffer** pParamValue
) PURE;
STDMETHOD(HandleGetParameterResponse) (THIS_
HX_RESULT status,
IHXBuffer* pParamValue
) PURE;
STDMETHOD(HandleRedirectRequest) (THIS_
const char* pURL,
UINT32 msecsFromNow
) PURE;
STDMETHOD(HandleUseProxyRequest) (THIS_
const char* pProxyURL
)
{
// default behavior is NOTIMPL
return HXR_NOTIMPL;
}
/************************************************************************
* Method:
* IHXRTSPClientProtocolResponse::HandleAlertRequest
* Purpose:
* Called to notify client of alert request
*/
STDMETHOD(HandleAlertRequest) (THIS_
HX_RESULT status,
INT32 lAlertNumber,
const char* pAlertText
) PURE;
/************************************************************************
* Method:
* IHXRTSPClientProtocolResponse::HandlePacket
* Purpose:
* Called when transport layer has received a data packet
*/
STDMETHOD(HandlePacket) (THIS_
HX_RESULT status,
const char* pSessionID,
IHXPacket* pPacket
) PURE;
/************************************************************************
* Method:
* IHXRTSPClientProtocolResponse::HandleProtocolError
* Purpose:
* Called to notify client of protocol error conditions
*/
STDMETHOD(HandleProtocolError) (THIS_
HX_RESULT status
) PURE;
STDMETHOD(HandleRTTResponse) (THIS_
HX_RESULT status,
const char* pSessionID,
UINT32 ulSecs,
UINT32 ulUSecs
) PURE;
STDMETHOD(HandleCongestion) (THIS_
HX_RESULT status,
const char* pSessionID,
INT32 xmitMultiplier,
INT32 recvMultiplier
) PURE;
STDMETHOD(HandleStreamDone) (THIS_
HX_RESULT status,
UINT16 uStreamNumber
) PURE;
/* This only indicates that all packets have been received from the
* server. We still need to read packets from the transport buffer
* StreamDone will indicate when there are no more packets to be
* read from Transport buffer
*/
STDMETHOD(HandleSourceDone) (THIS) PURE;
STDMETHOD(HandlePrerollChange) (THIS_
RTSPPrerollTypeEnum prerollType,
UINT32 ulPreroll
) PURE;
};
DECLARE_INTERFACE_(IHXRTSPClientProtocol, IUnknown)
{
/*
* IUnknown methods
*/
STDMETHOD(QueryInterface) (THIS_
REFIID riid,
void** ppvObj) PURE;
STDMETHOD_(ULONG32,AddRef) (THIS) PURE;
STDMETHOD_(ULONG32,Release) (THIS) PURE;
/************************************************************************
* Method:
* IHXRTSPClientProtocol::Init
* Purpose:
* Initialize an IHXTCPSocket and connect to pAddr:port
*/
STDMETHOD(Init)
(THIS_
IUnknown* pContext,
const char* pAddr,
UINT16 port,
IHXRTSPClientProtocolResponse* pClient,
UINT32 initializationType,
IHXValues* pSessionHeaders,
IHXValues* pInfo,
BOOL bHTTPCloak,
UINT16 uCloakPort,
BOOL bNoReuseConnection
) PURE;
STDMETHOD(SetBuildVersion) (THIS_
const char* pVersionString) PURE;
/************************************************************************
* Method:
* IHXRTSPClientProtocol::Done
* Purpose:
* Close protocol objects
*/
STDMETHOD(Done) (THIS) PURE;
/************************************************************************
* Method:
* IHXRTSPClientProtocol::SendStreamDescriptionRequest
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -