mfmediaengine: Handle Play() when called before topology is set.
[wine.git] / dlls / l3codeca.acm / mpegl3.c
blobfa9f38258e50ba51dcf9252433ff008f48e2042b
1 /*
2 * MPEG Layer 3 handling
4 * Copyright (C) 2002 Eric Pouech
5 * Copyright (C) 2009 CodeWeavers, Aric Stewart
7 * This library is free software; you can redistribute it and/or
8 * modify it under the terms of the GNU Lesser General Public
9 * License as published by the Free Software Foundation; either
10 * version 2.1 of the License, or (at your option) any later version.
12 * This library is distributed in the hope that it will be useful,
13 * but WITHOUT ANY WARRANTY; without even the implied warranty of
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
15 * Lesser General Public License for more details.
17 * You should have received a copy of the GNU Lesser General Public
18 * License along with this library; if not, write to the Free Software
19 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
22 #include "config.h"
23 #include "wine/port.h"
25 #include <assert.h>
26 #include <stdarg.h>
27 #include <string.h>
29 #include <mpg123.h>
31 #include "windef.h"
32 #include "winbase.h"
33 #include "wingdi.h"
34 #include "winuser.h"
35 #include "winnls.h"
36 #include "mmsystem.h"
37 #include "mmreg.h"
38 #include "msacm.h"
39 #include "msacmdrv.h"
40 #include "wine/debug.h"
42 WINE_DEFAULT_DEBUG_CHANNEL(mpeg3);
44 /* table to list all supported formats... those are the basic ones. this
45 * also helps given a unique index to each of the supported formats
47 typedef struct
49 int nChannels;
50 int nBits;
51 int rate;
52 } Format;
54 static const Format PCM_Formats[] =
56 {1, 8, 8000}, {2, 8, 8000}, {1, 16, 8000}, {2, 16, 8000},
57 {1, 8, 11025}, {2, 8, 11025}, {1, 16, 11025}, {2, 16, 11025},
58 {1, 8, 12000}, {2, 8, 12000}, {1, 16, 12000}, {2, 16, 12000},
59 {1, 8, 16000}, {2, 8, 16000}, {1, 16, 16000}, {2, 16, 16000},
60 {1, 8, 22050}, {2, 8, 22050}, {1, 16, 22050}, {2, 16, 22050},
61 {1, 8, 24000}, {2, 8, 24000}, {1, 16, 24000}, {2, 16, 24000},
62 {1, 8, 32000}, {2, 8, 32000}, {1, 16, 32000}, {2, 16, 32000},
63 {1, 8, 44100}, {2, 8, 44100}, {1, 16, 44100}, {2, 16, 44100},
64 {1, 8, 48000}, {2, 8, 48000}, {1, 16, 48000}, {2, 16, 48000}
67 static const Format MPEG3_Formats[] =
69 {1, 0, 8000}, {2, 0, 8000},
70 {1, 0, 11025}, {2, 0, 11025},
71 {1, 0, 12000}, {2, 0, 12000},
72 {1, 0, 16000}, {2, 0, 16000},
73 {1, 0, 22050}, {2, 0, 22050},
74 {1, 0, 24000}, {2, 0, 24000},
75 {1, 0, 32000}, {2, 0, 32000},
76 {1, 0, 44100}, {2, 0, 44100},
77 {1, 0, 48000}, {2, 0, 48000}
80 /***********************************************************************
81 * MPEG3_GetFormatIndex
83 static DWORD MPEG3_GetFormatIndex(LPWAVEFORMATEX wfx)
85 int i, hi;
86 const Format *fmts;
88 switch (wfx->wFormatTag)
90 case WAVE_FORMAT_PCM:
91 hi = ARRAY_SIZE(PCM_Formats);
92 fmts = PCM_Formats;
93 break;
94 case WAVE_FORMAT_MPEG:
95 case WAVE_FORMAT_MPEGLAYER3:
96 hi = ARRAY_SIZE(MPEG3_Formats);
97 fmts = MPEG3_Formats;
98 break;
99 default:
100 return 0xFFFFFFFF;
103 for (i = 0; i < hi; i++)
105 if (wfx->nChannels == fmts[i].nChannels &&
106 wfx->nSamplesPerSec == fmts[i].rate &&
107 (wfx->wBitsPerSample == fmts[i].nBits || !fmts[i].nBits))
108 return i;
111 return 0xFFFFFFFF;
114 /***********************************************************************
115 * MPEG3_drvOpen
117 static LRESULT MPEG3_drvOpen(LPCSTR str)
119 mpg123_init();
120 return 1;
123 /***********************************************************************
124 * MPEG3_drvClose
126 static LRESULT MPEG3_drvClose(DWORD_PTR dwDevID)
128 mpg123_exit();
129 return 1;
133 static void mp3_horse(mpg123_handle *handle, const unsigned char *src,
134 DWORD *nsrc, unsigned char *dst, DWORD *ndst)
136 int ret;
137 size_t size;
138 DWORD dpos = 0;
141 if (*nsrc > 0)
143 ret = mpg123_feed(handle, src, *nsrc);
144 if (ret != MPG123_OK)
146 ERR("Error feeding data\n");
147 *ndst = *nsrc = 0;
148 return;
152 do {
153 size = 0;
154 ret = mpg123_read(handle, dst + dpos, *ndst - dpos, &size);
155 if (ret == MPG123_ERR)
157 FIXME("Error occurred during decoding!\n");
158 *ndst = *nsrc = 0;
159 return;
162 if (ret == MPG123_NEW_FORMAT)
164 long rate;
165 int channels, enc;
166 mpg123_getformat(handle, &rate, &channels, &enc);
167 TRACE("New format: %li Hz, %i channels, encoding value %i\n", rate, channels, enc);
169 dpos += size;
170 if (dpos >= *ndst) break;
171 } while (ret != MPG123_ERR && ret != MPG123_NEED_MORE);
172 *ndst = dpos;
175 /***********************************************************************
176 * MPEG3_StreamOpen
179 static LRESULT MPEG3_StreamOpen(ACMDRVSTREAMINSTANCE *instance)
181 mpg123_handle *handle;
182 int err;
184 assert(!(instance->fdwOpen & ACM_STREAMOPENF_ASYNC));
186 if (MPEG3_GetFormatIndex(instance->pwfxSrc) == 0xFFFFFFFF
187 || MPEG3_GetFormatIndex(instance->pwfxDst) == 0xFFFFFFFF)
188 return ACMERR_NOTPOSSIBLE;
190 if (instance->pwfxDst->wFormatTag != WAVE_FORMAT_PCM)
191 return MMSYSERR_NOTSUPPORTED;
193 if (instance->pwfxSrc->wFormatTag != WAVE_FORMAT_MPEGLAYER3
194 && instance->pwfxSrc->wFormatTag != WAVE_FORMAT_MPEG)
195 return MMSYSERR_NOTSUPPORTED;
197 if (instance->pwfxSrc->wFormatTag == WAVE_FORMAT_MPEGLAYER3)
199 MPEGLAYER3WAVEFORMAT *mp3_format = (MPEGLAYER3WAVEFORMAT *)instance->pwfxSrc;
201 if (instance->pwfxSrc->cbSize < MPEGLAYER3_WFX_EXTRA_BYTES
202 || mp3_format->wID != MPEGLAYER3_ID_MPEG)
203 return ACMERR_NOTPOSSIBLE;
206 if (instance->pwfxSrc->nSamplesPerSec != instance->pwfxDst->nSamplesPerSec
207 || instance->pwfxSrc->nChannels != instance->pwfxDst->nChannels
208 || instance->pwfxDst->wBitsPerSample != 16)
209 return MMSYSERR_NOTSUPPORTED;
211 handle = mpg123_new(NULL, &err);
212 instance->dwDriver = (DWORD_PTR)handle;
213 mpg123_open_feed(handle);
215 #if MPG123_API_VERSION >= 31 /* needed for MPG123_IGNORE_FRAMEINFO enum value */
216 /* mpg123 may find a XING header in the mp3 and use that information
217 * to ask for seeks in order to read specific frames in the file.
218 * We cannot allow that since the caller application is feeding us.
219 * This fixes problems for mp3 files encoded with LAME (bug 42361)
221 mpg123_param(handle, MPG123_ADD_FLAGS, MPG123_IGNORE_INFOFRAME, 0);
222 #endif
224 return MMSYSERR_NOERROR;
227 /***********************************************************************
228 * MPEG3_StreamClose
231 static LRESULT MPEG3_StreamClose(ACMDRVSTREAMINSTANCE *instance)
233 mpg123_handle *handle = (mpg123_handle *)instance->dwDriver;
235 mpg123_close(handle);
236 mpg123_delete(handle);
237 return MMSYSERR_NOERROR;
240 /***********************************************************************
241 * MPEG3_DriverDetails
244 static LRESULT MPEG3_DriverDetails(PACMDRIVERDETAILSW add)
246 add->fccType = ACMDRIVERDETAILS_FCCTYPE_AUDIOCODEC;
247 add->fccComp = ACMDRIVERDETAILS_FCCCOMP_UNDEFINED;
248 add->wMid = MM_FRAUNHOFER_IIS;
249 add->wPid = MM_FHGIIS_MPEGLAYER3_DECODE;
250 add->vdwACM = 0x01000000;
251 add->vdwDriver = 0x01000000;
252 add->fdwSupport = ACMDRIVERDETAILS_SUPPORTF_CODEC;
253 add->cFormatTags = 3; /* PCM, MPEG3 */
254 add->cFilterTags = 0;
255 add->hicon = NULL;
256 MultiByteToWideChar( CP_ACP, 0, "MPEG Layer-3 Codec", -1,
257 add->szShortName, ARRAY_SIZE( add->szShortName ));
258 MultiByteToWideChar( CP_ACP, 0, "Wine MPEG3 decoder", -1,
259 add->szLongName, ARRAY_SIZE( add->szLongName ));
260 MultiByteToWideChar( CP_ACP, 0, "Brought to you by the Wine team...", -1,
261 add->szCopyright, ARRAY_SIZE( add->szCopyright ));
262 MultiByteToWideChar( CP_ACP, 0, "Refer to LICENSE file", -1,
263 add->szLicensing, ARRAY_SIZE( add->szLicensing ));
264 add->szFeatures[0] = 0;
266 return MMSYSERR_NOERROR;
269 /***********************************************************************
270 * MPEG3_FormatTagDetails
273 static LRESULT MPEG3_FormatTagDetails(PACMFORMATTAGDETAILSW aftd, DWORD dwQuery)
275 static const WCHAR szPcm[]={'P','C','M',0};
276 static const WCHAR szMpeg3[]={'M','P','e','g','3',0};
277 static const WCHAR szMpeg[]={'M','P','e','g',0};
279 switch (dwQuery)
281 case ACM_FORMATTAGDETAILSF_INDEX:
282 if (aftd->dwFormatTagIndex > 2) return ACMERR_NOTPOSSIBLE;
283 break;
284 case ACM_FORMATTAGDETAILSF_LARGESTSIZE:
285 if (aftd->dwFormatTag == WAVE_FORMAT_UNKNOWN)
287 aftd->dwFormatTagIndex = 2; /* WAVE_FORMAT_MPEG is biggest */
288 break;
290 /* fall through */
291 case ACM_FORMATTAGDETAILSF_FORMATTAG:
292 switch (aftd->dwFormatTag)
294 case WAVE_FORMAT_PCM: aftd->dwFormatTagIndex = 0; break;
295 case WAVE_FORMAT_MPEGLAYER3: aftd->dwFormatTagIndex = 1; break;
296 case WAVE_FORMAT_MPEG: aftd->dwFormatTagIndex = 2; break;
297 default: return ACMERR_NOTPOSSIBLE;
299 break;
300 default:
301 WARN("Unsupported query %08x\n", dwQuery);
302 return MMSYSERR_NOTSUPPORTED;
305 aftd->fdwSupport = ACMDRIVERDETAILS_SUPPORTF_CODEC;
306 switch (aftd->dwFormatTagIndex)
308 case 0:
309 aftd->dwFormatTag = WAVE_FORMAT_PCM;
310 aftd->cbFormatSize = sizeof(PCMWAVEFORMAT);
311 aftd->cStandardFormats = ARRAY_SIZE(PCM_Formats);
312 lstrcpyW(aftd->szFormatTag, szPcm);
313 break;
314 case 1:
315 aftd->dwFormatTag = WAVE_FORMAT_MPEGLAYER3;
316 aftd->cbFormatSize = sizeof(MPEGLAYER3WAVEFORMAT);
317 aftd->cStandardFormats = 0;
318 lstrcpyW(aftd->szFormatTag, szMpeg3);
319 break;
320 case 2:
321 aftd->dwFormatTag = WAVE_FORMAT_MPEG;
322 aftd->cbFormatSize = sizeof(MPEG1WAVEFORMAT);
323 aftd->cStandardFormats = 0;
324 lstrcpyW(aftd->szFormatTag, szMpeg);
325 break;
327 return MMSYSERR_NOERROR;
330 /***********************************************************************
331 * MPEG3_FormatDetails
334 static LRESULT MPEG3_FormatDetails(PACMFORMATDETAILSW afd, DWORD dwQuery)
336 switch (dwQuery)
338 case ACM_FORMATDETAILSF_FORMAT:
339 if (MPEG3_GetFormatIndex(afd->pwfx) == 0xFFFFFFFF) return ACMERR_NOTPOSSIBLE;
340 break;
341 case ACM_FORMATDETAILSF_INDEX:
342 afd->pwfx->wFormatTag = afd->dwFormatTag;
343 switch (afd->dwFormatTag)
345 case WAVE_FORMAT_PCM:
346 if (afd->dwFormatIndex >= ARRAY_SIZE(PCM_Formats)) return ACMERR_NOTPOSSIBLE;
347 afd->pwfx->nChannels = PCM_Formats[afd->dwFormatIndex].nChannels;
348 afd->pwfx->nSamplesPerSec = PCM_Formats[afd->dwFormatIndex].rate;
349 afd->pwfx->wBitsPerSample = PCM_Formats[afd->dwFormatIndex].nBits;
350 /* native MSACM uses a PCMWAVEFORMAT structure, so cbSize is not accessible
351 * afd->pwfx->cbSize = 0;
353 afd->pwfx->nBlockAlign =
354 (afd->pwfx->nChannels * afd->pwfx->wBitsPerSample) / 8;
355 afd->pwfx->nAvgBytesPerSec =
356 afd->pwfx->nSamplesPerSec * afd->pwfx->nBlockAlign;
357 break;
358 case WAVE_FORMAT_MPEGLAYER3:
359 case WAVE_FORMAT_MPEG:
360 WARN("Encoding to MPEG is not supported\n");
361 return ACMERR_NOTPOSSIBLE;
362 default:
363 WARN("Unsupported tag %08x\n", afd->dwFormatTag);
364 return MMSYSERR_INVALPARAM;
366 break;
367 default:
368 WARN("Unsupported query %08x\n", dwQuery);
369 return MMSYSERR_NOTSUPPORTED;
371 afd->fdwSupport = ACMDRIVERDETAILS_SUPPORTF_CODEC;
372 afd->szFormat[0] = 0; /* let MSACM format this for us... */
374 return MMSYSERR_NOERROR;
377 /***********************************************************************
378 * MPEG3_FormatSuggest
381 static LRESULT MPEG3_FormatSuggest(PACMDRVFORMATSUGGEST adfs)
383 /* some tests ... */
384 if (adfs->cbwfxSrc < sizeof(PCMWAVEFORMAT) ||
385 adfs->cbwfxDst < sizeof(PCMWAVEFORMAT) ||
386 MPEG3_GetFormatIndex(adfs->pwfxSrc) == 0xFFFFFFFF) return ACMERR_NOTPOSSIBLE;
387 /* FIXME: should do those tests against the real size (according to format tag */
389 /* If no suggestion for destination, then copy source value */
390 if (!(adfs->fdwSuggest & ACM_FORMATSUGGESTF_NCHANNELS))
391 adfs->pwfxDst->nChannels = adfs->pwfxSrc->nChannels;
392 if (!(adfs->fdwSuggest & ACM_FORMATSUGGESTF_NSAMPLESPERSEC))
393 adfs->pwfxDst->nSamplesPerSec = adfs->pwfxSrc->nSamplesPerSec;
394 if (!(adfs->fdwSuggest & ACM_FORMATSUGGESTF_WBITSPERSAMPLE))
395 adfs->pwfxDst->wBitsPerSample = 16;
396 if (!(adfs->fdwSuggest & ACM_FORMATSUGGESTF_WFORMATTAG))
398 if (adfs->pwfxSrc->wFormatTag == WAVE_FORMAT_PCM)
400 WARN("Encoding to MPEG is not supported\n");
401 return ACMERR_NOTPOSSIBLE;
403 else
404 adfs->pwfxDst->wFormatTag = WAVE_FORMAT_PCM;
407 /* check if result is ok */
408 if (MPEG3_GetFormatIndex(adfs->pwfxDst) == 0xFFFFFFFF) return ACMERR_NOTPOSSIBLE;
410 /* recompute other values */
411 switch (adfs->pwfxDst->wFormatTag)
413 case WAVE_FORMAT_PCM:
414 adfs->pwfxDst->nBlockAlign = (adfs->pwfxDst->nChannels * adfs->pwfxDst->wBitsPerSample) / 8;
415 adfs->pwfxDst->nAvgBytesPerSec = adfs->pwfxDst->nSamplesPerSec * adfs->pwfxDst->nBlockAlign;
416 break;
417 case WAVE_FORMAT_MPEG:
418 case WAVE_FORMAT_MPEGLAYER3:
419 WARN("Encoding to MPEG is not supported\n");
420 return ACMERR_NOTPOSSIBLE;
421 break;
422 default:
423 FIXME("\n");
424 break;
427 return MMSYSERR_NOERROR;
430 /***********************************************************************
431 * MPEG3_StreamSize
434 static LRESULT MPEG3_StreamSize(PACMDRVSTREAMINSTANCE adsi, PACMDRVSTREAMSIZE adss)
436 DWORD nblocks;
438 switch (adss->fdwSize)
440 case ACM_STREAMSIZEF_DESTINATION:
441 /* cbDstLength => cbSrcLength */
442 if (adsi->pwfxSrc->wFormatTag == WAVE_FORMAT_PCM &&
443 (adsi->pwfxDst->wFormatTag == WAVE_FORMAT_MPEGLAYER3 ||
444 adsi->pwfxDst->wFormatTag == WAVE_FORMAT_MPEG))
446 nblocks = (adss->cbDstLength - 3000) / (DWORD)(adsi->pwfxDst->nAvgBytesPerSec * 1152 / adsi->pwfxDst->nSamplesPerSec + 0.5);
447 if (nblocks == 0)
448 return ACMERR_NOTPOSSIBLE;
449 adss->cbSrcLength = nblocks * 1152 * adsi->pwfxSrc->nBlockAlign;
451 else if ((adsi->pwfxSrc->wFormatTag == WAVE_FORMAT_MPEGLAYER3 ||
452 adsi->pwfxSrc->wFormatTag == WAVE_FORMAT_MPEG) &&
453 adsi->pwfxDst->wFormatTag == WAVE_FORMAT_PCM)
455 nblocks = adss->cbDstLength / (adsi->pwfxDst->nBlockAlign * 1152);
456 if (nblocks == 0)
457 return ACMERR_NOTPOSSIBLE;
458 adss->cbSrcLength = nblocks * (DWORD)(adsi->pwfxSrc->nAvgBytesPerSec * 1152 / adsi->pwfxSrc->nSamplesPerSec);
460 else
462 return MMSYSERR_NOTSUPPORTED;
464 break;
465 case ACM_STREAMSIZEF_SOURCE:
466 /* cbSrcLength => cbDstLength */
467 if (adsi->pwfxSrc->wFormatTag == WAVE_FORMAT_PCM &&
468 (adsi->pwfxDst->wFormatTag == WAVE_FORMAT_MPEGLAYER3 ||
469 adsi->pwfxDst->wFormatTag == WAVE_FORMAT_MPEG))
471 nblocks = adss->cbSrcLength / (adsi->pwfxSrc->nBlockAlign * 1152);
472 if (adss->cbSrcLength % (DWORD)(adsi->pwfxSrc->nBlockAlign * 1152))
473 /* Round block count up. */
474 nblocks++;
475 if (nblocks == 0)
476 return ACMERR_NOTPOSSIBLE;
477 adss->cbDstLength = 3000 + nblocks * (DWORD)(adsi->pwfxDst->nAvgBytesPerSec * 1152 / adsi->pwfxDst->nSamplesPerSec + 0.5);
479 else if ((adsi->pwfxSrc->wFormatTag == WAVE_FORMAT_MPEGLAYER3 ||
480 adsi->pwfxSrc->wFormatTag == WAVE_FORMAT_MPEG) &&
481 adsi->pwfxDst->wFormatTag == WAVE_FORMAT_PCM)
483 nblocks = adss->cbSrcLength / (DWORD)(adsi->pwfxSrc->nAvgBytesPerSec * 1152 / adsi->pwfxSrc->nSamplesPerSec);
484 if (adss->cbSrcLength % (DWORD)(adsi->pwfxSrc->nAvgBytesPerSec * 1152 / adsi->pwfxSrc->nSamplesPerSec))
485 /* Round block count up. */
486 nblocks++;
487 if (nblocks == 0)
488 return ACMERR_NOTPOSSIBLE;
489 adss->cbDstLength = nblocks * 1152 * adsi->pwfxDst->nBlockAlign;
491 else
493 return MMSYSERR_NOTSUPPORTED;
495 break;
496 default:
497 WARN("Unsupported query %08x\n", adss->fdwSize);
498 return MMSYSERR_NOTSUPPORTED;
500 return MMSYSERR_NOERROR;
503 /***********************************************************************
504 * MPEG3_StreamConvert
507 static LRESULT MPEG3_StreamConvert(ACMDRVSTREAMINSTANCE *instance, ACMDRVSTREAMHEADER *adsh)
509 mpg123_handle *handle = (mpg123_handle *)instance->dwDriver;
510 DWORD nsrc = adsh->cbSrcLength;
511 DWORD ndst = adsh->cbDstLength;
513 if (adsh->fdwConvert &
514 ~(ACM_STREAMCONVERTF_BLOCKALIGN|
515 ACM_STREAMCONVERTF_END|
516 ACM_STREAMCONVERTF_START))
518 FIXME("Unsupported fdwConvert (%08x), ignoring it\n", adsh->fdwConvert);
520 /* ACM_STREAMCONVERTF_BLOCKALIGN
521 * currently all conversions are block aligned, so do nothing for this flag
522 * ACM_STREAMCONVERTF_END
523 * no pending data, so do nothing for this flag
525 if ((adsh->fdwConvert & ACM_STREAMCONVERTF_START))
527 mpg123_feedseek(handle, 0, SEEK_SET, NULL);
528 mpg123_close(handle);
529 mpg123_open_feed(handle);
532 mp3_horse(handle, adsh->pbSrc, &nsrc, adsh->pbDst, &ndst);
533 adsh->cbSrcLengthUsed = nsrc;
534 adsh->cbDstLengthUsed = ndst;
536 return MMSYSERR_NOERROR;
539 /**************************************************************************
540 * MPEG3_DriverProc [exported]
542 LRESULT CALLBACK MPEG3_DriverProc(DWORD_PTR dwDevID, HDRVR hDriv, UINT wMsg,
543 LPARAM dwParam1, LPARAM dwParam2)
545 TRACE("(%08lx %p %04x %08lx %08lx);\n",
546 dwDevID, hDriv, wMsg, dwParam1, dwParam2);
548 switch (wMsg)
550 case DRV_LOAD: return 1;
551 case DRV_FREE: return 1;
552 case DRV_OPEN: return MPEG3_drvOpen((LPSTR)dwParam1);
553 case DRV_CLOSE: return MPEG3_drvClose(dwDevID);
554 case DRV_ENABLE: return 1;
555 case DRV_DISABLE: return 1;
556 case DRV_QUERYCONFIGURE: return 1;
557 case DRV_CONFIGURE: MessageBoxA(0, "MPEG3 filter !", "Wine Driver", MB_OK); return 1;
558 case DRV_INSTALL: return DRVCNF_RESTART;
559 case DRV_REMOVE: return DRVCNF_RESTART;
561 case ACMDM_DRIVER_NOTIFY:
562 /* no caching from other ACM drivers is done so far */
563 return MMSYSERR_NOERROR;
565 case ACMDM_DRIVER_DETAILS:
566 return MPEG3_DriverDetails((PACMDRIVERDETAILSW)dwParam1);
568 case ACMDM_FORMATTAG_DETAILS:
569 return MPEG3_FormatTagDetails((PACMFORMATTAGDETAILSW)dwParam1, dwParam2);
571 case ACMDM_FORMAT_DETAILS:
572 return MPEG3_FormatDetails((PACMFORMATDETAILSW)dwParam1, dwParam2);
574 case ACMDM_FORMAT_SUGGEST:
575 return MPEG3_FormatSuggest((PACMDRVFORMATSUGGEST)dwParam1);
577 case ACMDM_STREAM_OPEN:
578 return MPEG3_StreamOpen((PACMDRVSTREAMINSTANCE)dwParam1);
580 case ACMDM_STREAM_CLOSE:
581 return MPEG3_StreamClose((PACMDRVSTREAMINSTANCE)dwParam1);
583 case ACMDM_STREAM_SIZE:
584 return MPEG3_StreamSize((PACMDRVSTREAMINSTANCE)dwParam1, (PACMDRVSTREAMSIZE)dwParam2);
586 case ACMDM_STREAM_CONVERT:
587 return MPEG3_StreamConvert((PACMDRVSTREAMINSTANCE)dwParam1, (PACMDRVSTREAMHEADER)dwParam2);
589 case ACMDM_HARDWARE_WAVE_CAPS_INPUT:
590 case ACMDM_HARDWARE_WAVE_CAPS_OUTPUT:
591 /* this converter is not a hardware driver */
592 case ACMDM_FILTERTAG_DETAILS:
593 case ACMDM_FILTER_DETAILS:
594 /* this converter is not a filter */
595 case ACMDM_STREAM_RESET:
596 /* only needed for asynchronous driver... we aren't, so just say it */
597 return MMSYSERR_NOTSUPPORTED;
598 case ACMDM_STREAM_PREPARE:
599 case ACMDM_STREAM_UNPREPARE:
600 /* nothing special to do here... so don't do anything */
601 return MMSYSERR_NOERROR;
603 default:
604 return DefDriverProc(dwDevID, hDriv, wMsg, dwParam1, dwParam2);