wasapi:
- fixed compilation by MinGW, was failing due to double ambiguous jack describing enums used in KS ds: - fixed compile by MinGW, was failing due to missing casts to LPVOID * and usage of UINT instead of DWORD by PaWinDsStream::previousPlayCursor
This commit is contained in:
parent
2b8866cd3d
commit
24c304db21
2 changed files with 68 additions and 50 deletions
|
|
@ -244,7 +244,7 @@ typedef struct PaWinDsStream
|
|||
/* Try to detect play buffer underflows. */
|
||||
LARGE_INTEGER perfCounterTicksPerBuffer; /* counter ticks it should take to play a full buffer */
|
||||
LARGE_INTEGER previousPlayTime;
|
||||
UINT previousPlayCursor;
|
||||
DWORD previousPlayCursor;
|
||||
UINT outputUnderflowCount;
|
||||
BOOL outputIsRunning;
|
||||
INT finalZeroBytesWritten; /* used to determine when we've flushed the whole buffer */
|
||||
|
|
@ -1502,10 +1502,10 @@ static HRESULT InitFullDuplexInputOutputBuffers( PaWinDsStream *stream,
|
|||
|
||||
/* retrieve the pre ds 8 buffer interfaces which are used by the rest of the code */
|
||||
|
||||
hr = IUnknown_QueryInterface( pCaptureBuffer8, &IID_IDirectSoundCaptureBuffer, &stream->pDirectSoundInputBuffer );
|
||||
hr = IUnknown_QueryInterface( pCaptureBuffer8, &IID_IDirectSoundCaptureBuffer, (LPVOID *)&stream->pDirectSoundInputBuffer );
|
||||
|
||||
if( hr == DS_OK )
|
||||
hr = IUnknown_QueryInterface( pRenderBuffer8, &IID_IDirectSoundBuffer, &stream->pDirectSoundOutputBuffer );
|
||||
hr = IUnknown_QueryInterface( pRenderBuffer8, &IID_IDirectSoundBuffer, (LPVOID *)&stream->pDirectSoundOutputBuffer );
|
||||
|
||||
/* release the ds 8 interfaces, we don't need them */
|
||||
IUnknown_Release( pCaptureBuffer8 );
|
||||
|
|
|
|||
|
|
@ -75,6 +75,8 @@
|
|||
|
||||
#ifndef NTDDI_VERSION
|
||||
|
||||
#define NTDDI_VERSION 0x06000000 // NTDDI_VISTA
|
||||
|
||||
#ifndef _AVRT_ //<< fix MinGW dummy compile by defining missing type: AVRT_PRIORITY
|
||||
typedef enum _AVRT_PRIORITY
|
||||
{
|
||||
|
|
@ -238,8 +240,11 @@
|
|||
#define NONAMELESSUNION
|
||||
#endif
|
||||
|
||||
#undef NTDDI_VERSION
|
||||
#undef WINVER
|
||||
#define WINVER 0x0600
|
||||
#undef _WIN32_WINNT
|
||||
#define _WIN32_WINNT 0x0600
|
||||
#include <sdkddkver.h>
|
||||
#include <propkeydef.h>
|
||||
#define COBJMACROS
|
||||
|
|
@ -248,6 +253,7 @@
|
|||
#include <mmdeviceapi.h>
|
||||
#include <endpointvolume.h>
|
||||
#include <functiondiscoverykeys.h>
|
||||
#include <devicetopology.h> // Used to get IKsJackDescription interface
|
||||
#undef INITGUID
|
||||
|
||||
#endif // NTDDI_VERSION
|
||||
|
|
@ -636,13 +642,13 @@ static PaError __LogPaError(PaError err, const char *func, const char *file, int
|
|||
}
|
||||
|
||||
// ------------------------------------------------------------------------------------------
|
||||
static double nano100ToMillis(REFERENCE_TIME ref)
|
||||
/*static double nano100ToMillis(REFERENCE_TIME ref)
|
||||
{
|
||||
// 1 nano = 0.000000001 seconds
|
||||
//100 nano = 0.0000001 seconds
|
||||
//100 nano = 0.0001 milliseconds
|
||||
return ((double)ref)*0.0001;
|
||||
}
|
||||
}*/
|
||||
|
||||
// ------------------------------------------------------------------------------------------
|
||||
static double nano100ToSeconds(REFERENCE_TIME ref)
|
||||
|
|
@ -654,13 +660,13 @@ static double nano100ToSeconds(REFERENCE_TIME ref)
|
|||
}
|
||||
|
||||
// ------------------------------------------------------------------------------------------
|
||||
static REFERENCE_TIME MillisTonano100(double ref)
|
||||
/*static REFERENCE_TIME MillisTonano100(double ref)
|
||||
{
|
||||
// 1 nano = 0.000000001 seconds
|
||||
//100 nano = 0.0000001 seconds
|
||||
//100 nano = 0.0001 milliseconds
|
||||
return (REFERENCE_TIME)(ref/0.0001);
|
||||
}
|
||||
}*/
|
||||
|
||||
// ------------------------------------------------------------------------------------------
|
||||
static REFERENCE_TIME SecondsTonano100(double ref)
|
||||
|
|
@ -696,10 +702,10 @@ static WORD PaSampleFormatToBitsPerSample(PaSampleFormat format_id)
|
|||
|
||||
// ------------------------------------------------------------------------------------------
|
||||
// Converts PaSampleFormat to bits per sample value
|
||||
static WORD PaSampleFormatToBytesPerSample(PaSampleFormat format_id)
|
||||
/*static WORD PaSampleFormatToBytesPerSample(PaSampleFormat format_id)
|
||||
{
|
||||
return PaSampleFormatToBitsPerSample(format_id) >> 3; // 'bits/8'
|
||||
}
|
||||
}*/
|
||||
|
||||
// ------------------------------------------------------------------------------------------
|
||||
// Converts Hns period into number of frames
|
||||
|
|
@ -727,13 +733,13 @@ static UINT32 ALIGN_BWD(UINT32 v, UINT32 align)
|
|||
|
||||
// ------------------------------------------------------------------------------------------
|
||||
// Aligns 'v' forward
|
||||
static UINT32 ALIGN_FWD(UINT32 v, UINT32 align)
|
||||
/*static UINT32 ALIGN_FWD(UINT32 v, UINT32 align)
|
||||
{
|
||||
UINT32 remainder = (align ? (v % align) : 0);
|
||||
if (remainder == 0)
|
||||
return v;
|
||||
return v + (align - remainder);
|
||||
}
|
||||
}*/
|
||||
|
||||
// ------------------------------------------------------------------------------------------
|
||||
// Aligns WASAPI buffer to 128 byte packet boundary. HD Audio will fail to play if buffer
|
||||
|
|
@ -1624,7 +1630,7 @@ static PaError MakeWaveFormatFromParams(WAVEFORMATEXTENSIBLE *wavex, const PaStr
|
|||
}
|
||||
|
||||
// ------------------------------------------------------------------------------------------
|
||||
static void wasapiFillWFEXT( WAVEFORMATEXTENSIBLE* pwfext, PaSampleFormat sampleFormat, double sampleRate, int channelCount)
|
||||
/*static void wasapiFillWFEXT( WAVEFORMATEXTENSIBLE* pwfext, PaSampleFormat sampleFormat, double sampleRate, int channelCount)
|
||||
{
|
||||
PA_DEBUG(( "sampleFormat = %lx\n" , sampleFormat ));
|
||||
PA_DEBUG(( "sampleRate = %f\n" , sampleRate ));
|
||||
|
|
@ -1670,7 +1676,7 @@ static void wasapiFillWFEXT( WAVEFORMATEXTENSIBLE* pwfext, PaSampleFormat sample
|
|||
pwfext->SubFormat = pa_KSDATAFORMAT_SUBTYPE_PCM;
|
||||
}
|
||||
pwfext->Format.nAvgBytesPerSec = pwfext->Format.nSamplesPerSec * pwfext->Format.nBlockAlign;
|
||||
}
|
||||
}*/
|
||||
|
||||
// ------------------------------------------------------------------------------------------
|
||||
static PaError GetClosestFormat(IAudioClient *myClient, double sampleRate,
|
||||
|
|
@ -3550,7 +3556,11 @@ static PaWasapiJackConnectionType ConvertJackConnectionTypeWASAPIToPA(int connTy
|
|||
switch (connType)
|
||||
{
|
||||
case eConnTypeUnknown: return eJackConnTypeUnknown;
|
||||
#ifdef _KS_
|
||||
case eConnType3Point5mm: return eJackConnType3Point5mm;
|
||||
#else
|
||||
case eConnTypeEighth: return eJackConnType3Point5mm;
|
||||
#endif
|
||||
case eConnTypeQuarter: return eJackConnTypeQuarter;
|
||||
case eConnTypeAtapiInternal: return eJackConnTypeAtapiInternal;
|
||||
case eConnTypeRCA: return eJackConnTypeRCA;
|
||||
|
|
@ -3576,7 +3586,11 @@ static PaWasapiJackGeoLocation ConvertJackGeoLocationWASAPIToPA(int geoLoc)
|
|||
case eGeoLocRight: return eJackGeoLocRight;
|
||||
case eGeoLocTop: return eJackGeoLocTop;
|
||||
case eGeoLocBottom: return eJackGeoLocBottom;
|
||||
#ifdef _KS_
|
||||
case eGeoLocRearPanel: return eJackGeoLocRearPanel;
|
||||
#else
|
||||
case eGeoLocRearOPanel: return eJackGeoLocRearPanel;
|
||||
#endif
|
||||
case eGeoLocRiser: return eJackGeoLocRiser;
|
||||
case eGeoLocInsideMobileLid: return eJackGeoLocInsideMobileLid;
|
||||
case eGeoLocDrivebay: return eJackGeoLocDrivebay;
|
||||
|
|
@ -3594,7 +3608,11 @@ static PaWasapiJackGenLocation ConvertJackGenLocationWASAPIToPA(int genLoc)
|
|||
{
|
||||
case eGenLocPrimaryBox: return eJackGenLocPrimaryBox;
|
||||
case eGenLocInternal: return eJackGenLocInternal;
|
||||
#ifdef _KS_
|
||||
case eGenLocSeparate: return eJackGenLocSeparate;
|
||||
#else
|
||||
case eGenLocSeperate: return eJackGenLocSeparate;
|
||||
#endif
|
||||
case eGenLocOther: return eJackGenLocOther;
|
||||
}
|
||||
return eJackGenLocPrimaryBox;
|
||||
|
|
|
|||
Loading…
Reference in a new issue