ReactOS 0.4.17-dev-966-gf06eace
mpegl3.c
Go to the documentation of this file.
1/*
2 * MPEG Layer 3 handling
3 *
4 * Copyright (C) 2002 Eric Pouech
5 * Copyright (C) 2009 CodeWeavers, Aric Stewart
6 *
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.
11 *
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.
16 *
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
20 */
21
22#include <assert.h>
23#include <stdarg.h>
24#include <string.h>
25#include <mpg123.h>
26
27#include "windef.h"
28#include "winbase.h"
29#include "wingdi.h"
30#include "winuser.h"
31#include "winnls.h"
32#include "mmsystem.h"
33#include "mmreg.h"
34#include "msacm.h"
35#include "msacmdrv.h"
36#include "wine/debug.h"
37
39
40/* table to list all supported formats... those are the basic ones. this
41 * also helps given a unique index to each of the supported formats
42 */
43typedef struct
44{
45 int nChannels;
46 int nBits;
47 int rate;
48} Format;
49
50static const Format PCM_Formats[] =
51{
52 {1, 8, 8000}, {2, 8, 8000}, {1, 16, 8000}, {2, 16, 8000},
53 {1, 8, 11025}, {2, 8, 11025}, {1, 16, 11025}, {2, 16, 11025},
54 {1, 8, 12000}, {2, 8, 12000}, {1, 16, 12000}, {2, 16, 12000},
55 {1, 8, 16000}, {2, 8, 16000}, {1, 16, 16000}, {2, 16, 16000},
56 {1, 8, 22050}, {2, 8, 22050}, {1, 16, 22050}, {2, 16, 22050},
57 {1, 8, 24000}, {2, 8, 24000}, {1, 16, 24000}, {2, 16, 24000},
58 {1, 8, 32000}, {2, 8, 32000}, {1, 16, 32000}, {2, 16, 32000},
59 {1, 8, 44100}, {2, 8, 44100}, {1, 16, 44100}, {2, 16, 44100},
60 {1, 8, 48000}, {2, 8, 48000}, {1, 16, 48000}, {2, 16, 48000}
61};
62
63static const Format MPEG3_Formats[] =
64{
65 {1, 0, 8000}, {2, 0, 8000},
66 {1, 0, 11025}, {2, 0, 11025},
67 {1, 0, 12000}, {2, 0, 12000},
68 {1, 0, 16000}, {2, 0, 16000},
69 {1, 0, 22050}, {2, 0, 22050},
70 {1, 0, 24000}, {2, 0, 24000},
71 {1, 0, 32000}, {2, 0, 32000},
72 {1, 0, 44100}, {2, 0, 44100},
73 {1, 0, 48000}, {2, 0, 48000}
74};
75
76/***********************************************************************
77 * MPEG3_GetFormatIndex
78 */
80{
81 int i, hi;
82 const Format *fmts;
83
84 switch (wfx->wFormatTag)
85 {
86 case WAVE_FORMAT_PCM:
89 break;
94 break;
95 default:
96 return 0xFFFFFFFF;
97 }
98
99 for (i = 0; i < hi; i++)
100 {
101 if (wfx->nChannels == fmts[i].nChannels &&
102 wfx->nSamplesPerSec == fmts[i].rate &&
103 (wfx->wBitsPerSample == fmts[i].nBits || !fmts[i].nBits))
104 return i;
105 }
106
107 return 0xFFFFFFFF;
108}
109
110/***********************************************************************
111 * MPEG3_drvOpen
112 */
114{
115 mpg123_init();
116 return 1;
117}
118
119/***********************************************************************
120 * MPEG3_drvClose
121 */
123{
124 mpg123_exit();
125 return 1;
126}
127
128
129static void mp3_horse(mpg123_handle *handle, const unsigned char *src,
130 DWORD *nsrc, unsigned char *dst, DWORD *ndst)
131{
132 int ret;
133 size_t size;
134 DWORD dpos = 0;
135
136
137 if (*nsrc > 0)
138 {
139 ret = mpg123_feed(handle, src, *nsrc);
140 if (ret != MPG123_OK)
141 {
142 ERR("Error feeding data\n");
143 *ndst = *nsrc = 0;
144 return;
145 }
146 }
147
148 do {
149 size = 0;
150 ret = mpg123_read(handle, dst + dpos, *ndst - dpos, &size);
151 if (ret == MPG123_ERR)
152 {
153 FIXME("Error occurred during decoding!\n");
154 *ndst = *nsrc = 0;
155 return;
156 }
157
158 if (ret == MPG123_NEW_FORMAT)
159 {
160 long rate;
161 int channels, enc;
163 TRACE("New format: %li Hz, %i channels, encoding value %i\n", rate, channels, enc);
164 }
165 dpos += size;
166 if (dpos >= *ndst) break;
167 } while (ret != MPG123_ERR && ret != MPG123_NEED_MORE);
168 *ndst = dpos;
169}
170
171/***********************************************************************
172 * MPEG3_StreamOpen
173 *
174 */
176{
178 int err;
179
181
182 if (MPEG3_GetFormatIndex(instance->pwfxSrc) == 0xFFFFFFFF
183 || MPEG3_GetFormatIndex(instance->pwfxDst) == 0xFFFFFFFF)
184 return ACMERR_NOTPOSSIBLE;
185
186 if (instance->pwfxDst->wFormatTag != WAVE_FORMAT_PCM)
188
189 if (instance->pwfxSrc->wFormatTag != WAVE_FORMAT_MPEGLAYER3
190 && instance->pwfxSrc->wFormatTag != WAVE_FORMAT_MPEG)
192
193 if (instance->pwfxSrc->wFormatTag == WAVE_FORMAT_MPEGLAYER3)
194 {
195 MPEGLAYER3WAVEFORMAT *mp3_format = (MPEGLAYER3WAVEFORMAT *)instance->pwfxSrc;
196
197 if (instance->pwfxSrc->cbSize < MPEGLAYER3_WFX_EXTRA_BYTES
198 || mp3_format->wID != MPEGLAYER3_ID_MPEG)
199 return ACMERR_NOTPOSSIBLE;
200 }
201
202 if (instance->pwfxSrc->nSamplesPerSec != instance->pwfxDst->nSamplesPerSec
203 || instance->pwfxSrc->nChannels != instance->pwfxDst->nChannels
204 || instance->pwfxDst->wBitsPerSample != 16)
206
208 instance->dwDriver = (DWORD_PTR)handle;
210
211 /* mpg123 may find a XING header in the mp3 and use that information
212 * to ask for seeks in order to read specific frames in the file.
213 * We cannot allow that since the caller application is feeding us.
214 * This fixes problems for mp3 files encoded with LAME (bug 42361)
215 */
217
218 return MMSYSERR_NOERROR;
219}
220
221/***********************************************************************
222 * MPEG3_StreamClose
223 *
224 */
226{
228
231 return MMSYSERR_NOERROR;
232}
233
234/***********************************************************************
235 * MPEG3_DriverDetails
236 *
237 */
239{
242 add->wMid = MM_FRAUNHOFER_IIS;
243 add->wPid = MM_FHGIIS_MPEGLAYER3_DECODE;
244 add->vdwACM = 0x01000000;
245 add->vdwDriver = 0x01000000;
246 add->fdwSupport = ACMDRIVERDETAILS_SUPPORTF_CODEC;
247 add->cFormatTags = 3; /* PCM, MPEG3 */
248 add->cFilterTags = 0;
249 add->hicon = NULL;
250 MultiByteToWideChar( CP_ACP, 0, "MPEG Layer-3 Codec", -1,
251 add->szShortName, ARRAY_SIZE( add->szShortName ));
252 MultiByteToWideChar( CP_ACP, 0, "Wine MPEG3 decoder", -1,
253 add->szLongName, ARRAY_SIZE( add->szLongName ));
254 MultiByteToWideChar( CP_ACP, 0, "Brought to you by the Wine team...", -1,
255 add->szCopyright, ARRAY_SIZE( add->szCopyright ));
256 MultiByteToWideChar( CP_ACP, 0, "Refer to LICENSE file", -1,
257 add->szLicensing, ARRAY_SIZE( add->szLicensing ));
258 add->szFeatures[0] = 0;
259
260 return MMSYSERR_NOERROR;
261}
262
263/***********************************************************************
264 * MPEG3_FormatTagDetails
265 *
266 */
268{
269 static const WCHAR szPcm[]={'P','C','M',0};
270 static const WCHAR szMpeg3[]={'M','P','e','g','3',0};
271 static const WCHAR szMpeg[]={'M','P','e','g',0};
272
273 switch (dwQuery)
274 {
276 if (aftd->dwFormatTagIndex > 2) return ACMERR_NOTPOSSIBLE;
277 break;
279 if (aftd->dwFormatTag == WAVE_FORMAT_UNKNOWN)
280 {
281 aftd->dwFormatTagIndex = 2; /* WAVE_FORMAT_MPEG is biggest */
282 break;
283 }
284 /* fall through */
286 switch (aftd->dwFormatTag)
287 {
288 case WAVE_FORMAT_PCM: aftd->dwFormatTagIndex = 0; break;
289 case WAVE_FORMAT_MPEGLAYER3: aftd->dwFormatTagIndex = 1; break;
290 case WAVE_FORMAT_MPEG: aftd->dwFormatTagIndex = 2; break;
291 default: return ACMERR_NOTPOSSIBLE;
292 }
293 break;
294 default:
295 WARN("Unsupported query %08lx\n", dwQuery);
297 }
298
300 switch (aftd->dwFormatTagIndex)
301 {
302 case 0:
304 aftd->cbFormatSize = sizeof(PCMWAVEFORMAT);
306 lstrcpyW(aftd->szFormatTag, szPcm);
307 break;
308 case 1:
310 aftd->cbFormatSize = sizeof(MPEGLAYER3WAVEFORMAT);
311 aftd->cStandardFormats = 0;
312 lstrcpyW(aftd->szFormatTag, szMpeg3);
313 break;
314 case 2:
316 aftd->cbFormatSize = sizeof(MPEG1WAVEFORMAT);
317 aftd->cStandardFormats = 0;
318 lstrcpyW(aftd->szFormatTag, szMpeg);
319 break;
320 }
321 return MMSYSERR_NOERROR;
322}
323
324/***********************************************************************
325 * MPEG3_FormatDetails
326 *
327 */
329{
330 switch (dwQuery)
331 {
333 if (MPEG3_GetFormatIndex(afd->pwfx) == 0xFFFFFFFF) return ACMERR_NOTPOSSIBLE;
334 break;
336 afd->pwfx->wFormatTag = afd->dwFormatTag;
337 switch (afd->dwFormatTag)
338 {
339 case WAVE_FORMAT_PCM:
344 /* native MSACM uses a PCMWAVEFORMAT structure, so cbSize is not accessible
345 * afd->pwfx->cbSize = 0;
346 */
347 afd->pwfx->nBlockAlign =
348 (afd->pwfx->nChannels * afd->pwfx->wBitsPerSample) / 8;
349 afd->pwfx->nAvgBytesPerSec =
350 afd->pwfx->nSamplesPerSec * afd->pwfx->nBlockAlign;
351 break;
353 case WAVE_FORMAT_MPEG:
354 WARN("Encoding to MPEG is not supported\n");
355 return ACMERR_NOTPOSSIBLE;
356 default:
357 WARN("Unsupported tag %08lx\n", afd->dwFormatTag);
358 return MMSYSERR_INVALPARAM;
359 }
360 break;
361 default:
362 WARN("Unsupported query %08lx\n", dwQuery);
364 }
366 afd->szFormat[0] = 0; /* let MSACM format this for us... */
367
368 return MMSYSERR_NOERROR;
369}
370
371/***********************************************************************
372 * MPEG3_FormatSuggest
373 *
374 */
376{
377 /* some tests ... */
378 if (adfs->cbwfxSrc < sizeof(PCMWAVEFORMAT) ||
379 adfs->cbwfxDst < sizeof(PCMWAVEFORMAT) ||
380 MPEG3_GetFormatIndex(adfs->pwfxSrc) == 0xFFFFFFFF) return ACMERR_NOTPOSSIBLE;
381 /* FIXME: should do those tests against the real size (according to format tag */
382
383 /* If no suggestion for destination, then copy source value */
385 adfs->pwfxDst->nChannels = adfs->pwfxSrc->nChannels;
389 adfs->pwfxDst->wBitsPerSample = 16;
391 {
392 if (adfs->pwfxSrc->wFormatTag == WAVE_FORMAT_PCM)
393 {
394 WARN("Encoding to MPEG is not supported\n");
395 return ACMERR_NOTPOSSIBLE;
396 }
397 else
399 }
400
401 /* check if result is ok */
402 if (MPEG3_GetFormatIndex(adfs->pwfxDst) == 0xFFFFFFFF) return ACMERR_NOTPOSSIBLE;
403
404 /* recompute other values */
405 switch (adfs->pwfxDst->wFormatTag)
406 {
407 case WAVE_FORMAT_PCM:
408 adfs->pwfxDst->nBlockAlign = (adfs->pwfxDst->nChannels * adfs->pwfxDst->wBitsPerSample) / 8;
410 break;
411 case WAVE_FORMAT_MPEG:
413 WARN("Encoding to MPEG is not supported\n");
414 return ACMERR_NOTPOSSIBLE;
415 break;
416 default:
417 FIXME("\n");
418 break;
419 }
420
421 return MMSYSERR_NOERROR;
422}
423
424/***********************************************************************
425 * MPEG3_StreamSize
426 *
427 */
429{
430 DWORD nblocks;
431
432 switch (adss->fdwSize)
433 {
435 /* cbDstLength => cbSrcLength */
436 if (adsi->pwfxSrc->wFormatTag == WAVE_FORMAT_PCM &&
439 {
440 nblocks = (adss->cbDstLength - 3000) / (DWORD)(adsi->pwfxDst->nAvgBytesPerSec * 1152 / adsi->pwfxDst->nSamplesPerSec + 0.5);
441 if (nblocks == 0)
442 return ACMERR_NOTPOSSIBLE;
443 adss->cbSrcLength = nblocks * 1152 * adsi->pwfxSrc->nBlockAlign;
444 }
445 else if ((adsi->pwfxSrc->wFormatTag == WAVE_FORMAT_MPEGLAYER3 ||
448 {
449 nblocks = adss->cbDstLength / (adsi->pwfxDst->nBlockAlign * 1152);
450 if (nblocks == 0)
451 return ACMERR_NOTPOSSIBLE;
452 adss->cbSrcLength = nblocks * (DWORD)(adsi->pwfxSrc->nAvgBytesPerSec * 1152 / adsi->pwfxSrc->nSamplesPerSec);
453 }
454 else
455 {
457 }
458 break;
460 /* cbSrcLength => cbDstLength */
461 if (adsi->pwfxSrc->wFormatTag == WAVE_FORMAT_PCM &&
464 {
465 nblocks = adss->cbSrcLength / (adsi->pwfxSrc->nBlockAlign * 1152);
466 if (adss->cbSrcLength % (DWORD)(adsi->pwfxSrc->nBlockAlign * 1152))
467 /* Round block count up. */
468 nblocks++;
469 if (nblocks == 0)
470 return ACMERR_NOTPOSSIBLE;
471 adss->cbDstLength = 3000 + nblocks * (DWORD)(adsi->pwfxDst->nAvgBytesPerSec * 1152 / adsi->pwfxDst->nSamplesPerSec + 0.5);
472 }
473 else if ((adsi->pwfxSrc->wFormatTag == WAVE_FORMAT_MPEGLAYER3 ||
476 {
477 nblocks = adss->cbSrcLength / (DWORD)(adsi->pwfxSrc->nAvgBytesPerSec * 1152 / adsi->pwfxSrc->nSamplesPerSec);
478 if (adss->cbSrcLength % (DWORD)(adsi->pwfxSrc->nAvgBytesPerSec * 1152 / adsi->pwfxSrc->nSamplesPerSec))
479 /* Round block count up. */
480 nblocks++;
481 if (nblocks == 0)
482 return ACMERR_NOTPOSSIBLE;
483 adss->cbDstLength = nblocks * 1152 * adsi->pwfxDst->nBlockAlign;
484 }
485 else
486 {
488 }
489 break;
490 default:
491 WARN("Unsupported query %08lx\n", adss->fdwSize);
493 }
494 return MMSYSERR_NOERROR;
495}
496
497/***********************************************************************
498 * MPEG3_StreamConvert
499 *
500 */
502{
504 DWORD nsrc = adsh->cbSrcLength;
505 DWORD ndst = adsh->cbDstLength;
506
507 if (adsh->fdwConvert &
511 {
512 FIXME("Unsupported fdwConvert (%08lx), ignoring it\n", adsh->fdwConvert);
513 }
514 /* ACM_STREAMCONVERTF_BLOCKALIGN
515 * currently all conversions are block aligned, so do nothing for this flag
516 * ACM_STREAMCONVERTF_END
517 * no pending data, so do nothing for this flag
518 */
520 {
524 }
525
526 mp3_horse(handle, adsh->pbSrc, &nsrc, adsh->pbDst, &ndst);
527 adsh->cbSrcLengthUsed = nsrc;
528 adsh->cbDstLengthUsed = ndst;
529
530 return MMSYSERR_NOERROR;
531}
532
533/**************************************************************************
534 * MPEG3_DriverProc [exported]
535 */
536LRESULT CALLBACK MPEG3_DriverProc(DWORD_PTR dwDevID, HDRVR hDriv, UINT wMsg,
537 LPARAM dwParam1, LPARAM dwParam2)
538{
539 TRACE("(%08Ix %p %04x %08Ix %08Ix);\n",
540 dwDevID, hDriv, wMsg, dwParam1, dwParam2);
541
542 switch (wMsg)
543 {
544 case DRV_LOAD: return 1;
545 case DRV_FREE: return 1;
546 case DRV_OPEN: return MPEG3_drvOpen((LPSTR)dwParam1);
547 case DRV_CLOSE: return MPEG3_drvClose(dwDevID);
548 case DRV_ENABLE: return 1;
549 case DRV_DISABLE: return 1;
550 case DRV_QUERYCONFIGURE: return 1;
551 case DRV_CONFIGURE: MessageBoxA(0, "MPEG3 filter !", "Wine Driver", MB_OK); return 1;
552 case DRV_INSTALL: return DRVCNF_RESTART;
553 case DRV_REMOVE: return DRVCNF_RESTART;
554
556 /* no caching from other ACM drivers is done so far */
557 return MMSYSERR_NOERROR;
558
560 return MPEG3_DriverDetails((PACMDRIVERDETAILSW)dwParam1);
561
563 return MPEG3_FormatTagDetails((PACMFORMATTAGDETAILSW)dwParam1, dwParam2);
564
566 return MPEG3_FormatDetails((PACMFORMATDETAILSW)dwParam1, dwParam2);
567
570
572 return MPEG3_StreamOpen((PACMDRVSTREAMINSTANCE)dwParam1);
573
576
578 return MPEG3_StreamSize((PACMDRVSTREAMINSTANCE)dwParam1, (PACMDRVSTREAMSIZE)dwParam2);
579
582
585 /* this converter is not a hardware driver */
588 /* this converter is not a filter */
590 /* only needed for asynchronous driver... we aren't, so just say it */
594 /* nothing special to do here... so don't do anything */
595 return MMSYSERR_NOERROR;
596
597 default:
598 return DefDriverProc(dwDevID, hDriv, wMsg, dwParam1, dwParam2);
599 }
600}
unsigned int channels
Definition: audiorecord.c:89
unsigned int rate
Definition: audiorecord.c:87
#define WINE_DEFAULT_DEBUG_CHANNEL(t)
Definition: precomp.h:23
#define WAVE_FORMAT_PCM
Definition: constants.h:425
#define ARRAY_SIZE(A)
Definition: main.h:20
#define FIXME(fmt,...)
Definition: precomp.h:53
#define WARN(fmt,...)
Definition: precomp.h:61
#define ERR(fmt,...)
Definition: precomp.h:57
#define NULL
Definition: types.h:112
static HINSTANCE instance
Definition: main.c:35
#define CP_ACP
Definition: compat.h:109
#define CALLBACK
Definition: compat.h:35
#define lstrcpyW
Definition: compat.h:749
#define MultiByteToWideChar
Definition: compat.h:110
#define assert(_expr)
Definition: assert.h:32
LRESULT WINAPI DefDriverProc(DWORD_PTR dwDriverIdentifier, HDRVR hDrv, UINT Msg, LPARAM lParam1, LPARAM lParam2)
Definition: driver.c:554
return ret
Definition: mutex.c:147
unsigned long DWORD
Definition: ntddk_ex.h:95
GLenum src
Definition: glext.h:6340
GLsizeiptr size
Definition: glext.h:5919
GLenum GLenum dst
Definition: glext.h:6340
GLsizei GLenum const GLvoid GLsizei GLenum GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLint GLint GLint GLshort GLshort GLshort GLubyte GLubyte GLubyte GLuint GLuint GLuint GLushort GLushort GLushort GLbyte GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLfloat GLint GLint GLint GLint GLshort GLshort GLshort GLshort GLubyte GLubyte GLubyte GLubyte GLuint GLuint GLuint GLuint GLushort GLushort GLushort GLushort GLboolean const GLdouble const GLfloat const GLint const GLshort const GLbyte const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLdouble const GLfloat const GLfloat const GLint const GLint const GLshort const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort GLenum GLenum GLenum GLfloat GLenum GLint GLenum GLenum GLenum GLfloat GLenum GLenum GLint GLenum GLfloat GLenum GLint GLint GLushort GLenum GLenum GLfloat GLenum GLenum GLint GLfloat const GLubyte GLenum GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLint GLint GLsizei GLsizei GLint GLenum GLenum const GLvoid GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLenum const GLdouble GLenum GLenum const GLfloat GLenum GLenum const GLint GLsizei GLuint GLfloat GLuint GLbitfield GLfloat GLint GLuint GLboolean GLenum GLfloat GLenum GLbitfield GLenum GLfloat GLfloat GLint GLint const GLfloat GLenum GLfloat GLfloat GLint GLint GLfloat GLfloat GLint GLint const GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat const GLdouble const GLfloat const GLdouble const GLfloat GLint i
Definition: glfuncs.h:248
@ MPG123_NEED_MORE
Definition: mpg123.h:389
@ MPG123_ERR
Definition: mpg123.h:390
@ MPG123_NEW_FORMAT
Definition: mpg123.h:388
@ MPG123_OK
Definition: mpg123.h:391
MPG123_EXPORT void mpg123_delete(mpg123_handle *mh)
Definition: libmpg123.c:1712
MPG123_EXPORT void mpg123_exit(void)
Definition: libmpg123.c:50
MPG123_EXPORT int mpg123_param(mpg123_handle *mh, enum mpg123_parms type, long value, double fvalue)
Definition: libmpg123.c:127
MPG123_EXPORT int mpg123_init(void)
Definition: libmpg123.c:23
MPG123_EXPORT mpg123_handle * mpg123_new(const char *decoder, int *error)
Definition: libmpg123.c:57
@ MPG123_IGNORE_INFOFRAME
Definition: mpg123.h:236
@ MPG123_ADD_FLAGS
Definition: mpg123.h:193
MPG123_EXPORT int mpg123_open_feed(mpg123_handle *mh)
Definition: libmpg123.c:535
MPG123_EXPORT int mpg123_feed(mpg123_handle *mh, const unsigned char *in, size_t size)
Definition: libmpg123.c:947
MPG123_EXPORT int mpg123_close(mpg123_handle *mh)
Definition: libmpg123.c:1694
MPG123_EXPORT int mpg123_read(mpg123_handle *mh, void *outmemory, size_t outmemsize, size_t *done)
Definition: libmpg123.c:942
MPG123_EXPORT int mpg123_getformat(mpg123_handle *mh, long *rate, int *channels, int *encoding)
Definition: libmpg123.c:1141
MPG123_EXPORT off_t mpg123_feedseek(mpg123_handle *mh, off_t sampleoff, int whence, off_t *input_offset)
Definition: lfs_wrap.c:291
unsigned int UINT
Definition: sysinfo.c:13
#define DRV_LOAD(x)
#define SEEK_SET
Definition: jmemansi.c:26
if(dx< 0)
Definition: linetemp.h:194
LONG_PTR LPARAM
Definition: minwindef.h:175
LONG_PTR LRESULT
Definition: minwindef.h:176
#define MM_FRAUNHOFER_IIS
Definition: mmreg.h:152
#define WAVE_FORMAT_UNKNOWN
Definition: mmreg.h:95
#define MPEGLAYER3_ID_MPEG
Definition: mmreg.h:442
#define WAVE_FORMAT_MPEG
Definition: mmreg.h:126
#define MPEGLAYER3_WFX_EXTRA_BYTES
Definition: mmreg.h:439
#define WAVE_FORMAT_MPEGLAYER3
Definition: mmreg.h:127
struct mpeglayer3waveformat_tag MPEGLAYER3WAVEFORMAT
struct mpeg1waveformat_tag MPEG1WAVEFORMAT
#define MM_FHGIIS_MPEGLAYER3_DECODE
Definition: mmreg.h:153
#define DRV_CLOSE
Definition: mmsystem.h:122
#define DRV_QUERYCONFIGURE
Definition: mmsystem.h:126
#define MMSYSERR_NOTSUPPORTED
Definition: mmsystem.h:104
#define DRVCNF_RESTART
Definition: mmsystem.h:135
#define DRV_REMOVE
Definition: mmsystem.h:128
#define DRV_ENABLE
Definition: mmsystem.h:120
#define DRV_CONFIGURE
Definition: mmsystem.h:125
#define DRV_OPEN
Definition: mmsystem.h:121
struct pcmwaveformat_tag PCMWAVEFORMAT
#define DRV_INSTALL
Definition: mmsystem.h:127
#define MMSYSERR_INVALPARAM
Definition: mmsystem.h:107
#define MMSYSERR_NOERROR
Definition: mmsystem.h:96
#define DRV_FREE
Definition: mmsystem.h:124
#define DRV_DISABLE
Definition: mmsystem.h:123
static struct fmt fmts[]
static LRESULT MPEG3_drvClose(DWORD_PTR dwDevID)
Definition: mpegl3.c:122
static void mp3_horse(mpg123_handle *handle, const unsigned char *src, DWORD *nsrc, unsigned char *dst, DWORD *ndst)
Definition: mpegl3.c:129
static LRESULT MPEG3_StreamConvert(ACMDRVSTREAMINSTANCE *instance, ACMDRVSTREAMHEADER *adsh)
Definition: mpegl3.c:501
static DWORD MPEG3_GetFormatIndex(LPWAVEFORMATEX wfx)
Definition: mpegl3.c:79
static LRESULT MPEG3_FormatSuggest(PACMDRVFORMATSUGGEST adfs)
Definition: mpegl3.c:375
LRESULT CALLBACK MPEG3_DriverProc(DWORD_PTR dwDevID, HDRVR hDriv, UINT wMsg, LPARAM dwParam1, LPARAM dwParam2)
Definition: mpegl3.c:536
static LRESULT MPEG3_drvOpen(LPCSTR str)
Definition: mpegl3.c:113
static LRESULT MPEG3_FormatTagDetails(PACMFORMATTAGDETAILSW aftd, DWORD dwQuery)
Definition: mpegl3.c:267
static LRESULT MPEG3_StreamSize(PACMDRVSTREAMINSTANCE adsi, PACMDRVSTREAMSIZE adss)
Definition: mpegl3.c:428
static LRESULT MPEG3_FormatDetails(PACMFORMATDETAILSW afd, DWORD dwQuery)
Definition: mpegl3.c:328
static LRESULT MPEG3_StreamClose(ACMDRVSTREAMINSTANCE *instance)
Definition: mpegl3.c:225
static LRESULT MPEG3_StreamOpen(ACMDRVSTREAMINSTANCE *instance)
Definition: mpegl3.c:175
static const Format MPEG3_Formats[]
Definition: mpegl3.c:63
static LRESULT MPEG3_DriverDetails(PACMDRIVERDETAILSW add)
Definition: mpegl3.c:238
static const Format PCM_Formats[]
Definition: mpegl3.c:50
#define ACM_STREAMCONVERTF_START
Definition: msacm.h:206
#define ACM_FORMATTAGDETAILSF_FORMATTAG
Definition: msacm.h:183
#define ACM_STREAMCONVERTF_BLOCKALIGN
Definition: msacm.h:205
#define ACM_STREAMOPENF_ASYNC
Definition: msacm.h:214
#define ACMDRIVERDETAILS_FCCCOMP_UNDEFINED
Definition: msacm.h:59
#define ACM_FORMATSUGGESTF_WFORMATTAG
Definition: msacm.h:174
#define ACM_FORMATSUGGESTF_NCHANNELS
Definition: msacm.h:175
#define ACMERR_NOTPOSSIBLE
Definition: msacm.h:36
#define ACM_FORMATDETAILSF_FORMAT
Definition: msacm.h:161
#define ACM_STREAMSIZEF_SOURCE
Definition: msacm.h:217
#define ACM_FORMATTAGDETAILSF_LARGESTSIZE
Definition: msacm.h:184
#define ACM_STREAMSIZEF_DESTINATION
Definition: msacm.h:218
#define ACM_FORMATDETAILSF_INDEX
Definition: msacm.h:160
#define ACM_FORMATTAGDETAILSF_INDEX
Definition: msacm.h:182
#define ACM_FORMATSUGGESTF_WBITSPERSAMPLE
Definition: msacm.h:177
#define ACM_STREAMCONVERTF_END
Definition: msacm.h:207
#define ACMDRIVERDETAILS_FCCTYPE_AUDIOCODEC
Definition: msacm.h:58
#define ACMDRIVERDETAILS_SUPPORTF_CODEC
Definition: msacm.h:61
#define ACM_FORMATSUGGESTF_NSAMPLESPERSEC
Definition: msacm.h:176
#define ACMDM_STREAM_PREPARE
Definition: msacmdrv.h:63
#define ACMDM_STREAM_CLOSE
Definition: msacmdrv.h:59
#define ACMDM_STREAM_CONVERT
Definition: msacmdrv.h:61
#define ACMDM_FORMAT_SUGGEST
Definition: msacmdrv.h:53
#define ACMDM_FILTER_DETAILS
Definition: msacmdrv.h:56
#define ACMDM_HARDWARE_WAVE_CAPS_INPUT
Definition: msacmdrv.h:48
#define ACMDM_DRIVER_NOTIFY
Definition: msacmdrv.h:45
#define ACMDM_FORMAT_DETAILS
Definition: msacmdrv.h:52
#define ACMDM_STREAM_SIZE
Definition: msacmdrv.h:60
#define ACMDM_FILTERTAG_DETAILS
Definition: msacmdrv.h:55
#define ACMDM_HARDWARE_WAVE_CAPS_OUTPUT
Definition: msacmdrv.h:49
#define ACMDM_FORMATTAG_DETAILS
Definition: msacmdrv.h:51
#define ACMDM_STREAM_UNPREPARE
Definition: msacmdrv.h:64
#define ACMDM_STREAM_OPEN
Definition: msacmdrv.h:58
#define ACMDM_DRIVER_DETAILS
Definition: msacmdrv.h:46
#define ACMDM_STREAM_RESET
Definition: msacmdrv.h:62
#define DWORD
Definition: nt_native.h:44
int nBits
Definition: pcmconverter.c:96
int nChannels
Definition: pcmconverter.c:95
short WCHAR
Definition: pedump.c:58
int WINAPI MessageBoxA(_In_opt_ HWND hWnd, _In_opt_ LPCSTR lpText, _In_opt_ LPCSTR lpCaption, _In_ UINT uType)
#define MB_OK
Definition: winuser.h:801
#define err(...)
const WCHAR * str
#define TRACE(s)
Definition: solgame.cpp:4
int nChannels
Definition: imaadp32.c:63
int nBits
Definition: imaadp32.c:64
int rate
Definition: imaadp32.c:65
PWAVEFORMATEX pwfxSrc
Definition: msacmdrv.h:151
PWAVEFORMATEX pwfxDst
Definition: msacmdrv.h:153
PWAVEFORMATEX pwfxSrc
Definition: msacmdrv.h:100
PWAVEFORMATEX pwfxDst
Definition: msacmdrv.h:101
WCHAR szFormat[ACMFORMATDETAILS_FORMAT_CHARS]
Definition: msacm.h:509
DWORD dwFormatTag
Definition: msacm.h:505
DWORD dwFormatIndex
Definition: msacm.h:504
DWORD fdwSupport
Definition: msacm.h:506
PWAVEFORMATEX pwfx
Definition: msacm.h:507
WCHAR szFormatTag[ACMFORMATTAGDETAILS_FORMATTAG_CHARS]
Definition: msacm.h:535
DWORD dwFormatTagIndex
Definition: msacm.h:530
DWORD cStandardFormats
Definition: msacm.h:534
WORD nBlockAlign
Definition: mmreg.h:82
DWORD nAvgBytesPerSec
Definition: mmreg.h:81
DWORD nSamplesPerSec
Definition: mmreg.h:80
WORD nChannels
Definition: mmreg.h:79
WORD wFormatTag
Definition: mmreg.h:78
WORD wBitsPerSample
Definition: mmreg.h:83
#define DWORD_PTR
Definition: treelist.c:76
const char * LPCSTR
Definition: typedefs.h:52
uint32_t DWORD_PTR
Definition: typedefs.h:65
char * LPSTR
Definition: typedefs.h:51