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.

316 lines
8.3 KiB

  1. //==========================================================================;
  2. //
  3. // THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY
  4. // KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE
  5. // IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR
  6. // PURPOSE.
  7. //
  8. // Copyright (c) 1993-1998 Microsoft Corporation
  9. //
  10. //--------------------------------------------------------------------------;
  11. //
  12. // codec.h
  13. //
  14. // Description:
  15. // This file contains codec definitions, Win16/Win32 compatibility
  16. // definitions, and instance structure definitions.
  17. //
  18. //
  19. //==========================================================================;
  20. #ifndef _INC_CODEC
  21. #define _INC_CODEC // #defined if codec.h has been included
  22. #ifndef RC_INVOKED
  23. #pragma pack(1) // assume byte packing throughout
  24. #endif
  25. #ifndef EXTERN_C
  26. #ifdef __cplusplus
  27. #define EXTERN_C extern "C"
  28. #else
  29. #define EXTERN_C extern
  30. #endif
  31. #endif
  32. #ifdef __cplusplus
  33. extern "C" // assume C declarations for C++
  34. {
  35. #endif
  36. //- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - ;
  37. //
  38. // ACM Driver Version:
  39. //
  40. // the version is a 32 bit number that is broken into three parts as
  41. // follows:
  42. //
  43. // bits 24 - 31: 8 bit _major_ version number
  44. // bits 16 - 23: 8 bit _minor_ version number
  45. // bits 0 - 15: 16 bit build number
  46. //
  47. // this is then displayed as follows (in decimal form):
  48. //
  49. // bMajor = (BYTE)(dwVersion >> 24)
  50. // bMinor = (BYTE)(dwVersion >> 16) &
  51. // wBuild = LOWORD(dwVersion)
  52. //
  53. // VERSION_ACM_DRIVER is the version of this driver.
  54. // VERSION_MSACM is the version of the ACM that this driver
  55. // was designed for (requires).
  56. //
  57. //- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - ;
  58. #ifdef _WIN32
  59. //
  60. // 32-bit versions
  61. //
  62. #if (WINVER >= 0x0400)
  63. #define VERSION_ACM_DRIVER MAKE_ACM_VERSION(4, 0, 0)
  64. #else
  65. #define VERSION_ACM_DRIVER MAKE_ACM_VERSION(3, 50, 0)
  66. #endif
  67. #define VERSION_MSACM MAKE_ACM_VERSION(3, 50, 0)
  68. #else
  69. //
  70. // 16-bit versions
  71. //
  72. #define VERSION_ACM_DRIVER MAKE_ACM_VERSION(1, 0, 0)
  73. #define VERSION_MSACM MAKE_ACM_VERSION(2, 1, 0)
  74. #endif
  75. //- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - ;
  76. //
  77. // Win 16/32 portability stuff...
  78. //
  79. //
  80. //
  81. //- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - ;
  82. #ifndef _WIN32
  83. #ifndef FNLOCAL
  84. #define FNLOCAL NEAR PASCAL
  85. #define FNCLOCAL NEAR _cdecl
  86. #define FNGLOBAL FAR PASCAL
  87. #define FNCGLOBAL FAR _cdecl
  88. #ifdef _WINDLL
  89. #define FNWCALLBACK FAR PASCAL _loadds
  90. #define FNEXPORT FAR PASCAL _export
  91. #else
  92. #define FNWCALLBACK FAR PASCAL
  93. #define FNEXPORT FAR PASCAL _export
  94. #endif
  95. #endif
  96. //
  97. //
  98. //
  99. //
  100. #ifndef FIELD_OFFSET
  101. #define FIELD_OFFSET(type, field) ((LONG)&(((type *)0)->field))
  102. #endif
  103. //
  104. // based code makes since only in win 16 (to try and keep stuff out of
  105. // our fixed data segment...
  106. //
  107. #define BCODE _based(_segname("_CODE"))
  108. #define HUGE _huge
  109. //
  110. // stuff for Unicode in Win 32--make it a noop in Win 16
  111. //
  112. #ifndef _TCHAR_DEFINED
  113. #define _TCHAR_DEFINED
  114. typedef char TCHAR, *PTCHAR;
  115. typedef unsigned char TBYTE, *PTUCHAR;
  116. typedef PSTR PTSTR, PTCH;
  117. typedef LPSTR LPTSTR, LPTCH;
  118. typedef LPCSTR LPCTSTR;
  119. #endif
  120. #define TEXT(a) a
  121. #define SIZEOF(x) sizeof(x)
  122. #define SIZEOFACMSTR(x) sizeof(x)
  123. #else
  124. #ifndef FNLOCAL
  125. #define FNLOCAL _stdcall
  126. #define FNCLOCAL _stdcall
  127. #define FNGLOBAL _stdcall
  128. #define FNCGLOBAL _stdcall
  129. #define FNWCALLBACK CALLBACK
  130. #define FNEXPORT CALLBACK
  131. #endif
  132. #ifndef try
  133. #define try __try
  134. #define leave __leave
  135. #define except __except
  136. #define finally __finally
  137. #endif
  138. //
  139. // there is no reason to have based stuff in win 32
  140. //
  141. #define BCODE
  142. #define HUGE
  143. #define HTASK HANDLE
  144. #define SELECTOROF(a) (a)
  145. //
  146. // for compiling Unicode
  147. //
  148. #ifdef UNICODE
  149. #define SIZEOF(x) (sizeof(x)/sizeof(WCHAR))
  150. #else
  151. #define SIZEOF(x) sizeof(x)
  152. #endif
  153. #define SIZEOFACMSTR(x) (sizeof(x)/sizeof(WCHAR))
  154. #endif
  155. //- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - ;
  156. //
  157. // misc defines for misc sizes and things...
  158. //
  159. //
  160. //- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - ;
  161. //
  162. // bilingual. this allows the same identifier to be used in resource files
  163. // and code without having to decorate the id in your code.
  164. //
  165. #ifdef RC_INVOKED
  166. #define RCID(id) id
  167. #else
  168. #define RCID(id) MAKEINTRESOURCE(id)
  169. #endif
  170. //
  171. //
  172. //
  173. #define SIZEOF_ARRAY(ar) (sizeof(ar)/sizeof((ar)[0]))
  174. //
  175. // macros to compute block alignment and convert between samples and bytes
  176. // of PCM data. note that these macros assume:
  177. //
  178. // wBitsPerSample = 8 or 16
  179. // nChannels = 1 or 2
  180. //
  181. // the pwf argument is a pointer to a PCMWAVEFORMAT structure.
  182. //
  183. #define PCM_BLOCKALIGNMENT(pwf) (UINT)(((pwf)->wBitsPerSample >> 3) << ((pwf)->wf.nChannels >> 1))
  184. #define PCM_AVGBYTESPERSEC(pwf) (DWORD)((pwf)->wf.nSamplesPerSec * (pwf)->wf.nBlockAlign)
  185. #define PCM_BYTESTOSAMPLES(pwf, dw) (DWORD)(dw / PCM_BLOCKALIGNMENT(pwf))
  186. #define PCM_SAMPLESTOBYTES(pwf, dw) (DWORD)(dw * PCM_BLOCKALIGNMENT(pwf))
  187. //- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - ;
  188. //
  189. //
  190. //
  191. //
  192. //- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - ;
  193. typedef struct tDRIVERINSTANCE
  194. {
  195. //
  196. // although not required, it is suggested that the first two members
  197. // of this structure remain as fccType and DriverProc _in this order_.
  198. // the reason for this is that the driver will be easier to combine
  199. // with other types of drivers (defined by AVI) in the future.
  200. //
  201. FOURCC fccType; // type of driver: 'audc'
  202. DRIVERPROC fnDriverProc; // driver proc for the instance
  203. //
  204. // the remaining members of this structure are entirely open to what
  205. // your driver requires.
  206. //
  207. HDRVR hdrvr; // driver handle we were opened with
  208. HINSTANCE hinst; // DLL module handle.
  209. DWORD vdwACM; // current version of ACM opening you
  210. DWORD fdwOpen; // flags from open description
  211. DWORD fdwConfig; // driver instance configuration flags
  212. } DRIVERINSTANCE, *PDRIVERINSTANCE, FAR *LPDRIVERINSTANCE;
  213. //- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - ;
  214. //
  215. //
  216. //
  217. //
  218. //- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - ;
  219. //
  220. //
  221. //
  222. //
  223. typedef LRESULT (FNGLOBAL *STREAMCONVERTPROC)
  224. (
  225. LPACMDRVSTREAMINSTANCE padsi,
  226. LPACMDRVSTREAMHEADER padsh
  227. );
  228. //
  229. //
  230. //
  231. //
  232. typedef struct tSTREAMINSTANCE
  233. {
  234. STREAMCONVERTPROC fnConvert; // stream instance conversion proc
  235. DWORD fdwConfig; // stream instance configuration flags
  236. } STREAMINSTANCE, *PSTREAMINSTANCE, FAR *LPSTREAMINSTANCE;
  237. //- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - ;
  238. //
  239. // resource id's
  240. //
  241. //
  242. //- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - ;
  243. #define IDS_ACM_DRIVER_SHORTNAME (1) // ACMDRIVERDETAILS.szShortName
  244. #define IDS_ACM_DRIVER_LONGNAME (2) // ACMDRIVERDETAILS.szLongName
  245. #define IDS_ACM_DRIVER_COPYRIGHT (3) // ACMDRIVERDETAILS.szCopyright
  246. #define IDS_ACM_DRIVER_LICENSING (4) // ACMDRIVERDETAILS.szLicensing
  247. #define IDS_ACM_DRIVER_FEATURES (5) // ACMDRIVERDETAILS.szFeatures
  248. #define IDS_ACM_DRIVER_TAG_NAME_ALAW (20) // ACMFORMATTAGDETAILS.szFormatTag
  249. #define IDS_ACM_DRIVER_TAG_NAME_MULAW (30) // ACMFORMATTAGDETAILS.szFormatTag
  250. //- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - ;
  251. //
  252. //
  253. //
  254. //- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - ;
  255. #ifndef RC_INVOKED
  256. #pragma pack() // revert to default packing
  257. #endif
  258. #ifdef __cplusplus
  259. } // end of extern "C" {
  260. #endif
  261. #endif // _INC_CODEC