Source code of Windows XP (NT5)
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

240 lines
6.5 KiB

  1. /*++
  2. Copyright (c) 1997 Microsoft Corporation
  3. Module Name:
  4. confcall.h
  5. Abstract:
  6. Declaration of the CIPConfMSPCall
  7. Author:
  8. Mu Han (muhan) 5-September-1998
  9. --*/
  10. #ifndef __CONFCALL_H_
  11. #define __CONFCALL_H_
  12. #if _MSC_VER >= 1000
  13. #pragma once
  14. #endif // _MSC_VER >= 1000
  15. #include <confpdu.h>
  16. typedef struct _STREAMSETTINGS
  17. {
  18. DWORD dwPayloadType; // The RTP payload type. In the future the
  19. // MSP will use H245 defines to remove this
  20. // dependency on the payload type number.
  21. DWORD dwMSPerPacket; // milliseconds per packet.
  22. DWORD dwQOSLevel;
  23. DWORD dwTTL;
  24. DWORD dwIPLocal; // local interface to bind to.
  25. DWORD dwIPRemote; // remote IP address in host byte order.
  26. WORD wRTPPortRemote; // remote port number in host byte order.
  27. BOOL fCIF; // if CIF is used for video.
  28. } STREAMSETTINGS, *PSTREAMSETTINGS;
  29. /////////////////////////////////////////////////////////////////////////////
  30. // CIPConfMSPCall
  31. /////////////////////////////////////////////////////////////////////////////
  32. class ATL_NO_VTABLE CIPConfMSPCall :
  33. public CMSPCallMultiGraph,
  34. public IDispatchImpl<ITParticipantControl, &IID_ITParticipantControl,
  35. &LIBID_IPConfMSPLib>,
  36. public IDispatchImpl<ITLocalParticipant, &IID_ITLocalParticipant,
  37. &LIBID_IPConfMSPLib>,
  38. public CMSPObjectSafetyImpl
  39. {
  40. public:
  41. BEGIN_COM_MAP(CIPConfMSPCall)
  42. COM_INTERFACE_ENTRY(ITParticipantControl)
  43. COM_INTERFACE_ENTRY(ITLocalParticipant)
  44. COM_INTERFACE_ENTRY2(IDispatch, ITStreamControl)
  45. COM_INTERFACE_ENTRY(IObjectSafety)
  46. COM_INTERFACE_ENTRY_CHAIN(CMSPCallMultiGraph)
  47. END_COM_MAP()
  48. CIPConfMSPCall();
  49. // ITStreamControl methods, called by the app.
  50. STDMETHOD (CreateStream) (
  51. IN long lMediaType,
  52. IN TERMINAL_DIRECTION Direction,
  53. IN OUT ITStream ** ppStream
  54. );
  55. STDMETHOD (RemoveStream) (
  56. IN ITStream * pStream
  57. );
  58. // ITParticipantControl methods, called by the app.
  59. STDMETHOD (EnumerateParticipants) (
  60. OUT IEnumParticipant ** ppEnumParticipants
  61. );
  62. STDMETHOD (get_Participants) (
  63. OUT VARIANT * pVariant
  64. );
  65. // ITLocalParticipant methods, called by the app.
  66. STDMETHOD (get_LocalParticipantTypedInfo) (
  67. IN PARTICIPANT_TYPED_INFO InfoType,
  68. OUT BSTR * ppInfo
  69. );
  70. STDMETHOD (put_LocalParticipantTypedInfo) (
  71. IN PARTICIPANT_TYPED_INFO InfoType,
  72. IN BSTR pInfo
  73. );
  74. // methods called by the MSPAddress object.
  75. HRESULT Init(
  76. IN CMSPAddress * pMSPAddress,
  77. IN MSP_HANDLE htCall,
  78. IN DWORD dwReserved,
  79. IN DWORD dwMediaType
  80. );
  81. HRESULT ShutDown();
  82. HRESULT ReceiveTSPCallData(
  83. IN PBYTE pBuffer,
  84. IN DWORD dwSize
  85. );
  86. // medthod called by the worker thread.
  87. static DWORD WINAPI WorkerCallbackDispatcher(VOID *pContext);
  88. virtual VOID HandleGraphEvent(
  89. IN MSPSTREAMCONTEXT * pContext
  90. );
  91. DWORD ProcessWorkerCallBack(
  92. IN PBYTE pBuffer,
  93. IN DWORD dwSize
  94. );
  95. HRESULT InternalShutDown();
  96. DWORD MSPCallAddRef()
  97. {
  98. return MSPAddRefHelper(this);
  99. }
  100. DWORD MSPCallRelease()
  101. {
  102. return MSPReleaseHelper(this);
  103. }
  104. // medthod called by the streams for participants
  105. HRESULT NewParticipant(
  106. IN ITStream * pITStream,
  107. IN DWORD dwSSRC,
  108. IN DWORD dwSendRecv,
  109. IN DWORD dwMediaType,
  110. IN char * szCName,
  111. OUT ITParticipant ** pITParticipant
  112. );
  113. HRESULT ParticipantLeft(
  114. IN ITParticipant * pITParticipant
  115. );
  116. void SendParticipantEvent(
  117. IN PARTICIPANT_EVENT Event,
  118. IN ITParticipant * pITParticipant,
  119. IN ITSubStream * pITSubStream = NULL
  120. ) const;
  121. HRESULT SendTSPMessage(
  122. IN TSP_MSP_COMMAND command,
  123. IN DWORD dwParam1 = 0,
  124. IN DWORD dwParam2 = 0
  125. ) const;
  126. // this function is called at the call init time.
  127. void SetIPInterface(DWORD dwIPInterface)
  128. { m_dwIPInterface = dwIPInterface; }
  129. protected:
  130. HRESULT InitializeLocalParticipant();
  131. virtual HRESULT CreateStreamObject(
  132. IN DWORD dwMediaType,
  133. IN TERMINAL_DIRECTION Direction,
  134. IN IMediaEvent * pGraph,
  135. IN ITStream ** ppStream
  136. );
  137. HRESULT ProcessMediaItem(
  138. IN ITMedia * pITMedia,
  139. IN DWORD dwMediaTypeMask,
  140. OUT DWORD * pdwMediaType,
  141. OUT WORD * pwPort,
  142. OUT DWORD * pdwPayloadType
  143. );
  144. DWORD FindInterfaceByName(
  145. IN WCHAR * pMachineName
  146. );
  147. HRESULT CIPConfMSPCall::CheckOrigin(
  148. IN ITSdp * pITSdp,
  149. OUT BOOL * pFlag,
  150. OUT DWORD * pdwIP
  151. );
  152. HRESULT ConfigStreamsBasedOnSDP(
  153. IN ITSdp * pITSdp,
  154. IN DWORD dwAudioQOSLevel,
  155. IN DWORD dwVideoQOSLevel
  156. );
  157. HRESULT ParseSDP(
  158. IN WCHAR * pSDP,
  159. IN DWORD dwAudioQOSLevel,
  160. IN DWORD dwVideoQOSLevel
  161. );
  162. HRESULT CheckUnusedStreams();
  163. protected:
  164. // The list of participant in the call.
  165. CParticipantList m_Participants;
  166. // the information items for local participant. The index is the
  167. // value of RTCP_SDES_TYPE_T - 1, see RTP.h.
  168. WCHAR * m_InfoItems[RTCP_SDES_LAST - 1];
  169. BOOL m_fLocalInfoRetrieved;
  170. // The critical section to protect the participant list.
  171. CMSPCritSection m_ParticipantLock;
  172. BOOL m_fShutDown;
  173. DWORD m_dwIPInterface;
  174. };
  175. typedef struct _CALLWORKITEM
  176. {
  177. CIPConfMSPCall *pCall;
  178. DWORD dwLen;
  179. BYTE Buffer[1];
  180. } CALLWORKITEM, *PCALLWORKITEM;
  181. #endif //__CONFCALL_H_