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.

186 lines
6.1 KiB

  1. /*==========================================================================;
  2. *
  3. * Copyright (C) 1999 Microsoft Corporation. All Rights Reserved.
  4. *
  5. * File: dpvoice.h
  6. * Content: DirectPlayVoice include file
  7. * History:
  8. * Date By Reason
  9. * =========== =========== ====================
  10. * 10/27/99 rodtoll created
  11. * 12/16/99 rodtoll Padding for compression structure
  12. ***************************************************************************/
  13. #ifndef __DPVCP_H
  14. #define __DPVCP_H
  15. #include "dvoice.h"
  16. /////////////////////////////////////////////////////////////////////////////////////
  17. // GUIDS
  18. //
  19. // {B8485451-07C4-4973-A278-C69890D8CF8D}
  20. DEFINE_GUID(IID_IDPVCompressionProvider,
  21. 0xb8485451, 0x7c4, 0x4973, 0xa2, 0x78, 0xc6, 0x98, 0x90, 0xd8, 0xcf, 0x8d);
  22. // {AAA56B61-3B8D-4906-AE58-29C26B8F47B8}
  23. DEFINE_GUID(IID_IDPVConverter,
  24. 0xaaa56b61, 0x3b8d, 0x4906, 0xae, 0x58, 0x29, 0xc2, 0x6b, 0x8f, 0x47, 0xb8);
  25. /////////////////////////////////////////////////////////////////////////////////////
  26. // Interface types
  27. //
  28. typedef struct IDPVCompressionProvider FAR *LPDPVCOMPRESSIONPROVIDER, *PDPVCOMPRESSIONPROVIDER;
  29. typedef struct IDPVCompressor FAR *LPDPVCOMPRESSOR, *PDPVCOMPRESSOR;
  30. /////////////////////////////////////////////////////////////////////////////////////
  31. // Data Types
  32. //
  33. typedef struct
  34. {
  35. // DVCOMPRESSIONINFO Structure
  36. //
  37. DWORD dwSize;
  38. GUID guidType;
  39. LPWSTR lpszName;
  40. LPWSTR lpszDescription;
  41. DWORD dwFlags;
  42. DWORD dwMaxBitsPerSecond;
  43. WAVEFORMATEX *lpwfxFormat;
  44. //
  45. // DVCOMPRESSIONINFO Structure End
  46. // Above this point must match the DVCOMPRESSIONINFO structure.
  47. //
  48. DWORD dwFramesPerBuffer;
  49. DWORD dwTrailFrames;
  50. DWORD dwTimeout;
  51. DWORD dwFrameLength;
  52. DWORD dwFrame8Khz;
  53. DWORD dwFrame11Khz;
  54. DWORD dwFrame22Khz;
  55. DWORD dwFrame44Khz;
  56. WORD wInnerQueueSize;
  57. WORD wMaxHighWaterMark;
  58. BYTE bMaxQueueSize;
  59. BYTE bMinConnectType;
  60. BYTE bPadding1; // For alignment
  61. BYTE bPadding2; // For alignment
  62. } DVFULLCOMPRESSIONINFO, *LPDVFULLCOMPRESSIONINFO, *PDVFULLCOMPRESSIONINFO;
  63. /////////////////////////////////////////////////////////////////////////////////////
  64. // Interface definitions
  65. //
  66. #undef INTERFACE
  67. #define INTERFACE IDPVCompressionProvider
  68. //
  69. // IDPVCompressionProvider
  70. //
  71. // This interface is exported by each DLL which provides compression services.
  72. // It is used to enumerate the compression types available with a DLL and/or
  73. // create a compressor/decompressor for a specified type.
  74. //
  75. // I propose there will be two providers:
  76. //
  77. // DPVACM.DLL - Provides these services for ACM based drivers. It will read
  78. // the types it supports from the registry and can therefore be
  79. // extended with new types as ACM drivers become available
  80. // CLSID_DPVACM
  81. //
  82. // DPVVOX.DLL - Provides these services for Voxware.
  83. //
  84. DECLARE_INTERFACE_( IDPVCompressionProvider, IUnknown )
  85. {
  86. /*** IUnknown methods ***/
  87. STDMETHOD(QueryInterface) (THIS_ REFIID riid, PVOID *ppvObj) PURE;
  88. STDMETHOD_(ULONG,AddRef) (THIS) PURE;
  89. STDMETHOD_(ULONG,Release) (THIS) PURE;
  90. /*** IDPVCompressionProvider methods ***/
  91. // EnumCompressionTypes
  92. //
  93. // Enumerates compression types supported by this DLL. Returns an array
  94. // of DVFULLCOMPRESSIONINFO structures describing the supported types.
  95. //
  96. STDMETHOD_(HRESULT, EnumCompressionTypes)( THIS_ PVOID, PDWORD, PDWORD, DWORD ) PURE;
  97. // IsCompressionSupported
  98. //
  99. // Quick query function for determing if the DLL supports a specified
  100. // compression type.
  101. //
  102. STDMETHOD_(HRESULT, IsCompressionSupported)( THIS_ GUID ) PURE;
  103. // CreateCompressor
  104. //
  105. // Create a IDPVConverter object which converts from the specified uncompressed
  106. // format to the specified compression format.
  107. //
  108. STDMETHOD_(HRESULT, CreateCompressor)( THIS_ LPWAVEFORMATEX, GUID, PDPVCOMPRESSOR *, DWORD ) PURE;
  109. // CreateDeCompressor
  110. //
  111. // Creates a IDPVConveter object which converts from the specified format to
  112. // the specified uncompressed format.
  113. //
  114. STDMETHOD_(HRESULT, CreateDeCompressor)( THIS_ GUID, LPWAVEFORMATEX, PDPVCOMPRESSOR *, DWORD ) PURE;
  115. // GetCompressionInfo
  116. //
  117. // Retrieves the DVFULLCOMPRESSIONINFO structure for the specified compression
  118. // type.
  119. //
  120. STDMETHOD_(HRESULT, GetCompressionInfo)( THIS_ GUID, PVOID, PDWORD ) PURE;
  121. };
  122. #undef INTERFACE
  123. #define INTERFACE IDPVCompressor
  124. //
  125. // IDPVCompressor
  126. //
  127. // This interface does the actual work of performing conversions for
  128. // DirectPlayVoice. This can be instantiated on it's own and Initialized,
  129. // ot created using the CreateCompressor/CreateDecompressor above.
  130. //
  131. DECLARE_INTERFACE_( IDPVCompressor, IUnknown )
  132. {
  133. /*** IUnknown methods ***/
  134. STDMETHOD(QueryInterface) (THIS_ REFIID riid, PVOID *ppvObj) PURE;
  135. STDMETHOD_(ULONG,AddRef) (THIS) PURE;
  136. STDMETHOD_(ULONG,Release) (THIS) PURE;
  137. /*** IDPVCompressor methods ***/
  138. // Initialize
  139. //
  140. // Initialize this object as a decompressor.
  141. //
  142. STDMETHOD_(HRESULT, InitDeCompress)( THIS_ GUID, LPWAVEFORMATEX ) PURE;
  143. // Initialize
  144. //
  145. // Initialize this object as a compressor
  146. STDMETHOD_(HRESULT, InitCompress)( THIS_ LPWAVEFORMATEX, GUID ) PURE;
  147. // IsValid
  148. //
  149. // Returns TRUE in the LPBOOL param if this compression type is
  150. // available.
  151. STDMETHOD_(HRESULT, IsValid)( THIS_ LPBOOL ) PURE;
  152. // GetXXXXXX
  153. //
  154. // Functions used by the engine for sizing.
  155. STDMETHOD_(HRESULT, GetUnCompressedFrameSize)( THIS_ LPDWORD ) PURE;
  156. STDMETHOD_(HRESULT, GetCompressedFrameSize)( THIS_ LPDWORD ) PURE;
  157. STDMETHOD_(HRESULT, GetNumFramesPerBuffer)( THIS_ LPDWORD ) PURE;
  158. // Convert
  159. //
  160. // Perform actual conversion
  161. STDMETHOD_(HRESULT, Convert)( THIS_ LPVOID, DWORD, LPVOID, LPDWORD, BOOL ) PURE;
  162. };
  163. #endif