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.

217 lines
8.9 KiB

  1. /*
  2. * @DEC_COPYRIGHT@
  3. */
  4. /*
  5. * HISTORY
  6. * $Log: SA.h,v $
  7. * Revision 1.1.8.4 1996/11/14 21:49:22 Hans_Graves
  8. * Added SaDecompressEx() for AC3 multichannels.
  9. * [1996/11/14 21:46:20 Hans_Graves]
  10. *
  11. * Revision 1.1.8.3 1996/11/08 21:50:34 Hans_Graves
  12. * Added AC3 enum types.
  13. * [1996/11/08 21:16:32 Hans_Graves]
  14. *
  15. * Revision 1.1.8.2 1996/07/19 02:11:00 Hans_Graves
  16. * Added SA_PARAM_DEBUG.
  17. * [1996/07/19 01:22:50 Hans_Graves]
  18. *
  19. * Revision 1.1.6.5 1996/04/23 21:01:39 Hans_Graves
  20. * Added protos for SaDecompressQuery() and SaCompressQuery()
  21. * [1996/04/23 20:57:15 Hans_Graves]
  22. *
  23. * Revision 1.1.6.4 1996/04/15 14:18:34 Hans_Graves
  24. * Change proto for SaCompress() - returns bytes processed
  25. * [1996/04/15 14:10:30 Hans_Graves]
  26. *
  27. * Revision 1.1.6.3 1996/04/10 21:47:05 Hans_Graves
  28. * Added PARAMs. Replaced externs with EXTERN.
  29. * [1996/04/10 21:22:49 Hans_Graves]
  30. *
  31. * Revision 1.1.6.2 1996/03/29 22:20:59 Hans_Graves
  32. * Changed include <mme/mmsystem.h> to <mmsystem.h>
  33. * [1996/03/29 22:16:43 Hans_Graves]
  34. *
  35. * Revision 1.1.4.3 1996/02/06 22:53:52 Hans_Graves
  36. * Added PARAM enums
  37. * [1996/02/06 22:18:04 Hans_Graves]
  38. *
  39. * Revision 1.1.4.2 1996/01/15 16:26:21 Hans_Graves
  40. * Added prototypes for SaSetDataDestination() and SaSetBitrate()
  41. * [1996/01/15 15:42:41 Hans_Graves]
  42. *
  43. * Revision 1.1.2.8 1995/09/14 17:28:10 Bjorn_Engberg
  44. * Ported to NT
  45. * [1995/09/14 17:17:18 Bjorn_Engberg]
  46. *
  47. * Revision 1.1.2.7 1995/07/21 17:41:00 Hans_Graves
  48. * Moved Callback related stuff to SC.h
  49. * [1995/07/21 17:27:29 Hans_Graves]
  50. *
  51. * Revision 1.1.2.6 1995/07/17 22:01:30 Hans_Graves
  52. * Defined SaBufferInfo_t as ScBufferInfo_t.
  53. * [1995/07/17 21:41:54 Hans_Graves]
  54. *
  55. * Revision 1.1.2.5 1995/06/27 17:40:59 Hans_Graves
  56. * Added include <mme/mmsystem.h>.
  57. * [1995/06/27 17:39:26 Hans_Graves]
  58. *
  59. * Revision 1.1.2.4 1995/06/27 13:54:20 Hans_Graves
  60. * Added SA_GSM_DECODE and SA_GSM_ENCODE
  61. * [1995/06/26 21:01:12 Hans_Graves]
  62. *
  63. * Revision 1.1.2.3 1995/06/09 18:33:29 Hans_Graves
  64. * Added SaGetInputBitstream() prototype.
  65. * [1995/06/09 17:41:59 Hans_Graves]
  66. *
  67. * Revision 1.1.2.2 1995/05/31 18:09:17 Hans_Graves
  68. * Inclusion in new SLIB location.
  69. * [1995/05/31 15:19:33 Hans_Graves]
  70. *
  71. * Revision 1.1.2.3 1995/04/17 18:26:57 Hans_Graves
  72. * Added ENCODE Codec defs
  73. * [1995/04/17 18:26:33 Hans_Graves]
  74. *
  75. * Revision 1.1.2.2 1995/04/07 19:35:31 Hans_Graves
  76. * Inclusion in SLIB
  77. * [1995/04/07 19:22:48 Hans_Graves]
  78. *
  79. * $EndLog$
  80. */
  81. /*****************************************************************************
  82. ** Copyright (c) Digital Equipment Corporation, 1995 **
  83. ** **
  84. ** All Rights Reserved. Unpublished rights reserved under the copyright **
  85. ** laws of the United States. **
  86. ** **
  87. ** The software contained on this media is proprietary to and embodies **
  88. ** the confidential technology of Digital Equipment Corporation. **
  89. ** Possession, use, duplication or dissemination of the software and **
  90. ** media is authorized only pursuant to a valid written license from **
  91. ** Digital Equipment Corporation. **
  92. ** **
  93. ** RESTRICTED RIGHTS LEGEND Use, duplication, or disclosure by the U.S. **
  94. ** Government is subject to restrictions as set forth in Subparagraph **
  95. ** (c)(1)(ii) of DFARS 252.227-7013, or in FAR 52.227-19, as applicable. **
  96. ******************************************************************************/
  97. #ifndef _SA_H_
  98. #define _SA_H_
  99. #ifdef WIN32
  100. #include <windows.h> /* Windows NT */
  101. #endif
  102. #include <mmsystem.h> /* needed for WAVEFORMATEX structure def */
  103. #include "SC.h"
  104. typedef enum {
  105. SA_MPEG_DECODE = 102,
  106. SA_MPEG_ENCODE = 103,
  107. SA_PCM_DECODE = 104,
  108. SA_PCM_ENCODE = 105,
  109. SA_GSM_DECODE = 106,
  110. SA_GSM_ENCODE = 107,
  111. SA_AC3_DECODE = 108,
  112. SA_AC3_ENCODE = 109,
  113. SA_G723_DECODE = 110,
  114. SA_G723_ENCODE = 111,
  115. SA_TMP_DECODE = 200, /* temp - used for testing */
  116. SA_TMP_ENCODE = 201,
  117. } SaCodecType_e;
  118. #define SA_USE_SAME STREAM_USE_SAME
  119. #define SA_USE_FILE STREAM_USE_FILE
  120. #define SA_USE_BUFFER_QUEUE STREAM_USE_QUEUE
  121. #define SA_USE_BUFFER STREAM_USE_BUFFER
  122. /*
  123. ** Parameters
  124. */
  125. typedef enum {
  126. SA_PARAM_NATIVEFORMAT, /* native/preferred decompressed format (FOURCC) */
  127. SA_PARAM_BITRATE, /* bitrate - bits per second */
  128. SA_PARAM_CHANNELS, /* channels - 1=mono, 2=stereo, 4/5=surround */
  129. SA_PARAM_AUDIOLENGTH, /* milliseconds of audio */
  130. SA_PARAM_SAMPLESPERSEC, /* samples per second (8000, 11025, 22050, etc.)
  131. SA_PARAM_BITSPERSAMPLE, /* bits per sample (8 or 16) */
  132. SA_PARAM_TIMECODE, /* audio time code */
  133. SA_PARAM_MPEG_LAYER, /* MPEG Layer: I, II, or III */
  134. SA_PARAM_PSY_MODEL, /* Psy Acoustic Model */
  135. SA_PARAM_ALGFLAGS, /* Algorithm flags */
  136. SA_PARAM_QUALITY, /* Quality: 0=worst 99>=best */
  137. SA_PARAM_FASTDECODE, /* Fast decode desired */
  138. SA_PARAM_FASTENCODE, /* Fast encode desired */
  139. SA_PARAM_DEBUG, /* Setup debug */
  140. } SaParameter_t;
  141. /*
  142. ** Type definitions
  143. */
  144. typedef int SaStatus_t;
  145. typedef void *SaHandle_t;
  146. typedef ScCallbackInfo_t SaCallbackInfo_t;
  147. /*
  148. ** Store basic info for user about the codec
  149. */
  150. typedef struct SaInfo_s {
  151. SaCodecType_e Type; /* Codec Type */
  152. char Name[20]; /* Codec name (i.e. "MPEG-Decode") */
  153. char Description[128]; /* Codec description */
  154. unsigned int Version; /* Codec version number */
  155. int CodecStarted; /* SaDecompressBegin/End */
  156. unsigned int MS; /* Number of milliseconds processed */
  157. unsigned int NumBytesIn; /* Number of bytes input */
  158. unsigned int NumBytesOut; /* Number of bytes output */
  159. unsigned int NumFrames; /* Number of ellapsed frames */
  160. unsigned long TotalFrames; /* Total number of frames */
  161. unsigned long TotalMS; /* Total number of milliseconds */
  162. } SaInfo_t;
  163. /***************************** Prototypes ********************************/
  164. EXTERN SaStatus_t SaOpenCodec (SaCodecType_e CodecType, SaHandle_t *Sah);
  165. EXTERN SaStatus_t SaCloseCodec (SaHandle_t Sah);
  166. EXTERN SaStatus_t SaRegisterCallback (SaHandle_t Sah,
  167. int (*Callback)(SaHandle_t, SaCallbackInfo_t *, SaInfo_t *),
  168. void *UserData);
  169. EXTERN ScBitstream_t *SaGetInputBitstream (SaHandle_t Sah);
  170. EXTERN SaStatus_t SaDecompressQuery(SaHandle_t Sah, WAVEFORMATEX *wfIn,
  171. WAVEFORMATEX *wfOut);
  172. EXTERN SaStatus_t SaDecompressBegin (SaHandle_t Sah, WAVEFORMATEX *wfIn,
  173. WAVEFORMATEX *wfOut);
  174. EXTERN SaStatus_t SaDecompress (SaHandle_t Sah, u_char *CompData,
  175. unsigned int CompLen,
  176. u_char *DcmpData, unsigned int *DcmpLen);
  177. PRIVATE_EXTERN SaStatus_t SaDecompressEx (SaHandle_t Sah, u_char *CompData,
  178. unsigned int CompLen,
  179. u_char **DcmpData, unsigned int *DcmpLen);
  180. EXTERN SaStatus_t SaDecompressEnd (SaHandle_t Sah);
  181. EXTERN SaStatus_t SaCompressQuery(SaHandle_t Sah, WAVEFORMATEX *wfIn,
  182. WAVEFORMATEX *wfOut);
  183. EXTERN SaStatus_t SaCompressBegin (SaHandle_t Sah, WAVEFORMATEX *wfIn,
  184. WAVEFORMATEX *wfOut);
  185. EXTERN SaStatus_t SaCompress (SaHandle_t Sah,
  186. u_char *DcmpData, unsigned int *DcmpLen,
  187. u_char *CompData, unsigned int *CompLen);
  188. EXTERN SaStatus_t SaCompressEnd (SaHandle_t Sah);
  189. EXTERN SaStatus_t SaSetDataSource(SaHandle_t Sah, int Source, int Fd,
  190. void *Buffer_UserData, int BufSize);
  191. EXTERN SaStatus_t SaSetDataDestination(SaHandle_t Sah, int Dest, int Fd,
  192. void *Buffer_UserData, int BufSize);
  193. EXTERN ScBitstream_t *SaGetDataSource (SaHandle_t Sah);
  194. EXTERN ScBitstream_t *SaGetDataDestination(SaHandle_t Sah);
  195. EXTERN SaStatus_t SaAddBuffer (SaHandle_t Sah, SaCallbackInfo_t *BufferInfo);
  196. #ifdef MPEG_SUPPORT
  197. EXTERN SaStatus_t sa_GetMpegAudioInfo(int fd, WAVEFORMATEX *wf,
  198. SaInfo_t *info);
  199. #endif /* MPEG_SUPPORT */
  200. EXTERN SaStatus_t SaSetParamBoolean(SaHandle_t Sah, SaParameter_t param,
  201. ScBoolean_t value);
  202. EXTERN SaStatus_t SaSetParamInt(SaHandle_t Sah, SaParameter_t param,
  203. qword value);
  204. EXTERN ScBoolean_t SaGetParamBoolean(SaHandle_t Sah, SaParameter_t param);
  205. EXTERN qword SaGetParamInt(SaHandle_t Sah, SaParameter_t param);
  206. #endif _SA_H_