summaryrefslogtreecommitdiffstats
path: root/loader
diff options
context:
space:
mode:
authorwm4 <wm4@nowhere>2012-08-12 15:30:21 +0200
committerwm4 <wm4@nowhere>2012-08-16 17:16:33 +0200
commitaebfbbf2bdda8e18beef90c16da97bd335f7d3b0 (patch)
treea7362bf3ef6f2d80a47b2e539a2ea4efe5e2e079 /loader
parentc6b03ffef6250096373c4a81a489dae9fbff9087 (diff)
downloadmpv-aebfbbf2bdda8e18beef90c16da97bd335f7d3b0.tar.bz2
mpv-aebfbbf2bdda8e18beef90c16da97bd335f7d3b0.tar.xz
Remove win32/qt/xanim/real binary codecs loading
Remove the win32 loader - the win32 emulation layer, as well as the code for using DirectShow/DMO/VFW codecs. Remove loading of xanim, QuickTime, and RealMedia codecs. The win32 emulation layer is based on a very old version of wine. Apparently, wine code was copied and hacked until it was somehow able to load a limited collection of binary codecs. It poked around in the code segment of some known binary codecs to disable unsupported win32 API calls to make them work. Example from module.c: for (i=0;i<5;i++) RVA(0x19e842)[i]=0x90; // make_new_region ? for (i=0;i<28;i++) RVA(0x19e86d)[i]=0x90; // call__call_CreateCompatibleDC ? for (i=0;i<5;i++) RVA(0x19e898)[i]=0x90; // jmp_to_call_loadbitmap ? for (i=0;i<9;i++) RVA(0x19e8ac)[i]=0x90; // call__calls_OLE_shit ? for (i=0;i<106;i++) RVA(0x261b10)[i]=0x90; // disable threads Just to show how utterly insane this code is. You wouldn't want even your worst enemy to have to maintain this. In fact, it seems nobody made major changes to this code ever since it was committed. Most formats can be decoded by libavcodecs these days, and the loader couldn't be used on 64 bit platforms anyway. The same is (probably) true for the other binary codecs. General note about how support for win32 codecs could be added back: It's not possible to replace the win32 loader code by using wine as library, because modern wine can not be linked with native Linux programs for certain reasons. It would be possible to to move DirectShow video decoding into a separate process linked with wine, like the CoreAVC-for-Linux patches do. There is also the mplayer-ww fork, which uses the dshownative library to use DirectShow codecs on Windows.
Diffstat (limited to 'loader')
-rw-r--r--loader/afl.c763
-rw-r--r--loader/com.h82
-rw-r--r--loader/debug.h12
-rw-r--r--loader/dmo/DMO_AudioDecoder.c171
-rw-r--r--loader/dmo/DMO_AudioDecoder.h20
-rw-r--r--loader/dmo/DMO_Filter.h39
-rw-r--r--loader/dmo/DMO_VideoDecoder.c555
-rw-r--r--loader/dmo/DMO_VideoDecoder.h29
-rw-r--r--loader/dmo/buffer.c119
-rw-r--r--loader/dmo/dmo.c166
-rw-r--r--loader/dmo/dmo.h81
-rw-r--r--loader/dmo/dmo_guids.c41
-rw-r--r--loader/dmo/dmo_guids.h35
-rw-r--r--loader/dmo/dmo_interfaces.h194
-rw-r--r--loader/drv.c176
-rw-r--r--loader/drv.h18
-rw-r--r--loader/dshow/DS_AudioDecoder.c192
-rw-r--r--loader/dshow/DS_AudioDecoder.h20
-rw-r--r--loader/dshow/DS_Filter.c318
-rw-r--r--loader/dshow/DS_Filter.h42
-rw-r--r--loader/dshow/DS_VideoDecoder.c916
-rw-r--r--loader/dshow/DS_VideoDecoder.h32
-rw-r--r--loader/dshow/allocator.c363
-rw-r--r--loader/dshow/allocator.h27
-rw-r--r--loader/dshow/cmediasample.c576
-rw-r--r--loader/dshow/cmediasample.h32
-rw-r--r--loader/dshow/graph.c165
-rw-r--r--loader/dshow/graph.h57
-rw-r--r--loader/dshow/guids.c83
-rw-r--r--loader/dshow/guids.h89
-rw-r--r--loader/dshow/inputpin.c1492
-rw-r--r--loader/dshow/inputpin.h70
-rw-r--r--loader/dshow/interfaces.h360
-rw-r--r--loader/dshow/iunk.h54
-rw-r--r--loader/dshow/libwin32.h256
-rw-r--r--loader/dshow/mediatype.c161
-rw-r--r--loader/dshow/mediatype.h96
-rw-r--r--loader/dshow/outputpin.c957
-rw-r--r--loader/dshow/outputpin.h32
-rw-r--r--loader/elfdll.c292
-rw-r--r--loader/ext.c593
-rw-r--r--loader/ext.h19
-rw-r--r--loader/ldt_keeper.c275
-rw-r--r--loader/ldt_keeper.h15
-rw-r--r--loader/loader.h36
-rw-r--r--loader/module.c1075
-rw-r--r--loader/pe_image.c949
-rw-r--r--loader/pe_resource.c396
-rw-r--r--loader/qt_comp_template.c27
-rw-r--r--loader/qt_fv.h1593
-rw-r--r--loader/qtx/qtxsdk/components.h757
-rw-r--r--loader/qtx/qtxsdk/select.h72
-rw-r--r--loader/registry.c531
-rw-r--r--loader/registry.h40
-rw-r--r--loader/resource.c487
-rw-r--r--loader/vfl.c228
-rw-r--r--loader/win32.c5779
-rw-r--r--loader/win32.h34
-rw-r--r--loader/wine/avifmt.h240
-rw-r--r--loader/wine/basetsd.h152
-rw-r--r--loader/wine/debugtools.h71
-rw-r--r--loader/wine/driver.h110
-rw-r--r--loader/wine/elfdll.h13
-rw-r--r--loader/wine/heap.h56
-rw-r--r--loader/wine/ldt.h92
-rw-r--r--loader/wine/mmreg.h249
-rw-r--r--loader/wine/module.h149
-rw-r--r--loader/wine/msacm.h935
-rw-r--r--loader/wine/msacmdrv.h203
-rw-r--r--loader/wine/ntdef.h93
-rw-r--r--loader/wine/objbase.h22
-rw-r--r--loader/wine/pe_image.h81
-rw-r--r--loader/wine/poppack.h15
-rw-r--r--loader/wine/pshpack1.h12
-rw-r--r--loader/wine/pshpack2.h12
-rw-r--r--loader/wine/pshpack4.h14
-rw-r--r--loader/wine/pshpack8.h12
-rw-r--r--loader/wine/vfw.h669
-rw-r--r--loader/wine/winbase.h1777
-rw-r--r--loader/wine/windef.h628
-rw-r--r--loader/wine/windows.h30
-rw-r--r--loader/wine/winerror.h1658
-rw-r--r--loader/wine/winestring.h13
-rw-r--r--loader/wine/winnt.h2663
-rw-r--r--loader/wine/winreg.h49
-rw-r--r--loader/wine/winuser.h2922
-rw-r--r--loader/wineacm.h62
-rw-r--r--loader/wrapper.S88
-rw-r--r--loader/wrapper.h19
89 files changed, 0 insertions, 35198 deletions
diff --git a/loader/afl.c b/loader/afl.c
deleted file mode 100644
index b29471cdce..0000000000
--- a/loader/afl.c
+++ /dev/null
@@ -1,763 +0,0 @@
-/**************************************************************************
-
-
- This file will contain an interface to ACM drivers.
- Its content will be based mainly on wine/dlls/msacm32
- actually, for audio decompression only the following functions
- are needed:
-
- acmStreamOpen ( takes formats of src and dest, returns stream handle )
- acmStreamPrepareHeader ( takes stream handler and info on data )
- acmStreamConvert ( the same as PrepareHeader )
- acmStreamUnprepareHeader
- acmStreamClose
- acmStreamSize
- maybe acmStreamReset
-
- In future I'll also add functions for format enumeration,
- but not right now.
-
- Modified for use with MPlayer, detailed changelog at
- http://svn.mplayerhq.hu/mplayer/trunk/
-
-***************************************************************************/
-#include "config.h"
-#include "debug.h"
-
-#include "wine/winbase.h"
-#include "wine/windef.h"
-#include "wine/winuser.h"
-#include "wine/vfw.h"
-#include "wine/winestring.h"
-#include "wine/driver.h"
-#include "wine/winerror.h"
-#include "wine/msacm.h"
-#include "wine/msacmdrv.h"
-#include "wineacm.h"
-#ifndef __MINGW32__
-#include "ext.h"
-#endif
-#include "drv.h"
-
-#include <stdio.h>
-#include <stdlib.h>
-#include <string.h>
-#pragma pack(1)
-#define OpenDriverA DrvOpen
-#define CloseDriver DrvClose
-
-static inline PWINE_ACMSTREAM ACM_GetStream(HACMSTREAM has)
-{
- return (PWINE_ACMSTREAM)has;
-}
-
-/***********************************************************************
- * acmDriverAddA (MSACM32.2)
- */
-MMRESULT WINAPI acmDriverAddA(PHACMDRIVERID phadid, HINSTANCE hinstModule,
- LPARAM lParam, DWORD dwPriority, DWORD fdwAdd)
-{
- if (!phadid)
- return MMSYSERR_INVALPARAM;
-
- /* Check if any unknown flags */
- if (fdwAdd &
- ~(ACM_DRIVERADDF_FUNCTION|ACM_DRIVERADDF_NOTIFYHWND|
- ACM_DRIVERADDF_GLOBAL))
- return MMSYSERR_INVALFLAG;
-
- /* Check if any incompatible flags */
- if ((fdwAdd & ACM_DRIVERADDF_FUNCTION) &&
- (fdwAdd & ACM_DRIVERADDF_NOTIFYHWND))
- return MMSYSERR_INVALFLAG;
-
- /* FIXME: in fact, should GetModuleFileName(hinstModule) and do a
- * LoadDriver on it, to be sure we can call SendDriverMessage on the
- * hDrvr handle.
- */
- *phadid = (HACMDRIVERID) MSACM_RegisterDriver(NULL, 0, hinstModule);
-
- /* FIXME: lParam, dwPriority and fdwAdd ignored */
-
- return MMSYSERR_NOERROR;
-}
-
-/***********************************************************************
- * acmDriverClose (MSACM32.4)
- */
-MMRESULT WINAPI acmDriverClose(HACMDRIVER had, DWORD fdwClose)
-{
- PWINE_ACMDRIVER p;
- PWINE_ACMDRIVER* tp;
-
- if (fdwClose)
- return MMSYSERR_INVALFLAG;
-
- p = MSACM_GetDriver(had);
- if (!p)
- return MMSYSERR_INVALHANDLE;
-
- for (tp = &(p->obj.pACMDriverID->pACMDriverList); *tp; *tp = (*tp)->pNextACMDriver) {
- if (*tp == p) {
- *tp = (*tp)->pNextACMDriver;
- break;
- }
- }
-
- if (p->hDrvr && !p->obj.pACMDriverID->pACMDriverList)
- CloseDriver(p->hDrvr);
-
- HeapFree(MSACM_hHeap, 0, p);
-
- return MMSYSERR_NOERROR;
-}
-
-/***********************************************************************
- * acmDriverEnum (MSACM32.7)
- */
-MMRESULT WINAPI acmDriverEnum(ACMDRIVERENUMCB fnCallback, DWORD dwInstance, DWORD fdwEnum)
-{
- PWINE_ACMDRIVERID p;
- DWORD fdwSupport;
-
- if (!fnCallback) {
- return MMSYSERR_INVALPARAM;
- }
-
- if (fdwEnum && ~(ACM_DRIVERENUMF_NOLOCAL|ACM_DRIVERENUMF_DISABLED)) {
- return MMSYSERR_INVALFLAG;
- }
-
- for (p = MSACM_pFirstACMDriverID; p; p = p->pNextACMDriverID) {
- fdwSupport = ACMDRIVERDETAILS_SUPPORTF_CODEC;
- if (!p->bEnabled) {
- if (fdwEnum & ACM_DRIVERENUMF_DISABLED)
- fdwSupport |= ACMDRIVERDETAILS_SUPPORTF_DISABLED;
- else
- continue;
- }
- (*fnCallback)((HACMDRIVERID) p, dwInstance, fdwSupport);
- }
-
- return MMSYSERR_NOERROR;
-}
-
-/***********************************************************************
- * acmDriverID (MSACM32.8)
- */
-MMRESULT WINAPI acmDriverID(HACMOBJ hao, PHACMDRIVERID phadid, DWORD fdwDriverID)
-{
- PWINE_ACMOBJ pao;
-
- pao = MSACM_GetObj(hao);
- if (!pao)
- return MMSYSERR_INVALHANDLE;
-
- if (!phadid)
- return MMSYSERR_INVALPARAM;
-
- if (fdwDriverID)
- return MMSYSERR_INVALFLAG;
-
- *phadid = (HACMDRIVERID) pao->pACMDriverID;
-
- return MMSYSERR_NOERROR;
-}
-
-/***********************************************************************
- * acmDriverMessage (MSACM32.9)
- * FIXME
- * Not implemented
- */
-LRESULT WINAPI acmDriverMessage(HACMDRIVER had, UINT uMsg, LPARAM lParam1, LPARAM lParam2)
-{
- PWINE_ACMDRIVER pad = MSACM_GetDriver(had);
- if (!pad)
- return MMSYSERR_INVALPARAM;
-
- /* FIXME: Check if uMsg legal */
-
- if (!SendDriverMessage(pad->hDrvr, uMsg, lParam1, lParam2))
- return MMSYSERR_NOTSUPPORTED;
-
- return MMSYSERR_NOERROR;
-}
-
-
-/***********************************************************************
- * acmDriverOpen (MSACM32.10)
- */
-MMRESULT WINAPI acmDriverOpen(PHACMDRIVER phad, HACMDRIVERID hadid, DWORD fdwOpen)
-{
- PWINE_ACMDRIVERID padid;
- PWINE_ACMDRIVER pad;
- ICOPEN icopen;
-
-
- TRACE("(%p, %x, %08lu)\n", phad, hadid, fdwOpen);
-
- if (!phad)
- return MMSYSERR_INVALPARAM;
-
- padid = MSACM_GetDriverID(hadid);
- if (!padid)
- return MMSYSERR_INVALHANDLE;
-
- if (fdwOpen)
- return MMSYSERR_INVALFLAG;
-
- pad = (PWINE_ACMDRIVER) HeapAlloc(MSACM_hHeap, 0, sizeof(WINE_ACMDRIVER));
- if (!pad)
- return MMSYSERR_NOMEM;
-
- pad->obj.pACMDriverID = padid;
- icopen.fccType = mmioFOURCC('a', 'u', 'd', 'c');
- icopen.fccHandler = (long)padid->pszFileName;
- icopen.dwSize = sizeof(ICOPEN);
- icopen.dwFlags = 0;
-
- icopen.pV1Reserved = padid->pszFileName;
- if (!padid->hInstModule)
- pad->hDrvr = OpenDriverA((long)&icopen);
- else
- pad->hDrvr = padid->hInstModule;
-
- if (!pad->hDrvr) {
- HeapFree(MSACM_hHeap, 0, pad);
- return MMSYSERR_ERROR;
- }
-
- pad->pfnDriverProc = (DRIVERPROC)GetProcAddress(pad->hDrvr, "DriverProc");
-
- /* insert new pad at beg of list */
- pad->pNextACMDriver = padid->pACMDriverList;
- padid->pACMDriverList = pad;
-
- /* FIXME: Create a WINE_ACMDRIVER32 */
- *phad = (HACMDRIVER)pad;
-
- return MMSYSERR_NOERROR;
-}
-
-/***********************************************************************
- * acmDriverRemove (MSACM32.12)
- */
-MMRESULT WINAPI acmDriverRemove(HACMDRIVERID hadid, DWORD fdwRemove)
-{
- PWINE_ACMDRIVERID padid;
-
- padid = MSACM_GetDriverID(hadid);
- if (!padid)
- return MMSYSERR_INVALHANDLE;
-
- if (fdwRemove)
- return MMSYSERR_INVALFLAG;
-
- MSACM_UnregisterDriver(padid);
-
- return MMSYSERR_NOERROR;
-}
-
-
-
-/**********************************************************************/
-
-HANDLE MSACM_hHeap = (HANDLE) NULL;
-PWINE_ACMDRIVERID MSACM_pFirstACMDriverID = NULL;
-PWINE_ACMDRIVERID MSACM_pLastACMDriverID = NULL;
-
-/***********************************************************************
- * MSACM_RegisterDriver32()
- */
-PWINE_ACMDRIVERID MSACM_RegisterDriver(const char* pszFileName,
- WORD wFormatTag,
- HINSTANCE hinstModule)
-{
- PWINE_ACMDRIVERID padid;
-
- TRACE("('%s', '%x', 0x%08x)\n", pszFileName, wFormatTag, hinstModule);
-
-#ifndef WIN32_LOADER
- MSACM_hHeap = GetProcessHeap();
-#endif
- padid = (PWINE_ACMDRIVERID) HeapAlloc(MSACM_hHeap, 0, sizeof(WINE_ACMDRIVERID));
- padid->pszFileName = malloc(strlen(pszFileName)+1);
- strcpy(padid->pszFileName, pszFileName);
-// 1~strdup(pszDriverAlias);
- padid->wFormatTag = wFormatTag;
- padid->hInstModule = hinstModule;
- padid->bEnabled = TRUE;
- padid->pACMDriverList = NULL;
- padid->pNextACMDriverID = NULL;
- padid->pPrevACMDriverID = MSACM_pLastACMDriverID;
- if (MSACM_pLastACMDriverID)
- MSACM_pLastACMDriverID->pNextACMDriverID = padid;
- MSACM_pLastACMDriverID = padid;
- if (!MSACM_pFirstACMDriverID)
- MSACM_pFirstACMDriverID = padid;
-
- return padid;
-}
-
-
-/***********************************************************************
- * MSACM_UnregisterDriver32()
- */
-PWINE_ACMDRIVERID MSACM_UnregisterDriver(PWINE_ACMDRIVERID p)
-{
- PWINE_ACMDRIVERID pNextACMDriverID;
-
- while (p->pACMDriverList)
- acmDriverClose((HACMDRIVER) p->pACMDriverList, 0);
-
- free(p->pszFileName);
-
- if (p == MSACM_pFirstACMDriverID)
- MSACM_pFirstACMDriverID = p->pNextACMDriverID;
- if (p == MSACM_pLastACMDriverID)
- MSACM_pLastACMDriverID = p->pPrevACMDriverID;
-
- if (p->pPrevACMDriverID)
- p->pPrevACMDriverID->pNextACMDriverID = p->pNextACMDriverID;
- if (p->pNextACMDriverID)
- p->pNextACMDriverID->pPrevACMDriverID = p->pPrevACMDriverID;
-
- pNextACMDriverID = p->pNextACMDriverID;
-
- HeapFree(MSACM_hHeap, 0, p);
-
- return pNextACMDriverID;
-}
-
-/***********************************************************************
- * MSACM_UnregisterAllDrivers32()
- * FIXME
- * Where should this function be called?
- */
-void MSACM_UnregisterAllDrivers(void)
-{
- PWINE_ACMDRIVERID p;
-
- for (p = MSACM_pFirstACMDriverID; p; p = MSACM_UnregisterDriver(p));
-}
-
-/***********************************************************************
- * MSACM_GetDriverID32()
- */
-PWINE_ACMDRIVERID MSACM_GetDriverID(HACMDRIVERID hDriverID)
-{
- return (PWINE_ACMDRIVERID)hDriverID;
-}
-
-/***********************************************************************
- * MSACM_GetDriver32()
- */
-PWINE_ACMDRIVER MSACM_GetDriver(HACMDRIVER hDriver)
-{
- return (PWINE_ACMDRIVER)hDriver;
-}
-
-/***********************************************************************
- * MSACM_GetObj32()
- */
-PWINE_ACMOBJ MSACM_GetObj(HACMOBJ hObj)
-{
- return (PWINE_ACMOBJ)hObj;
-}
-
-
-
-/***********************************************************************
- * acmStreamOpen (MSACM32.40)
- */
-MMRESULT WINAPI acmStreamOpen(PHACMSTREAM phas, HACMDRIVER had, PWAVEFORMATEX pwfxSrc,
- PWAVEFORMATEX pwfxDst, PWAVEFILTER pwfltr, DWORD dwCallback,
- DWORD dwInstance, DWORD fdwOpen)
-{
- PWINE_ACMSTREAM was;
- PWINE_ACMDRIVER wad;
- MMRESULT ret;
- int wfxSrcSize;
- int wfxDstSize;
-
- TRACE("(%p, 0x%08x, %p, %p, %p, %ld, %ld, %ld)\n",
- phas, had, pwfxSrc, pwfxDst, pwfltr, dwCallback, dwInstance, fdwOpen);
-
- TRACE("src [wFormatTag=%u, nChannels=%u, nSamplesPerSec=%lu, nAvgBytesPerSec=%lu, nBlockAlign=%u, wBitsPerSample=%u, cbSize=%u]\n",
- pwfxSrc->wFormatTag, pwfxSrc->nChannels, pwfxSrc->nSamplesPerSec, pwfxSrc->nAvgBytesPerSec,
- pwfxSrc->nBlockAlign, pwfxSrc->wBitsPerSample, pwfxSrc->cbSize);
-
- TRACE("dst [wFormatTag=%u, nChannels=%u, nSamplesPerSec=%lu, nAvgBytesPerSec=%lu, nBlockAlign=%u, wBitsPerSample=%u, cbSize=%u]\n",
- pwfxDst->wFormatTag, pwfxDst->nChannels, pwfxDst->nSamplesPerSec, pwfxDst->nAvgBytesPerSec,
- pwfxDst->nBlockAlign, pwfxDst->wBitsPerSample, pwfxDst->cbSize);
-
-#define SIZEOF_WFX(wfx) (sizeof(WAVEFORMATEX) + ((wfx->wFormatTag == WAVE_FORMAT_PCM) ? 0 : wfx->cbSize))
- wfxSrcSize = SIZEOF_WFX(pwfxSrc);
- wfxDstSize = SIZEOF_WFX(pwfxDst);