23 #define XAPOBASE_DEFAULT_FORMAT_TAG WAVE_FORMAT_IEEE_FLOAT // 32-bit float only, applies to WAVEFORMATEX.wFormatTag or WAVEFORMATEXTENSIBLE.SubFormat when used 24 #define XAPOBASE_DEFAULT_FORMAT_MIN_CHANNELS XAPO_MIN_CHANNELS // minimum channel count, applies to WAVEFORMATEX.nChannels 25 #define XAPOBASE_DEFAULT_FORMAT_MAX_CHANNELS XAPO_MAX_CHANNELS // maximum channel count, applies to WAVEFORMATEX.nChannels 26 #define XAPOBASE_DEFAULT_FORMAT_MIN_FRAMERATE XAPO_MIN_FRAMERATE // minimum framerate, applies to WAVEFORMATEX.nSamplesPerSec 27 #define XAPOBASE_DEFAULT_FORMAT_MAX_FRAMERATE XAPO_MAX_FRAMERATE // maximum framerate, applies to WAVEFORMATEX.nSamplesPerSec 28 #define XAPOBASE_DEFAULT_FORMAT_BITSPERSAMPLE 32 // 32-bit float only, applies to WAVEFORMATEX.wBitsPerSample and WAVEFORMATEXTENSIBLE.wValidBitsPerSample when used 31 #define XAPOBASE_DEFAULT_FLAG (XAPO_FLAG_CHANNELS_MUST_MATCH | XAPO_FLAG_FRAMERATE_MUST_MATCH | XAPO_FLAG_BITSPERSAMPLE_MUST_MATCH | XAPO_FLAG_BUFFERCOUNT_MUST_MATCH | XAPO_FLAG_INPLACE_SUPPORTED) 34 #define XAPOBASE_DEFAULT_BUFFER_COUNT 1 39 #if !defined(XAPOASSERT) 41 #define XAPOASSERT(exp) if (!(exp)) { OutputDebugStringA("XAPO ASSERT: " #exp ", {" __FUNCTION__ "}\n"); __debugbreak(); } 43 #define XAPOASSERT(exp) __assume(exp) 46 #if !defined(XAPOASSERT_NO_OUTPUT) 48 #define XAPOASSERT_NO_OUTPUT(exp) if (!(exp)) { __debugbreak(); } 50 #define XAPOASSERT_NO_OUTPUT(exp) __assume(exp) 56 #pragma pack(push, 8) // set packing alignment to ensure consistency across arbitrary build environments, and ensure synchronization variables used by Interlocked functionality are correctly aligned 68 class __declspec(novtable) CXAPOBase:
public IXAPO {
72 void* m_pfnMatrixMixFunction;
73 FLOAT32* m_pfl32MatrixCoefficients;
75 BOOL m_fIsScalarMatrix;
80 LONG m_lReferenceCount;
155 void ProcessThru (
const void* pInputBuffer, _Inout_updates_(FrameCount*OutputChannelCount)
FLOAT32* pOutputBuffer,
UINT32 FrameCount,
UINT32 InputChannelCount,
UINT32 OutputChannelCount,
BOOL MixWithOutput);
159 BOOL IsLocked () {
return m_fIsLocked; }
164 virtual ~CXAPOBase ();
168 STDMETHOD(QueryInterface) (REFIID riid, _Outptr_
void** ppInterface)
173 if (riid == __uuidof(IXAPO)) {
174 *ppInterface =
static_cast<IXAPO*
>(
this);
176 }
else if (riid == __uuidof(IUnknown)) {
177 *ppInterface =
static_cast<IUnknown*
>(
this);
188 STDMETHOD_(ULONG, AddRef) ()
190 return (ULONG)InterlockedIncrement(&m_lReferenceCount);
196 ULONG uTmpReferenceCount = (ULONG)InterlockedDecrement(&m_lReferenceCount);
197 if (uTmpReferenceCount == 0) {
200 return uTmpReferenceCount;
223 UNREFERENCED_PARAMETER(DataByteSize);
230 STDMETHOD_(
void, Reset) () {
return; }
240 STDMETHOD_(
void, UnlockForProcess) ();
244 STDMETHOD_(
UINT32, CalcInputFrames) (
UINT32 OutputFrameCount) {
return OutputFrameCount; }
248 STDMETHOD_(
UINT32, CalcOutputFrames) (
UINT32 InputFrameCount) {
return InputFrameCount; }
267 class __declspec(novtable) CXAPOParametersBase:
public CXAPOBase,
public IXAPOParameters {
269 BYTE* m_pParameterBlocks;
270 BYTE* m_pCurrentParameters;
271 BYTE* m_pCurrentParametersInternal;
272 UINT32 m_uCurrentParametersIndex;
273 UINT32 m_uParameterBlockByteSize;
274 BOOL m_fNewerResultsReady;
287 virtual ~CXAPOParametersBase ();
291 STDMETHOD(QueryInterface) (REFIID riid, _Outptr_result_maybenull_
void** ppInterface)
296 if (riid == __uuidof(IXAPOParameters)) {
297 *ppInterface =
static_cast<IXAPOParameters*
>(
this);
300 hr = CXAPOBase::QueryInterface(riid, ppInterface);
307 STDMETHOD_(ULONG, AddRef)() {
return CXAPOBase::AddRef(); }
315 STDMETHOD_(
void, SetParameters) (_In_reads_bytes_(ParameterByteSize)
const void* pParameters,
UINT32 ParameterByteSize);
320 STDMETHOD_(
void, GetParameters) (_Out_writes_bytes_(ParameterByteSize)
void* pParameters,
UINT32 ParameterByteSize);
326 virtual void OnSetParameters (_In_reads_bytes_(ParameterByteSize)
const void* pParameters,
UINT32 ParameterByteSize)
330 XAPOASSERT(ParameterByteSize == m_uParameterBlockByteSize);
336 BOOL ParametersChanged ();
341 BYTE* BeginProcess ();
351 #pragma pack(pop) // revert packing alignment typedef HRESULT(WINAPI *PFN_D3D12_SERIALIZE_ROOT_SIGNATURE)(_In_ const D3D12_ROOT_SIGNATURE_DESC *pRootSignature
_Outptr_ IUnknown _In_reads_bytes_opt_(InitDataByteSize) const void *pInitData
#define NULL
Pointer to 0.
Definition: gctypes.h:65
float FLOAT32
Definition: xapobase.h:60
static INLINE ULONG Release(void *object)
Definition: dxgi_common.h:253
unsigned int BOOL
Definition: gctypes.h:51
uint32_t UINT32
Definition: coretypes.h:10
#define XAPOASSERT(exp)
Definition: xapobase.h:43
Definition: audiodefs.h:40