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.

119 lines
2.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. #include <amrtpss.h>
  13. const DWORD g_dwAudioThreadPriority = THREAD_PRIORITY_TIME_CRITICAL;
  14. const DWORD g_dwAudioChannels = 1;
  15. const DWORD g_wAudioCaptureBitPerSample = 16;
  16. const DWORD g_dwAudioSampleRate = 8000;
  17. const DWORD g_dwAudioCaptureNumBufffers = 32;
  18. const DWORD g_dwRTPHeaderSize = 12;
  19. const DWORD g_dwG723BytesPerFrame = 24;
  20. const DWORD g_dwG723_DATARATE = 16000; // bit per second.
  21. const DWORD g_dwMilliSecondPerFrame = 30;
  22. inline DWORD AudioCaptureBufferSize(DWORD dwMillisecondPerPacket)
  23. {
  24. return dwMillisecondPerPacket * (g_dwAudioSampleRate / 1000)
  25. * (g_wAudioCaptureBitPerSample / 8);
  26. }
  27. inline DWORD G723PacketSize(DWORD dwMillisecondPerPacket)
  28. {
  29. return dwMillisecondPerPacket / g_dwMilliSecondPerFrame
  30. * g_dwG723BytesPerFrame + g_dwRTPHeaderSize;
  31. }
  32. inline DWORD G711PacketSize(DWORD dwMillisecondPerPacket)
  33. {
  34. return dwMillisecondPerPacket * (g_dwAudioSampleRate / 1000)
  35. + g_dwRTPHeaderSize;
  36. }
  37. class CStreamAudioRecv : public CH323MSPStream
  38. {
  39. public:
  40. CStreamAudioRecv();
  41. HRESULT Configure(
  42. IN HANDLE htChannel,
  43. IN STREAMSETTINGS & StreamSettings
  44. );
  45. protected:
  46. HRESULT SetUpFilters();
  47. HRESULT ConfigureRTPFilter(
  48. IN IBaseFilter * pIBaseFilter
  49. );
  50. HRESULT SetUpInternalFilters();
  51. HRESULT ConnectTerminal(
  52. IN ITTerminal * pITTerminal
  53. );
  54. };
  55. class CStreamAudioSend : public CH323MSPStream
  56. {
  57. public:
  58. CStreamAudioSend();
  59. virtual HRESULT Configure(
  60. IN HANDLE htChannel,
  61. IN STREAMSETTINGS &StreamSettings
  62. );
  63. protected:
  64. HRESULT SetUpFilters();
  65. HRESULT ConnectTerminal(
  66. IN ITTerminal * pITTerminal
  67. );
  68. HRESULT CreateSendFilters(
  69. IN IPin *pPin
  70. );
  71. HRESULT ConfigureRTPFilter(
  72. IN IBaseFilter * pIBaseFilter
  73. );
  74. HRESULT ConfigureAudioCaptureTerminal(
  75. IN ITTerminalControl * pTerminal,
  76. OUT IPin ** ppIPin
  77. );
  78. HRESULT ProcessAGCEvent(
  79. IN AGC_EVENT Event,
  80. IN long lPercent
  81. );
  82. HRESULT ProcessGraphEvent(
  83. IN long lEventCode,
  84. IN long lParam1,
  85. IN long lParam2
  86. );
  87. };
  88. #endif