bladedll.h
上传用户:bjsgzm
上传日期:2007-01-08
资源大小:256k
文件大小:4k
源码类别:

mpeg/mp3

开发平台:

Visual C++

  1. /*
  2. bladedll.h
  3.     +++++++++++++++++++++++++++
  4. +   Blade's Encoder DLL   +
  5. +++++++++++++++++++++++++++
  6.     ------------------------------------------------------
  7. - Version 1.00 (7 November 1998) - Jukka Poikolainen -
  8. ------------------------------------------------------
  9. Initial version
  10. ------------------------------------------------------
  11. - Version x.xx (x xxxxxxxx xxxx) - xxxxx xxxxxxxxxxx -
  12. ------------------------------------------------------
  13. */
  14. #ifndef ___BLADEDLL_H_INCLUDED___
  15. #define ___BLADEDLL_H_INCLUDED___
  16. #pragma pack(push)
  17. #pragma pack(1)
  18. /* encoding formats */
  19. #define BE_CONFIG_MP3 0
  20. /* type definitions */
  21. typedef unsigned long HBE_STREAM;
  22. typedef HBE_STREAM *PHBE_STREAM;
  23. typedef unsigned long BE_ERR;
  24. /* error codes */
  25. #define BE_ERR_SUCCESSFUL 0x00000000
  26. #define BE_ERR_INVALID_FORMAT 0x00000001
  27. #define BE_ERR_INVALID_FORMAT_PARAMETERS 0x00000002
  28. #define BE_ERR_NO_MORE_HANDLES 0x00000003
  29. #define BE_ERR_INVALID_HANDLE 0x00000004
  30. /* other constants */
  31. #define BE_MAX_HOMEPAGE 256
  32. /* format specific variables */
  33. #define BE_MP3_MODE_STEREO 0
  34. #define BE_MP3_MODE_DUALCHANNEL 2
  35. #define BE_MP3_MODE_MONO 3
  36. typedef struct {
  37. DWORD dwConfig; // BE_CONFIG_XXXXX
  38. // Currently only BE_CONFIG_MP3 is supported
  39. union {
  40. struct {
  41. DWORD dwSampleRate; // 48000, 44100 and 32000 allowed
  42. BYTE byMode; // BE_MP3_MODE_STEREO, BE_MP3_MODE_DUALCHANNEL, BE_MP3_MODE_MONO
  43. WORD wBitrate; // 32, 40, 48, 56, 64, 80, 96, 112, 128, 160, 192, 224, 256 and 320 allowed
  44. BOOL bPrivate;
  45. BOOL bCRC;
  46. BOOL bCopyright;
  47. BOOL bOriginal;
  48. } mp3; // BE_CONFIG_MP3
  49. struct {
  50. DWORD dwSampleRate;
  51. BYTE byMode;
  52. WORD wBitrate;
  53. BYTE byEncodingMethod;
  54. } aac;
  55. } format;
  56. } BE_CONFIG, *PBE_CONFIG;
  57. typedef struct {
  58. // BladeEnc DLL Version number
  59. BYTE byDLLMajorVersion;
  60. BYTE byDLLMinorVersion;
  61. // BladeEnc Engine Version Number
  62. BYTE byMajorVersion;
  63. BYTE byMinorVersion;
  64. // DLL Release date
  65. BYTE byDay;
  66. BYTE byMonth;
  67. WORD wYear;
  68. // BladeEnc Homepage URL
  69. CHAR zHomepage[BE_MAX_HOMEPAGE + 1];
  70. } BE_VERSION, *PBE_VERSION;
  71. #ifndef _BLADEDLL
  72. typedef BE_ERR (*BEINITSTREAM) (PBE_CONFIG, PDWORD, PDWORD, PHBE_STREAM);
  73. typedef BE_ERR (*BEENCODECHUNK) (HBE_STREAM, DWORD, PSHORT, PBYTE, PDWORD);
  74. typedef BE_ERR (*BEDEINITSTREAM) (HBE_STREAM, PBYTE, PDWORD);
  75. typedef BE_ERR (*BECLOSESTREAM) (HBE_STREAM);
  76. typedef VOID (*BEVERSION) (PBE_VERSION);
  77. #define TEXT_BEINITSTREAM "beInitStream"
  78. #define TEXT_BEENCODECHUNK "beEncodeChunk"
  79. #define TEXT_BEDEINITSTREAM "beDeinitStream"
  80. #define TEXT_BECLOSESTREAM "beCloseStream"
  81. #define TEXT_BEVERSION "beVersion"
  82. /*
  83. BE_ERR beInitStream(PBE_CONFIG pbeConfig, PDWORD dwSamples, PDWORD dwBufferSize, PHBE_STREAM phbeStream);
  84. BE_ERR beEncodeChunk(HBE_STREAM hbeStream, DWORD nSamples, PSHORT pSamples, PBYTE pOutput, PDWORD pdwOutput);
  85. BE_ERR beDeinitStream(HBE_STREAM hbeStream, PBYTE pOutput, PDWORD pdwOutput);
  86. BE_ERR beCloseStream(HBE_STREAM hbeStream);
  87. VOID beVersion(PBE_VERSION pbeVersion);
  88. */
  89. #else
  90. __declspec(dllexport) BE_ERR beInitStream(PBE_CONFIG pbeConfig, PDWORD dwSamples, PDWORD dwBufferSize, PHBE_STREAM phbeStream);
  91. __declspec(dllexport) BE_ERR beEncodeChunk(HBE_STREAM hbeStream, DWORD nSamples, PSHORT pSamples, PBYTE pOutput, PDWORD pdwOutput);
  92. __declspec(dllexport) BE_ERR beDeinitStream(HBE_STREAM hbeStream, PBYTE pOutput, PDWORD pdwOutput);
  93. __declspec(dllexport) BE_ERR beCloseStream(HBE_STREAM hbeStream);
  94. __declspec(dllexport) VOID beVersion(PBE_VERSION pbeVersion);
  95. #endif
  96. #pragma pack(pop)
  97. #endif