2 * imaadp32.drv - IMA4 codec driver
4 * Copyright 2001 Hidenori Takeshima
6 * This library is free software; you can redistribute it and/or
7 * modify it under the terms of the GNU Lesser General Public
8 * License as published by the Free Software Foundation; either
9 * version 2.1 of the License, or (at your option) any later version.
11 * This library is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14 * Lesser General Public License for more details.
16 * You should have received a copy of the GNU Lesser General Public
17 * License along with this library; if not, write to the Free Software
18 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
21 * FIXME - no encoding.
33 #include "../msacmdrv.h"
35 #include "wine/debug.h"
37 WINE_DEFAULT_DEBUG_CHANNEL(imaadp32);
39 /***********************************************************************/
44 CodecType_EncIMAADPCM,
45 CodecType_DecIMAADPCM,
48 typedef struct CodecImpl
53 /***********************************************************************/
56 static const int ima_step[88+1] =
58 /* from Y.Ajima's WAVFMT.TXT */
59 7, 8, 9, 10, 11, 12, 13, 14,
60 16, 17, 19, 21, 23, 25, 28, 31,
61 34, 37, 41, 45, 50, 55, 60, 66,
62 73, 80, 88, 97, 107, 118, 130, 143,
63 157, 173, 190, 209, 230, 253, 279, 307,
64 337, 371, 408, 449, 494, 544, 598, 658,
65 724, 796, 876, 963, 1060, 1166, 1282, 1411,
66 1552, 1707, 1878, 2066, 2272, 2499, 2749, 3024,
67 3327, 3660, 4026, 4428, 4871, 5358, 5894, 6484,
68 7132, 7845, 8630, 9493, 10442, 11487, 12635, 13899,
69 15289, 16818, 18500, 20350, 22385, 24623, 27086, 29794, 32767
72 static const int ima_indexupdate[8*2] =
74 /* from Y.Ajima's WAVFMT.TXT */
75 -1,-1,-1,-1, 2, 4, 6, 8,
76 -1,-1,-1,-1, 2, 4, 6, 8,
79 static int stepindex_to_diff( int stepindex, int input )
81 /* from Y.Ajima's WAVFMT.TXT */
84 absdiff = (ima_step[stepindex]*((input&0x7)*2+1)) >> 3;
85 return (input&0x8) ? (-absdiff) : absdiff;
88 static int update_stepindex( int oldindex, int input )
92 index = oldindex + ima_indexupdate[input];
93 return (index < 0) ? 0 : (index > 88) ? 88 : index;
96 static void decode_ima_block( int channels, int samplesperblock, SHORT* pDst, BYTE* pSrc )
103 for ( n = 0; n < channels; n++ )
105 samp[n] = *(SHORT*)pSrc; pSrc += sizeof(SHORT);
106 stepindex[n] = *pSrc; pSrc += sizeof(SHORT);
111 while ( samplesperblock >= 8 )
113 for ( n = 0; n < channels; n++ )
115 for ( k = 0; k < 4; k++ )
117 inputs[k*2+0] = (*pSrc) & 0xf;
118 inputs[k*2+1] = (*pSrc) >> 4;
121 for ( k = 0; k < 8; k++ )
123 diff = stepindex_to_diff( stepindex[n], inputs[k] );
124 stepindex[n] = update_stepindex( stepindex[n], inputs[k] );
126 if ( diff < -32768 ) diff = -32768;
127 if ( diff > 32767 ) diff = 32767;
129 pDst[k*channels+n] = samp[n];
134 samplesperblock -= 8;
138 static LONG IMAADPCM32_Decode( int channels, int blockalign, int samplesperblock, BYTE* pbDst, DWORD cbDstLength, DWORD* pcbDstLengthUsed, BYTE* pbSrc, DWORD cbSrcLength, DWORD* pcbSrcLengthUsed )
140 DWORD cbDstLengthUsed = 0;
141 DWORD cbSrcLengthUsed = 0;
144 dstblocksize = samplesperblock*channels*sizeof(SHORT);
145 while ( cbDstLength >= dstblocksize && cbSrcLength >= blockalign )
147 decode_ima_block( channels, samplesperblock, (SHORT*)pbDst, pbSrc );
148 pbDst += dstblocksize;
149 cbDstLength -= dstblocksize;
150 cbDstLengthUsed += dstblocksize;
152 cbSrcLength -= blockalign;
153 cbSrcLengthUsed += blockalign;
156 *pcbSrcLengthUsed = cbSrcLengthUsed;
157 *pcbDstLengthUsed = cbDstLengthUsed;
159 return MMSYSERR_NOERROR;
163 /***********************************************************************/
165 static LONG Codec_DrvQueryConfigure( CodecImpl* This )
167 return MMSYSERR_NOTSUPPORTED;
170 static LONG Codec_DrvConfigure( CodecImpl* This, HWND hwnd, DRVCONFIGINFO* pinfo )
172 return MMSYSERR_NOTSUPPORTED;
175 static LONG Codec_DriverDetails( ACMDRIVERDETAILSW* pDrvDetails )
177 if ( pDrvDetails->cbStruct < sizeof(ACMDRIVERDETAILSW) )
178 return MMSYSERR_INVALPARAM;
180 ZeroMemory( pDrvDetails, sizeof(ACMDRIVERDETAILSW) );
181 pDrvDetails->cbStruct = sizeof(ACMDRIVERDETAILSW);
183 pDrvDetails->fccType = ACMDRIVERDETAILS_FCCTYPE_AUDIOCODEC;
184 pDrvDetails->fccComp = ACMDRIVERDETAILS_FCCCOMP_UNDEFINED;
185 pDrvDetails->wMid = 0xff; /* FIXME? */
186 pDrvDetails->wPid = 0x00; /* FIXME? */
187 pDrvDetails->vdwACM = 0x01000000; /* FIXME? */
188 pDrvDetails->vdwDriver = 0x01000000; /* FIXME? */
189 pDrvDetails->fdwSupport = ACMDRIVERDETAILS_SUPPORTF_CODEC;
190 pDrvDetails->cFormatTags = 2;
191 pDrvDetails->cFilterTags = 0;
192 pDrvDetails->hicon = (HICON)NULL;
193 MultiByteToWideChar( CP_ACP, 0, "WineIMA", -1,
194 pDrvDetails->szShortName,
195 sizeof(pDrvDetails->szShortName)/sizeof(WCHAR) );
196 MultiByteToWideChar( CP_ACP, 0, "Wine IMA codec", -1,
197 pDrvDetails->szLongName,
198 sizeof(pDrvDetails->szLongName)/sizeof(WCHAR) );
199 MultiByteToWideChar( CP_ACP, 0, "Brought to you by the Wine team...", -1,
200 pDrvDetails->szCopyright,
201 sizeof(pDrvDetails->szCopyright)/sizeof(WCHAR) );
202 MultiByteToWideChar( CP_ACP, 0, "Refer to LICENSE file", -1,
203 pDrvDetails->szLicensing,
204 sizeof(pDrvDetails->szLicensing)/sizeof(WCHAR) );
205 pDrvDetails->szFeatures[0] = 0;
207 return MMSYSERR_NOERROR;
210 static LONG Codec_QueryAbout( void )
212 return MMSYSERR_NOTSUPPORTED;
215 static LONG Codec_About( HWND hwnd )
217 return MMSYSERR_NOTSUPPORTED;
220 /***********************************************************************/
222 static LONG Codec_FormatTagDetails( CodecImpl* This, ACMFORMATTAGDETAILSW* pFmtTagDetails, DWORD dwFlags )
224 FIXME( "enumerate tags\n" );
228 case ACM_FORMATTAGDETAILSF_INDEX:
229 switch ( pFmtTagDetails->dwFormatTagIndex )
232 pFmtTagDetails->dwFormatTag = 0x11; /* IMA ADPCM */
235 pFmtTagDetails->dwFormatTag = 1; /* PCM */
238 return ACMERR_NOTPOSSIBLE;
241 case ACM_FORMATTAGDETAILSF_FORMATTAG:
242 switch ( pFmtTagDetails->dwFormatTag )
244 case 0x11: /* IMA ADPCM */
245 pFmtTagDetails->dwFormatTagIndex = 0;
248 pFmtTagDetails->dwFormatTagIndex = 1;
251 return ACMERR_NOTPOSSIBLE;
254 case ACM_FORMATTAGDETAILSF_LARGESTSIZE:
255 if ( pFmtTagDetails->dwFormatTag != 0 &&
256 pFmtTagDetails->dwFormatTag != 1 &&
257 pFmtTagDetails->dwFormatTag != 0x11 )
258 return ACMERR_NOTPOSSIBLE;
259 pFmtTagDetails->dwFormatTagIndex = 0;
262 return MMSYSERR_NOTSUPPORTED;
265 pFmtTagDetails->fdwSupport = ACMDRIVERDETAILS_SUPPORTF_CODEC;
266 pFmtTagDetails->cbFormatSize = sizeof(WAVEFORMATEX);
267 pFmtTagDetails->cStandardFormats = 2; /* FIXME */
268 pFmtTagDetails->szFormatTag[0] = 0; /* FIXME */
270 return MMSYSERR_NOERROR;
273 static LONG Codec_FormatDetails( CodecImpl* This, ACMFORMATDETAILSW* pFmtDetails, DWORD dwFlags )
275 FIXME( "enumerate standard formats\n" );
277 if ( pFmtDetails->cbStruct < sizeof(ACMFORMATDETAILSW) )
278 return MMSYSERR_INVALPARAM;
279 pFmtDetails->cbStruct = sizeof(ACMFORMATDETAILSW);
283 case ACM_FORMATDETAILSF_INDEX:
284 switch ( pFmtDetails->dwFormatIndex )
287 pFmtDetails->dwFormatTag = 0x11; /* IMA ADPCM */
290 pFmtDetails->dwFormatTag = 1; /* PCM */
293 return MMSYSERR_INVALPARAM;
296 case ACM_FORMATDETAILSF_FORMAT:
297 switch ( pFmtDetails->dwFormatTag )
299 case 0x11: /* IMA ADPCM */
300 pFmtDetails->dwFormatIndex = 0;
303 pFmtDetails->dwFormatIndex = 1;
306 return ACMERR_NOTPOSSIBLE;
310 return MMSYSERR_NOTSUPPORTED;
313 pFmtDetails->fdwSupport = ACMDRIVERDETAILS_SUPPORTF_CODEC;
314 pFmtDetails->pwfx->wFormatTag = pFmtDetails->dwFormatTag;
315 pFmtDetails->pwfx->nChannels = 1;
316 pFmtDetails->pwfx->nSamplesPerSec = 11025;
317 pFmtDetails->pwfx->wBitsPerSample = 4;
318 if ( pFmtDetails->dwFormatTag == 1 )
320 pFmtDetails->cbwfx = sizeof(PCMWAVEFORMAT);
324 pFmtDetails->pwfx->cbSize = sizeof(WORD);
325 pFmtDetails->cbwfx = sizeof(WAVEFORMATEX) + sizeof(WORD);
327 pFmtDetails->szFormat[0] = 0; /* FIXME */
329 return MMSYSERR_NOERROR;
333 static LONG Codec_FormatSuggest( CodecImpl* This, ACMDRVFORMATSUGGEST* pFmtSuggest )
337 FIXME( "get suggested format\n" );
339 if ( pFmtSuggest->cbStruct != sizeof(ACMDRVFORMATSUGGEST) )
340 return MMSYSERR_INVALPARAM;
342 if ( pFmtSuggest->cbwfxSrc < sizeof(PCMWAVEFORMAT) ||
343 pFmtSuggest->cbwfxDst < sizeof(PCMWAVEFORMAT) )
344 return MMSYSERR_INVALPARAM;
346 fdwSuggest = pFmtSuggest->fdwSuggest;
348 if ( fdwSuggest & ACM_FORMATSUGGESTF_NCHANNELS )
350 if ( pFmtSuggest->pwfxSrc->nChannels != pFmtSuggest->pwfxDst->nChannels )
351 return ACMERR_NOTPOSSIBLE;
352 fdwSuggest &= ~ACM_FORMATSUGGESTF_NCHANNELS;
355 if ( fdwSuggest & ACM_FORMATSUGGESTF_NSAMPLESPERSEC )
357 if ( pFmtSuggest->pwfxSrc->nSamplesPerSec != pFmtSuggest->pwfxDst->nSamplesPerSec )
358 return ACMERR_NOTPOSSIBLE;
359 fdwSuggest &= ~ACM_FORMATSUGGESTF_NSAMPLESPERSEC;
362 if ( pFmtSuggest->pwfxSrc->wFormatTag == 1 )
365 if ( pFmtSuggest->cbwfxDst < (sizeof(WAVEFORMATEX)+sizeof(WORD)) )
366 return MMSYSERR_INVALPARAM;
367 if ( pFmtSuggest->pwfxSrc->wBitsPerSample != 16 )
368 return ACMERR_NOTPOSSIBLE;
370 if ( fdwSuggest & ACM_FORMATSUGGESTF_WFORMATTAG )
372 if ( pFmtSuggest->pwfxDst->wFormatTag != 0x11 )
373 return ACMERR_NOTPOSSIBLE;
374 fdwSuggest &= ~ACM_FORMATSUGGESTF_WFORMATTAG;
377 if ( fdwSuggest & ACM_FORMATSUGGESTF_WBITSPERSAMPLE )
379 if ( pFmtSuggest->pwfxDst->wBitsPerSample != 4 )
380 return ACMERR_NOTPOSSIBLE;
381 fdwSuggest &= ~ACM_FORMATSUGGESTF_WFORMATTAG;
384 if ( fdwSuggest != 0 )
385 return MMSYSERR_INVALFLAG;
387 if ( !(fdwSuggest & ACM_FORMATSUGGESTF_WFORMATTAG) )
388 pFmtSuggest->pwfxDst->wFormatTag = 0x11;
389 pFmtSuggest->pwfxDst->nChannels = pFmtSuggest->pwfxSrc->nChannels;
390 pFmtSuggest->pwfxDst->nSamplesPerSec = pFmtSuggest->pwfxSrc->nSamplesPerSec;
391 pFmtSuggest->pwfxDst->nAvgBytesPerSec = 0; /* FIXME */
392 pFmtSuggest->pwfxDst->nBlockAlign = 0; /* FIXME */
393 pFmtSuggest->pwfxDst->wBitsPerSample = 4;
394 pFmtSuggest->pwfxDst->cbSize = 2;
396 FIXME( "no compressor" );
397 return ACMERR_NOTPOSSIBLE;
402 if ( pFmtSuggest->cbwfxSrc < (sizeof(WAVEFORMATEX)+sizeof(WORD)) )
403 return MMSYSERR_INVALPARAM;
404 if ( pFmtSuggest->pwfxSrc->wFormatTag != 0x11 )
405 return ACMERR_NOTPOSSIBLE;
406 if ( pFmtSuggest->pwfxSrc->wBitsPerSample != 4 )
407 return ACMERR_NOTPOSSIBLE;
409 if ( fdwSuggest & ACM_FORMATSUGGESTF_WFORMATTAG )
411 if ( pFmtSuggest->pwfxDst->wFormatTag != 1 )
412 return ACMERR_NOTPOSSIBLE;
413 fdwSuggest &= ~ACM_FORMATSUGGESTF_WFORMATTAG;
416 if ( fdwSuggest & ACM_FORMATSUGGESTF_WBITSPERSAMPLE )
418 if ( pFmtSuggest->pwfxDst->wBitsPerSample != 16 )
419 return ACMERR_NOTPOSSIBLE;
420 fdwSuggest &= ~ACM_FORMATSUGGESTF_WFORMATTAG;
423 if ( fdwSuggest != 0 )
424 return MMSYSERR_INVALFLAG;
426 pFmtSuggest->pwfxDst->wFormatTag = 1;
427 pFmtSuggest->pwfxDst->nChannels = pFmtSuggest->pwfxSrc->nChannels;
428 pFmtSuggest->pwfxDst->nSamplesPerSec = pFmtSuggest->pwfxSrc->nSamplesPerSec;
429 pFmtSuggest->pwfxDst->nAvgBytesPerSec = pFmtSuggest->pwfxSrc->nSamplesPerSec * pFmtSuggest->pwfxSrc->nChannels * 2;
430 pFmtSuggest->pwfxDst->nBlockAlign = pFmtSuggest->pwfxSrc->nChannels * 2;
431 pFmtSuggest->pwfxDst->wBitsPerSample = 16;
434 return MMSYSERR_NOERROR;
437 static LONG Codec_FilterTagDetails( CodecImpl* This, ACMFILTERTAGDETAILSW* pFilterTagDetails, DWORD dwFlags )
439 /* This is a codec driver. */
440 return MMSYSERR_NOTSUPPORTED;
443 static LONG Codec_FilterDetails( CodecImpl* This, ACMFILTERDETAILSW* pFilterDetails, DWORD dwFlags )
445 /* This is a codec driver. */
446 return MMSYSERR_NOTSUPPORTED;
449 static LONG Codec_StreamOpen( CodecImpl* This, ACMDRVSTREAMINSTANCE* pStreamInst )
451 enum CodecType codectype = CodecType_Invalid;
453 if ( pStreamInst->cbStruct != sizeof(ACMDRVSTREAMINSTANCE) )
455 TRACE("invalid size of struct\n");
456 return MMSYSERR_INVALPARAM;
459 if ( pStreamInst->fdwOpen & (~(ACM_STREAMOPENF_ASYNC|ACM_STREAMOPENF_NONREALTIME|ACM_STREAMOPENF_QUERY|CALLBACK_EVENT|CALLBACK_FUNCTION|CALLBACK_WINDOW)) )
461 TRACE("unknown flags\n");
462 return MMSYSERR_INVALFLAG;
465 /* No support for async operations. */
466 if ( pStreamInst->fdwOpen & ACM_STREAMOPENF_ASYNC )
467 return MMSYSERR_INVALFLAG;
469 /* This is a codec driver. */
470 if ( pStreamInst->pwfxSrc->nChannels != pStreamInst->pwfxDst->nChannels || pStreamInst->pwfxSrc->nSamplesPerSec != pStreamInst->pwfxDst->nSamplesPerSec )
471 return ACMERR_NOTPOSSIBLE;
472 if ( pStreamInst->pwfltr != NULL )
473 return ACMERR_NOTPOSSIBLE;
475 if ( pStreamInst->pwfxSrc->wFormatTag == 1 )
477 if ( pStreamInst->pwfxSrc->wBitsPerSample != 16 )
478 return ACMERR_NOTPOSSIBLE;
479 if ( pStreamInst->pwfxDst->wBitsPerSample != 4 )
480 return ACMERR_NOTPOSSIBLE;
482 /* Queried as a compressor */
483 FIXME( "Compressor is not implemented now\n" );
484 return ACMERR_NOTPOSSIBLE;
487 if ( pStreamInst->pwfxDst->wFormatTag == 1 )
489 if ( pStreamInst->pwfxDst->wBitsPerSample != 16 )
490 return ACMERR_NOTPOSSIBLE;
491 if ( pStreamInst->pwfxSrc->wBitsPerSample != 4 )
492 return ACMERR_NOTPOSSIBLE;
494 switch ( pStreamInst->pwfxSrc->wFormatTag )
496 case 0x11: /* IMA ADPCM */
497 TRACE( "IMG ADPCM deompressor\n" );
498 codectype = CodecType_DecIMAADPCM;
501 return ACMERR_NOTPOSSIBLE;
506 return ACMERR_NOTPOSSIBLE;
509 if ( pStreamInst->fdwOpen & ACM_STREAMOPENF_QUERY )
510 return MMSYSERR_NOERROR;
512 pStreamInst->dwDriver = (DWORD)codectype;
514 return MMSYSERR_NOERROR;
517 static LONG Codec_StreamClose( CodecImpl* This, ACMDRVSTREAMINSTANCE* pStreamInst )
519 return MMSYSERR_NOERROR;
522 static LONG Codec_StreamSize( CodecImpl* This, ACMDRVSTREAMINSTANCE* pStreamInst, ACMDRVSTREAMSIZE* pStreamSize )
524 enum CodecType codectype;
527 if ( pStreamSize->cbStruct != sizeof(ACMDRVSTREAMSIZE) )
528 return MMSYSERR_INVALPARAM;
530 codectype = (enum CodecType)pStreamInst->dwDriver;
532 res = MMSYSERR_NOERROR;
536 case CodecType_EncIMAADPCM:
537 if ( pStreamSize->fdwSize == ACM_STREAMSIZEF_SOURCE )
538 pStreamSize->cbDstLength = 64 + (pStreamSize->cbSrcLength >> 2);
540 if ( pStreamSize->fdwSize == ACM_STREAMSIZEF_DESTINATION )
541 pStreamSize->cbSrcLength = pStreamSize->cbDstLength << 2;
543 res = MMSYSERR_INVALFLAG;
545 case CodecType_DecIMAADPCM:
546 if ( pStreamSize->fdwSize == ACM_STREAMSIZEF_SOURCE )
547 pStreamSize->cbDstLength = pStreamSize->cbSrcLength << 2;
549 if ( pStreamSize->fdwSize == ACM_STREAMSIZEF_DESTINATION )
550 pStreamSize->cbSrcLength = 64 + (pStreamSize->cbDstLength >> 2);
552 res = MMSYSERR_INVALFLAG;
555 ERR( "CodecType_Invalid\n" );
556 res = MMSYSERR_NOTSUPPORTED;
563 static LONG Codec_StreamConvert( CodecImpl* This, ACMDRVSTREAMINSTANCE* pStreamInst, ACMDRVSTREAMHEADER* pStreamHdr )
565 enum CodecType codectype;
568 codectype = (enum CodecType)pStreamInst->dwDriver;
570 res = MMSYSERR_NOTSUPPORTED;
573 case CodecType_EncIMAADPCM:
574 FIXME( "CodecType_EncIMAADPCM\n" );
576 case CodecType_DecIMAADPCM:
577 TRACE( "CodecType_DecIMAADPCM\n" );
578 res = IMAADPCM32_Decode( pStreamInst->pwfxSrc->nChannels, pStreamInst->pwfxSrc->nBlockAlign, *(WORD*)(((BYTE*)pStreamInst->pwfxSrc) + sizeof(WAVEFORMATEX)), pStreamHdr->pbDst, pStreamHdr->cbDstLength, &pStreamHdr->cbDstLengthUsed, pStreamHdr->pbSrc, pStreamHdr->cbSrcLength, &pStreamHdr->cbSrcLengthUsed );
581 ERR( "CodecType_Invalid\n" );
588 static LONG Codec_StreamReset( CodecImpl* This, ACMDRVSTREAMINSTANCE* pStreamInst, DWORD dwFlags )
590 return MMSYSERR_NOTSUPPORTED;
593 static LONG Codec_StreamPrepare( CodecImpl* This, ACMDRVSTREAMINSTANCE* pStreamInst, ACMDRVSTREAMHEADER* pStreamHdr )
595 return MMSYSERR_NOTSUPPORTED;
598 static LONG Codec_StreamUnprepare( CodecImpl* This, ACMDRVSTREAMINSTANCE* pStreamInst, ACMDRVSTREAMHEADER* pStreamHdr )
600 return MMSYSERR_NOTSUPPORTED;
605 /***********************************************************************/
607 static CodecImpl* Codec_AllocDriver( void )
611 This = HeapAlloc( GetProcessHeap(), 0, sizeof(CodecImpl) );
614 ZeroMemory( This, sizeof(CodecImpl) );
616 /* initialize members. */
621 static void Codec_Close( CodecImpl* This )
624 HeapFree( GetProcessHeap(), 0, This );
629 /***********************************************************************/
631 LONG WINAPI IMAADP32_DriverProc(
632 DWORD dwDriverId, HDRVR hdrvr, UINT msg, LONG lParam1, LONG lParam2 )
634 TRACE( "DriverProc(%08lx,%08x,%08x,%08lx,%08lx)\n",
635 dwDriverId, hdrvr, msg, lParam1, lParam2 );
647 return (LONG)Codec_AllocDriver();
649 TRACE("DRV_CLOSE\n");
650 Codec_Close( (CodecImpl*)dwDriverId );
653 TRACE("DRV_ENABLE\n");
656 TRACE("DRV_DISABLE\n");
658 case DRV_QUERYCONFIGURE:
659 TRACE("DRV_QUERYCONFIGURE\n");
660 return Codec_DrvQueryConfigure( (CodecImpl*)dwDriverId );
662 TRACE("DRV_CONFIGURE\n");
663 return Codec_DrvConfigure( (CodecImpl*)dwDriverId,
664 (HWND)lParam1, (DRVCONFIGINFO*)lParam2 );
666 TRACE("DRV_INSTALL\n");
669 TRACE("DRV_REMOVE\n");
672 TRACE("DRV_POWER\n");
675 case ACMDM_DRIVER_NOTIFY:
676 return MMSYSERR_NOERROR;
677 case ACMDM_DRIVER_DETAILS:
678 return Codec_DriverDetails((ACMDRIVERDETAILSW*)lParam1);
679 case ACMDM_DRIVER_ABOUT:
680 TRACE("ACMDM_DRIVER_ABOUT\n");
681 return (lParam1 == -1) ? Codec_QueryAbout() : Codec_About( (HWND)lParam1 );
683 case ACMDM_HARDWARE_WAVE_CAPS_INPUT:
684 return MMSYSERR_NOTSUPPORTED;
685 case ACMDM_HARDWARE_WAVE_CAPS_OUTPUT:
686 return MMSYSERR_NOTSUPPORTED;
688 case ACMDM_FORMATTAG_DETAILS:
689 return Codec_FormatTagDetails( (CodecImpl*)dwDriverId, (ACMFORMATTAGDETAILSW*)lParam1, (DWORD)lParam2 );
690 case ACMDM_FORMAT_DETAILS:
691 return Codec_FormatDetails( (CodecImpl*)dwDriverId, (ACMFORMATDETAILSW*)lParam1, (DWORD)lParam2 );
692 case ACMDM_FORMAT_SUGGEST:
693 return Codec_FormatSuggest( (CodecImpl*)dwDriverId, (ACMDRVFORMATSUGGEST*)lParam1 );
695 case ACMDM_FILTERTAG_DETAILS:
696 return Codec_FilterTagDetails( (CodecImpl*)dwDriverId, (ACMFILTERTAGDETAILSW*)lParam1, (DWORD)lParam2 );
697 case ACMDM_FILTER_DETAILS:
698 return Codec_FilterDetails( (CodecImpl*)dwDriverId, (ACMFILTERDETAILSW*)lParam1, (DWORD)lParam2 );
700 case ACMDM_STREAM_OPEN:
701 return Codec_StreamOpen( (CodecImpl*)dwDriverId, (ACMDRVSTREAMINSTANCE*)lParam1 );
702 case ACMDM_STREAM_CLOSE:
703 return Codec_StreamClose( (CodecImpl*)dwDriverId, (ACMDRVSTREAMINSTANCE*)lParam1 );
704 case ACMDM_STREAM_SIZE:
705 return Codec_StreamSize( (CodecImpl*)dwDriverId, (ACMDRVSTREAMINSTANCE*)lParam1, (ACMDRVSTREAMSIZE*)lParam2 );
706 case ACMDM_STREAM_CONVERT:
707 return Codec_StreamConvert( (CodecImpl*)dwDriverId, (ACMDRVSTREAMINSTANCE*)lParam1, (ACMDRVSTREAMHEADER*)lParam2 );
708 case ACMDM_STREAM_RESET:
709 return Codec_StreamReset( (CodecImpl*)dwDriverId, (ACMDRVSTREAMINSTANCE*)lParam1, (DWORD)lParam2 );
710 case ACMDM_STREAM_PREPARE:
711 return Codec_StreamPrepare( (CodecImpl*)dwDriverId, (ACMDRVSTREAMINSTANCE*)lParam1, (ACMDRVSTREAMHEADER*)lParam2 );
712 case ACMDM_STREAM_UNPREPARE:
713 return Codec_StreamUnprepare( (CodecImpl*)dwDriverId, (ACMDRVSTREAMINSTANCE*)lParam1, (ACMDRVSTREAMHEADER*)lParam2 );
717 return DefDriverProc( dwDriverId, hdrvr, msg, lParam1, lParam2 );
720 /***********************************************************************/
722 BOOL WINAPI IMAADP32_DllMain( HINSTANCE hInst, DWORD dwReason, LPVOID lpvReserved )
724 TRACE( "(%08x,%08lx,%p)\n",hInst,dwReason,lpvReserved );