ReactOS  0.4.14-dev-583-g2a1ba2c
msgsm32.c
Go to the documentation of this file.
1 /*
2  * GSM 06.10 codec handling
3  * Copyright (C) 2009 Maarten Lankhorst
4  *
5  * Based on msg711.acm
6  * Copyright (C) 2002 Eric Pouech
7  *
8  * This library is free software; you can redistribute it and/or
9  * modify it under the terms of the GNU Lesser General Public
10  * License as published by the Free Software Foundation; either
11  * version 2.1 of the License, or (at your option) any later version.
12  *
13  * This library is distributed in the hope that it will be useful,
14  * but WITHOUT ANY WARRANTY; without even the implied warranty of
15  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
16  * Lesser General Public License for more details.
17  *
18  * You should have received a copy of the GNU Lesser General Public
19  * License along with this library; if not, write to the Free Software
20  * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
21  */
22 
23 #include "config.h"
24 #include <wine/port.h>
25 
26 #include <assert.h>
27 #include <stdarg.h>
28 #include <string.h>
29 
30 #ifdef HAVE_GSM_GSM_H
31 #include <gsm/gsm.h>
32 #elif defined(HAVE_GSM_H)
33 #include <gsm.h>
34 #endif
35 
36 #include "windef.h"
37 #include "winbase.h"
38 #include "wingdi.h"
39 #include "winuser.h"
40 #include "winnls.h"
41 #include "mmsystem.h"
42 #include "mmreg.h"
43 #include "msacm.h"
44 #include "msacmdrv.h"
45 #include "wine/library.h"
46 #include "wine/debug.h"
47 
49 
50 #ifdef SONAME_LIBGSM
51 
52 static void *libgsm_handle;
53 #define FUNCPTR(f) static typeof(f) * p##f
54 FUNCPTR(gsm_create);
55 FUNCPTR(gsm_destroy);
56 FUNCPTR(gsm_option);
57 FUNCPTR(gsm_encode);
58 FUNCPTR(gsm_decode);
59 
60 #define LOAD_FUNCPTR(f) \
61  if((p##f = wine_dlsym(libgsm_handle, #f, NULL, 0)) == NULL) { \
62  wine_dlclose(libgsm_handle, NULL, 0); \
63  libgsm_handle = NULL; \
64  return FALSE; \
65  }
66 
67 /***********************************************************************
68  * GSM_drvLoad
69  */
70 static BOOL GSM_drvLoad(void)
71 {
72  char error[128];
73 
74  libgsm_handle = wine_dlopen(SONAME_LIBGSM, RTLD_NOW, error, sizeof(error));
75  if (libgsm_handle)
76  {
77  LOAD_FUNCPTR(gsm_create);
78  LOAD_FUNCPTR(gsm_destroy);
79  LOAD_FUNCPTR(gsm_option);
80  LOAD_FUNCPTR(gsm_encode);
81  LOAD_FUNCPTR(gsm_decode);
82  return TRUE;
83  }
84  else
85  {
86  ERR("Couldn't load " SONAME_LIBGSM ": %s\n", error);
87  return FALSE;
88  }
89 }
90 
91 /***********************************************************************
92  * GSM_drvFree
93  */
94 static LRESULT GSM_drvFree(void)
95 {
96  if (libgsm_handle)
97  wine_dlclose(libgsm_handle, NULL, 0);
98  return 1;
99 }
100 
101 #else
102 
103 static LRESULT GSM_drvFree(void)
104 {
105  return 1;
106 }
107 
108 #endif
109 
110 /***********************************************************************
111  * GSM_DriverDetails
112  *
113  */
115 {
118  /* Details found from probing native msgsm32.acm */
119  add->wMid = MM_MICROSOFT;
120  add->wPid = MM_MSFT_ACM_GSM610;
121  add->vdwACM = 0x3320000;
122  add->vdwDriver = 0x4000000;
123  add->fdwSupport = ACMDRIVERDETAILS_SUPPORTF_CODEC;
124  add->cFormatTags = 2;
125  add->cFilterTags = 0;
126  add->hicon = NULL;
127  MultiByteToWideChar( CP_ACP, 0, "Microsoft GSM 6.10", -1,
128  add->szShortName, ARRAY_SIZE( add->szShortName ));
129  MultiByteToWideChar( CP_ACP, 0, "Wine GSM 6.10 libgsm codec", -1,
130  add->szLongName, ARRAY_SIZE( add->szLongName ));
131  MultiByteToWideChar( CP_ACP, 0, "Brought to you by the Wine team...", -1,
132  add->szCopyright, ARRAY_SIZE( add->szCopyright ));
133  MultiByteToWideChar( CP_ACP, 0, "Refer to LICENSE file", -1,
134  add->szLicensing, ARRAY_SIZE( add->szLicensing ));
135  add->szFeatures[0] = 0;
136  return MMSYSERR_NOERROR;
137 }
138 
139 /* Validate a WAVEFORMATEX structure */
141 {
142  if (wfx->nChannels != 1)
143  return FALSE;
144 
145  switch (wfx->wFormatTag)
146  {
147  case WAVE_FORMAT_PCM:
148  if (wfx->wBitsPerSample != 16)
149  {
150  WARN("PCM wBitsPerSample %u\n", wfx->wBitsPerSample);
151  return FALSE;
152  }
153  if (wfx->nBlockAlign != 2)
154  {
155  WARN("PCM nBlockAlign %u\n", wfx->nBlockAlign);
156  return FALSE;
157  }
158  if (wfx->nAvgBytesPerSec != wfx->nBlockAlign * wfx->nSamplesPerSec)
159  {
160  WARN("PCM nAvgBytesPerSec %u/%u\n",
161  wfx->nAvgBytesPerSec,
162  wfx->nBlockAlign * wfx->nSamplesPerSec);
163  return FALSE;
164  }
165  return TRUE;
166  case WAVE_FORMAT_GSM610:
167  if (wfx->cbSize < sizeof(WORD))
168  {
169  WARN("GSM cbSize %u\n", wfx->cbSize);
170  return FALSE;
171  }
172  if (wfx->wBitsPerSample != 0)
173  {
174  WARN("GSM wBitsPerSample %u\n", wfx->wBitsPerSample);
175  return FALSE;
176  }
177  if (wfx->nBlockAlign != 65)
178  {
179  WARN("GSM nBlockAlign %u\n", wfx->nBlockAlign);
180  return FALSE;
181  }
182  if (((const GSM610WAVEFORMAT*)wfx)->wSamplesPerBlock != 320)
183  {
184  WARN("GSM wSamplesPerBlock %u\n",
185  ((const GSM610WAVEFORMAT*)wfx)->wSamplesPerBlock);
186  return FALSE;
187  }
188  if (wfx->nAvgBytesPerSec != wfx->nSamplesPerSec * 65 / 320)
189  {
190  WARN("GSM nAvgBytesPerSec %d / %d\n",
191  wfx->nAvgBytesPerSec, wfx->nSamplesPerSec * 65 / 320);
192  return FALSE;
193  }
194  return TRUE;
195  default:
196  return FALSE;
197  }
198  return FALSE;
199 }
200 
201 static const DWORD gsm_rates[] = { 8000, 11025, 22050, 44100, 48000, 96000 };
202 
203 /***********************************************************************
204  * GSM_FormatTagDetails
205  *
206  */
208 {
209  static const WCHAR szPcm[]={'P','C','M',0};
210  static const WCHAR szGsm[]={'G','S','M',' ','6','.','1','0',0};
211 
212  switch (dwQuery)
213  {
215  if (aftd->dwFormatTagIndex > 1) return ACMERR_NOTPOSSIBLE;
216  break;
218  if (aftd->dwFormatTag == WAVE_FORMAT_UNKNOWN)
219  {
220  aftd->dwFormatTagIndex = 1;
221  break;
222  }
223  /* fall through */
225  switch (aftd->dwFormatTag)
226  {
227  case WAVE_FORMAT_PCM: aftd->dwFormatTagIndex = 0; break;
228  case WAVE_FORMAT_GSM610: aftd->dwFormatTagIndex = 1; break;
229  default: return ACMERR_NOTPOSSIBLE;
230  }
231  break;
232  default:
233  WARN("Unsupported query %08x\n", dwQuery);
234  return MMSYSERR_NOTSUPPORTED;
235  }
236 
238  switch (aftd->dwFormatTagIndex)
239  {
240  case 0:
242  aftd->cbFormatSize = sizeof(PCMWAVEFORMAT);
244  lstrcpyW(aftd->szFormatTag, szPcm);
245  break;
246  case 1:
248  aftd->cbFormatSize = sizeof(GSM610WAVEFORMAT);
250  lstrcpyW(aftd->szFormatTag, szGsm);
251  break;
252  }
253  return MMSYSERR_NOERROR;
254 }
255 
256 /***********************************************************************
257  * GSM_FormatDetails
258  *
259  */
261 {
262  switch (dwQuery)
263  {
265  if (!GSM_FormatValidate(afd->pwfx)) return ACMERR_NOTPOSSIBLE;
266  break;
268  afd->pwfx->wFormatTag = afd->dwFormatTag;
269  switch (afd->dwFormatTag)
270  {
271  case WAVE_FORMAT_PCM:
273  afd->pwfx->nChannels = 1;
275  afd->pwfx->wBitsPerSample = 16;
276  afd->pwfx->nBlockAlign = 2;
277  afd->pwfx->nAvgBytesPerSec = afd->pwfx->nSamplesPerSec * afd->pwfx->nBlockAlign;
278  break;
279  case WAVE_FORMAT_GSM610:
281  afd->pwfx->nChannels = 1;
283  afd->pwfx->wBitsPerSample = 0;
284  afd->pwfx->nBlockAlign = 65;
285  afd->pwfx->nAvgBytesPerSec = afd->pwfx->nSamplesPerSec * 65 / 320;
286  afd->pwfx->cbSize = sizeof(WORD);
287  ((GSM610WAVEFORMAT*)afd->pwfx)->wSamplesPerBlock = 320;
288  break;
289  default:
290  WARN("Unsupported tag %08x\n", afd->dwFormatTag);
291  return MMSYSERR_INVALPARAM;
292  }
293  break;
294  default:
295  WARN("Unsupported query %08x\n", dwQuery);
296  return MMSYSERR_NOTSUPPORTED;
297  }
299  afd->szFormat[0] = 0; /* let MSACM format this for us... */
300 
301  return MMSYSERR_NOERROR;
302 }
303 
304 /***********************************************************************
305  * GSM_FormatSuggest
306  *
307  */
309 {
310  /* some tests ... */
311  if (adfs->cbwfxSrc < sizeof(PCMWAVEFORMAT) ||
312  adfs->cbwfxDst < sizeof(PCMWAVEFORMAT) ||
314  /* FIXME: should do those tests against the real size (according to format tag */
315 
316  /* If no suggestion for destination, then copy source value */
318  adfs->pwfxDst->nChannels = adfs->pwfxSrc->nChannels;
321 
323  {
324  if (adfs->pwfxSrc->wFormatTag == WAVE_FORMAT_PCM)
325  adfs->pwfxDst->wBitsPerSample = 0;
326  else
327  adfs->pwfxDst->wBitsPerSample = 16;
328  }
330  {
331  switch (adfs->pwfxSrc->wFormatTag)
332  {
335  }
336  }
337 
338  /* recompute other values */
339  switch (adfs->pwfxDst->wFormatTag)
340  {
341  case WAVE_FORMAT_PCM:
342  adfs->pwfxDst->nBlockAlign = 2;
343  adfs->pwfxDst->nAvgBytesPerSec = adfs->pwfxDst->nSamplesPerSec * 2;
344  break;
345  case WAVE_FORMAT_GSM610:
346  if (adfs->pwfxDst->cbSize < sizeof(WORD))
347  return ACMERR_NOTPOSSIBLE;
348  adfs->pwfxDst->nBlockAlign = 65;
349  adfs->pwfxDst->nAvgBytesPerSec = adfs->pwfxDst->nSamplesPerSec * 65 / 320;
350  ((GSM610WAVEFORMAT*)adfs->pwfxDst)->wSamplesPerBlock = 320;
351  break;
352  default:
353  return ACMERR_NOTPOSSIBLE;
354  }
355 
356  /* check if result is ok */
357  if (!GSM_FormatValidate(adfs->pwfxDst)) return ACMERR_NOTPOSSIBLE;
358  return MMSYSERR_NOERROR;
359 }
360 
361 #ifdef SONAME_LIBGSM
362 /***********************************************************************
363  * GSM_StreamOpen
364  *
365  */
366 static LRESULT GSM_StreamOpen(PACMDRVSTREAMINSTANCE adsi)
367 {
368  int used = 1;
369  gsm r;
370  if (!GSM_FormatValidate(adsi->pwfxSrc) || !GSM_FormatValidate(adsi->pwfxDst))
371  return MMSYSERR_NOTSUPPORTED;
372 
373  if (adsi->pwfxSrc->nSamplesPerSec != adsi->pwfxDst->nSamplesPerSec)
374  return MMSYSERR_NOTSUPPORTED;
375 
376  if (!GSM_drvLoad()) return MMSYSERR_NOTSUPPORTED;
377 
378  r = pgsm_create();
379  if (!r)
380  return MMSYSERR_NOMEM;
381  if (pgsm_option(r, GSM_OPT_WAV49, &used) < 0)
382  {
383  FIXME("Your libgsm library doesn't support GSM_OPT_WAV49\n");
384  FIXME("Please recompile libgsm with WAV49 support\n");
385  pgsm_destroy(r);
386  return MMSYSERR_NOTSUPPORTED;
387  }
388  adsi->dwDriver = (DWORD_PTR)r;
389  return MMSYSERR_NOERROR;
390 }
391 
392 /***********************************************************************
393  * GSM_StreamClose
394  *
395  */
396 static LRESULT GSM_StreamClose(PACMDRVSTREAMINSTANCE adsi)
397 {
398  pgsm_destroy((gsm)adsi->dwDriver);
399  return MMSYSERR_NOERROR;
400 }
401 
402 /***********************************************************************
403  * GSM_StreamSize
404  *
405  */
406 static LRESULT GSM_StreamSize(const ACMDRVSTREAMINSTANCE *adsi, PACMDRVSTREAMSIZE adss)
407 {
408  switch (adss->fdwSize)
409  {
411  /* cbDstLength => cbSrcLength */
412  if (adsi->pwfxSrc->wFormatTag == WAVE_FORMAT_PCM &&
414  {
415  adss->cbSrcLength = adss->cbDstLength / 65 * 640;
416  }
417  else if (adsi->pwfxSrc->wFormatTag == WAVE_FORMAT_GSM610 &&
419  {
420  adss->cbSrcLength = adss->cbDstLength / 640 * 65;
421  }
422  else
423  {
424  return MMSYSERR_NOTSUPPORTED;
425  }
426  return MMSYSERR_NOERROR;
428  /* cbSrcLength => cbDstLength */
429  if (adsi->pwfxSrc->wFormatTag == WAVE_FORMAT_PCM &&
431  {
432  adss->cbDstLength = (adss->cbSrcLength + 639) / 640 * 65;
433  }
434  else if (adsi->pwfxSrc->wFormatTag == WAVE_FORMAT_GSM610 &&
436  {
437  adss->cbDstLength = adss->cbSrcLength / 65 * 640;
438  }
439  else
440  {
441  return MMSYSERR_NOTSUPPORTED;
442  }
443  return MMSYSERR_NOERROR;
444  default:
445  WARN("Unsupported query %08x\n", adss->fdwSize);
446  return MMSYSERR_NOTSUPPORTED;
447  }
448 }
449 
450 /***********************************************************************
451  * GSM_StreamConvert
452  *
453  */
454 static LRESULT GSM_StreamConvert(PACMDRVSTREAMINSTANCE adsi, PACMDRVSTREAMHEADER adsh)
455 {
456  gsm r = (gsm)adsi->dwDriver;
457  DWORD nsrc = 0;
458  DWORD ndst = 0;
459  BYTE *src = adsh->pbSrc;
460  BYTE *dst = adsh->pbDst;
461  int odd = 0;
462 
463  if (adsh->fdwConvert &
467  {
468  FIXME("Unsupported fdwConvert (%08x), ignoring it\n", adsh->fdwConvert);
469  }
470 
471  /* Reset the index to 0, just to be sure */
472  pgsm_option(r, GSM_OPT_FRAME_INDEX, &odd);
473 
474  /* The native ms codec writes 65 bytes, and this requires 2 libgsm calls.
475  * First 32 bytes are written, or 33 bytes read
476  * Second 33 bytes are written, or 32 bytes read
477  */
478 
479  /* Decode */
480  if (adsi->pwfxSrc->wFormatTag == WAVE_FORMAT_GSM610)
481  {
482  if (adsh->cbSrcLength / 65 * 640 > adsh->cbDstLength)
483  {
484  return ACMERR_NOTPOSSIBLE;
485  }
486 
487  while (nsrc + 65 <= adsh->cbSrcLength)
488  {
489  /* Decode data */
490  if (pgsm_decode(r, src + nsrc, (gsm_signal*)(dst + ndst)) < 0)
491  FIXME("Couldn't decode data\n");
492  ndst += 320;
493  nsrc += 33;
494 
495  if (pgsm_decode(r, src + nsrc, (gsm_signal*)(dst + ndst)) < 0)
496  FIXME("Couldn't decode data\n");
497  ndst += 320;
498  nsrc += 32;
499  }
500  }
501  else
502  {
503  /* Testing a little seems to reveal that despite being able to fit
504  * inside the buffer if ACM_STREAMCONVERTF_BLOCKALIGN is set
505  * it still rounds up
506  */
507  if ((adsh->cbSrcLength + 639) / 640 * 65 > adsh->cbDstLength)
508  {
509  return ACMERR_NOTPOSSIBLE;
510  }
511 
512  /* The packing algorithm writes 32 bytes, then 33 bytes,
513  * and it seems to pad to align to 65 bytes always
514  * adding extra data where necessary
515  */
516  while (nsrc + 640 <= adsh->cbSrcLength)
517  {
518  /* Encode data */
519  pgsm_encode(r, (gsm_signal*)(src+nsrc), dst+ndst);
520  nsrc += 320;
521  ndst += 32;
522  pgsm_encode(r, (gsm_signal*)(src+nsrc), dst+ndst);
523  nsrc += 320;
524  ndst += 33;
525  }
526 
527  /* If ACM_STREAMCONVERTF_BLOCKALIGN isn't set pad with zeros */
528  if (!(adsh->fdwConvert & ACM_STREAMCONVERTF_BLOCKALIGN) &&
529  nsrc < adsh->cbSrcLength)
530  {
531  char emptiness[320];
532  int todo = adsh->cbSrcLength - nsrc;
533 
534  if (todo > 320)
535  {
536  pgsm_encode(r, (gsm_signal*)(src+nsrc), dst+ndst);
537  ndst += 32;
538  todo -= 320;
539  nsrc += 320;
540 
541  memcpy(emptiness, src+nsrc, todo);
542  memset(emptiness + todo, 0, 320 - todo);
543  pgsm_encode(r, (gsm_signal*)emptiness, dst+ndst);
544  ndst += 33;
545  }
546  else
547  {
548  memcpy(emptiness, src+nsrc, todo);
549  memset(emptiness + todo, 0, 320 - todo);
550  pgsm_encode(r, (gsm_signal*)emptiness, dst+ndst);
551  ndst += 32;
552 
553  memset(emptiness, 0, todo);
554  pgsm_encode(r, (gsm_signal*)emptiness, dst+ndst);
555  ndst += 33;
556  }
557  nsrc = adsh->cbSrcLength;
558  }
559  }
560 
561  adsh->cbSrcLengthUsed = nsrc;
562  adsh->cbDstLengthUsed = ndst;
563  TRACE("%d(%d) -> %d(%d)\n", nsrc, adsh->cbSrcLength, ndst, adsh->cbDstLength);
564  return MMSYSERR_NOERROR;
565 }
566 
567 #endif
568 
569 /**************************************************************************
570  * GSM_DriverProc [exported]
571  */
572 LRESULT CALLBACK GSM_DriverProc(DWORD_PTR dwDevID, HDRVR hDriv, UINT wMsg,
573  LPARAM dwParam1, LPARAM dwParam2)
574 {
575  TRACE("(%08lx %p %04x %08lx %08lx);\n",
576  dwDevID, hDriv, wMsg, dwParam1, dwParam2);
577 
578  switch (wMsg)
579  {
580  case DRV_LOAD: return 1;
581  case DRV_FREE: return GSM_drvFree();
582  case DRV_OPEN: return 1;
583  case DRV_CLOSE: return 1;
584  case DRV_ENABLE: return 1;
585  case DRV_DISABLE: return 1;
586  case DRV_QUERYCONFIGURE: return 1;
587  case DRV_CONFIGURE: MessageBoxA(0, "GSM 06.10 codec", "Wine Driver", MB_OK); return 1;
588  case DRV_INSTALL: return DRVCNF_RESTART;
589  case DRV_REMOVE: return DRVCNF_RESTART;
590 
591  case ACMDM_DRIVER_NOTIFY:
592  /* no caching from other ACM drivers is done so far */
593  return MMSYSERR_NOERROR;
594 
596  return GSM_DriverDetails((PACMDRIVERDETAILSW)dwParam1);
597 
599  return GSM_FormatTagDetails((PACMFORMATTAGDETAILSW)dwParam1, dwParam2);
600 
602  return GSM_FormatDetails((PACMFORMATDETAILSW)dwParam1, dwParam2);
603 
605  return GSM_FormatSuggest((PACMDRVFORMATSUGGEST)dwParam1);
606 
607 #ifdef SONAME_LIBGSM
608  case ACMDM_STREAM_OPEN:
609  return GSM_StreamOpen((PACMDRVSTREAMINSTANCE)dwParam1);
610 
611  case ACMDM_STREAM_CLOSE:
612  return GSM_StreamClose((PACMDRVSTREAMINSTANCE)dwParam1);
613 
614  case ACMDM_STREAM_SIZE:
615  return GSM_StreamSize((PACMDRVSTREAMINSTANCE)dwParam1, (PACMDRVSTREAMSIZE)dwParam2);
616 
618  return GSM_StreamConvert((PACMDRVSTREAMINSTANCE)dwParam1, (PACMDRVSTREAMHEADER)dwParam2);
619 #else
620  case ACMDM_STREAM_OPEN: WARN("libgsm support not compiled in!\n");
621  case ACMDM_STREAM_CLOSE:
622  case ACMDM_STREAM_SIZE:
624  return MMSYSERR_NOTSUPPORTED;
625 #endif
626 
629  /* this converter is not a hardware driver */
632  /* this converter is not a filter */
633  case ACMDM_STREAM_RESET:
634  /* only needed for asynchronous driver... we aren't, so just say it */
635  return MMSYSERR_NOTSUPPORTED;
638  /* nothing special to do here... so don't do anything */
639  return MMSYSERR_NOERROR;
640 
641  default:
642  return DefDriverProc(dwDevID, hDriv, wMsg, dwParam1, dwParam2);
643  }
644 }
PWAVEFORMATEX pwfx
Definition: msacm.h:507
#define DRV_DISABLE
Definition: mmsystem.h:123
#define WAVE_FORMAT_UNKNOWN
Definition: mmreg.h:95
int add
Definition: i386-dis.c:3122
#define MM_MSFT_ACM_GSM610
Definition: mmreg.h:148
#define ACM_STREAMSIZEF_DESTINATION
Definition: msacm.h:218
#define TRUE
Definition: types.h:120
#define ACM_FORMATSUGGESTF_NSAMPLESPERSEC
Definition: msacm.h:176
#define DWORD_PTR
Definition: treelist.c:76
#define error(str)
Definition: mkdosfs.c:1605
#define ACM_STREAMCONVERTF_BLOCKALIGN
Definition: msacm.h:205
GLdouble GLdouble GLdouble r
Definition: gl.h:2055
PWAVEFORMATEX pwfxDst
Definition: msacmdrv.h:153
#define CP_ACP
Definition: compat.h:99
DWORD nAvgBytesPerSec
Definition: mmreg.h:81
WORD nChannels
Definition: mmreg.h:79
#define WARN(fmt,...)
Definition: debug.h:111
#define ACMDRIVERDETAILS_SUPPORTF_CODEC
Definition: msacm.h:61
#define ACMDM_STREAM_RESET
Definition: msacmdrv.h:62
#define CALLBACK
Definition: compat.h:27
BOOL todo
Definition: filedlg.c:313
#define ACM_FORMATSUGGESTF_WFORMATTAG
Definition: msacm.h:174
struct gsm610waveformat_tag GSM610WAVEFORMAT
static BOOL GSM_FormatValidate(const WAVEFORMATEX *wfx)
Definition: msgsm32.c:140
#define DRV_CLOSE
Definition: mmsystem.h:122
Definition: unary.h:11
static LRESULT GSM_FormatDetails(PACMFORMATDETAILSW afd, DWORD dwQuery)
Definition: msgsm32.c:260
#define ACMDM_STREAM_OPEN
Definition: msacmdrv.h:58
#define ACMDM_FORMATTAG_DETAILS
Definition: msacmdrv.h:51
#define ACMDM_STREAM_PREPARE
Definition: msacmdrv.h:63
struct pcmwaveformat_tag PCMWAVEFORMAT
static LRESULT GSM_FormatSuggest(PACMDRVFORMATSUGGEST adfs)
Definition: msgsm32.c:308
#define ACM_STREAMCONVERTF_END
Definition: msacm.h:207
#define ACMDM_STREAM_CLOSE
Definition: msacmdrv.h:59
#define DRV_QUERYCONFIGURE
Definition: mmsystem.h:126
#define DRV_OPEN
Definition: mmsystem.h:121
int WINAPI MessageBoxA(_In_opt_ HWND, _In_opt_ LPCSTR, _In_opt_ LPCSTR, _In_ UINT)
#define ACMDM_DRIVER_NOTIFY
Definition: msacmdrv.h:45
#define ACMDM_FORMAT_SUGGEST
Definition: msacmdrv.h:53
#define MMSYSERR_NOMEM
Definition: mmsystem.h:103
#define WAVE_FORMAT_PCM
Definition: constants.h:425
#define ACM_FORMATDETAILSF_FORMAT
Definition: msacm.h:161
LRESULT CALLBACK GSM_DriverProc(DWORD_PTR dwDevID, HDRVR hDriv, UINT wMsg, LPARAM dwParam1, LPARAM dwParam2)
Definition: msgsm32.c:572
unsigned int BOOL
Definition: ntddk_ex.h:94
#define ACMDM_DRIVER_DETAILS
Definition: msacmdrv.h:46
#define ACMDM_STREAM_CONVERT
Definition: msacmdrv.h:61
#define FIXME(fmt,...)
Definition: debug.h:110
WORD wBitsPerSample
Definition: audioclient.idl:45
DWORD cStandardFormats
Definition: msacm.h:534
#define ACMDRIVERDETAILS_FCCCOMP_UNDEFINED
Definition: msacm.h:59
smooth NULL
Definition: ftsmooth.c:416
void * wine_dlopen(const char *filename, int flag, char *error, size_t errorsize)
Definition: loader.c:53
LONG_PTR LPARAM
Definition: windef.h:208
#define ACM_FORMATSUGGESTF_NCHANNELS
Definition: msacm.h:175
#define DRV_LOAD(x)
static LRESULT GSM_DriverDetails(PACMDRIVERDETAILSW add)
Definition: msgsm32.c:114
#define DRVCNF_RESTART
Definition: mmsystem.h:135
#define DRV_REMOVE
Definition: mmsystem.h:128
DWORD nSamplesPerSec
Definition: audioclient.idl:42
#define ACMDM_HARDWARE_WAVE_CAPS_OUTPUT
Definition: msacmdrv.h:49
#define ACMDM_HARDWARE_WAVE_CAPS_INPUT
Definition: msacmdrv.h:48
c used
Definition: write.c:2877
PWAVEFORMATEX pwfxDst
Definition: msacmdrv.h:101
#define LOAD_FUNCPTR(f)
#define TRACE(s)
Definition: solgame.cpp:4
#define ACM_FORMATTAGDETAILSF_FORMATTAG
Definition: msacm.h:183
#define MMSYSERR_NOERROR
Definition: mmsystem.h:96
#define DRV_CONFIGURE
Definition: mmsystem.h:125
if(!(yy_init))
Definition: macro.lex.yy.c:714
__wchar_t WCHAR
Definition: xmlstorage.h:180
#define ACM_STREAMSIZEF_SOURCE
Definition: msacm.h:217
#define ACM_FORMATTAGDETAILSF_INDEX
Definition: msacm.h:182
unsigned short WORD
Definition: ntddk_ex.h:93
unsigned long DWORD
Definition: ntddk_ex.h:95
#define RTLD_NOW
Definition: port.h:100
WCHAR szFormat[ACMFORMATDETAILS_FORMAT_CHARS]
Definition: msacm.h:509
#define DRV_FREE
Definition: mmsystem.h:124
#define MMSYSERR_NOTSUPPORTED
Definition: mmsystem.h:104
static LRESULT GSM_drvFree(void)
Definition: msgsm32.c:103
WORD wFormatTag
Definition: mmreg.h:78
#define ACMDM_FILTERTAG_DETAILS
Definition: msacmdrv.h:55
DWORD dwFormatIndex
Definition: msacm.h:504
#define MM_MICROSOFT
Definition: mmreg.h:144
#define memcpy(s1, s2, n)
Definition: mkisofs.h:878
unsigned char BYTE
Definition: mem.h:68
#define ACM_FORMATTAGDETAILSF_LARGESTSIZE
Definition: msacm.h:184
GLenum src
Definition: glext.h:6340
DWORD dwFormatTagIndex
Definition: msacm.h:530
uint32_t DWORD_PTR
Definition: typedefs.h:63
#define ACMERR_NOTPOSSIBLE
Definition: msacm.h:36
#define ACMDM_STREAM_UNPREPARE
Definition: msacmdrv.h:64
#define DRV_ENABLE
Definition: mmsystem.h:120
#define ERR(fmt,...)
Definition: debug.h:109
static const DWORD gsm_rates[]
Definition: msgsm32.c:201
#define ACM_STREAMCONVERTF_START
Definition: msacm.h:206
#define lstrcpyW
Definition: compat.h:414
#define MMSYSERR_INVALPARAM
Definition: mmsystem.h:107
#define ARRAY_SIZE(a)
Definition: main.h:24
DWORD fdwSupport
Definition: msacm.h:506
DWORD nAvgBytesPerSec
Definition: audioclient.idl:43
PWAVEFORMATEX pwfxSrc
Definition: msacmdrv.h:151
WORD cbSize
Definition: mmreg.h:84
GLenum GLenum dst
Definition: glext.h:6340
DWORD_PTR dwDriver
Definition: msacmdrv.h:107
unsigned int UINT
Definition: ndis.h:50
#define MB_OK
Definition: winuser.h:784
WCHAR szFormatTag[ACMFORMATTAGDETAILS_FORMATTAG_CHARS]
Definition: msacm.h:535
#define MultiByteToWideChar
Definition: compat.h:100
DWORD nSamplesPerSec
Definition: mmreg.h:80
WORD nBlockAlign
Definition: mmreg.h:82
#define ACM_FORMATDETAILSF_INDEX
Definition: msacm.h:160
WORD wBitsPerSample
Definition: mmreg.h:83
PWAVEFORMATEX pwfxSrc
Definition: msacmdrv.h:100
#define DRV_INSTALL
Definition: mmsystem.h:127
LRESULT WINAPI DefDriverProc(DWORD_PTR dwDriverIdentifier, HDRVR hDrv, UINT Msg, LPARAM lParam1, LPARAM lParam2)
Definition: driver.c:554
static LRESULT GSM_FormatTagDetails(PACMFORMATTAGDETAILSW aftd, DWORD dwQuery)
Definition: msgsm32.c:207
#define WAVE_FORMAT_GSM610
Definition: mmreg.h:118
WINE_DEFAULT_DEBUG_CHANNEL(gsm)
LONG_PTR LRESULT
Definition: windef.h:209
DWORD dwFormatTag
Definition: msacm.h:505
#define memset(x, y, z)
Definition: compat.h:39
#define ACM_FORMATSUGGESTF_WBITSPERSAMPLE
Definition: msacm.h:177
#define ACMDM_FORMAT_DETAILS
Definition: msacmdrv.h:52
int wine_dlclose(void *handle, char *error, size_t errorsize)
Definition: loader.c:58
#define ACMDRIVERDETAILS_FCCTYPE_AUDIOCODEC
Definition: msacm.h:58
#define ACMDM_STREAM_SIZE
Definition: msacmdrv.h:60
#define ACMDM_FILTER_DETAILS
Definition: msacmdrv.h:56