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.

280 lines
6.5 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. // the volume range for the API.
  13. const long MIN_VOLUME = 0;
  14. const long MAX_VOLUME = 0xFFFF;
  15. const long BALANCE_LEFT = -100;
  16. const long BALANCE_RIGHT = 100;
  17. const long BOOST_FACTOR = 100;
  18. // the volume range of the IAMInputMixer
  19. const double MIXER_MIN_VOLUME = 0.0;
  20. const double MIXER_MAX_VOLUME = 1.0;
  21. const long DEFUAT_AEC_STATUS = 0;
  22. const long DEFUAT_AGC_STATUS = 1;
  23. class CStreamAudioRecv :
  24. public CH323MSPStream,
  25. public ITAudioSettings
  26. {
  27. BEGIN_COM_MAP(CStreamAudioRecv)
  28. COM_INTERFACE_ENTRY(ITAudioSettings)
  29. COM_INTERFACE_ENTRY_CHAIN(CH323MSPStream)
  30. END_COM_MAP()
  31. public:
  32. CStreamAudioRecv();
  33. ~CStreamAudioRecv();
  34. HRESULT ShutDown();
  35. // this method is called by the call object at init time.
  36. void SetFullDuplexController(
  37. IN IAudioDuplexController * pIAudioDuplexController
  38. );
  39. //
  40. // ITAudioSettings methods
  41. //
  42. STDMETHOD (GetRange) (
  43. IN AudioSettingsProperty Property,
  44. OUT long *plMin,
  45. OUT long *plMax,
  46. OUT long *plSteppingDelta,
  47. OUT long *plDefault,
  48. OUT TAPIControlFlags *plFlags
  49. );
  50. STDMETHOD (Get) (
  51. IN AudioSettingsProperty Property,
  52. OUT long *plValue,
  53. OUT TAPIControlFlags *plFlags
  54. );
  55. STDMETHOD (Set) (
  56. IN AudioSettingsProperty Property,
  57. IN long lValue,
  58. IN TAPIControlFlags lFlags
  59. );
  60. //
  61. // ITFormatControl
  62. //
  63. STDMETHOD (GetCurrentFormat) (
  64. OUT AM_MEDIA_TYPE **ppMediaType
  65. );
  66. //
  67. // ITStreamQualityControl methods
  68. //
  69. STDMETHOD (Set) (
  70. IN StreamQualityProperty Property,
  71. IN long lValue,
  72. IN TAPIControlFlags lFlags
  73. );
  74. //
  75. //IInnerStreamQualityControl methods
  76. //
  77. STDMETHOD (GetRange) (
  78. IN InnerStreamQualityProperty property,
  79. OUT LONG *plMin,
  80. OUT LONG *plMax,
  81. OUT LONG *plSteppingDelta,
  82. OUT LONG *plDefault,
  83. OUT TAPIControlFlags *plFlags
  84. );
  85. STDMETHOD (Get) (
  86. IN InnerStreamQualityProperty property,
  87. OUT LONG *plValue,
  88. OUT TAPIControlFlags *plFlags
  89. );
  90. protected:
  91. HRESULT SetUpInternalFilters(
  92. IN IPin * pTerminalInputPin
  93. );
  94. HRESULT ConnectTerminal(
  95. IN ITTerminal * pITTerminal
  96. );
  97. HRESULT DisconnectTerminal(
  98. IN ITTerminal * pITTerminal
  99. );
  100. HRESULT InitializeH245CapabilityTable();
  101. protected:
  102. IBaseFilter * m_pDecoderFilter;
  103. IAudioDuplexController *m_pIAudioDuplexController;
  104. IBitrateControl * m_pRenderBitrateControl;
  105. };
  106. class CStreamAudioSend :
  107. public CH323MSPStream,
  108. public ITAudioSettings,
  109. public ITAudioDeviceControl
  110. {
  111. BEGIN_COM_MAP(CStreamAudioSend)
  112. COM_INTERFACE_ENTRY(ITAudioSettings)
  113. COM_INTERFACE_ENTRY(ITAudioDeviceControl)
  114. COM_INTERFACE_ENTRY_CHAIN(CH323MSPStream)
  115. END_COM_MAP()
  116. public:
  117. CStreamAudioSend();
  118. ~CStreamAudioSend();
  119. HRESULT ShutDown();
  120. // this method is called by the call object at init time.
  121. void SetFullDuplexController(
  122. IN IAudioDuplexController *pIAudioDuplexController
  123. );
  124. //
  125. // ITAudioDeviceControl methods
  126. //
  127. STDMETHOD (GetRange) (
  128. IN AudioDeviceProperty Property,
  129. OUT long *plMin,
  130. OUT long *plMax,
  131. OUT long *plSteppingDelta,
  132. OUT long *plDefault,
  133. OUT TAPIControlFlags *plFlags
  134. );
  135. STDMETHOD (Get) (
  136. IN AudioDeviceProperty Property,
  137. OUT long *plValue,
  138. OUT TAPIControlFlags *plFlags
  139. );
  140. STDMETHOD (Set) (
  141. IN AudioDeviceProperty Property,
  142. IN long lValue,
  143. IN TAPIControlFlags lFlags
  144. );
  145. //
  146. // ITAudioSettings methods
  147. //
  148. STDMETHOD (GetRange) (
  149. IN AudioSettingsProperty Property,
  150. OUT long *plMin,
  151. OUT long *plMax,
  152. OUT long *plSteppingDelta,
  153. OUT long *plDefault,
  154. OUT TAPIControlFlags *plFlags
  155. );
  156. STDMETHOD (Get) (
  157. IN AudioSettingsProperty Property,
  158. OUT long *plValue,
  159. OUT TAPIControlFlags *plFlags
  160. );
  161. STDMETHOD (Set) (
  162. IN AudioSettingsProperty Property,
  163. IN long lValue,
  164. IN TAPIControlFlags lFlags
  165. );
  166. //
  167. // ITFormatControl
  168. //
  169. STDMETHOD (GetCurrentFormat) (
  170. OUT AM_MEDIA_TYPE **ppMediaType
  171. );
  172. //
  173. // ITStreamQualityControl methods
  174. //
  175. STDMETHOD (Set) (
  176. IN StreamQualityProperty Property,
  177. IN long lValue,
  178. IN TAPIControlFlags lFlags
  179. );
  180. //
  181. //IInnerStreamQualityControl methods
  182. //
  183. STDMETHOD (GetRange) (
  184. IN InnerStreamQualityProperty property,
  185. OUT LONG *plMin,
  186. OUT LONG *plMax,
  187. OUT LONG *plSteppingDelta,
  188. OUT LONG *plDefault,
  189. OUT TAPIControlFlags *plFlags
  190. );
  191. STDMETHOD (Get) (
  192. IN InnerStreamQualityProperty property,
  193. OUT LONG *plValue,
  194. OUT TAPIControlFlags *plFlags
  195. );
  196. protected:
  197. HRESULT ConnectTerminal(
  198. IN ITTerminal * pITTerminal
  199. );
  200. HRESULT DisconnectTerminal(
  201. IN ITTerminal * pITTerminal
  202. );
  203. HRESULT CreateSendFilters(
  204. IN IPin *pPin
  205. );
  206. HRESULT GetAudioCapturePin(
  207. IN ITTerminalControl * pTerminal,
  208. OUT IPin ** ppIPin
  209. );
  210. void CleanupCachedInterface();
  211. HRESULT CacheAdditionalInterfaces(
  212. IN IPin * pIPin
  213. );
  214. protected:
  215. ISilenceControl * m_pSilenceControl;
  216. IAMAudioInputMixer * m_pAudioInputMixer;
  217. IAudioDeviceControl * m_pAudioDeviceControl;
  218. IAudioDuplexController *m_pIAudioDuplexController;
  219. IBitrateControl * m_pCaptureBitrateControl;
  220. IBaseFilter * m_pEncoder;
  221. long m_lAutomaticGainControl;
  222. long m_lAcousticEchoCancellation;
  223. };
  224. #endif