bladedll.h
上传用户:xmgzy123
上传日期:2007-01-07
资源大小:373k
文件大小:6k
源码类别:

SCSI/ASPI

开发平台:

WINDOWS

  1. /*
  2.   
  3.   bladedll.h
  4.   
  5.   +++++++++++++++++++++++++++
  6.   +   Blade's Encoder DLL   +
  7.   +++++++++++++++++++++++++++
  8.   
  9.   ------------------------------------------------------
  10.   - Version 1.00 (7 November 1998) - Jukka Poikolainen -
  11.   ------------------------------------------------------
  12.   
  13.   Initial version
  14.   
  15.   ------------------------------------------------------
  16.   - Version x.xx (x xxxxxxxx xxxx) - xxxxx xxxxxxxxxxx -
  17.   ------------------------------------------------------
  18.   
  19. */
  20. /*
  21.  * JAK - Feb 1999: Original file slightly modified for use with
  22.  *                 Mingw32/CygWin compilers
  23.  * JAK - Jan 2000: Modified for lame_enc.dll
  24.  */
  25. #ifndef ___BLADEDLL_H_INCLUDED___
  26. #define ___BLADEDLL_H_INCLUDED___
  27. #pragma pack(push)
  28. #pragma pack(1)
  29. #ifndef __GNUC__
  30. #define PACKED
  31. #pragma pack(1)
  32. #endif
  33. /* encoding formats */
  34. #define         BE_CONFIG_MP3          0
  35. #define         BE_CONFIG_LAME         256
  36. /* type definitions */
  37. typedef         unsigned long          HBE_STREAM;
  38. typedef         HBE_STREAM            *PHBE_STREAM;
  39. typedef         unsigned long          BE_ERR;
  40. /* error codes */
  41. #define         BE_ERR_SUCCESSFUL      0x00000000
  42. #define         BE_ERR_INVALID_FORMAT  0x00000001
  43. #define         BE_ERR_INVALID_FORMAT_PARAMETERS 0x00000002
  44. #define         BE_ERR_NO_MORE_HANDLES 0x00000003
  45. #define         BE_ERR_INVALID_HANDLE  0x00000004
  46. /* other constants */
  47. #define BE_MAX_HOMEPAGE 256
  48. /* format specific variables */
  49. #define  BE_MP3_MODE_STEREO          0
  50. #define  BE_MP3_MODE_JSTEREO         1
  51. #define  BE_MP3_MODE_DUALCHANNEL     2
  52. #define  BE_MP3_MODE_MONO            3
  53. #define  MPEG1    1
  54. #define  MPEG2    0
  55. typedef enum {
  56.   NORMAL_QUALITY=0,
  57.   LOW_QUALITY,
  58.   HIGH_QUALITY,
  59.   VOICE_QUALITY,
  60. } MPEG_QUALITY;
  61. typedef struct {
  62.   DWORD dwConfig;              // BE_CONFIG_XXXXX
  63.   union {
  64.     struct {  
  65.       DWORD  dwSampleRate;     // 48000, 44100 and 32000 allowed
  66.       BYTE   byMode;           // BE_MP3_MODE_STEREO, BE_MP3_MODE_DUALCHANNEL,
  67.                                // BE_MP3_MODE_MONO
  68.       WORD   wBitrate;         // 32, 40, 48, 56, 64, 80, 96, 112, 128,
  69.                                // 160, 192, 224, 256 and 320 allowed
  70.       BOOL   bPrivate;
  71.       BOOL   bCRC;
  72.       BOOL   bCopyright;
  73.       BOOL   bOriginal;
  74.     } PACKED mp3;  // BE_CONFIG_MP3
  75.     struct {
  76.       // STRUCTURE INFORMATION
  77.       DWORD  dwStructVersion;
  78.       DWORD  dwStructSize;
  79.       // BASIC ENCODER SETTINGS
  80.       DWORD  dwSampleRate;      // depends on dwMPEGVersion
  81.       DWORD  dwReSampleRate;    // downsample rate, 0=encoder decides
  82.       INT    nMode;             // BE_MP3_MODE_STEREO, BE_MP3_MODE_DUALCHANNEL,
  83.                                 // BE_MP3_MODE_MONO
  84.       DWORD  dwBitrate;         // CBR bitrate, VBR min bitrate
  85.       DWORD  dwMaxBitrate;      // CBR ignored, VBR max bitrate
  86.       MPEG_QUALITY nQuality;    // NORMAL, HIGH, LOW, VOICE
  87.       DWORD  dwMpegVersion;     // MPEG1 or MPEG2
  88.       DWORD  dwPsyModel;        // currently not used
  89.       DWORD  dwEmphasis;        // currently not used
  90.       // BIT STREAM SETTINGS
  91.       BOOL   bPrivate;          // Set Private Bit
  92.       BOOL   bCRC;              // Insert CRC
  93.       BOOL   bCopyright;        // Set copyright bit
  94.       BOOL   bOriginal;         // Set original bit
  95.       // VBR STUFF
  96.       BOOL   bWriteVBRHeader;   // Write XING VBR header
  97.       BOOL   bEnableVBR;        // Use VBR encoding
  98.       INT    nVBRQuality;       // VBR quality 0..9
  99.       BYTE   btReserved[255];   // Reserved for future use
  100.     } LHV1;
  101.     struct {
  102.       DWORD  dwSampleRate;
  103.       BYTE   byMode;
  104.       WORD   wBitrate;
  105.       BYTE   byEncodingMethod;
  106.     } PACKED aac;
  107.     
  108.   } PACKED format;
  109.   
  110. } PACKED BE_CONFIG, *PBE_CONFIG;
  111. typedef struct {
  112.   
  113.   // BladeEnc DLL Version number
  114.   
  115.   BYTE byDLLMajorVersion;
  116.   BYTE byDLLMinorVersion;
  117.   
  118.   // BladeEnc Engine Version Number
  119.   
  120.   BYTE byMajorVersion;
  121.   BYTE byMinorVersion;
  122.   
  123.   // DLL Release date
  124.   
  125.   BYTE byDay;
  126.   BYTE byMonth;
  127.   WORD wYear;
  128.   
  129.   // BladeEnc Homepage URL
  130.   
  131.   CHAR zHomepage[BE_MAX_HOMEPAGE + 1];
  132.   
  133. } PACKED BE_VERSION, *PBE_VERSION;
  134. #ifndef _BLADEDLL
  135. typedef BE_ERR (*BEINITSTREAM) (PBE_CONFIG, PDWORD, PDWORD, PHBE_STREAM);
  136. typedef BE_ERR (*BEENCODECHUNK) (HBE_STREAM, DWORD, PSHORT, PBYTE, PDWORD);
  137. typedef BE_ERR (*BEDEINITSTREAM) (HBE_STREAM, PBYTE, PDWORD);
  138. typedef BE_ERR (*BECLOSESTREAM) (HBE_STREAM);
  139. typedef VOID (*BEVERSION) (PBE_VERSION);
  140. #define TEXT_BEINITSTREAM "beInitStream"
  141. #define TEXT_BEENCODECHUNK "beEncodeChunk"
  142. #define TEXT_BEDEINITSTREAM "beDeinitStream"
  143. #define TEXT_BECLOSESTREAM "beCloseStream"
  144. #define TEXT_BEVERSION "beVersion"
  145. /*
  146. BE_ERR beInitStream(PBE_CONFIG pbeConfig, PDWORD dwSamples, PDWORD dwBufferSize, PHBE_STREAM phbeStream);
  147. BE_ERR beEncodeChunk(HBE_STREAM hbeStream, DWORD nSamples, PSHORT pSamples, PBYTE pOutput, PDWORD pdwOutput);
  148. BE_ERR beDeinitStream(HBE_STREAM hbeStream, PBYTE pOutput, PDWORD pdwOutput);
  149. BE_ERR beCloseStream(HBE_STREAM hbeStream);
  150. VOID beVersion(PBE_VERSION pbeVersion);
  151. */
  152. #else
  153. __declspec(dllexport) BE_ERR beInitStream(PBE_CONFIG pbeConfig, PDWORD dwSamples, PDWORD dwBufferSize, PHBE_STREAM phbeStream);
  154. __declspec(dllexport) BE_ERR beEncodeChunk(HBE_STREAM hbeStream, DWORD nSamples, PSHORT pSamples, PBYTE pOutput, PDWORD pdwOutput);
  155. __declspec(dllexport) BE_ERR beDeinitStream(HBE_STREAM hbeStream, PBYTE pOutput, PDWORD pdwOutput);
  156. __declspec(dllexport) BE_ERR beCloseStream(HBE_STREAM hbeStream);
  157. __declspec(dllexport) VOID beVersion(PBE_VERSION pbeVersion);
  158. #endif
  159. #pragma pack(pop)
  160. #endif