summaryrefslogtreecommitdiffstats
path: root/loader/vfl.c
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/vfl.c
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/vfl.c')
-rw-r--r--loader/vfl.c228
1 files changed, 0 insertions, 228 deletions
diff --git a/loader/vfl.c b/loader/vfl.c
deleted file mode 100644
index c4b2d28dd6..0000000000
--- a/loader/vfl.c
+++ /dev/null
@@ -1,228 +0,0 @@
-/*
- * Copyright 1998 Marcus Meissner
- *
- * Modified for use with MPlayer, detailed changelog at
- * http://svn.mplayerhq.hu/mplayer/trunk/
- *
- */
-#include <config.h>
-
-#include <stdio.h>
-#include <stdlib.h>
-#include <string.h>
-
-#include "win32.h"
-#include "loader.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/avifmt.h"
-#include "drv.h"
-
-#define OpenDriverA DrvOpen
-#define CloseDriver DrvClose
-
-/***********************************************************************
- * VideoForWindowsVersion [MSVFW.2][MSVIDEO.2]
- * Returns the version in major.minor form.
- * In Windows95 this returns 0x040003b6 (4.950)
- */
-long VFWAPI VideoForWindowsVersion(void) {
- return 0x040003B6; /* 4.950 */
-}
-
-/* system.ini: [drivers] */
-
-/***********************************************************************
- * ICInfo [MSVFW.33]
- * Get information about an installable compressor. Return TRUE if there
- * is one.
- */
-int VFWAPI
-ICInfo(
- long fccType, /* [in] type of compressor ('vidc') */
- long fccHandler, /* [in] <n>th compressor */
- ICINFO *lpicinfo /* [out] information about compressor */
-) {
- /* does OpenDriver/CloseDriver */
- lpicinfo->dwSize = sizeof(ICINFO);
- lpicinfo->fccType = fccType;
- lpicinfo->dwFlags = 0;
- return TRUE;
-}
-
-/***********************************************************************
- * ICOpen [MSVFW.37]
- * Opens an installable compressor. Return special handle.
- */
-HIC VFWAPI
-//ICOpen(long fccType,long fccHandler,unsigned int wMode) {
-ICOpen(long filename,long fccHandler,unsigned int wMode) {
- ICOPEN icopen;
- HDRVR hdrv;
- WINE_HIC *whic;
-
- /* Well, lParam2 is in fact a LPVIDEO_OPEN_PARMS, but it has the
- * same layout as ICOPEN
- */
- icopen.fccType = 0x63646976; // "vidc" //fccType;
- icopen.fccHandler = fccHandler;
- icopen.dwSize = sizeof(ICOPEN);
- icopen.dwFlags = wMode;
- icopen.pV1Reserved = (void*)filename;
- /* FIXME: do we need to fill out the rest too? */
- hdrv=OpenDriverA((long)&icopen);
- if (!hdrv) return 0;
- whic = malloc(sizeof(WINE_HIC));
- whic->hdrv = hdrv;
- whic->driverproc= ((DRVR*)hdrv)->DriverProc;
-// whic->private = ICSendMessage((HIC)whic,DRV_OPEN,0,(long)&icopen);
- whic->driverid = ((DRVR*)hdrv)->dwDriverID;
- return (HIC)whic;
-}
-
-/***********************************************************************
- * ICGetInfo [MSVFW.30]
- */
-LRESULT VFWAPI
-ICGetInfo(HIC hic,ICINFO *picinfo,long cb) {
- LRESULT ret;
-
- ret = ICSendMessage(hic,ICM_GETINFO,(long)picinfo,cb);
-
- return ret;
-}
-
-/***********************************************************************
- * ICCompress [MSVFW.23]
- */
-long VFWAPIV
-ICCompress(
- HIC hic,long dwFlags,LPBITMAPINFOHEADER lpbiOutput,void* lpData,
- LPBITMAPINFOHEADER lpbiInput,void* lpBits,long* lpckid,
- long* lpdwFlags,long lFrameNum,long dwFrameSize,long dwQuality,
- LPBITMAPINFOHEADER lpbiPrev,void* lpPrev
-) {
- ICCOMPRESS iccmp;
-
- iccmp.dwFlags = dwFlags;
-
- iccmp.lpbiOutput = lpbiOutput;
- iccmp.lpOutput = lpData;
- iccmp.lpbiInput = lpbiInput;
- iccmp.lpInput = lpBits;
-
- iccmp.lpckid = lpckid;
- iccmp.lpdwFlags = lpdwFlags;
- iccmp.lFrameNum = lFrameNum;
- iccmp.dwFrameSize = dwFrameSize;
- iccmp.dwQuality = dwQuality;
- iccmp.lpbiPrev = lpbiPrev;
- iccmp.lpPrev = lpPrev;
- return ICSendMessage(hic,ICM_COMPRESS,(long)&iccmp,sizeof(iccmp));
-}
-
-/***********************************************************************
- * ICDecompress [MSVFW.26]
- */
-long VFWAPIV
-ICDecompress(HIC hic,long dwFlags,LPBITMAPINFOHEADER lpbiFormat,void* lpData,LPBITMAPINFOHEADER lpbi,void* lpBits) {
- ICDECOMPRESS icd;
- int result;
- icd.dwFlags = dwFlags;
- icd.lpbiInput = lpbiFormat;
- icd.lpInput = lpData;
-
- icd.lpbiOutput = lpbi;
- icd.lpOutput = lpBits;
- icd.ckid = 0;
- result=ICSendMessage(hic,ICM_DECOMPRESS,(long)&icd,sizeof(icd));
- return result;
-}
-
-/***********************************************************************
- * ICDecompressEx [MSVFW.26]
- */
-long VFWAPIV
-ICDecompressEx(HIC hic,long dwFlags,LPBITMAPINFOHEADER lpbiFormat,void* lpData,LPBITMAPINFOHEADER lpbi,void* lpBits) {
- ICDECOMPRESSEX icd;
- int result;
-
- icd.dwFlags = dwFlags;
-
- icd.lpbiSrc = lpbiFormat;
- icd.lpSrc = lpData;
-
- icd.lpbiDst = lpbi;
- icd.lpDst = lpBits;
-
- icd.xSrc=icd.ySrc=0;
- icd.dxSrc=lpbiFormat->biWidth;
- icd.dySrc=abs(lpbiFormat->biHeight);
-
- icd.xDst=icd.yDst=0;
- icd.dxDst=lpbi->biWidth;
- icd.dyDst=abs(lpbi->biHeight);
-
- //icd.ckid = 0;
- result=ICSendMessage(hic,ICM_DECOMPRESSEX,(long)&icd,sizeof(icd));
- return result;
-}
-
-long VFWAPIV
-ICUniversalEx(HIC hic,int command,LPBITMAPINFOHEADER lpbiFormat,LPBITMAPINFOHEADER lpbi) {
- ICDECOMPRESSEX icd;
- int result;
-
- icd.dwFlags = 0;
-
- icd.lpbiSrc = lpbiFormat;
- icd.lpSrc = 0;
-
- icd.lpbiDst = lpbi;
- icd.lpDst = 0;
-
- icd.xSrc=icd.ySrc=0;
- icd.dxSrc=lpbiFormat->biWidth;
- icd.dySrc=abs(lpbiFormat->biHeight);
-
- icd.xDst=icd.yDst=0;
- icd.dxDst=lpbi->biWidth;
- icd.dyDst=abs(lpbi->biHeight);
-
- //icd.ckid = 0;
- result=ICSendMessage(hic,command,(long)&icd,sizeof(icd));
- return result;
-}
-
-
-/***********************************************************************
- * ICSendMessage [MSVFW.40]
- */
-LRESULT VFWAPI
-ICSendMessage(HIC hic,unsigned int msg,long lParam1,long lParam2) {
- WINE_HIC *whic = (WINE_HIC*)hic;
- return SendDriverMessage(whic->hdrv, msg, lParam1,lParam2);
-}
-
-
-/***********************************************************************
- * ICClose [MSVFW.22]
- */
-LRESULT VFWAPI ICClose(HIC hic) {
- WINE_HIC *whic = (WINE_HIC*)hic;
- /* FIXME: correct? */
-// CloseDriver(whic->hdrv,0,0);
- DrvClose(whic->hdrv);
- free(whic);
- return 0;
-}
-
-int VFWAPI ICDoSomething(void)
-{
- return 0;
-}