xapo.idl 4.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154
  1. /*
  2. * Copyright (c) 2015 Andrew Eikum for CodeWeavers
  3. *
  4. * This library is free software; you can redistribute it and/or
  5. * modify it under the terms of the GNU Lesser General Public
  6. * License as published by the Free Software Foundation; either
  7. * version 2.1 of the License, or (at your option) any later version.
  8. *
  9. * This library is distributed in the hope that it will be useful,
  10. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  11. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
  12. * Lesser General Public License for more details.
  13. *
  14. * You should have received a copy of the GNU Lesser General Public
  15. * License along with this library; if not, write to the Free Software
  16. * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
  17. */
  18. import "unknwn.idl";
  19. #define XAPO_REGISTRATION_STRING_LENGTH 256
  20. cpp_quote("#define XAPO_FLAG_CHANNELS_MUST_MATCH 0x1")
  21. cpp_quote("#define XAPO_FLAG_FRAMERATE_MUST_MATCH 0x2")
  22. cpp_quote("#define XAPO_FLAG_BITSPERSAMPLE_MUST_MATCH 0x4")
  23. cpp_quote("#define XAPO_FLAG_BUFFERCOUNT_MUST_MATCH 0x8")
  24. cpp_quote("#define XAPO_FLAG_INPLACE_SUPPORTED 0x10")
  25. cpp_quote("#define XAPO_FLAG_INPLACE_REQUIRED 0x20")
  26. cpp_quote("#if 0")
  27. typedef struct WAVEFORMATEX
  28. {
  29. WORD wFormatTag;
  30. WORD nChannels;
  31. DWORD nSamplesPerSec;
  32. DWORD nAvgBytesPerSec;
  33. WORD nBlockAlign;
  34. WORD wBitsPerSample;
  35. WORD cbSize;
  36. } WAVEFORMATEX;
  37. typedef struct {
  38. WAVEFORMATEX Format;
  39. union {
  40. WORD wValidBitsPerSample;
  41. WORD wSamplesPerBlock;
  42. WORD wReserved;
  43. } Samples;
  44. DWORD dwChannelMask;
  45. GUID SubFormat;
  46. } WAVEFORMATEXTENSIBLE, *PWAVEFORMATEXTENSIBLE;
  47. cpp_quote("#else")
  48. cpp_quote("#include <mmreg.h>")
  49. cpp_quote("#endif")
  50. typedef struct XAPO_REGISTRATION_PROPERTIES
  51. {
  52. CLSID clsid;
  53. WCHAR FriendlyName[XAPO_REGISTRATION_STRING_LENGTH];
  54. WCHAR CopyrightInfo[XAPO_REGISTRATION_STRING_LENGTH];
  55. UINT32 MajorVersion;
  56. UINT32 MinorVersion;
  57. UINT32 Flags;
  58. UINT32 MinInputBufferCount;
  59. UINT32 MaxInputBufferCount;
  60. UINT32 MinOutputBufferCount;
  61. UINT32 MaxOutputBufferCount;
  62. } XAPO_REGISTRATION_PROPERTIES;
  63. typedef struct XAPO20_REGISTRATION_PROPERTIES
  64. {
  65. CLSID clsid;
  66. WCHAR FriendlyName[XAPO_REGISTRATION_STRING_LENGTH];
  67. WCHAR CopyrightInfo[XAPO_REGISTRATION_STRING_LENGTH];
  68. UINT32 MajorVersion;
  69. UINT32 MinorVersion;
  70. UINT32 Flags;
  71. UINT32 MinInputBufferCount;
  72. UINT32 MaxInputBufferCount;
  73. UINT32 MinOutputBufferCount;
  74. UINT32 MaxOutputBufferCount;
  75. UINT32 InterfaceCount;
  76. IID InterfaceArray[1];
  77. } XAPO20_REGISTRATION_PROPERTIES;
  78. typedef struct XAPO_LOCKFORPROCESS_BUFFER_PARAMETERS {
  79. const WAVEFORMATEX *pFormat;
  80. UINT32 MaxFrameCount;
  81. } XAPO_LOCKFORPROCESS_BUFFER_PARAMETERS;
  82. typedef enum XAPO_BUFFER_FLAGS {
  83. XAPO_BUFFER_SILENT,
  84. XAPO_BUFFER_VALID
  85. } XAPO_BUFFER_FLAGS;
  86. typedef struct XAPO_PROCESS_BUFFER_PARAMETERS {
  87. void *pBuffer;
  88. XAPO_BUFFER_FLAGS BufferFlags;
  89. UINT32 ValidFrameCount;
  90. } XAPO_PROCESS_BUFFER_PARAMETERS;
  91. /* XAudio2 2.8 version of IXAPO */
  92. [
  93. object,
  94. local,
  95. uuid(a410b984-9839-4819-a0be-2856ae6b3adb)
  96. ]
  97. interface IXAPO : IUnknown
  98. {
  99. HRESULT GetRegistrationProperties([out] XAPO_REGISTRATION_PROPERTIES **props);
  100. HRESULT IsInputFormatSupported(const WAVEFORMATEX *output_fmt,
  101. const WAVEFORMATEX *input_fmt, WAVEFORMATEX **supported_fmt);
  102. HRESULT IsOutputFormatSupported(const WAVEFORMATEX *input_fmt,
  103. const WAVEFORMATEX *output_fmt, WAVEFORMATEX **supported_fmt);
  104. HRESULT Initialize(const void *data, UINT32 data_len);
  105. void Reset(void);
  106. HRESULT LockForProcess(UINT32 in_params_count, const XAPO_LOCKFORPROCESS_BUFFER_PARAMETERS *in_params,
  107. UINT32 out_params_count, const XAPO_LOCKFORPROCESS_BUFFER_PARAMETERS *out_params);
  108. void UnlockForProcess(void);
  109. void Process(UINT32 in_params_count, const XAPO_PROCESS_BUFFER_PARAMETERS *in_params,
  110. UINT32 out_params_count, XAPO_PROCESS_BUFFER_PARAMETERS *out_params,
  111. BOOL enabled);
  112. UINT32 CalcInputFrames(UINT32 output_frames);
  113. UINT32 CalcOutputFrames(UINT32 input_frames);
  114. }
  115. /* XAudio2 2.7 version of IXAPO is identical to 2.8 */
  116. cpp_quote("DEFINE_GUID(IID_IXAPO27, 0xa90bc001, 0xe897, 0xe897, 0x55, 0xe4, 0x9e, 0x47, 0x00, 0x00, 0x00, 0x00);")
  117. /* XAudio2 2.8 version of IXAPOParameters */
  118. [
  119. object,
  120. local,
  121. uuid(26d95c66-80f2-499a-ad54-5ae7f01c6d98)
  122. ]
  123. interface IXAPOParameters : IUnknown
  124. {
  125. void SetParameters(const void *params, UINT32 params_len);
  126. void GetParameters(void *params, UINT32 params_len);
  127. }
  128. /* XAudio2 2.7 version of IXAPOParameters is identical to 2.8 */
  129. cpp_quote("DEFINE_GUID(IID_IXAPO27Parameters, 0xa90bc001, 0xe897, 0xe897, 0x55, 0xe4, 0x9e, 0x47, 0x00, 0x00, 0x00, 0x01);")