#ifndef INITGUID
#define INITGUID
#endif
-#include <audioclient.h>
-#include <avrt.h>
-#include <mmdeviceapi.h>
-#include <functiondiscoverykeys_devpkey.h>
#include <mfapi.h>
#include <mferror.h>
#include <mfplay.h>
+#include <mftransform.h>
#include <wmcodecdsp.h>
+#include <audioclient.h>
+#include <avrt.h>
+#include <mmdeviceapi.h>
+#include <functiondiscoverykeys_devpkey.h>
+
#ifdef _MSC_VER
+ #pragma comment( lib, "ksuser" )
#pragma comment( lib, "mfplat.lib" )
#pragma comment( lib, "mfuuid.lib" )
#pragma comment( lib, "wmcodecdspuuid" )
, _sampleRatio( ( float ) outSampleRate / inSampleRate )
, _transformUnk( NULL )
, _transform( NULL )
- , _resamplerProps( NULL )
, _mediaType( NULL )
, _inputMediaType( NULL )
, _outputMediaType( NULL )
+
+ #ifdef __IWMResamplerProps_FWD_DEFINED__
+ , _resamplerProps( NULL )
+ #endif
{
// 1. Initialization
_transformUnk->QueryInterface( IID_PPV_ARGS( &_transform ) );
- _transformUnk->QueryInterface( IID_PPV_ARGS( &_resamplerProps ) );
- _resamplerProps->SetHalfFilterLength( 60 ); // best conversion quality
+ #ifdef __IWMResamplerProps_FWD_DEFINED__
+ _transformUnk->QueryInterface( IID_PPV_ARGS( &_resamplerProps ) );
+ _resamplerProps->SetHalfFilterLength( 60 ); // best conversion quality
+ #endif
// 3. Specify input / output format
SAFE_RELEASE( _transformUnk );
SAFE_RELEASE( _transform );
- SAFE_RELEASE( _resamplerProps );
SAFE_RELEASE( _mediaType );
SAFE_RELEASE( _inputMediaType );
SAFE_RELEASE( _outputMediaType );
+
+ #ifdef __IWMResamplerProps_FWD_DEFINED__
+ SAFE_RELEASE( _resamplerProps );
+ #endif
}
void Convert( char* outBuffer, const char* inBuffer, unsigned int inSampleCount, unsigned int& outSampleCount )
IUnknown* _transformUnk;
IMFTransform* _transform;
- IWMResamplerProps* _resamplerProps;
IMFMediaType* _mediaType;
IMFMediaType* _inputMediaType;
IMFMediaType* _outputMediaType;
+
+ #ifdef __IWMResamplerProps_FWD_DEFINED__
+ IWMResamplerProps* _resamplerProps;
+ #endif
};
//-----------------------------------------------------------------------------