From 718ac9b6c9106a1b0e3b7d4c821e031a601ae8fb Mon Sep 17 00:00:00 2001 From: James Stembridge Date: Tue, 4 May 2004 21:49:00 +0000 Subject: Port support for VP5 and VP6 from mplayer CVS patchset: 6483 CVS date: 2004/05/04 21:49:00 --- src/libw32dll/w32codec.c | 20 ++++++++++++++++++-- src/libw32dll/wine/module.c | 33 +++++++++++++++++++++++++++++++++ src/xine-engine/buffer_types.c | 4 +++- 3 files changed, 54 insertions(+), 3 deletions(-) (limited to 'src') diff --git a/src/libw32dll/w32codec.c b/src/libw32dll/w32codec.c index 3eed139c9..9dfecaeea 100644 --- a/src/libw32dll/w32codec.c +++ b/src/libw32dll/w32codec.c @@ -17,7 +17,7 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA * - * $Id: w32codec.c,v 1.140 2004/04/26 17:50:09 mroi Exp $ + * $Id: w32codec.c,v 1.141 2004/05/04 21:49:00 jstembridge Exp $ * * routines for using w32 codecs * DirectShow support by Miguel Freitas (Nov/2001) @@ -323,6 +323,8 @@ static int get_vids_codec_n_name(w32v_decoder_t *this, int buf_type) case BUF_VIDEO_DV: case BUF_VIDEO_VP31: case BUF_VIDEO_VP4: + case BUF_VIDEO_VP5: + case BUF_VIDEO_VP6: case BUF_VIDEO_MSS1: case BUF_VIDEO_TSCC: case BUF_VIDEO_UCOD: @@ -502,6 +504,20 @@ static char* get_vids_codec_name(w32v_decoder_t *this, _x_meta_info_set(this->stream, XINE_META_INFO_VIDEOCODEC, "On2 VP4 (win32)"); return "vp4vfw.dll"; + + case BUF_VIDEO_VP5: + this->yuv_supported=1; + this->ex_functions=1; + _x_meta_info_set(this->stream, XINE_META_INFO_VIDEOCODEC, + "On2 VP5 (win32)"); + return "vp5vfw.dll"; + + case BUF_VIDEO_VP6: + this->yuv_supported=1; + this->ex_functions=1; + _x_meta_info_set(this->stream, XINE_META_INFO_VIDEOCODEC, + "On2 VP6 (win32)"); + return "vp6vfw.dll"; case BUF_VIDEO_MSS1: this->driver_type = DRIVER_DS; @@ -1669,7 +1685,7 @@ static uint32_t video_types[] = { BUF_VIDEO_ATIVCR2, BUF_VIDEO_I263, BUF_VIDEO_MSVC, BUF_VIDEO_DV, BUF_VIDEO_WMV7, BUF_VIDEO_WMV8, BUF_VIDEO_WMV9, BUF_VIDEO_VP31, BUF_VIDEO_MSS1, BUF_VIDEO_TSCC, BUF_VIDEO_UCOD, - BUF_VIDEO_VP4, + BUF_VIDEO_VP4, BUF_VIDEO_VP5, BUF_VIDEO_VP6, 0 }; diff --git a/src/libw32dll/wine/module.c b/src/libw32dll/wine/module.c index 4393f7f00..6e97548b6 100644 --- a/src/libw32dll/wine/module.c +++ b/src/libw32dll/wine/module.c @@ -421,6 +421,39 @@ HMODULE WINAPI LoadLibraryExA(LPCSTR libname, HANDLE hfile, DWORD flags) if (!wm) printf("wine/module: Win32 LoadLibrary failed to load: %s\n", checked); + // remove a few divs in the VP codecs that make trouble + if (strstr(libname,"vp5vfw.dll") && wm) + { + int i; + if (PE_FindExportedFunction(wm, "DriverProc", TRUE)==(void*)0x10003930) { + for (i=0;i<3;i++) ((char*)0x10004e86)[i]=0x90; + for (i=0;i<3;i++) ((char*)0x10005a23)[i]=0x90; + for (i=0;i<3;i++) ((char*)0x10005bff)[i]=0x90; + } else { + printf("wine/module: Unsupported VP5 version\n"); + return 0; + } + } + + if (strstr(libname,"vp6vfw.dll") && wm) + { + int i; + if (PE_FindExportedFunction(wm, "DriverProc", TRUE)==(void*)0x10003ef0) { + // looks like VP 6.1.0.2 + for (i=0;i<6;i++) ((char*)0x10007268)[i]=0x90; + for (i=0;i<6;i++) ((char*)0x10007e83)[i]=0x90; + for (i=0;i<6;i++) ((char*)0x1000806a)[i]=0x90; + } else if (PE_FindExportedFunction(wm, "DriverProc", TRUE)==(void*)0x10004120) { + // looks like VP 6.2.0.10 + for (i=0;i<6;i++) ((char*)0x10007688)[i]=0x90; + for (i=0;i<6;i++) ((char*)0x100082c3)[i]=0x90; + for (i=0;i<6;i++) ((char*)0x100084aa)[i]=0x90; + } else { + printf("wine/module: Unsupported VP6 version\n"); + return 0; + } + } + if (strstr(libname,"QuickTime.qts") && wm) { void** ptr; diff --git a/src/xine-engine/buffer_types.c b/src/xine-engine/buffer_types.c index 32e8e03ce..fe2bd07f3 100644 --- a/src/xine-engine/buffer_types.c +++ b/src/xine-engine/buffer_types.c @@ -17,7 +17,7 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA * - * $Id: buffer_types.c,v 1.76 2004/04/10 03:45:52 miguelfreitas Exp $ + * $Id: buffer_types.c,v 1.77 2004/05/04 21:49:01 jstembridge Exp $ * * * contents: @@ -581,7 +581,9 @@ static video_db_t video_db[] = { }, { { + meFOURCC('V','P','6','0'), meFOURCC('V','P','6','1'), + meFOURCC('V','P','6','2'), 0 }, BUF_VIDEO_VP6, -- cgit v1.2.3