ReactOS  0.4.15-dev-1384-g878186b
mpegl3.c File Reference
#include "config.h"
#include "wine/port.h"
#include <assert.h>
#include <stdarg.h>
#include <string.h>
#include "windef.h"
#include "winbase.h"
#include "wingdi.h"
#include "winuser.h"
#include "winnls.h"
#include "mmsystem.h"
#include "mmreg.h"
#include "msacm.h"
#include "msacmdrv.h"
#include "wine/debug.h"
Include dependency graph for mpegl3.c:

Go to the source code of this file.

Classes

struct  Format
 

Functions

 WINE_DEFAULT_DEBUG_CHANNEL (mpeg3)
 
static DWORD MPEG3_GetFormatIndex (LPWAVEFORMATEX wfx)
 
static LRESULT MPEG3_DriverDetails (PACMDRIVERDETAILSW add)
 
static LRESULT MPEG3_FormatTagDetails (PACMFORMATTAGDETAILSW aftd, DWORD dwQuery)
 
static LRESULT MPEG3_FormatDetails (PACMFORMATDETAILSW afd, DWORD dwQuery)
 
static LRESULT MPEG3_FormatSuggest (PACMDRVFORMATSUGGEST adfs)
 
static LRESULT MPEG3_StreamSize (PACMDRVSTREAMINSTANCE adsi, PACMDRVSTREAMSIZE adss)
 
static LRESULT MPEG3_StreamConvert (PACMDRVSTREAMINSTANCE adsi, PACMDRVSTREAMHEADER adsh)
 
LRESULT CALLBACK MPEG3_DriverProc (DWORD_PTR dwDevID, HDRVR hDriv, UINT wMsg, LPARAM dwParam1, LPARAM dwParam2)
 

Variables

typedef helpstring
 
static const Format PCM_Formats []
 
static const Format MPEG3_Formats []
 

Function Documentation

◆ MPEG3_DriverDetails()

static LRESULT MPEG3_DriverDetails ( PACMDRIVERDETAILSW  add)
static

Definition at line 679 of file mpegl3.c.

680 {
683  add->wMid = MM_FRAUNHOFER_IIS;
685  add->vdwACM = 0x01000000;
686  add->vdwDriver = 0x01000000;
688  add->cFormatTags = 3; /* PCM, MPEG3 */
689  add->cFilterTags = 0;
690  add->hicon = NULL;
691  MultiByteToWideChar( CP_ACP, 0, "MPEG Layer-3 Codec", -1,
692  add->szShortName, ARRAY_SIZE( add->szShortName ));
693  MultiByteToWideChar( CP_ACP, 0, "Wine MPEG3 decoder", -1,
694  add->szLongName, ARRAY_SIZE( add->szLongName ));
695  MultiByteToWideChar( CP_ACP, 0, "Brought to you by the Wine team...", -1,
696  add->szCopyright, ARRAY_SIZE( add->szCopyright ));
697  MultiByteToWideChar( CP_ACP, 0, "Refer to LICENSE file", -1,
698  add->szLicensing, ARRAY_SIZE( add->szLicensing ));
699  add->szFeatures[0] = 0;
700 
701  return MMSYSERR_NOERROR;
702 }
WCHAR szLongName[ACMDRIVERDETAILS_LONGNAME_CHARS]
Definition: msacm.h:316
DWORD cFormatTags
Definition: msacm.h:310
#define MM_FHGIIS_MPEGLAYER3_DECODE
Definition: mmreg.h:153
#define CP_ACP
Definition: compat.h:109
DWORD cFilterTags
Definition: msacm.h:311
#define ACMDRIVERDETAILS_SUPPORTF_CODEC
Definition: msacm.h:61
WCHAR szFeatures[ACMDRIVERDETAILS_FEATURES_CHARS]
Definition: msacm.h:319
#define ACMDRIVERDETAILS_FCCCOMP_UNDEFINED
Definition: msacm.h:59
DWORD fdwSupport
Definition: msacm.h:309
#define MMSYSERR_NOERROR
Definition: mmsystem.h:96
#define MM_FRAUNHOFER_IIS
Definition: mmreg.h:152
WCHAR szShortName[ACMDRIVERDETAILS_SHORTNAME_CHARS]
Definition: msacm.h:315
DWORD vdwDriver
Definition: msacm.h:307
FOURCC fccType
Definition: msacm.h:300
#define ARRAY_SIZE(a)
Definition: main.h:24
#define NULL
Definition: types.h:112
FOURCC fccComp
Definition: msacm.h:301
#define MultiByteToWideChar
Definition: compat.h:110
WCHAR szLicensing[ACMDRIVERDETAILS_LICENSING_CHARS]
Definition: msacm.h:318
WCHAR szCopyright[ACMDRIVERDETAILS_COPYRIGHT_CHARS]
Definition: msacm.h:317
#define ACMDRIVERDETAILS_FCCTYPE_AUDIOCODEC
Definition: msacm.h:58

Referenced by MPEG3_DriverProc().

◆ MPEG3_DriverProc()

LRESULT CALLBACK MPEG3_DriverProc ( DWORD_PTR  dwDevID,
HDRVR  hDriv,
UINT  wMsg,
LPARAM  dwParam1,
LPARAM  dwParam2 
)

Definition at line 975 of file mpegl3.c.

977 {
978  TRACE("(%08lx %p %04x %08lx %08lx);\n",
979  dwDevID, hDriv, wMsg, dwParam1, dwParam2);
980 
981  switch (wMsg)
982  {
983  case DRV_LOAD: return 1;
984  case DRV_FREE: return 1;
985  case DRV_OPEN: return MPEG3_drvOpen((LPSTR)dwParam1);
986  case DRV_CLOSE: return MPEG3_drvClose(dwDevID);
987  case DRV_ENABLE: return 1;
988  case DRV_DISABLE: return 1;
989  case DRV_QUERYCONFIGURE: return 1;
990  case DRV_CONFIGURE: MessageBoxA(0, "MPEG3 filter !", "Wine Driver", MB_OK); return 1;
991  case DRV_INSTALL: return DRVCNF_RESTART;
992  case DRV_REMOVE: return DRVCNF_RESTART;
993 
994  case ACMDM_DRIVER_NOTIFY:
995  /* no caching from other ACM drivers is done so far */
996  return MMSYSERR_NOERROR;
997 
999  return MPEG3_DriverDetails((PACMDRIVERDETAILSW)dwParam1);
1000 
1002  return MPEG3_FormatTagDetails((PACMFORMATTAGDETAILSW)dwParam1, dwParam2);
1003 
1004  case ACMDM_FORMAT_DETAILS:
1005  return MPEG3_FormatDetails((PACMFORMATDETAILSW)dwParam1, dwParam2);
1006 
1007  case ACMDM_FORMAT_SUGGEST:
1008  return MPEG3_FormatSuggest((PACMDRVFORMATSUGGEST)dwParam1);
1009 
1010  case ACMDM_STREAM_OPEN:
1011  return MPEG3_StreamOpen((PACMDRVSTREAMINSTANCE)dwParam1);
1012 
1013  case ACMDM_STREAM_CLOSE:
1014  return MPEG3_StreamClose((PACMDRVSTREAMINSTANCE)dwParam1);
1015 
1016  case ACMDM_STREAM_SIZE:
1017  return MPEG3_StreamSize((PACMDRVSTREAMINSTANCE)dwParam1, (PACMDRVSTREAMSIZE)dwParam2);
1018 
1019  case ACMDM_STREAM_CONVERT:
1020  return MPEG3_StreamConvert((PACMDRVSTREAMINSTANCE)dwParam1, (PACMDRVSTREAMHEADER)dwParam2);
1021 
1024  /* this converter is not a hardware driver */
1026  case ACMDM_FILTER_DETAILS:
1027  /* this converter is not a filter */
1028  case ACMDM_STREAM_RESET:
1029  /* only needed for asynchronous driver... we aren't, so just say it */
1030  return MMSYSERR_NOTSUPPORTED;
1031  case ACMDM_STREAM_PREPARE:
1033  /* nothing special to do here... so don't do anything */
1034  return MMSYSERR_NOERROR;
1035 
1036  default:
1037  return DefDriverProc(dwDevID, hDriv, wMsg, dwParam1, dwParam2);
1038  }
1039 }
#define DRV_DISABLE
Definition: mmsystem.h:123
#define ACMDM_STREAM_RESET
Definition: msacmdrv.h:62
static LRESULT MPEG3_FormatSuggest(PACMDRVFORMATSUGGEST adfs)
Definition: mpegl3.c:816
#define DRV_CLOSE
Definition: mmsystem.h:122
#define ACMDM_STREAM_OPEN
Definition: msacmdrv.h:58
#define ACMDM_FORMATTAG_DETAILS
Definition: msacmdrv.h:51
char * LPSTR
Definition: xmlstorage.h:182
#define ACMDM_STREAM_PREPARE
Definition: msacmdrv.h:63
#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
static LRESULT MPEG3_FormatDetails(PACMFORMATDETAILSW afd, DWORD dwQuery)
Definition: mpegl3.c:769
#define ACMDM_DRIVER_DETAILS
Definition: msacmdrv.h:46
#define ACMDM_STREAM_CONVERT
Definition: msacmdrv.h:61
#define DRV_LOAD(x)
#define DRVCNF_RESTART
Definition: mmsystem.h:135
#define DRV_REMOVE
Definition: mmsystem.h:128
#define ACMDM_HARDWARE_WAVE_CAPS_OUTPUT
Definition: msacmdrv.h:49
#define ACMDM_HARDWARE_WAVE_CAPS_INPUT
Definition: msacmdrv.h:48
static LRESULT MPEG3_DriverDetails(PACMDRIVERDETAILSW add)
Definition: mpegl3.c:679
#define TRACE(s)
Definition: solgame.cpp:4
#define MMSYSERR_NOERROR
Definition: mmsystem.h:96
#define DRV_CONFIGURE
Definition: mmsystem.h:125
static LRESULT MPEG3_FormatTagDetails(PACMFORMATTAGDETAILSW aftd, DWORD dwQuery)
Definition: mpegl3.c:708
#define DRV_FREE
Definition: mmsystem.h:124
#define MMSYSERR_NOTSUPPORTED
Definition: mmsystem.h:104
#define ACMDM_FILTERTAG_DETAILS
Definition: msacmdrv.h:55
#define ACMDM_STREAM_UNPREPARE
Definition: msacmdrv.h:64
#define DRV_ENABLE
Definition: mmsystem.h:120
static LRESULT MPEG3_StreamConvert(PACMDRVSTREAMINSTANCE adsi, PACMDRVSTREAMHEADER adsh)
Definition: mpegl3.c:942
#define MB_OK
Definition: winuser.h:784
#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
#define ACMDM_FORMAT_DETAILS
Definition: msacmdrv.h:52
static LRESULT MPEG3_StreamSize(PACMDRVSTREAMINSTANCE adsi, PACMDRVSTREAMSIZE adss)
Definition: mpegl3.c:869
#define ACMDM_STREAM_SIZE
Definition: msacmdrv.h:60
#define ACMDM_FILTER_DETAILS
Definition: msacmdrv.h:56

◆ MPEG3_FormatDetails()

static LRESULT MPEG3_FormatDetails ( PACMFORMATDETAILSW  afd,
DWORD  dwQuery 
)
static

Definition at line 769 of file mpegl3.c.

770 {
771  switch (dwQuery)
772  {
774  if (MPEG3_GetFormatIndex(afd->pwfx) == 0xFFFFFFFF) return ACMERR_NOTPOSSIBLE;
775  break;
777  afd->pwfx->wFormatTag = afd->dwFormatTag;
778  switch (afd->dwFormatTag)
779  {
780  case WAVE_FORMAT_PCM:
785  /* native MSACM uses a PCMWAVEFORMAT structure, so cbSize is not accessible
786  * afd->pwfx->cbSize = 0;
787  */
788  afd->pwfx->nBlockAlign =
789  (afd->pwfx->nChannels * afd->pwfx->wBitsPerSample) / 8;
790  afd->pwfx->nAvgBytesPerSec =
791  afd->pwfx->nSamplesPerSec * afd->pwfx->nBlockAlign;
792  break;
794  case WAVE_FORMAT_MPEG:
795  WARN("Encoding to MPEG is not supported\n");
796  return ACMERR_NOTPOSSIBLE;
797  default:
798  WARN("Unsupported tag %08x\n", afd->dwFormatTag);
799  return MMSYSERR_INVALPARAM;
800  }
801  break;
802  default:
803  WARN("Unsupported query %08x\n", dwQuery);
804  return MMSYSERR_NOTSUPPORTED;
805  }
807  afd->szFormat[0] = 0; /* let MSACM format this for us... */
808 
809  return MMSYSERR_NOERROR;
810 }
PWAVEFORMATEX pwfx
Definition: msacm.h:507
DWORD nAvgBytesPerSec
Definition: mmreg.h:81
WORD nChannels
Definition: mmreg.h:79
#define WARN(fmt,...)
Definition: debug.h:112
#define ACMDRIVERDETAILS_SUPPORTF_CODEC
Definition: msacm.h:61
int nChannels
Definition: imaadp32.c:63
int nBits
Definition: imaadp32.c:64
#define WAVE_FORMAT_MPEG
Definition: mmreg.h:126
#define WAVE_FORMAT_PCM
Definition: constants.h:425
#define ACM_FORMATDETAILSF_FORMAT
Definition: msacm.h:161
#define MMSYSERR_NOERROR
Definition: mmsystem.h:96
static DWORD MPEG3_GetFormatIndex(LPWAVEFORMATEX wfx)
Definition: mpegl3.c:95
WCHAR szFormat[ACMFORMATDETAILS_FORMAT_CHARS]
Definition: msacm.h:509
#define MMSYSERR_NOTSUPPORTED
Definition: mmsystem.h:104
WORD wFormatTag
Definition: mmreg.h:78
DWORD dwFormatIndex
Definition: msacm.h:504
#define WAVE_FORMAT_MPEGLAYER3
Definition: mmreg.h:127
#define ACMERR_NOTPOSSIBLE
Definition: msacm.h:36
#define MMSYSERR_INVALPARAM
Definition: mmsystem.h:107
#define ARRAY_SIZE(a)
Definition: main.h:24
DWORD fdwSupport
Definition: msacm.h:506
DWORD nSamplesPerSec
Definition: mmreg.h:80
WORD nBlockAlign
Definition: mmreg.h:82
#define ACM_FORMATDETAILSF_INDEX
Definition: msacm.h:160
int rate
Definition: imaadp32.c:65
static const Format PCM_Formats[]
Definition: mpegl3.c:66
WORD wBitsPerSample
Definition: mmreg.h:83
DWORD dwFormatTag
Definition: msacm.h:505

Referenced by MPEG3_DriverProc().

◆ MPEG3_FormatSuggest()

static LRESULT MPEG3_FormatSuggest ( PACMDRVFORMATSUGGEST  adfs)
static

Definition at line 816 of file mpegl3.c.

817 {
818  /* some tests ... */
819  if (adfs->cbwfxSrc < sizeof(PCMWAVEFORMAT) ||
820  adfs->cbwfxDst < sizeof(PCMWAVEFORMAT) ||
821  MPEG3_GetFormatIndex(adfs->pwfxSrc) == 0xFFFFFFFF) return ACMERR_NOTPOSSIBLE;
822  /* FIXME: should do those tests against the real size (according to format tag */
823 
824  /* If no suggestion for destination, then copy source value */
826  adfs->pwfxDst->nChannels = adfs->pwfxSrc->nChannels;
830  adfs->pwfxDst->wBitsPerSample = 16;
832  {
833  if (adfs->pwfxSrc->wFormatTag == WAVE_FORMAT_PCM)
834  {
835  WARN("Encoding to MPEG is not supported\n");
836  return ACMERR_NOTPOSSIBLE;
837  }
838  else
840  }
841 
842  /* check if result is ok */
843  if (MPEG3_GetFormatIndex(adfs->pwfxDst) == 0xFFFFFFFF) return ACMERR_NOTPOSSIBLE;
844 
845  /* recompute other values */
846  switch (adfs->pwfxDst->wFormatTag)
847  {
848  case WAVE_FORMAT_PCM:
849  adfs->pwfxDst->nBlockAlign = (adfs->pwfxDst->nChannels * adfs->pwfxDst->wBitsPerSample) / 8;
851  break;
852  case WAVE_FORMAT_MPEG:
854  WARN("Encoding to MPEG is not supported\n");
855  return ACMERR_NOTPOSSIBLE;
856  break;
857  default:
858  FIXME("\n");
859  break;
860  }
861 
862  return MMSYSERR_NOERROR;
863 }
#define ACM_FORMATSUGGESTF_NSAMPLESPERSEC
Definition: msacm.h:176
PWAVEFORMATEX pwfxDst
Definition: msacmdrv.h:153
DWORD nAvgBytesPerSec
Definition: mmreg.h:81
WORD nChannels
Definition: mmreg.h:79
#define WARN(fmt,...)
Definition: debug.h:112
#define ACM_FORMATSUGGESTF_WFORMATTAG
Definition: msacm.h:174
#define WAVE_FORMAT_MPEG
Definition: mmreg.h:126
#define WAVE_FORMAT_PCM
Definition: constants.h:425
#define FIXME(fmt,...)
Definition: debug.h:111
#define ACM_FORMATSUGGESTF_NCHANNELS
Definition: msacm.h:175
#define MMSYSERR_NOERROR
Definition: mmsystem.h:96
static DWORD MPEG3_GetFormatIndex(LPWAVEFORMATEX wfx)
Definition: mpegl3.c:95
WORD wFormatTag
Definition: mmreg.h:78
#define WAVE_FORMAT_MPEGLAYER3
Definition: mmreg.h:127
#define ACMERR_NOTPOSSIBLE
Definition: msacm.h:36
PWAVEFORMATEX pwfxSrc
Definition: msacmdrv.h:151
DWORD nSamplesPerSec
Definition: mmreg.h:80
WORD nBlockAlign
Definition: mmreg.h:82
WORD wBitsPerSample
Definition: mmreg.h:83
#define ACM_FORMATSUGGESTF_WBITSPERSAMPLE
Definition: msacm.h:177

Referenced by MPEG3_DriverProc().

◆ MPEG3_FormatTagDetails()

static LRESULT MPEG3_FormatTagDetails ( PACMFORMATTAGDETAILSW  aftd,
DWORD  dwQuery 
)
static

Definition at line 708 of file mpegl3.c.

709 {
710  static const WCHAR szPcm[]={'P','C','M',0};
711  static const WCHAR szMpeg3[]={'M','P','e','g','3',0};
712  static const WCHAR szMpeg[]={'M','P','e','g',0};
713 
714  switch (dwQuery)
715  {
717  if (aftd->dwFormatTagIndex > 2) return ACMERR_NOTPOSSIBLE;
718  break;
720  if (aftd->dwFormatTag == WAVE_FORMAT_UNKNOWN)
721  {
722  aftd->dwFormatTagIndex = 2; /* WAVE_FORMAT_MPEG is biggest */
723  break;
724  }
725  /* fall through */
727  switch (aftd->dwFormatTag)
728  {
729  case WAVE_FORMAT_PCM: aftd->dwFormatTagIndex = 0; break;
730  case WAVE_FORMAT_MPEGLAYER3: aftd->dwFormatTagIndex = 1; break;
731  case WAVE_FORMAT_MPEG: aftd->dwFormatTagIndex = 2; break;
732  default: return ACMERR_NOTPOSSIBLE;
733  }
734  break;
735  default:
736  WARN("Unsupported query %08x\n", dwQuery);
737  return MMSYSERR_NOTSUPPORTED;
738  }
739 
741  switch (aftd->dwFormatTagIndex)
742  {
743  case 0:
745  aftd->cbFormatSize = sizeof(PCMWAVEFORMAT);
747  lstrcpyW(aftd->szFormatTag, szPcm);
748  break;
749  case 1:
751  aftd->cbFormatSize = sizeof(MPEGLAYER3WAVEFORMAT);
752  aftd->cStandardFormats = 0;
753  lstrcpyW(aftd->szFormatTag, szMpeg3);
754  break;
755  case 2:
757  aftd->cbFormatSize = sizeof(MPEG1WAVEFORMAT);
758  aftd->cStandardFormats = 0;
759  lstrcpyW(aftd->szFormatTag, szMpeg);
760  break;
761  }
762  return MMSYSERR_NOERROR;
763 }
#define WAVE_FORMAT_UNKNOWN
Definition: mmreg.h:95
#define WARN(fmt,...)
Definition: debug.h:112
#define ACMDRIVERDETAILS_SUPPORTF_CODEC
Definition: msacm.h:61
struct pcmwaveformat_tag PCMWAVEFORMAT
#define WAVE_FORMAT_MPEG
Definition: mmreg.h:126
#define WAVE_FORMAT_PCM
Definition: constants.h:425
DWORD cStandardFormats
Definition: msacm.h:534
struct mpeg1waveformat_tag MPEG1WAVEFORMAT
#define ACM_FORMATTAGDETAILSF_FORMATTAG
Definition: msacm.h:183
#define MMSYSERR_NOERROR
Definition: mmsystem.h:96
__wchar_t WCHAR
Definition: xmlstorage.h:180
#define ACM_FORMATTAGDETAILSF_INDEX
Definition: msacm.h:182
#define MMSYSERR_NOTSUPPORTED
Definition: mmsystem.h:104
#define WAVE_FORMAT_MPEGLAYER3
Definition: mmreg.h:127
#define ACM_FORMATTAGDETAILSF_LARGESTSIZE
Definition: msacm.h:184
struct mpeglayer3waveformat_tag MPEGLAYER3WAVEFORMAT
DWORD dwFormatTagIndex
Definition: msacm.h:530
#define ACMERR_NOTPOSSIBLE
Definition: msacm.h:36
#define lstrcpyW
Definition: compat.h:608
#define ARRAY_SIZE(a)
Definition: main.h:24
WCHAR szFormatTag[ACMFORMATTAGDETAILS_FORMATTAG_CHARS]
Definition: msacm.h:535
static const Format PCM_Formats[]
Definition: mpegl3.c:66

Referenced by MPEG3_DriverProc().

◆ MPEG3_GetFormatIndex()

static DWORD MPEG3_GetFormatIndex ( LPWAVEFORMATEX  wfx)
static

Definition at line 95 of file mpegl3.c.

96 {
97  int i, hi;
98  const Format *fmts;
99 
100  switch (wfx->wFormatTag)
101  {
102  case WAVE_FORMAT_PCM:
103  hi = ARRAY_SIZE(PCM_Formats);
104  fmts = PCM_Formats;
105  break;
106  case WAVE_FORMAT_MPEG:
110  break;
111  default:
112  return 0xFFFFFFFF;
113  }
114 
115  for (i = 0; i < hi; i++)
116  {
117  if (wfx->nChannels == fmts[i].nChannels &&
118  wfx->nSamplesPerSec == fmts[i].rate &&
119  (wfx->wBitsPerSample == fmts[i].nBits || !fmts[i].nBits))
120  return i;
121  }
122 
123  return 0xFFFFFFFF;
124 }
WORD nChannels
Definition: mmreg.h:79
#define WAVE_FORMAT_MPEG
Definition: mmreg.h:126
#define WAVE_FORMAT_PCM
Definition: constants.h:425
static const Format MPEG3_Formats[]
Definition: mpegl3.c:79
static struct fmt fmts[]
WORD wFormatTag
Definition: mmreg.h:78
#define WAVE_FORMAT_MPEGLAYER3
Definition: mmreg.h:127
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
#define ARRAY_SIZE(a)
Definition: main.h:24
DWORD nSamplesPerSec
Definition: mmreg.h:80
static const Format PCM_Formats[]
Definition: mpegl3.c:66
WORD wBitsPerSample
Definition: mmreg.h:83

Referenced by MPEG3_FormatDetails(), and MPEG3_FormatSuggest().

◆ MPEG3_StreamConvert()

static LRESULT MPEG3_StreamConvert ( PACMDRVSTREAMINSTANCE  adsi,
PACMDRVSTREAMHEADER  adsh 
)
static

Definition at line 942 of file mpegl3.c.

943 {
944  AcmMpeg3Data* aad = (AcmMpeg3Data*)adsi->dwDriver;
945  DWORD nsrc = adsh->cbSrcLength;
946  DWORD ndst = adsh->cbDstLength;
947 
948  if (adsh->fdwConvert &
952  {
953  FIXME("Unsupported fdwConvert (%08x), ignoring it\n", adsh->fdwConvert);
954  }
955  /* ACM_STREAMCONVERTF_BLOCKALIGN
956  * currently all conversions are block aligned, so do nothing for this flag
957  * ACM_STREAMCONVERTF_END
958  * no pending data, so do nothing for this flag
959  */
960  if ((adsh->fdwConvert & ACM_STREAMCONVERTF_START))
961  {
962  MPEG3_Reset(adsi, aad);
963  }
964 
965  aad->convert(adsi, adsh->pbSrc, &nsrc, adsh->pbDst, &ndst);
966  adsh->cbSrcLengthUsed = nsrc;
967  adsh->cbDstLengthUsed = ndst;
968 
969  return MMSYSERR_NOERROR;
970 }
#define ACM_STREAMCONVERTF_BLOCKALIGN
Definition: msacm.h:205
#define ACM_STREAMCONVERTF_END
Definition: msacm.h:207
#define FIXME(fmt,...)
Definition: debug.h:111
#define MMSYSERR_NOERROR
Definition: mmsystem.h:96
if(!(yy_init))
Definition: macro.lex.yy.c:714
unsigned long DWORD
Definition: ntddk_ex.h:95
#define ACM_STREAMCONVERTF_START
Definition: msacm.h:206
DWORD_PTR dwDriver
Definition: msacmdrv.h:107

Referenced by MPEG3_DriverProc().

◆ MPEG3_StreamSize()

static LRESULT MPEG3_StreamSize ( PACMDRVSTREAMINSTANCE  adsi,
PACMDRVSTREAMSIZE  adss 
)
static

Definition at line 869 of file mpegl3.c.

870 {
871  DWORD nblocks;
872 
873  switch (adss->fdwSize)
874  {
876  /* cbDstLength => cbSrcLength */
877  if (adsi->pwfxSrc->wFormatTag == WAVE_FORMAT_PCM &&
880  {
881  nblocks = (adss->cbDstLength - 3000) / (DWORD)(adsi->pwfxDst->nAvgBytesPerSec * 1152 / adsi->pwfxDst->nSamplesPerSec + 0.5);
882  if (nblocks == 0)
883  return ACMERR_NOTPOSSIBLE;
884  adss->cbSrcLength = nblocks * 1152 * adsi->pwfxSrc->nBlockAlign;
885  }
886  else if ((adsi->pwfxSrc->wFormatTag == WAVE_FORMAT_MPEGLAYER3 ||
887  adsi->pwfxSrc->wFormatTag == WAVE_FORMAT_MPEG) &&
889  {
890  nblocks = adss->cbDstLength / (adsi->pwfxDst->nBlockAlign * 1152);
891  if (nblocks == 0)
892  return ACMERR_NOTPOSSIBLE;
893  adss->cbSrcLength = nblocks * (DWORD)(adsi->pwfxSrc->nAvgBytesPerSec * 1152 / adsi->pwfxSrc->nSamplesPerSec);
894  }
895  else
896  {
897  return MMSYSERR_NOTSUPPORTED;
898  }
899  break;
901  /* cbSrcLength => cbDstLength */
902  if (adsi->pwfxSrc->wFormatTag == WAVE_FORMAT_PCM &&
905  {
906  nblocks = adss->cbSrcLength / (adsi->pwfxSrc->nBlockAlign * 1152);
907  if (adss->cbSrcLength % (DWORD)(adsi->pwfxSrc->nBlockAlign * 1152))
908  /* Round block count up. */
909  nblocks++;
910  if (nblocks == 0)
911  return ACMERR_NOTPOSSIBLE;
912  adss->cbDstLength = 3000 + nblocks * (DWORD)(adsi->pwfxDst->nAvgBytesPerSec * 1152 / adsi->pwfxDst->nSamplesPerSec + 0.5);
913  }
914  else if ((adsi->pwfxSrc->wFormatTag == WAVE_FORMAT_MPEGLAYER3 ||
915  adsi->pwfxSrc->wFormatTag == WAVE_FORMAT_MPEG) &&
917  {
918  nblocks = adss->cbSrcLength / (DWORD)(adsi->pwfxSrc->nAvgBytesPerSec * 1152 / adsi->pwfxSrc->nSamplesPerSec);
919  if (adss->cbSrcLength % (DWORD)(adsi->pwfxSrc->nAvgBytesPerSec * 1152 / adsi->pwfxSrc->nSamplesPerSec))
920  /* Round block count up. */
921  nblocks++;
922  if (nblocks == 0)
923  return ACMERR_NOTPOSSIBLE;
924  adss->cbDstLength = nblocks * 1152 * adsi->pwfxDst->nBlockAlign;
925  }
926  else
927  {
928  return MMSYSERR_NOTSUPPORTED;
929  }
930  break;
931  default:
932  WARN("Unsupported query %08x\n", adss->fdwSize);
933  return MMSYSERR_NOTSUPPORTED;
934  }
935  return MMSYSERR_NOERROR;
936 }
#define ACM_STREAMSIZEF_DESTINATION
Definition: msacm.h:218
DWORD nAvgBytesPerSec
Definition: mmreg.h:81
#define WARN(fmt,...)
Definition: debug.h:112
#define DWORD
Definition: nt_native.h:44
#define WAVE_FORMAT_MPEG
Definition: mmreg.h:126
#define WAVE_FORMAT_PCM
Definition: constants.h:425
PWAVEFORMATEX pwfxDst
Definition: msacmdrv.h:101
#define MMSYSERR_NOERROR
Definition: mmsystem.h:96
#define ACM_STREAMSIZEF_SOURCE
Definition: msacm.h:217
unsigned long DWORD
Definition: ntddk_ex.h:95
#define MMSYSERR_NOTSUPPORTED
Definition: mmsystem.h:104
WORD wFormatTag
Definition: mmreg.h:78
#define WAVE_FORMAT_MPEGLAYER3
Definition: mmreg.h:127
#define ACMERR_NOTPOSSIBLE
Definition: msacm.h:36
DWORD nSamplesPerSec
Definition: mmreg.h:80
WORD nBlockAlign
Definition: mmreg.h:82
PWAVEFORMATEX pwfxSrc
Definition: msacmdrv.h:100

Referenced by MPEG3_DriverProc().

◆ WINE_DEFAULT_DEBUG_CHANNEL()

WINE_DEFAULT_DEBUG_CHANNEL ( mpeg3  )

Variable Documentation

◆ helpstring

typedef helpstring

◆ MPEG3_Formats

const Format MPEG3_Formats[]
static
Initial value:
=
{
{1, 0, 8000}, {2, 0, 8000},
{1, 0, 11025}, {2, 0, 11025},
{1, 0, 12000}, {2, 0, 12000},
{1, 0, 16000}, {2, 0, 16000},
{1, 0, 22050}, {2, 0, 22050},
{1, 0, 24000}, {2, 0, 24000},
{1, 0, 32000}, {2, 0, 32000},
{1, 0, 44100}, {2, 0, 44100},
{1, 0, 48000}, {2, 0, 48000}
}

Definition at line 79 of file mpegl3.c.

Referenced by MPEG3_GetFormatIndex().

◆ PCM_Formats

const Format PCM_Formats[]
static
Initial value:
=
{
{1, 8, 8000}, {2, 8, 8000}, {1, 16, 8000}, {2, 16, 8000},
{1, 8, 11025}, {2, 8, 11025}, {1, 16, 11025}, {2, 16, 11025},
{1, 8, 12000}, {2, 8, 12000}, {1, 16, 12000}, {2, 16, 12000},
{1, 8, 16000}, {2, 8, 16000}, {1, 16, 16000}, {2, 16, 16000},
{1, 8, 22050}, {2, 8, 22050}, {1, 16, 22050}, {2, 16, 22050},
{1, 8, 24000}, {2, 8, 24000}, {1, 16, 24000}, {2, 16, 24000},
{1, 8, 32000}, {2, 8, 32000}, {1, 16, 32000}, {2, 16, 32000},
{1, 8, 44100}, {2, 8, 44100}, {1, 16, 44100}, {2, 16, 44100},
{1, 8, 48000}, {2, 8, 48000}, {1, 16, 48000}, {2, 16, 48000}
}

Definition at line 66 of file mpegl3.c.

Referenced by MPEG3_FormatDetails(), MPEG3_FormatTagDetails(), and MPEG3_GetFormatIndex().