ReactOS 0.4.15-dev-8419-g7f0e8a3
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

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}
#define ARRAY_SIZE(A)
Definition: main.h:33
#define NULL
Definition: types.h:112
#define CP_ACP
Definition: compat.h:109
#define MultiByteToWideChar
Definition: compat.h:110
#define MM_FRAUNHOFER_IIS
Definition: mmreg.h:152
#define MM_FHGIIS_MPEGLAYER3_DECODE
Definition: mmreg.h:153
#define MMSYSERR_NOERROR
Definition: mmsystem.h:96
#define ACMDRIVERDETAILS_FCCCOMP_UNDEFINED
Definition: msacm.h:59
#define ACMDRIVERDETAILS_FCCTYPE_AUDIOCODEC
Definition: msacm.h:58
#define ACMDRIVERDETAILS_SUPPORTF_CODEC
Definition: msacm.h:61
DWORD cFilterTags
Definition: msacm.h:311
WCHAR szCopyright[ACMDRIVERDETAILS_COPYRIGHT_CHARS]
Definition: msacm.h:317
WCHAR szLongName[ACMDRIVERDETAILS_LONGNAME_CHARS]
Definition: msacm.h:316
WCHAR szShortName[ACMDRIVERDETAILS_SHORTNAME_CHARS]
Definition: msacm.h:315
FOURCC fccComp
Definition: msacm.h:301
WCHAR szLicensing[ACMDRIVERDETAILS_LICENSING_CHARS]
Definition: msacm.h:318
FOURCC fccType
Definition: msacm.h:300
WCHAR szFeatures[ACMDRIVERDETAILS_FEATURES_CHARS]
Definition: msacm.h:319
DWORD cFormatTags
Definition: msacm.h:310
DWORD fdwSupport
Definition: msacm.h:309
DWORD vdwDriver
Definition: msacm.h:307

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
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
1005 return MPEG3_FormatDetails((PACMFORMATDETAILSW)dwParam1, dwParam2);
1006
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
1021
1024 /* this converter is not a hardware driver */
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;
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}
LRESULT WINAPI DefDriverProc(DWORD_PTR dwDriverIdentifier, HDRVR hDrv, UINT Msg, LPARAM lParam1, LPARAM lParam2)
Definition: driver.c:554
#define DRV_LOAD(x)
#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
#define DRV_INSTALL
Definition: mmsystem.h:127
#define DRV_FREE
Definition: mmsystem.h:124
#define DRV_DISABLE
Definition: mmsystem.h:123
static LRESULT MPEG3_StreamConvert(PACMDRVSTREAMINSTANCE adsi, PACMDRVSTREAMHEADER adsh)
Definition: mpegl3.c:942
static LRESULT MPEG3_FormatSuggest(PACMDRVFORMATSUGGEST adfs)
Definition: mpegl3.c:816
static LRESULT MPEG3_FormatTagDetails(PACMFORMATTAGDETAILSW aftd, DWORD dwQuery)
Definition: mpegl3.c:708
static LRESULT MPEG3_StreamSize(PACMDRVSTREAMINSTANCE adsi, PACMDRVSTREAMSIZE adss)
Definition: mpegl3.c:869
static LRESULT MPEG3_FormatDetails(PACMFORMATDETAILSW afd, DWORD dwQuery)
Definition: mpegl3.c:769
static LRESULT MPEG3_DriverDetails(PACMDRIVERDETAILSW add)
Definition: mpegl3.c:679
#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 TRACE(s)
Definition: solgame.cpp:4
int WINAPI MessageBoxA(_In_opt_ HWND hWnd, _In_opt_ LPCSTR lpText, _In_opt_ LPCSTR lpCaption, _In_ UINT uType)
#define MB_OK
Definition: winuser.h:790
char * LPSTR
Definition: xmlstorage.h:182

◆ 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);
805 }
807 afd->szFormat[0] = 0; /* let MSACM format this for us... */
808
809 return MMSYSERR_NOERROR;
810}
#define WAVE_FORMAT_PCM
Definition: constants.h:425
#define WARN(fmt,...)
Definition: precomp.h:61
#define WAVE_FORMAT_MPEG
Definition: mmreg.h:126
#define WAVE_FORMAT_MPEGLAYER3
Definition: mmreg.h:127
#define MMSYSERR_INVALPARAM
Definition: mmsystem.h:107
static DWORD MPEG3_GetFormatIndex(LPWAVEFORMATEX wfx)
Definition: mpegl3.c:95
static const Format PCM_Formats[]
Definition: mpegl3.c:66
#define ACMERR_NOTPOSSIBLE
Definition: msacm.h:36
#define ACM_FORMATDETAILSF_FORMAT
Definition: msacm.h:161
#define ACM_FORMATDETAILSF_INDEX
Definition: msacm.h:160
int nChannels
Definition: imaadp32.c:63
int nBits
Definition: imaadp32.c:64
int rate
Definition: imaadp32.c:65
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
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

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 FIXME(fmt,...)
Definition: precomp.h:53
#define ACM_FORMATSUGGESTF_WFORMATTAG
Definition: msacm.h:174
#define ACM_FORMATSUGGESTF_NCHANNELS
Definition: msacm.h:175
#define ACM_FORMATSUGGESTF_WBITSPERSAMPLE
Definition: msacm.h:177
#define ACM_FORMATSUGGESTF_NSAMPLESPERSEC
Definition: msacm.h:176
PWAVEFORMATEX pwfxSrc
Definition: msacmdrv.h:151
PWAVEFORMATEX pwfxDst
Definition: msacmdrv.h:153

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);
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 lstrcpyW
Definition: compat.h:749
#define WAVE_FORMAT_UNKNOWN
Definition: mmreg.h:95
struct mpeglayer3waveformat_tag MPEGLAYER3WAVEFORMAT
struct mpeg1waveformat_tag MPEG1WAVEFORMAT
struct pcmwaveformat_tag PCMWAVEFORMAT
#define ACM_FORMATTAGDETAILSF_FORMATTAG
Definition: msacm.h:183
#define ACM_FORMATTAGDETAILSF_LARGESTSIZE
Definition: msacm.h:184
#define ACM_FORMATTAGDETAILSF_INDEX
Definition: msacm.h:182
WCHAR szFormatTag[ACMFORMATTAGDETAILS_FORMATTAG_CHARS]
Definition: msacm.h:535
DWORD dwFormatTagIndex
Definition: msacm.h:530
DWORD cStandardFormats
Definition: msacm.h:534
__wchar_t WCHAR
Definition: xmlstorage.h:180

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:
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}
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
static struct fmt fmts[]
static const Format MPEG3_Formats[]
Definition: mpegl3.c:79

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 */
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}
unsigned long DWORD
Definition: ntddk_ex.h:95
if(dx< 0)
Definition: linetemp.h:194
#define ACM_STREAMCONVERTF_START
Definition: msacm.h:206
#define ACM_STREAMCONVERTF_BLOCKALIGN
Definition: msacm.h:205
#define ACM_STREAMCONVERTF_END
Definition: msacm.h:207
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 ||
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 {
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 ||
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 {
929 }
930 break;
931 default:
932 WARN("Unsupported query %08x\n", adss->fdwSize);
934 }
935 return MMSYSERR_NOERROR;
936}
#define ACM_STREAMSIZEF_SOURCE
Definition: msacm.h:217
#define ACM_STREAMSIZEF_DESTINATION
Definition: msacm.h:218
#define DWORD
Definition: nt_native.h:44
PWAVEFORMATEX pwfxSrc
Definition: msacmdrv.h:100
PWAVEFORMATEX pwfxDst
Definition: msacmdrv.h:101

Referenced by MPEG3_DriverProc().

◆ WINE_DEFAULT_DEBUG_CHANNEL()

WINE_DEFAULT_DEBUG_CHANNEL ( mpeg3  )

Variable Documentation

◆ 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().