| 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 |
|
| 19 |
import "unknwn.idl"; |
| 20 |
|
| 21 |
#define XAPO_REGISTRATION_STRING_LENGTH 256 |
| 22 |
|
| 23 |
cpp_quote("#define XAPO_FLAG_CHANNELS_MUST_MATCH 0x1") |
| 24 |
cpp_quote("#define XAPO_FLAG_FRAMERATE_MUST_MATCH 0x2") |
| 25 |
cpp_quote("#define XAPO_FLAG_BITSPERSAMPLE_MUST_MATCH 0x4") |
| 26 |
cpp_quote("#define XAPO_FLAG_BUFFERCOUNT_MUST_MATCH 0x8") |
| 27 |
cpp_quote("#define XAPO_FLAG_INPLACE_SUPPORTED 0x10") |
| 28 |
cpp_quote("#define XAPO_FLAG_INPLACE_REQUIRED 0x20") |
| 29 |
|
| 30 |
cpp_quote("#if 0") |
| 31 |
typedef struct WAVEFORMATEX |
| 32 |
{ |
| 33 |
WORD wFormatTag; |
| 34 |
WORD nChannels; |
| 35 |
DWORD nSamplesPerSec; |
| 36 |
DWORD nAvgBytesPerSec; |
| 37 |
WORD nBlockAlign; |
| 38 |
WORD wBitsPerSample; |
| 39 |
WORD cbSize; |
| 40 |
} WAVEFORMATEX; |
| 41 |
|
| 42 |
typedef struct { |
| 43 |
WAVEFORMATEX Format; |
| 44 |
union { |
| 45 |
WORD wValidBitsPerSample; |
| 46 |
WORD wSamplesPerBlock; |
| 47 |
WORD wReserved; |
| 48 |
} Samples; |
| 49 |
DWORD dwChannelMask; |
| 50 |
GUID SubFormat; |
| 51 |
} WAVEFORMATEXTENSIBLE, *PWAVEFORMATEXTENSIBLE; |
| 52 |
cpp_quote("#else") |
| 53 |
cpp_quote("#include <mmreg.h>") |
| 54 |
cpp_quote("#endif") |
| 55 |
|
| 56 |
typedef struct XAPO_REGISTRATION_PROPERTIES |
| 57 |
{ |
| 58 |
CLSID clsid; |
| 59 |
WCHAR FriendlyName[XAPO_REGISTRATION_STRING_LENGTH]; |
| 60 |
WCHAR CopyrightInfo[XAPO_REGISTRATION_STRING_LENGTH]; |
| 61 |
UINT32 MajorVersion; |
| 62 |
UINT32 MinorVersion; |
| 63 |
UINT32 Flags; |
| 64 |
UINT32 MinInputBufferCount; |
| 65 |
UINT32 MaxInputBufferCount; |
| 66 |
UINT32 MinOutputBufferCount; |
| 67 |
UINT32 MaxOutputBufferCount; |
| 68 |
} XAPO_REGISTRATION_PROPERTIES; |
| 69 |
|
| 70 |
typedef struct XAPO20_REGISTRATION_PROPERTIES |
| 71 |
{ |
| 72 |
CLSID clsid; |
| 73 |
WCHAR FriendlyName[XAPO_REGISTRATION_STRING_LENGTH]; |
| 74 |
WCHAR CopyrightInfo[XAPO_REGISTRATION_STRING_LENGTH]; |
| 75 |
UINT32 MajorVersion; |
| 76 |
UINT32 MinorVersion; |
| 77 |
UINT32 Flags; |
| 78 |
UINT32 MinInputBufferCount; |
| 79 |
UINT32 MaxInputBufferCount; |
| 80 |
UINT32 MinOutputBufferCount; |
| 81 |
UINT32 MaxOutputBufferCount; |
| 82 |
UINT32 InterfaceCount; |
| 83 |
IID InterfaceArray[1]; |
| 84 |
} XAPO20_REGISTRATION_PROPERTIES; |
| 85 |
|
| 86 |
typedef struct XAPO_LOCKFORPROCESS_BUFFER_PARAMETERS { |
| 87 |
const WAVEFORMATEX *pFormat; |
| 88 |
UINT32 MaxFrameCount; |
| 89 |
} XAPO_LOCKFORPROCESS_BUFFER_PARAMETERS; |
| 90 |
|
| 91 |
typedef enum XAPO_BUFFER_FLAGS { |
| 92 |
XAPO_BUFFER_SILENT, |
| 93 |
XAPO_BUFFER_VALID |
| 94 |
} XAPO_BUFFER_FLAGS; |
| 95 |
|
| 96 |
typedef struct XAPO_PROCESS_BUFFER_PARAMETERS { |
| 97 |
void *pBuffer; |
| 98 |
XAPO_BUFFER_FLAGS BufferFlags; |
| 99 |
UINT32 ValidFrameCount; |
| 100 |
} XAPO_PROCESS_BUFFER_PARAMETERS; |
| 101 |
|
| 102 |
/* XAudio2 2.8 version of IXAPO */ |
| 103 |
[ |
| 104 |
object, |
| 105 |
local, |
| 106 |
uuid(a410b984-9839-4819-a0be-2856ae6b3adb) |
| 107 |
] |
| 108 |
interface IXAPO : IUnknown |
| 109 |
{ |
| 110 |
HRESULT GetRegistrationProperties([out] XAPO_REGISTRATION_PROPERTIES **props); |
| 111 |
|
| 112 |
HRESULT IsInputFormatSupported(const WAVEFORMATEX *output_fmt, |
| 113 |
const WAVEFORMATEX *input_fmt, WAVEFORMATEX **supported_fmt); |
| 114 |
|
| 115 |
HRESULT IsOutputFormatSupported(const WAVEFORMATEX *input_fmt, |
| 116 |
const WAVEFORMATEX *output_fmt, WAVEFORMATEX **supported_fmt); |
| 117 |
|
| 118 |
HRESULT Initialize(const void *data, UINT32 data_len); |
| 119 |
|
| 120 |
void Reset(void); |
| 121 |
|
| 122 |
HRESULT LockForProcess(UINT32 in_params_count, const XAPO_LOCKFORPROCESS_BUFFER_PARAMETERS *in_params, |
| 123 |
UINT32 out_params_count, const XAPO_LOCKFORPROCESS_BUFFER_PARAMETERS *out_params); |
| 124 |
|
| 125 |
void UnlockForProcess(void); |
| 126 |
|
| 127 |
void Process(UINT32 in_params_count, const XAPO_PROCESS_BUFFER_PARAMETERS *in_params, |
| 128 |
UINT32 out_params_count, XAPO_PROCESS_BUFFER_PARAMETERS *out_params, |
| 129 |
BOOL enabled); |
| 130 |
|
| 131 |
UINT32 CalcInputFrames(UINT32 output_frames); |
| 132 |
|
| 133 |
UINT32 CalcOutputFrames(UINT32 input_frames); |
| 134 |
} |
| 135 |
|
| 136 |
/* XAudio2 2.7 version of IXAPO is identical to 2.8 */ |
| 137 |
cpp_quote("DEFINE_GUID(IID_IXAPO27, 0xa90bc001, 0xe897, 0xe897, 0x55, 0xe4, 0x9e, 0x47, 0x00, 0x00, 0x00, 0x00);") |
| 138 |
|
| 139 |
|
| 140 |
/* XAudio2 2.8 version of IXAPOParameters */ |
| 141 |
[ |
| 142 |
object, |
| 143 |
local, |
| 144 |
uuid(26d95c66-80f2-499a-ad54-5ae7f01c6d98) |
| 145 |
] |
| 146 |
interface IXAPOParameters : IUnknown |
| 147 |
{ |
| 148 |
void SetParameters(const void *params, UINT32 params_len); |
| 149 |
|
| 150 |
void GetParameters(void *params, UINT32 params_len); |
| 151 |
} |
| 152 |
|
| 153 |
/* XAudio2 2.7 version of IXAPOParameters is identical to 2.8 */ |
| 154 |
cpp_quote("DEFINE_GUID(IID_IXAPO27Parameters, 0xa90bc001, 0xe897, 0xe897, 0x55, 0xe4, 0x9e, 0x47, 0x00, 0x00, 0x00, 0x01);") |