msacm32: acmFormatEnum: Implement ACM_FORMATENUMF_SUGGEST.
This commit is contained in:
parent
e1413faeb7
commit
3a54e89ff8
|
@ -443,41 +443,85 @@ static BOOL MSACM_FormatEnumHelper(PWINE_ACMDRIVERID padid, HACMDRIVER had,
|
||||||
ACMFORMATTAGDETAILSW aftd;
|
ACMFORMATTAGDETAILSW aftd;
|
||||||
unsigned int i, j;
|
unsigned int i, j;
|
||||||
|
|
||||||
for (i = 0; i < padid->cFormatTags; i++) {
|
if (fdwEnum & ACM_FORMATENUMF_SUGGEST) {
|
||||||
memset(&aftd, 0, sizeof(aftd));
|
HDRVR hdrvr;
|
||||||
aftd.cbStruct = sizeof(aftd);
|
ACMDRVFORMATSUGGEST adfs;
|
||||||
aftd.dwFormatTagIndex = i;
|
pafd->dwFormatIndex = 0;
|
||||||
if (acmFormatTagDetailsW(had, &aftd, ACM_FORMATTAGDETAILSF_INDEX) != MMSYSERR_NOERROR)
|
memset(&aftd, 0, sizeof(aftd));
|
||||||
continue;
|
aftd.cbStruct = sizeof(aftd);
|
||||||
|
memset(&adfs, 0, sizeof(adfs));
|
||||||
|
adfs.cbStruct = sizeof(adfs);
|
||||||
|
|
||||||
if ((fdwEnum & ACM_FORMATENUMF_WFORMATTAG) && aftd.dwFormatTag != pwfxRef->wFormatTag)
|
for (i = 0; i < padid->cFormatTags; i++) {
|
||||||
continue;
|
aftd.dwFormatTag = i;
|
||||||
|
pafd->dwFormatTag = aftd.dwFormatTag;
|
||||||
|
pafd->pwfx->wFormatTag = pafd->dwFormatTag;
|
||||||
|
|
||||||
for (j = 0; j < aftd.cStandardFormats; j++) {
|
if (acmFormatTagDetailsW(had, &aftd, ACM_FORMATTAGDETAILSF_INDEX) != MMSYSERR_NOERROR)
|
||||||
pafd->dwFormatIndex = j;
|
continue;
|
||||||
pafd->dwFormatTag = aftd.dwFormatTag;
|
|
||||||
if (acmFormatDetailsW(had, pafd, ACM_FORMATDETAILSF_INDEX) != MMSYSERR_NOERROR)
|
|
||||||
continue;
|
|
||||||
|
|
||||||
if ((fdwEnum & ACM_FORMATENUMF_NCHANNELS) &&
|
adfs.cbwfxSrc = aftd.cbFormatSize;
|
||||||
pafd->pwfx->nChannels != pwfxRef->nChannels)
|
adfs.cbwfxDst = aftd.cbFormatSize;
|
||||||
continue;
|
adfs.pwfxSrc = pwfxRef;
|
||||||
if ((fdwEnum & ACM_FORMATENUMF_NSAMPLESPERSEC) &&
|
adfs.pwfxDst = pafd->pwfx;
|
||||||
pafd->pwfx->nSamplesPerSec != pwfxRef->nSamplesPerSec)
|
pafd->fdwSupport = padid->fdwSupport;
|
||||||
continue;
|
|
||||||
if ((fdwEnum & ACM_FORMATENUMF_WBITSPERSAMPLE) &&
|
|
||||||
pafd->pwfx->wBitsPerSample != pwfxRef->wBitsPerSample)
|
|
||||||
continue;
|
|
||||||
if ((fdwEnum & ACM_FORMATENUMF_HARDWARE) &&
|
|
||||||
!(pafd->fdwSupport & ACMDRIVERDETAILS_SUPPORTF_HARDWARE))
|
|
||||||
continue;
|
|
||||||
|
|
||||||
/* more checks to be done on fdwEnum */
|
if ((fdwEnum & ACM_FORMATENUMF_WFORMATTAG) &&
|
||||||
|
aftd.dwFormatTag != pwfxRef->wFormatTag)
|
||||||
|
continue;
|
||||||
|
|
||||||
if (!(fnCallback)((HACMDRIVERID)padid, pafd, dwInstance, padid->fdwSupport))
|
if ((fdwEnum & ACM_FORMATENUMF_HARDWARE) &&
|
||||||
return FALSE;
|
!(pafd->fdwSupport & ACMDRIVERDETAILS_SUPPORTF_HARDWARE))
|
||||||
}
|
continue;
|
||||||
/* the "formats" used by the filters are also reported */
|
|
||||||
|
hdrvr = OpenDriver(padid->pszFileName,0,0);
|
||||||
|
SendDriverMessage(hdrvr,ACMDM_FORMAT_SUGGEST,(DWORD)&adfs,(fdwEnum & 0x000000FFL));
|
||||||
|
|
||||||
|
if (acmFormatDetailsW(had, pafd, ACM_FORMATDETAILSF_FORMAT) != MMSYSERR_NOERROR)
|
||||||
|
continue;
|
||||||
|
|
||||||
|
pafd->cbwfx = sizeof(*(pafd->pwfx));
|
||||||
|
|
||||||
|
if (!(fnCallback)((HACMDRIVERID)padid, pafd, dwInstance, padid->fdwSupport))
|
||||||
|
return FALSE;
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
for (i = 0; i < padid->cFormatTags; i++) {
|
||||||
|
memset(&aftd, 0, sizeof(aftd));
|
||||||
|
aftd.cbStruct = sizeof(aftd);
|
||||||
|
aftd.dwFormatTagIndex = i;
|
||||||
|
if (acmFormatTagDetailsW(had, &aftd, ACM_FORMATTAGDETAILSF_INDEX) != MMSYSERR_NOERROR)
|
||||||
|
continue;
|
||||||
|
|
||||||
|
if ((fdwEnum & ACM_FORMATENUMF_WFORMATTAG) && aftd.dwFormatTag != pwfxRef->wFormatTag)
|
||||||
|
continue;
|
||||||
|
|
||||||
|
for (j = 0; j < aftd.cStandardFormats; j++) {
|
||||||
|
pafd->dwFormatIndex = j;
|
||||||
|
pafd->dwFormatTag = aftd.dwFormatTag;
|
||||||
|
if (acmFormatDetailsW(had, pafd, ACM_FORMATDETAILSF_INDEX) != MMSYSERR_NOERROR)
|
||||||
|
continue;
|
||||||
|
|
||||||
|
if ((fdwEnum & ACM_FORMATENUMF_NCHANNELS) &&
|
||||||
|
pafd->pwfx->nChannels != pwfxRef->nChannels)
|
||||||
|
continue;
|
||||||
|
if ((fdwEnum & ACM_FORMATENUMF_NSAMPLESPERSEC) &&
|
||||||
|
pafd->pwfx->nSamplesPerSec != pwfxRef->nSamplesPerSec)
|
||||||
|
continue;
|
||||||
|
if ((fdwEnum & ACM_FORMATENUMF_WBITSPERSAMPLE) &&
|
||||||
|
pafd->pwfx->wBitsPerSample != pwfxRef->wBitsPerSample)
|
||||||
|
continue;
|
||||||
|
if ((fdwEnum & ACM_FORMATENUMF_HARDWARE) &&
|
||||||
|
!(pafd->fdwSupport & ACMDRIVERDETAILS_SUPPORTF_HARDWARE))
|
||||||
|
continue;
|
||||||
|
|
||||||
|
/* more checks to be done on fdwEnum */
|
||||||
|
|
||||||
|
if (!(fnCallback)((HACMDRIVERID)padid, pafd, dwInstance, padid->fdwSupport))
|
||||||
|
return FALSE;
|
||||||
|
}
|
||||||
|
/* the "formats" used by the filters are also reported */
|
||||||
|
}
|
||||||
}
|
}
|
||||||
return TRUE;
|
return TRUE;
|
||||||
}
|
}
|
||||||
|
@ -514,8 +558,7 @@ MMRESULT WINAPI acmFormatEnumW(HACMDRIVER had, PACMFORMATDETAILSW pafd,
|
||||||
(pafd->dwFormatTag != pafd->pwfx->wFormatTag))
|
(pafd->dwFormatTag != pafd->pwfx->wFormatTag))
|
||||||
return MMSYSERR_INVALPARAM;
|
return MMSYSERR_INVALPARAM;
|
||||||
|
|
||||||
if (fdwEnum & (ACM_FORMATENUMF_CONVERT|ACM_FORMATENUMF_SUGGEST|
|
if (fdwEnum & (ACM_FORMATENUMF_CONVERT|ACM_FORMATENUMF_INPUT|ACM_FORMATENUMF_OUTPUT))
|
||||||
ACM_FORMATENUMF_INPUT|ACM_FORMATENUMF_OUTPUT))
|
|
||||||
FIXME("Unsupported fdwEnum values %08x\n", fdwEnum);
|
FIXME("Unsupported fdwEnum values %08x\n", fdwEnum);
|
||||||
|
|
||||||
if (had) {
|
if (had) {
|
||||||
|
|
Loading…
Reference in New Issue