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.

303 lines
7.2 KiB

  1. /*++
  2. Copyright (c) 1997 Microsoft Corporation
  3. Module Name:
  4. ConfStrm.h
  5. Abstract:
  6. Definitions for CIPConfMSPStream class.
  7. Author:
  8. Mu Han (muhan) 1-November-1997
  9. --*/
  10. #ifndef __CONFSTRM_H
  11. #define __CONFSTRM_H
  12. /////////////////////////////////////////////////////////////////////////////
  13. // CIPConfMSPStream
  14. /////////////////////////////////////////////////////////////////////////////
  15. #ifdef DEBUG_REFCOUNT
  16. extern LONG g_lStreamObjects;
  17. #endif
  18. class ATL_NO_VTABLE CIPConfMSPStream :
  19. public CMSPStream,
  20. public ITStreamQualityControl,
  21. public IInnerStreamQualityControl,
  22. public CMSPObjectSafetyImpl
  23. {
  24. BEGIN_COM_MAP(CIPConfMSPStream)
  25. COM_INTERFACE_ENTRY(IObjectSafety)
  26. COM_INTERFACE_ENTRY(ITStreamQualityControl)
  27. COM_INTERFACE_ENTRY(IInnerStreamQualityControl)
  28. COM_INTERFACE_ENTRY_CHAIN(CMSPStream)
  29. END_COM_MAP()
  30. public:
  31. CIPConfMSPStream();
  32. #ifdef DEBUG_REFCOUNT
  33. ULONG InternalAddRef();
  34. ULONG InternalRelease();
  35. #endif
  36. DWORD MediaType() const { return m_dwMediaType; }
  37. TERMINAL_DIRECTION Direction() const { return m_Direction; }
  38. BOOL IsConfigured();
  39. virtual HRESULT Configure(
  40. IN STREAMSETTINGS &StreamSettings,
  41. IN WCHAR *pszKey
  42. );
  43. HRESULT FinishConfigure();
  44. // CMSPStream methods.
  45. HRESULT ShutDown ();
  46. // ITStream
  47. STDMETHOD (get_Name) (
  48. OUT BSTR * ppName
  49. );
  50. STDMETHOD (StartStream) ();
  51. STDMETHOD (PauseStream) ();
  52. STDMETHOD (StopStream) ();
  53. STDMETHOD (SelectTerminal)(
  54. IN ITTerminal * pTerminal
  55. );
  56. STDMETHOD (UnselectTerminal)(
  57. IN ITTerminal * pTerminal
  58. );
  59. //
  60. // ITStreamQualityControl methods
  61. //
  62. STDMETHOD (GetRange) (
  63. IN StreamQualityProperty Property,
  64. OUT long *plMin,
  65. OUT long *plMax,
  66. OUT long *plSteppingDelta,
  67. OUT long *plDefault,
  68. OUT TAPIControlFlags *plFlags
  69. );
  70. STDMETHOD (Get) (
  71. IN StreamQualityProperty Property,
  72. OUT long *plValue,
  73. OUT TAPIControlFlags *plFlags
  74. );
  75. STDMETHOD (Set) (
  76. IN StreamQualityProperty Property,
  77. IN long lValue,
  78. IN TAPIControlFlags lFlags
  79. );
  80. //
  81. // IInnerStreamQualityControl
  82. //
  83. STDMETHOD (LinkInnerCallQC) (
  84. IN IInnerCallQualityControl *pIInnerCallQC
  85. );
  86. STDMETHOD (UnlinkInnerCallQC) (
  87. IN BOOL fByStream
  88. );
  89. STDMETHOD (GetRange) (
  90. IN InnerStreamQualityProperty property,
  91. OUT LONG *plMin,
  92. OUT LONG *plMax,
  93. OUT LONG *plSteppingDelta,
  94. OUT LONG *plDefault,
  95. OUT TAPIControlFlags *plFlags
  96. );
  97. STDMETHOD (Set) (
  98. IN InnerStreamQualityProperty property,
  99. IN LONG lValue1,
  100. IN TAPIControlFlags lFlags
  101. );
  102. STDMETHOD (Get) (
  103. IN InnerStreamQualityProperty property,
  104. OUT LONG *plValue,
  105. OUT TAPIControlFlags *plFlags
  106. );
  107. STDMETHOD (TryLockStream)() { return m_lock.TryLock()?S_OK:S_FALSE; }
  108. STDMETHOD (UnlockStream)() { m_lock.Unlock(); return S_OK; }
  109. STDMETHOD (IsAccessingQC)() { return m_fAccessingQC?S_OK:S_FALSE; }
  110. // methods called by the MSPCall object.
  111. HRESULT Init(
  112. IN HANDLE hAddress,
  113. IN CMSPCallBase * pMSPCall,
  114. IN IMediaEvent * pGraph,
  115. IN DWORD dwMediaType,
  116. IN TERMINAL_DIRECTION Direction
  117. );
  118. HRESULT SetLocalParticipantInfo(
  119. IN PARTICIPANT_TYPED_INFO InfoType,
  120. IN WCHAR * pInfo,
  121. IN DWORD dwLen
  122. );
  123. // Called by stream and substream to send event to tapi.
  124. virtual HRESULT SendStreamEvent(
  125. IN MSP_CALL_EVENT Event,
  126. IN MSP_CALL_EVENT_CAUSE Cause,
  127. IN HRESULT hrError,
  128. IN ITTerminal * pTerminal
  129. );
  130. // Called by the participant object.
  131. virtual HRESULT EnableParticipant(
  132. IN DWORD dwSSRC,
  133. IN BOOL fEnable
  134. );
  135. virtual HRESULT GetParticipantStatus(
  136. IN DWORD dwSSRC,
  137. IN BOOL * pfEnable
  138. );
  139. protected:
  140. HRESULT ProcessGraphEvent(
  141. IN long lEventCode,
  142. IN LONG_PTR lParam1,
  143. IN LONG_PTR lParam2
  144. );
  145. virtual HRESULT CheckTerminalTypeAndDirection(
  146. IN ITTerminal * pTerminal
  147. );
  148. virtual HRESULT ConnectTerminal(
  149. IN ITTerminal * pITTerminal
  150. ) = 0;
  151. virtual HRESULT DisconnectTerminal(
  152. IN ITTerminal * pITTerminal
  153. );
  154. virtual HRESULT SetUpFilters() = 0;
  155. virtual HRESULT CleanUpFilters();
  156. HRESULT EnableParticipantEvents(
  157. IN IRtpSession * pRtpSession
  158. );
  159. HRESULT EnableQOS(
  160. IN IRtpSession * pRtpSession
  161. );
  162. HRESULT EnableEncryption(
  163. IN IRtpSession * pRtpSession,
  164. IN WCHAR *pPassPhrase
  165. );
  166. HRESULT ConfigureRTPFilter(
  167. IN IBaseFilter * pIBaseFilter
  168. );
  169. virtual HRESULT ProcessParticipantTimeOutOrRecovered(
  170. IN BOOL fTimeOutOrRecovered,
  171. IN DWORD dwSSRC
  172. );
  173. virtual HRESULT ProcessSDESUpdate(
  174. IN DWORD dwInfoItem,
  175. IN DWORD dwSSRC
  176. );
  177. virtual HRESULT ProcessParticipantLeave(
  178. IN DWORD dwSSRC
  179. );
  180. virtual HRESULT ProcessQOSEvent(
  181. IN long lEventCode
  182. );
  183. virtual HRESULT ProcessTalkingEvent(
  184. IN DWORD dwSSRC
  185. );
  186. virtual HRESULT ProcessWasTalkingEvent(
  187. IN DWORD dwSSRC
  188. );
  189. virtual HRESULT ProcessSilentEvent(
  190. IN DWORD dwSSRC
  191. );
  192. virtual HRESULT ProcessPinMappedEvent(
  193. IN DWORD dwSSRC,
  194. IN IPin * pIPin
  195. );
  196. virtual HRESULT ProcessPinUnmapEvent(
  197. IN DWORD dwSSRC,
  198. IN IPin * pIPin
  199. );
  200. virtual HRESULT ProcessNewParticipant(
  201. IN int index,
  202. IN DWORD dwSSRC,
  203. IN DWORD dwSendRecv,
  204. IN WCHAR * szCName,
  205. OUT ITParticipant ** ppITParticipant
  206. );
  207. virtual HRESULT NewParticipantPostProcess(
  208. IN DWORD dwSSRC,
  209. IN ITParticipant *pITParticipant
  210. );
  211. virtual HRESULT SetLocalInfoOnRTPFilter(
  212. IN IBaseFilter * pRTPFilter
  213. );
  214. protected:
  215. const WCHAR * m_szName;
  216. BOOL m_fIsConfigured;
  217. STREAMSETTINGS m_Settings;
  218. IRtpDemux * m_pIRTPDemux;
  219. IRtpSession * m_pIRTPSession;
  220. IStreamConfig * m_pIStreamConfig;
  221. // The list of participant in the stream.
  222. CParticipantList m_Participants;
  223. // Callback interface to the quality controller.
  224. CStreamQualityControlRelay * m_pStreamQCRelay;
  225. // the local info needed to be set on the RTP filter.
  226. WCHAR * m_InfoItems[NUM_SDES_ITEMS];
  227. WCHAR * m_szKey;
  228. // flag will be set when stream is accessing quality control methods
  229. // that will in turn lock the stream list lock inside quality control.
  230. BOOL m_fAccessingQC;
  231. };
  232. #endif