Commit 7d43d7bb authored by Robert Reif's avatar Robert Reif Committed by Alexandre Julliard

Use the drivers to get device capabilities and property sets.

parent 3e037992
......@@ -1044,6 +1044,7 @@ HRESULT WINAPI IDirectSoundBufferImpl_Create(
dsb->dsb = 0;
dsb->dsound = ds;
dsb->lpVtbl = &dsbvt;
dsb->iks = NULL;
memcpy(&dsb->dsbd, dsbd, sizeof(*dsbd));
if (wfex)
......@@ -1064,7 +1065,9 @@ HRESULT WINAPI IDirectSoundBufferImpl_Create(
else capf |= DSCAPS_SECONDARYMONO;
if (wfex->wBitsPerSample==16) capf |= DSCAPS_SECONDARY16BIT;
else capf |= DSCAPS_SECONDARY8BIT;
use_hw = (ds->drvcaps.dwFlags & capf) == capf;
TRACE("use_hw = 0x%08x, capf = 0x%08lx, ds->drvcaps.dwFlags = 0x%08lx\n", use_hw, capf, ds->drvcaps.dwFlags);
/* FIXME: check hardware sample rate mixing capabilities */
/* FIXME: check app hints for software/hardware buffer (STATIC, LOCHARDWARE, etc) */
......
......@@ -671,37 +671,37 @@ static HRESULT WINAPI IDirectSoundImpl_GetCaps(LPDIRECTSOUND8 iface,LPDSCAPS lpD
return DSERR_INVALIDPARAM;
}
lpDSCaps->dwFlags = This->drvcaps.dwFlags;
lpDSCaps->dwFlags = This->drvcaps.dwFlags;
TRACE("(flags=0x%08lx)\n",lpDSCaps->dwFlags);
/* FIXME: copy caps from This->drv */
lpDSCaps->dwMinSecondarySampleRate = DSBFREQUENCY_MIN;
lpDSCaps->dwMaxSecondarySampleRate = DSBFREQUENCY_MAX;
lpDSCaps->dwMinSecondarySampleRate = This->drvcaps.dwMinSecondarySampleRate;
lpDSCaps->dwMaxSecondarySampleRate = This->drvcaps.dwMaxSecondarySampleRate;
lpDSCaps->dwPrimaryBuffers = 1;
lpDSCaps->dwPrimaryBuffers = This->drvcaps.dwPrimaryBuffers;
lpDSCaps->dwMaxHwMixingAllBuffers = 0;
lpDSCaps->dwMaxHwMixingStaticBuffers = 0;
lpDSCaps->dwMaxHwMixingStreamingBuffers = 0;
lpDSCaps->dwMaxHwMixingAllBuffers = This->drvcaps.dwMaxHwMixingAllBuffers;
lpDSCaps->dwMaxHwMixingStaticBuffers = This->drvcaps.dwMaxHwMixingStaticBuffers;
lpDSCaps->dwMaxHwMixingStreamingBuffers = This->drvcaps.dwMaxHwMixingStreamingBuffers;
lpDSCaps->dwFreeHwMixingAllBuffers = 0;
lpDSCaps->dwFreeHwMixingStaticBuffers = 0;
lpDSCaps->dwFreeHwMixingStreamingBuffers = 0;
lpDSCaps->dwFreeHwMixingAllBuffers = This->drvcaps.dwFreeHwMixingAllBuffers;
lpDSCaps->dwFreeHwMixingStaticBuffers = This->drvcaps.dwFreeHwMixingStaticBuffers;
lpDSCaps->dwFreeHwMixingStreamingBuffers = This->drvcaps.dwFreeHwMixingStreamingBuffers;
lpDSCaps->dwMaxHw3DAllBuffers = 0;
lpDSCaps->dwMaxHw3DStaticBuffers = 0;
lpDSCaps->dwMaxHw3DStreamingBuffers = 0;
lpDSCaps->dwMaxHw3DAllBuffers = This->drvcaps.dwMaxHw3DAllBuffers;
lpDSCaps->dwMaxHw3DStaticBuffers = This->drvcaps.dwMaxHw3DStaticBuffers;
lpDSCaps->dwMaxHw3DStreamingBuffers = This->drvcaps.dwMaxHw3DStreamingBuffers;
lpDSCaps->dwFreeHw3DAllBuffers = 0;
lpDSCaps->dwFreeHw3DStaticBuffers = 0;
lpDSCaps->dwFreeHw3DStreamingBuffers = 0;
lpDSCaps->dwFreeHw3DAllBuffers = This->drvcaps.dwFreeHw3DAllBuffers;
lpDSCaps->dwFreeHw3DStaticBuffers = This->drvcaps.dwFreeHw3DStaticBuffers;
lpDSCaps->dwFreeHw3DStreamingBuffers = This->drvcaps.dwFreeHw3DStreamingBuffers;
lpDSCaps->dwTotalHwMemBytes = 0;
lpDSCaps->dwTotalHwMemBytes = This->drvcaps.dwTotalHwMemBytes;
lpDSCaps->dwFreeHwMemBytes = 0;
lpDSCaps->dwFreeHwMemBytes = This->drvcaps.dwFreeHwMemBytes;
lpDSCaps->dwMaxContigFreeHwMemBytes = 0;
lpDSCaps->dwMaxContigFreeHwMemBytes = This->drvcaps.dwMaxContigFreeHwMemBytes;
/* driver doesn't have these */
lpDSCaps->dwUnlockTransferRateHwBuffers = 4096; /* But we have none... */
lpDSCaps->dwPlayCpuOverheadSwBuffers = 1; /* 1% */
......@@ -1099,7 +1099,7 @@ HRESULT WINAPI DirectSoundCreate8(LPCGUID lpcGUID,LPDIRECTSOUND8 *ppDS,IUnknown
*ippDS = NULL;
return err;
}
(*ippDS)->drvcaps.dwFlags = 0;
ZeroMemory(&(*ippDS)->drvcaps, sizeof((*ippDS)->drvcaps));
if ((woc.dwFormats & WAVE_FORMAT_1M08) ||
(woc.dwFormats & WAVE_FORMAT_2M08) ||
(woc.dwFormats & WAVE_FORMAT_4M08) ||
......@@ -1134,6 +1134,9 @@ HRESULT WINAPI DirectSoundCreate8(LPCGUID lpcGUID,LPDIRECTSOUND8 *ppDS,IUnknown
}
if (ds_emuldriver)
(*ippDS)->drvcaps.dwFlags |= DSCAPS_EMULDRIVER;
(*ippDS)->drvcaps.dwMinSecondarySampleRate = DSBFREQUENCY_MIN;
(*ippDS)->drvcaps.dwMaxSecondarySampleRate = DSBFREQUENCY_MAX;
(*ippDS)->drvcaps.dwPrimaryBuffers = 1;
}
DSOUND_RecalcVolPan(&((*ippDS)->volpan));
......
......@@ -2009,6 +2009,8 @@ static HRESULT WINAPI IDsDriverImpl_GetCaps(PIDSDRIVER iface, PDSDRIVERCAPS pCap
pCaps->dwPrimaryBuffers = 1;
TRACE("caps=0x%X\n",(unsigned int)pCaps->dwFlags);
pCaps->dwMinSecondarySampleRate = DSBFREQUENCY_MIN;
pCaps->dwMaxSecondarySampleRate = DSBFREQUENCY_MAX;
/* the other fields only apply to secondary buffers, which we don't support
* (unless we want to mess with wavetable synthesizers and MIDI) */
......
......@@ -1562,6 +1562,8 @@ static HRESULT WINAPI IDsDriverImpl_GetCaps(PIDSDRIVER iface, PDSDRIVERCAPS pCap
pCaps->dwFlags = DSCAPS_PRIMARYMONO | DSCAPS_PRIMARYSTEREO |
DSCAPS_PRIMARY8BIT | DSCAPS_PRIMARY16BIT;
pCaps->dwPrimaryBuffers = 1;
pCaps->dwMinSecondarySampleRate = DSBFREQUENCY_MIN;
pCaps->dwMaxSecondarySampleRate = DSBFREQUENCY_MAX;
/* the other fields only apply to secondary buffers, which we don't support
* (unless we want to mess with wavetable synthesizers and MIDI) */
return DS_OK;
......
......@@ -553,7 +553,9 @@ static BOOL OSS_WaveOutInit(OSS_DEVICE* ossdev)
/* direct sound caps */
ossdev->ds_caps.dwFlags = 0;
ossdev->ds_caps.dwPrimaryBuffers = 1;
ossdev->ds_caps.dwMinSecondarySampleRate = DSBFREQUENCY_MIN;
ossdev->ds_caps.dwMaxSecondarySampleRate = DSBFREQUENCY_MAX;
if (WINE_TRACE_ON(wave)) {
/* Note that this only reports the formats supported by the hardware.
* The driver may support other formats and do the conversions in
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment