Leaked source code of windows server 2003
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.

306 lines
7.1 KiB

  1. /*++
  2. Copyright (c) 1997 Microsoft Corporation
  3. Module Name:
  4. Confaud.h
  5. Abstract:
  6. Definitions for audio streams
  7. Author:
  8. Mu Han (muhan) 15-September-1998
  9. --*/
  10. #ifndef __CONFAUD_H_
  11. #define __CONFAUD_H_
  12. const DWORD MAX_MIX_CHANNELS = 5;
  13. const long DEFUAT_AEC_STATUS = 0;
  14. const long DEFUAT_AGC_STATUS = 1;
  15. class ATL_NO_VTABLE CStreamAudioRecv :
  16. public CIPConfMSPStream,
  17. public ITAudioSettings
  18. {
  19. BEGIN_COM_MAP(CStreamAudioRecv)
  20. COM_INTERFACE_ENTRY(ITAudioSettings)
  21. COM_INTERFACE_ENTRY_CHAIN(CIPConfMSPStream)
  22. END_COM_MAP()
  23. public:
  24. CStreamAudioRecv();
  25. ~CStreamAudioRecv();
  26. // this method is called by the call object at init time.
  27. void SetFullDuplexController(
  28. IN IAudioDuplexController * pIAudioDuplexController
  29. );
  30. HRESULT ShutDown();
  31. //
  32. // ITAudioSettings methods
  33. //
  34. STDMETHOD (GetRange) (
  35. IN AudioSettingsProperty Property,
  36. OUT long *plMin,
  37. OUT long *plMax,
  38. OUT long *plSteppingDelta,
  39. OUT long *plDefault,
  40. OUT TAPIControlFlags *plFlags
  41. );
  42. STDMETHOD (Get) (
  43. IN AudioSettingsProperty Property,
  44. OUT long *plValue,
  45. OUT TAPIControlFlags *plFlags
  46. );
  47. STDMETHOD (Set) (
  48. IN AudioSettingsProperty Property,
  49. IN long lValue,
  50. IN TAPIControlFlags lFlags
  51. );
  52. //
  53. // ITStreamQualityControl methods
  54. //
  55. STDMETHOD (Set) (
  56. IN StreamQualityProperty Property,
  57. IN long lValue,
  58. IN TAPIControlFlags lFlags
  59. );
  60. //
  61. //IInnerStreamQualityControl methods
  62. //
  63. #if 0
  64. STDMETHOD (GetRange) (
  65. IN InnerStreamQualityProperty property,
  66. OUT LONG *plMin,
  67. OUT LONG *plMax,
  68. OUT LONG *plSteppingDelta,
  69. OUT LONG *plDefault,
  70. OUT TAPIControlFlags *plFlags
  71. );
  72. STDMETHOD (Get) (
  73. IN InnerStreamQualityProperty property,
  74. OUT LONG *plValue,
  75. OUT TAPIControlFlags *plFlags
  76. );
  77. #endif
  78. protected:
  79. HRESULT SetUpFilters();
  80. HRESULT ConfigureRTPFormats(
  81. IN IBaseFilter * pIRTPFilter,
  82. IN IStreamConfig * pIStreamConfig
  83. );
  84. HRESULT AddOneMixChannel(
  85. IN IBaseFilter* pSourceFilter,
  86. IN IPin *pPin,
  87. IN DWORD dwChannelNumber
  88. );
  89. HRESULT SetUpInternalFilters(
  90. IN IPin **ppPins,
  91. IN DWORD dwNumPins
  92. );
  93. HRESULT ConnectTerminal(
  94. IN ITTerminal * pITTerminal
  95. );
  96. HRESULT DisconnectTerminal(
  97. IN ITTerminal * pITTerminal
  98. );
  99. HRESULT ProcessTalkingEvent(
  100. IN DWORD dwSSRC
  101. );
  102. HRESULT ProcessWasTalkingEvent(
  103. IN DWORD dwSSRC
  104. );
  105. HRESULT ProcessParticipantLeave(
  106. IN DWORD dwSSRC
  107. );
  108. HRESULT NewParticipantPostProcess(
  109. IN DWORD dwSSRC,
  110. IN ITParticipant *pITParticipant
  111. );
  112. protected:
  113. // a small buffer to queue up pin mapped events.
  114. CMSPArray <DWORD> m_PendingSSRCs;
  115. protected:
  116. IAudioDuplexController *m_pIAudioDuplexController;
  117. // need an array of IBitrateControl pointer for all the decoders.
  118. //IBitrateControl * m_pRenderBitrateControl;
  119. };
  120. class ATL_NO_VTABLE CStreamAudioSend :
  121. public CIPConfMSPStream,
  122. public ITAudioSettings,
  123. public ITAudioDeviceControl
  124. {
  125. BEGIN_COM_MAP(CStreamAudioSend)
  126. COM_INTERFACE_ENTRY(ITAudioSettings)
  127. COM_INTERFACE_ENTRY(ITAudioDeviceControl)
  128. COM_INTERFACE_ENTRY_CHAIN(CIPConfMSPStream)
  129. END_COM_MAP()
  130. public:
  131. CStreamAudioSend();
  132. ~CStreamAudioSend();
  133. HRESULT ShutDown();
  134. // this method is called by the call object at init time.
  135. void SetFullDuplexController(
  136. IN IAudioDuplexController *pIAudioDuplexController
  137. );
  138. //
  139. // ITAudioDeviceControl methods
  140. //
  141. STDMETHOD (GetRange) (
  142. IN AudioDeviceProperty Property,
  143. OUT long *plMin,
  144. OUT long *plMax,
  145. OUT long *plSteppingDelta,
  146. OUT long *plDefault,
  147. OUT TAPIControlFlags *plFlags
  148. );
  149. STDMETHOD (Get) (
  150. IN AudioDeviceProperty Property,
  151. OUT long *plValue,
  152. OUT TAPIControlFlags *plFlags
  153. );
  154. STDMETHOD (Set) (
  155. IN AudioDeviceProperty Property,
  156. IN long lValue,
  157. IN TAPIControlFlags lFlags
  158. );
  159. //
  160. // ITAudioSettings methods
  161. //
  162. STDMETHOD (GetRange) (
  163. IN AudioSettingsProperty Property,
  164. OUT long *plMin,
  165. OUT long *plMax,
  166. OUT long *plSteppingDelta,
  167. OUT long *plDefault,
  168. OUT TAPIControlFlags *plFlags
  169. );
  170. STDMETHOD (Get) (
  171. IN AudioSettingsProperty Property,
  172. OUT long *plValue,
  173. OUT TAPIControlFlags *plFlags
  174. );
  175. STDMETHOD (Set) (
  176. IN AudioSettingsProperty Property,
  177. IN long lValue,
  178. IN TAPIControlFlags lFlags
  179. );
  180. //
  181. // ITStreamQualityControl methods
  182. //
  183. STDMETHOD (Set) (
  184. IN StreamQualityProperty Property,
  185. IN long lValue,
  186. IN TAPIControlFlags lFlags
  187. );
  188. //
  189. //IInnerStreamQualityControl methods
  190. //
  191. STDMETHOD (GetRange) (
  192. IN InnerStreamQualityProperty property,
  193. OUT LONG *plMin,
  194. OUT LONG *plMax,
  195. OUT LONG *plSteppingDelta,
  196. OUT LONG *plDefault,
  197. OUT TAPIControlFlags *plFlags
  198. );
  199. STDMETHOD (Get) (
  200. IN InnerStreamQualityProperty property,
  201. OUT LONG *plValue,
  202. OUT TAPIControlFlags *plFlags
  203. );
  204. protected:
  205. HRESULT SetUpFilters();
  206. HRESULT ConnectTerminal(
  207. IN ITTerminal * pITTerminal
  208. );
  209. HRESULT DisconnectTerminal(
  210. IN ITTerminal * pITTerminal
  211. );
  212. HRESULT CreateSendFilters(
  213. IN IPin *pPin
  214. );
  215. HRESULT ConfigureRTPFormats(
  216. IN IBaseFilter * pIRTPFilter,
  217. IN IStreamConfig * pIStreamConfig
  218. );
  219. HRESULT GetAudioCapturePin(
  220. IN ITTerminalControl * pTerminal,
  221. OUT IPin ** ppIPin
  222. );
  223. HRESULT ProcessGraphEvent(
  224. IN long lEventCode,
  225. IN LONG_PTR lParam1,
  226. IN LONG_PTR lParam2
  227. );
  228. void CleanupCachedInterface();
  229. HRESULT CacheAdditionalInterfaces(
  230. IN IPin * pIPin
  231. );
  232. protected:
  233. IPin * m_pCapturePin;
  234. IStreamConfig* m_pIStreamConfig;
  235. ISilenceControl * m_pSilenceControl;
  236. IAMAudioInputMixer * m_pAudioInputMixer;
  237. IAudioDeviceControl * m_pAudioDeviceControl;
  238. IAudioDuplexController *m_pIAudioDuplexController;
  239. IBitrateControl * m_pCaptureBitrateControl;
  240. IBaseFilter * m_pEncoder;
  241. long m_lAutomaticGainControl;
  242. long m_lAcousticEchoCancellation;
  243. };
  244. #endif