summaryrefslogtreecommitdiffstats
path: root/loader/dshow/libwin32.h
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/dshow/libwin32.h
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/dshow/libwin32.h')
-rw-r--r--loader/dshow/libwin32.h256
1 files changed, 0 insertions, 256 deletions
diff --git a/loader/dshow/libwin32.h b/loader/dshow/libwin32.h
deleted file mode 100644
index dd25c31941..0000000000
--- a/loader/dshow/libwin32.h
+++ /dev/null
@@ -1,256 +0,0 @@
-#ifndef MPLAYER_LIBWIN32_H
-#define MPLAYER_LIBWIN32_H
-
-#define VFW_E_NOT_RUNNING 0x80040226
-
-#include <inttypes.h>
-
-//#define FATAL(a) // you don't need exception - if you want - just fill more code
-#include "loader/wine/mmreg.h"
-#include "loader/wine/winreg.h"
-#include "loader/wine/vfw.h"
-#include "loader/com.h"
-
-typedef uint32_t fourcc_t;
-
-/*
-typedef struct FatalError
-{
- FatalError();
- void PrintAll(void) {}
-}FatalError;
-*/
-
-typedef struct CodecInfo
-{
- char* dll;
- GUID* guid;
-}CodecInfo;
-
-
-typedef struct CImage // public your_libvo_mem
-{
- char* ptr;
-
- /*char* (*Data)();
- {
- return 0;
- // pointer to memory block
- }*/
- /*int (*Supported)(fourcc_t csp, int bits);
- {
- return true;
- // if you support such surface
- }*/
-}CImage;
-
-
-#if 0
-struct BitmapInfo : public BITMAPINFOHEADER
-{
- void SetBits(int b) { return; /*fixme*/ }
- void SetSpace(int b) { return; /*fixme*/ }
-};
-#endif
-
-typedef struct IAudioDecoder
-{
- WAVEFORMATEX in_fmt;
- CodecInfo record;
- /*(*IAudioDecoder)( CodecInfo * r, const WAVEFORMATEX* w);
- {
- memcpy(&this->record,r,sizeof(CodecInfo));
- in_fmt = *w;
- }*/
-}IAudioDecoder;
-
-/*
-struct IAudioEncoder
-{
- IAudioEncoder(const CodecInfo&, WAVEFORMATEX*) {}
- // you do not need this one...
-};
-*/
-
- enum CAPS
- {
- CAP_NONE = 0,
- CAP_YUY2 = 1,
- CAP_YV12 = 2,
- CAP_IYUV = 4,
- CAP_UYVY = 8,
- CAP_YVYU = 16,
- CAP_I420 = 32,
- CAP_YVU9 = 64,
- CAP_IF09 = 128,
- };
- enum DecodingMode
- {
- DIRECT = 0,
- REALTIME,
- REALTIME_QUALITY_AUTO,
- };
- enum DecodingState
- {
- STOP = 0,
- START,
- };
-
-typedef struct BitmapInfo
-{
- long biSize;
- long biWidth;
- long biHeight;
- short biPlanes;
- short biBitCount;
- long biCompression;
- long biSizeImage;
- long biXPelsPerMeter;
- long biYPelsPerMeter;
- long biClrUsed;
- long biClrImportant;
- int colors[3];
-} BitmapInfo;
-
-typedef struct IVideoDecoder
-{
- int VBUFSIZE;
- int QMARKHI;
- int QMARKLO;
- int DMARKHI;
- int DMARKLO;
-
- /*
- IVideoDecoder(CodecInfo& info, const BITMAPINFOHEADER& format) : record(info)
- {
- // implement init part
- }
- virtual ~IVideoDecoder();
- void Stop()
- {
- }
- void Start()
- {
- }
- */
- const CodecInfo record;
- int m_Mode; // should we do precaching (or even change Quality on the fly)
- int m_State;
- int m_iDecpos;
- int m_iPlaypos;
- float m_fQuality; // quality for the progress bar 0..1(best)
- int m_bCapable16b;
-
- BITMAPINFOHEADER* m_bh; // format of input data (might be larger - e.g. huffyuv)
- BitmapInfo m_decoder; // format of decoder output
- BitmapInfo m_obh; // format of returned frames
-}IVideoDecoder;
-
-/*
-struct IRtConfig
-{
-};
-*/
-
-// might be minimalized to contain just those which are needed by DS_VideoDecoder
-
-#ifndef mmioFOURCC
-#define mmioFOURCC( ch0, ch1, ch2, ch3 ) \
- ( (long)(unsigned char)(ch0) | ( (long)(unsigned char)(ch1) << 8 ) | \
- ( (long)(unsigned char)(ch2) << 16 ) | ( (long)(unsigned char)(ch3) << 24 ) )
-#endif /* mmioFOURCC */
-
-/* OpenDivX */
-#define fccMP4S mmioFOURCC('M', 'P', '4', 'S')
-#define fccmp4s mmioFOURCC('m', 'p', '4', 's')
-#define fccDIVX mmioFOURCC('D', 'I', 'V', 'X')
-#define fccdivx mmioFOURCC('d', 'i', 'v', 'x')
-#define fccDIV1 mmioFOURCC('D', 'I', 'V', '1')
-#define fccdiv1 mmioFOURCC('d', 'i', 'v', '1')
-
-/* DivX codecs */
-#define fccDIV2 mmioFOURCC('D', 'I', 'V', '2')
-#define fccdiv2 mmioFOURCC('d', 'i', 'v', '2')
-#define fccDIV3 mmioFOURCC('D', 'I', 'V', '3')
-#define fccdiv3 mmioFOURCC('d', 'i', 'v', '3')
-#define fccDIV4 mmioFOURCC('D', 'I', 'V', '4')
-#define fccdiv4 mmioFOURCC('d', 'i', 'v', '4')
-#define fccDIV5 mmioFOURCC('D', 'I', 'V', '5')
-#define fccdiv5 mmioFOURCC('d', 'i', 'v', '5')
-#define fccDIV6 mmioFOURCC('D', 'I', 'V', '6')
-#define fccdiv6 mmioFOURCC('d', 'i', 'v', '6')
-#define fccMP41 mmioFOURCC('M', 'P', '4', '1')
-#define fccmp41 mmioFOURCC('m', 'p', '4', '1')
-#define fccMP43 mmioFOURCC('M', 'P', '4', '3')
-#define fccmp43 mmioFOURCC('m', 'p', '4', '3')
-/* old ms mpeg-4 codecs */
-#define fccMP42 mmioFOURCC('M', 'P', '4', '2')
-#define fccmp42 mmioFOURCC('m', 'p', '4', '2')
-#define fccMPG4 mmioFOURCC('M', 'P', 'G', '4')
-#define fccmpg4 mmioFOURCC('m', 'p', 'g', '4')
-/* Windows media codecs */
-#define fccWMV1 mmioFOURCC('W', 'M', 'V', '1')
-#define fccwmv1 mmioFOURCC('w', 'm', 'v', '1')
-#define fccWMV2 mmioFOURCC('W', 'M', 'V', '2')
-#define fccwmv2 mmioFOURCC('w', 'm', 'v', '2')
-#define fccMWV1 mmioFOURCC('M', 'W', 'V', '1')
-
-/* Angel codecs */
-#define fccAP41 mmioFOURCC('A', 'P', '4', '1')
-#define fccap41 mmioFOURCC('a', 'p', '4', '1')
-#define fccAP42 mmioFOURCC('A', 'P', '4', '2')
-#define fccap42 mmioFOURCC('a', 'p', '4', '2')
-
-/* other codecs */
-#define fccIV31 mmioFOURCC('I', 'V', '3', '1')
-#define fcciv31 mmioFOURCC('i', 'v', '3', '1')
-#define fccIV32 mmioFOURCC('I', 'V', '3', '2')
-#define fcciv32 mmioFOURCC('i', 'v', '3', '2')
-#define fccIV41 mmioFOURCC('I', 'V', '4', '1')
-#define fcciv41 mmioFOURCC('i', 'v', '4', '1')
-#define fccIV50 mmioFOURCC('I', 'V', '5', '0')
-#define fcciv50 mmioFOURCC('i', 'v', '5', '0')
-#define fccI263 mmioFOURCC('I', '2', '6', '3')
-#define fcci263 mmioFOURCC('i', '2', '6', '3')
-
-#define fccMJPG mmioFOURCC('M', 'J', 'P', 'G')
-#define fccmjpg mmioFOURCC('m', 'j', 'p', 'g')
-
-#define fccHFYU mmioFOURCC('H', 'F', 'Y', 'U')
-
-#define fcccvid mmioFOURCC('c', 'v', 'i', 'd')
-#define fccdvsd mmioFOURCC('d', 'v', 's', 'd')
-
-/* Ati codecs */
-#define fccVCR2 mmioFOURCC('V', 'C', 'R', '2')
-#define fccVCR1 mmioFOURCC('V', 'C', 'R', '1')
-#define fccVYUY mmioFOURCC('V', 'Y', 'U', 'Y')
-#define fccIYU9 mmioFOURCC('I', 'Y', 'U', '9') // it was defined as fccYVU9
-
-/* Asus codecs */
-#define fccASV1 mmioFOURCC('A', 'S', 'V', '1')
-#define fccASV2 mmioFOURCC('A', 'S', 'V', '2')
-
-/* Microsoft video */
-#define fcccram mmioFOURCC('c', 'r', 'a', 'm')
-#define fccCRAM mmioFOURCC('C', 'R', 'A', 'M')
-#define fccMSVC mmioFOURCC('M', 'S', 'V', 'C')
-
-
-#define fccMSZH mmioFOURCC('M', 'S', 'Z', 'H')
-
-#define fccZLIB mmioFOURCC('Z', 'L', 'I', 'B')
-
-#define fccTM20 mmioFOURCC('T', 'M', '2', '0')
-
-#define fccYUV mmioFOURCC('Y', 'U', 'V', ' ')
-#define fccYUY2 mmioFOURCC('Y', 'U', 'Y', '2')
-#define fccYV12 mmioFOURCC('Y', 'V', '1', '2')/* Planar mode: Y + V + U (3 planes) */
-#define fccI420 mmioFOURCC('I', '4', '2', '0')
-#define fccIYUV mmioFOURCC('I', 'Y', 'U', 'V')/* Planar mode: Y + U + V (3 planes) */
-#define fccUYVY mmioFOURCC('U', 'Y', 'V', 'Y')/* Packed mode: U0+Y0+V0+Y1 (1 plane) */
-#define fccYVYU mmioFOURCC('Y', 'V', 'Y', 'U')/* Packed mode: Y0+V0+Y1+U0 (1 plane) */
-#define fccYVU9 mmioFOURCC('Y', 'V', 'U', '9')/* Planar 4:1:0 */
-#define fccIF09 mmioFOURCC('I', 'F', '0', '9')/* Planar 4:1:0 + delta */
-
-#endif /* MPLAYER_LIBWIN32_H */