summaryrefslogtreecommitdiff
path: root/src/libw32dll/wine/afl.c
diff options
context:
space:
mode:
authorGuenter Bartsch <guenter@users.sourceforge.net>2002-12-18 04:00:45 +0000
committerGuenter Bartsch <guenter@users.sourceforge.net>2002-12-18 04:00:45 +0000
commit85632e5177760e08d3d40dcfe9456bef54fcdc2d (patch)
tree23fe16c5ebbc032f620ac5d97706a539982426a2 /src/libw32dll/wine/afl.c
parent54e7d3ecdb73fbbe09025c7f8b3bdbbe8ea87690 (diff)
downloadxine-lib-85632e5177760e08d3d40dcfe9456bef54fcdc2d.tar.gz
xine-lib-85632e5177760e08d3d40dcfe9456bef54fcdc2d.tar.bz2
first draft of quicktime binary-only codec support
CVS patchset: 3580 CVS date: 2002/12/18 04:00:45
Diffstat (limited to 'src/libw32dll/wine/afl.c')
-rw-r--r--src/libw32dll/wine/afl.c65
1 files changed, 27 insertions, 38 deletions
diff --git a/src/libw32dll/wine/afl.c b/src/libw32dll/wine/afl.c
index a887ead80..6f3fb0eb6 100644
--- a/src/libw32dll/wine/afl.c
+++ b/src/libw32dll/wine/afl.c
@@ -39,6 +39,10 @@
#include "driver.h"
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+#pragma pack(1)
#define OpenDriverA DrvOpen
#define CloseDriver DrvClose
@@ -215,7 +219,8 @@ MMRESULT WINAPI acmDriverOpen(PHACMDRIVER phad, HACMDRIVERID hadid, DWORD fdwOpe
icopen.dwSize = sizeof(ICOPEN);
icopen.dwFlags = 0;
- if (!padid->hInstModule)
+ icopen.pV1Reserved = padid->pszFileName;
+ if (!padid->hInstModule)
pad->hDrvr = OpenDriverA((long)&icopen);
else
pad->hDrvr = padid->hInstModule;
@@ -267,22 +272,19 @@ PWINE_ACMDRIVERID MSACM_pLastACMDriverID = NULL;
/***********************************************************************
* MSACM_RegisterDriver32()
*/
-PWINE_ACMDRIVERID MSACM_RegisterDriver(LPSTR pszDriverAlias, LPSTR pszFileName,
+PWINE_ACMDRIVERID MSACM_RegisterDriver(const char* pszFileName,
+ WORD wFormatTag,
HINSTANCE hinstModule)
-//
-// File names are stored in driver.c. I reuse this variable to store driver ID
-// in it. If it's <0x10000, it is primary codec for corresponding format.
-//
{
PWINE_ACMDRIVERID padid;
- TRACE("('%s', '%x', 0x%08x)\n", pszDriverAlias, pszFileName, hinstModule);
+ TRACE("('%s', '%x', 0x%08x)\n", pszFileName, wFormatTag, hinstModule);
padid = (PWINE_ACMDRIVERID) HeapAlloc(MSACM_hHeap, 0, sizeof(WINE_ACMDRIVERID));
- padid->pszDriverAlias = (char*)malloc(strlen(pszDriverAlias)+1);
- strcpy(padid->pszDriverAlias, pszDriverAlias);
+ padid->pszFileName = (char*)malloc(strlen(pszFileName)+1);
+ strcpy(padid->pszFileName, pszFileName);
// 1~strdup(pszDriverAlias);
- padid->pszFileName = pszFileName;
+ padid->wFormatTag = wFormatTag;
padid->hInstModule = hinstModule;
padid->bEnabled = TRUE;
padid->pACMDriverList = NULL;
@@ -297,23 +299,6 @@ PWINE_ACMDRIVERID MSACM_RegisterDriver(LPSTR pszDriverAlias, LPSTR pszFileName,
return padid;
}
-/***********************************************************************
- * MSACM_RegisterAllDrivers32()
- */
-void MSACM_RegisterAllDrivers(void)
-{
- /*LPSTR pszBuffer;
- DWORD dwBufferLength; -- not used */
-
- if (MSACM_pFirstACMDriverID)
- return;
-
- MSACM_RegisterDriver("divxa32", (LPSTR)0x161, 0); // DivX/WMA [07]
- MSACM_RegisterDriver("msadp32", (LPSTR)0x2, 0); // MS ADPCM [08]
- MSACM_RegisterDriver("l3codeca", (LPSTR)0x55, 0); // MPEG Layer-3 [12]
-// MSACM_RegisterDriver("imaadp32", (LPSTR)0x11, 0); // IMA ADPCM [13]
-// MSACM_RegisterDriver("msgsm32", (LPSTR)0x32, 0); // MS GSM 6.10 [14]
-}
/***********************************************************************
* MSACM_UnregisterDriver32()
@@ -325,10 +310,8 @@ PWINE_ACMDRIVERID MSACM_UnregisterDriver(PWINE_ACMDRIVERID p)
while (p->pACMDriverList)
acmDriverClose((HACMDRIVER) p->pACMDriverList, 0);
- if (p->pszDriverAlias)
- HeapFree(MSACM_hHeap, 0, p->pszDriverAlias);
-// if (p->pszFileName)
-// HeapFree(MSACM_hHeap, 0, p->pszFileName);
+ if (p->pszFileName)
+ free(p->pszFileName);
if (p == MSACM_pFirstACMDriverID)
MSACM_pFirstACMDriverID = p->pNextACMDriverID;
@@ -398,8 +381,6 @@ MMRESULT WINAPI acmStreamOpen(PHACMSTREAM phas, HACMDRIVER had, PWAVEFORMATEX pw
int wfxSrcSize;
int wfxDstSize;
- //printf("gcc-3.0 bug, pwfxSrc=%p, pwfxSrc->cbSize=%d\n", pwfxSrc, pwfxSrc->cbSize);
-
TRACE("(%p, 0x%08x, %p, %p, %p, %ld, %ld, %ld)\n",
phas, had, pwfxSrc, pwfxDst, pwfltr, dwCallback, dwInstance, fdwOpen);
@@ -416,13 +397,15 @@ MMRESULT WINAPI acmStreamOpen(PHACMSTREAM phas, HACMDRIVER had, PWAVEFORMATEX pw
wfxDstSize = SIZEOF_WFX(pwfxDst);
#undef SIZEOF_WFX
- was = HeapAlloc(MSACM_hHeap, 0, sizeof(*was) + wfxSrcSize + wfxDstSize + ((pwfltr) ? sizeof(WAVEFILTER) : 0));
+ was = (PWINE_ACMSTREAM) HeapAlloc(MSACM_hHeap, 0, sizeof(*was) + wfxSrcSize + wfxDstSize + ((pwfltr) ? sizeof(WAVEFILTER) : 0));
if (was == NULL)
return MMSYSERR_NOMEM;
-
was->drvInst.cbStruct = sizeof(was->drvInst);
was->drvInst.pwfxSrc = (PWAVEFORMATEX)((LPSTR)was + sizeof(*was));
memcpy(was->drvInst.pwfxSrc, pwfxSrc, wfxSrcSize);
+ // LHACM is checking for 0x1
+ // but if this will not help
+ // was->drvInst.pwfxSrc->wFormatTag = 1;
was->drvInst.pwfxDst = (PWAVEFORMATEX)((LPSTR)was + sizeof(*was) + wfxSrcSize);
memcpy(was->drvInst.pwfxDst, pwfxDst, wfxDstSize);
if (pwfltr) {
@@ -479,10 +462,14 @@ MMRESULT WINAPI acmStreamOpen(PHACMSTREAM phas, HACMDRIVER had, PWAVEFORMATEX pw
}
}
acmDriverClose(had, 0L);*/
- if(MSACM_pFirstACMDriverID==NULL)
- MSACM_RegisterAllDrivers();
+ //if(MSACM_pFirstACMDriverID==NULL)
+ // MSACM_RegisterAllDrivers();
- for (wadi = MSACM_pFirstACMDriverID; wadi; wadi = wadi->pNextACMDriverID) {
+ for (wadi = MSACM_pFirstACMDriverID; wadi; wadi = wadi->pNextACMDriverID)
+ {
+ /* Check Format */
+ if ((int)wadi->wFormatTag != (int)pwfxSrc->wFormatTag) continue;
+
ret = acmDriverOpen(&had, (HACMDRIVERID)wadi, 0L);
if (ret == MMSYSERR_NOERROR) {
if ((wad = MSACM_GetDriver(had)) != 0) {
@@ -491,6 +478,8 @@ MMRESULT WINAPI acmStreamOpen(PHACMSTREAM phas, HACMDRIVER had, PWAVEFORMATEX pw
was->hAcmDriver = had;
ret = SendDriverMessage(wad->hDrvr, ACMDM_STREAM_OPEN, (DWORD)&was->drvInst, 0L);
+ //lhacm - crash printf("RETOPEN %d\n", ret);
+ //ret = 0;
if (ret == MMSYSERR_NOERROR) {
if (fdwOpen & ACM_STREAMOPENF_QUERY) {
acmDriverClose(had, 0L);