mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2025-01-03 05:59:10 +00:00
Refreshed the winloader with the latest xmmp code. win32 codecs work again. It was a metter of turning of optimisations.
Original commit message from CVS: Refreshed the winloader with the latest xmmp code. win32 codecs work again. It was a metter of turning of optimisations.
This commit is contained in:
parent
f37f8a939e
commit
78514b44f4
8 changed files with 64 additions and 35 deletions
|
@ -13,7 +13,7 @@
|
||||||
extern "C" {
|
extern "C" {
|
||||||
#endif /* defined(__cplusplus) */
|
#endif /* defined(__cplusplus) */
|
||||||
|
|
||||||
typedef WORD VERSION; /* major (high byte), minor (low byte) */
|
//typedef WORD VERSION; /* major (high byte), minor (low byte) */
|
||||||
|
|
||||||
typedef UINT16 MMVERSION16;
|
typedef UINT16 MMVERSION16;
|
||||||
typedef UINT MMVERSION;
|
typedef UINT MMVERSION;
|
||||||
|
|
|
@ -3,12 +3,12 @@ filterdir = $(libdir)/gst
|
||||||
filter_LTLIBRARIES = libwinloader.la
|
filter_LTLIBRARIES = libwinloader.la
|
||||||
|
|
||||||
# compiler manages to screw something up here... must reduce optimizations
|
# compiler manages to screw something up here... must reduce optimizations
|
||||||
CFLAGS += -O2
|
CFLAGS += -O0 -funroll-loops
|
||||||
|
|
||||||
libwinloader_la_SOURCES = driver.c elfdll.c ext.c externals.c module.c \
|
libwinloader_la_SOURCES = win32.c driver.c elfdll.c ext.c module.c \
|
||||||
pe_image.c pe_resource.c registry.c resource.c stubs.s vfl.c afl.c
|
pe_image.c pe_resource.c registry.c resource.c stubs.s vfl.c afl.c
|
||||||
|
|
||||||
noinst_HEADERS = externals.h wineacm.h
|
noinst_HEADERS = wineacm.h
|
||||||
|
|
||||||
DEFINES=-rdynamic -fPIC -D__WINE__ -Ddbg_printf=__vprintf -DTRACE=__vprintf
|
DEFINES=-rdynamic -fPIC -D__WINE__ -Ddbg_printf=__vprintf -DTRACE=__vprintf
|
||||||
CFLAGS += $(DEFINES)
|
CFLAGS += $(DEFINES)
|
||||||
|
|
|
@ -304,6 +304,7 @@ void MSACM_RegisterAllDrivers(void)
|
||||||
|
|
||||||
MSACM_RegisterDriver("divxa32", (LPSTR)0x161, 0);
|
MSACM_RegisterDriver("divxa32", (LPSTR)0x161, 0);
|
||||||
MSACM_RegisterDriver("msadp32", (LPSTR)0x2, 0);
|
MSACM_RegisterDriver("msadp32", (LPSTR)0x2, 0);
|
||||||
|
MSACM_RegisterDriver("l3codeca", (LPSTR)0x55, 0);
|
||||||
}
|
}
|
||||||
|
|
||||||
/***********************************************************************
|
/***********************************************************************
|
||||||
|
|
|
@ -6,8 +6,6 @@
|
||||||
#include <wine/vfw.h>
|
#include <wine/vfw.h>
|
||||||
#include <registry.h>
|
#include <registry.h>
|
||||||
|
|
||||||
#include <config.h>
|
|
||||||
|
|
||||||
#define STORE_ALL \
|
#define STORE_ALL \
|
||||||
__asm__ ( \
|
__asm__ ( \
|
||||||
"push %%ebx\n\t" \
|
"push %%ebx\n\t" \
|
||||||
|
@ -25,6 +23,7 @@
|
||||||
"pop %%ebx\n\t"::)
|
"pop %%ebx\n\t"::)
|
||||||
|
|
||||||
|
|
||||||
|
#define WIN32_PATH "/usr/lib/win32"
|
||||||
|
|
||||||
typedef struct {
|
typedef struct {
|
||||||
UINT uDriverSignature;
|
UINT uDriverSignature;
|
||||||
|
@ -86,18 +85,21 @@ typedef struct
|
||||||
int usage;
|
int usage;
|
||||||
}codec_t;
|
}codec_t;
|
||||||
|
|
||||||
//#define Win32Path "/usr/lib/win32/"
|
|
||||||
#define Win32Path GST_WIN32_LIBDIR
|
|
||||||
static codec_t avi_codecs[]={
|
static codec_t avi_codecs[]={
|
||||||
{0, Win32Path"/divxc32.dll", 0}, //0
|
{0, WIN32_PATH"/divxc32.dll", 0}, //0
|
||||||
{0, Win32Path"/ir50_32.dll", 0},
|
{0, WIN32_PATH"/ir50_32.dll", 0},
|
||||||
{0, Win32Path"/ir41_32.dll", 0},
|
{0, WIN32_PATH"/ir41_32.dll", 0},
|
||||||
{0, Win32Path"/ir32_32.dll", 0},
|
{0, WIN32_PATH"/ir32_32.dll", 0},
|
||||||
{0, Win32Path"/mpg4c32.dll", 0},
|
{0, WIN32_PATH"/mpg4c32.dll", 0},
|
||||||
{0, Win32Path"/iccvid.dll", 0}, //5
|
{0, WIN32_PATH"/iccvid.dll", 0}, //5
|
||||||
{0, Win32Path"/libvideodll.so", 0},
|
{0, WIN32_PATH"/libvideodll.so", 0},
|
||||||
{0, Win32Path"/divxa32.acm", 0}, //7
|
{0, WIN32_PATH"/divxa32.acm", 0},
|
||||||
{0, Win32Path"/msadp32.acm", 0},
|
{0, WIN32_PATH"/msadp32.acm", 0},
|
||||||
|
{0, WIN32_PATH"/ativcr1.dll", 0},
|
||||||
|
{0, WIN32_PATH"/ativcr2.dll", 0}, //10
|
||||||
|
{0, WIN32_PATH"/i263_32.drv", 0},
|
||||||
|
{0, WIN32_PATH"/l3codeca.acm", 0},
|
||||||
|
// {0, WIN32_PATH"/atiyvu9.dll", 0},
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
|
@ -155,6 +157,9 @@ DrvOpen(LPARAM lParam2)
|
||||||
case mmioFOURCC('D', 'I', 'V', '4'):
|
case mmioFOURCC('D', 'I', 'V', '4'):
|
||||||
case mmioFOURCC('d', 'i', 'v', '3'):
|
case mmioFOURCC('d', 'i', 'v', '3'):
|
||||||
case mmioFOURCC('d', 'i', 'v', '4'):
|
case mmioFOURCC('d', 'i', 'v', '4'):
|
||||||
|
case mmioFOURCC('M', 'P', '4', '1'):
|
||||||
|
case mmioFOURCC('M', 'P', '4', '2'):
|
||||||
|
case mmioFOURCC('M', 'P', '4', '3'):
|
||||||
printf("Video in DivX ;-) format\n");
|
printf("Video in DivX ;-) format\n");
|
||||||
drv_id=0;
|
drv_id=0;
|
||||||
break;
|
break;
|
||||||
|
@ -178,9 +183,6 @@ DrvOpen(LPARAM lParam2)
|
||||||
case mmioFOURCC('m', 'p', '4', '2'):
|
case mmioFOURCC('m', 'p', '4', '2'):
|
||||||
case mmioFOURCC('m', 'p', '4', '3'):
|
case mmioFOURCC('m', 'p', '4', '3'):
|
||||||
case mmioFOURCC('M', 'P', 'G', '4'):
|
case mmioFOURCC('M', 'P', 'G', '4'):
|
||||||
case mmioFOURCC('M', 'P', '4', '1'):
|
|
||||||
case mmioFOURCC('M', 'P', '4', '2'):
|
|
||||||
case mmioFOURCC('M', 'P', '4', '3'):
|
|
||||||
printf("Video in Microsoft MPEG-4 format\n");
|
printf("Video in Microsoft MPEG-4 format\n");
|
||||||
drv_id=4;
|
drv_id=4;
|
||||||
break;
|
break;
|
||||||
|
@ -188,6 +190,19 @@ DrvOpen(LPARAM lParam2)
|
||||||
printf("Video in Cinepak format\n");
|
printf("Video in Cinepak format\n");
|
||||||
drv_id=5;
|
drv_id=5;
|
||||||
break;
|
break;
|
||||||
|
case mmioFOURCC('V', 'C', 'R', '1'):
|
||||||
|
drv_id=9;
|
||||||
|
break;
|
||||||
|
case mmioFOURCC('V', 'C', 'R', '2'):
|
||||||
|
drv_id=10;
|
||||||
|
break;
|
||||||
|
case mmioFOURCC('i', '2', '6', '3'):
|
||||||
|
case mmioFOURCC('I', '2', '6', '3'):
|
||||||
|
drv_id=11;
|
||||||
|
break;
|
||||||
|
// case mmioFOURCC('Y', 'V', 'U', '9'):
|
||||||
|
// drv_id=12;
|
||||||
|
// break;
|
||||||
default:
|
default:
|
||||||
printf("Unknown codec %X='%c%c%c%c'\n", fccHandler,
|
printf("Unknown codec %X='%c%c%c%c'\n", fccHandler,
|
||||||
fccHandler&0xFF, (fccHandler&0xFF00)>>8,
|
fccHandler&0xFF, (fccHandler&0xFF00)>>8,
|
||||||
|
@ -204,6 +219,10 @@ DrvOpen(LPARAM lParam2)
|
||||||
case 0x2://MS ADPCM
|
case 0x2://MS ADPCM
|
||||||
drv_id=8;
|
drv_id=8;
|
||||||
break;
|
break;
|
||||||
|
case 0x55://MPEG Layer 3
|
||||||
|
printf("MPEG Layer 3 ( 0x55 )\n");
|
||||||
|
drv_id=12;
|
||||||
|
break;
|
||||||
default:
|
default:
|
||||||
printf("Unknown ACM codec 0x%X\n", fccHandler);
|
printf("Unknown ACM codec 0x%X\n", fccHandler);
|
||||||
return (HDRVR)0;
|
return (HDRVR)0;
|
||||||
|
|
|
@ -45,8 +45,7 @@ extern DWORD fixup_imports(WINE_MODREF *wm);
|
||||||
extern void dump_exports(HMODULE hModule);
|
extern void dump_exports(HMODULE hModule);
|
||||||
/*---------------- END HACKS ---------------*/
|
/*---------------- END HACKS ---------------*/
|
||||||
|
|
||||||
//char *extra_ld_library_path = "/usr/lib/win32";
|
char *extra_ld_library_path = "/usr/lib/win32";
|
||||||
char *extra_ld_library_path = GST_WIN32_LIBDIR;
|
|
||||||
|
|
||||||
struct elfdll_image
|
struct elfdll_image
|
||||||
{
|
{
|
||||||
|
|
|
@ -14,7 +14,7 @@
|
||||||
|
|
||||||
#include <sys/mman.h>
|
#include <sys/mman.h>
|
||||||
#include <sys/types.h>
|
#include <sys/types.h>
|
||||||
|
/*
|
||||||
#ifdef __linux__
|
#ifdef __linux__
|
||||||
#include <asm/unistd.h>
|
#include <asm/unistd.h>
|
||||||
#include <asm/ldt.h>
|
#include <asm/ldt.h>
|
||||||
|
@ -40,7 +40,7 @@ struct modify_ldt_ldt_s {
|
||||||
#define __NR_modify_ldt 123
|
#define __NR_modify_ldt 123
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
*/
|
||||||
#include <wine/windef.h>
|
#include <wine/windef.h>
|
||||||
#include <wine/winerror.h>
|
#include <wine/winerror.h>
|
||||||
#include <wine/heap.h>
|
#include <wine/heap.h>
|
||||||
|
@ -64,7 +64,7 @@ modref_list;
|
||||||
*
|
*
|
||||||
* Convert an ldt_entry structure to the raw bytes of the descriptor.
|
* Convert an ldt_entry structure to the raw bytes of the descriptor.
|
||||||
*/
|
*/
|
||||||
static void LDT_EntryToBytes( unsigned long *buffer, const struct modify_ldt_ldt_s *content )
|
/*static void LDT_EntryToBytes( unsigned long *buffer, const struct modify_ldt_ldt_s *content )
|
||||||
{
|
{
|
||||||
*buffer++ = ((content->base_addr & 0x0000ffff) << 16) |
|
*buffer++ = ((content->base_addr & 0x0000ffff) << 16) |
|
||||||
(content->limit & 0x0ffff);
|
(content->limit & 0x0ffff);
|
||||||
|
@ -77,7 +77,7 @@ static void LDT_EntryToBytes( unsigned long *buffer, const struct modify_ldt_ldt
|
||||||
((content->limit_in_pages != 0) << 23) |
|
((content->limit_in_pages != 0) << 23) |
|
||||||
0xf000;
|
0xf000;
|
||||||
}
|
}
|
||||||
|
*/
|
||||||
|
|
||||||
//
|
//
|
||||||
// funcs:
|
// funcs:
|
||||||
|
@ -86,6 +86,7 @@ static void LDT_EntryToBytes( unsigned long *buffer, const struct modify_ldt_ldt
|
||||||
// 1 write old mode
|
// 1 write old mode
|
||||||
// 0x11 write
|
// 0x11 write
|
||||||
//
|
//
|
||||||
|
/*
|
||||||
static int modify_ldt( int func, struct modify_ldt_ldt_s *ptr,
|
static int modify_ldt( int func, struct modify_ldt_ldt_s *ptr,
|
||||||
unsigned long count )
|
unsigned long count )
|
||||||
{
|
{
|
||||||
|
@ -107,7 +108,7 @@ static int modify_ldt( int func, struct modify_ldt_ldt_s *ptr,
|
||||||
"b" (func),
|
"b" (func),
|
||||||
"c" (ptr),
|
"c" (ptr),
|
||||||
"d" (sizeof(struct modify_ldt_ldt_s)*count) );
|
"d" (sizeof(struct modify_ldt_ldt_s)*count) );
|
||||||
#endif /* __PIC__ */
|
#endif
|
||||||
if (res >= 0) return res;
|
if (res >= 0) return res;
|
||||||
errno = -res;
|
errno = -res;
|
||||||
return -1;
|
return -1;
|
||||||
|
@ -147,7 +148,7 @@ static int install_fs()
|
||||||
perror("install_fs");
|
perror("install_fs");
|
||||||
MESSAGE("Couldn't install fs segment, expect segfault\n");
|
MESSAGE("Couldn't install fs segment, expect segfault\n");
|
||||||
}
|
}
|
||||||
#endif /*linux*/
|
#endif
|
||||||
|
|
||||||
#if defined(__NetBSD__) || defined(__FreeBSD__) || defined(__OpenBSD__)
|
#if defined(__NetBSD__) || defined(__FreeBSD__) || defined(__OpenBSD__)
|
||||||
{
|
{
|
||||||
|
@ -161,11 +162,11 @@ static int install_fs()
|
||||||
MESSAGE("Did you reconfigure the kernel with \"options USER_LDT\"?\n");
|
MESSAGE("Did you reconfigure the kernel with \"options USER_LDT\"?\n");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
#endif /* __NetBSD__ || __FreeBSD__ || __OpenBSD__ */
|
#endif
|
||||||
__asm__
|
__asm__
|
||||||
(
|
(
|
||||||
"movl $0xf,%eax\n\t"
|
"movl $0xf,%eax\n\t"
|
||||||
"pushw %ax\n\t"
|
// "pushw %ax\n\t"
|
||||||
"movw %ax, %fs\n\t"
|
"movw %ax, %fs\n\t"
|
||||||
);
|
);
|
||||||
prev_struct=malloc(8);
|
prev_struct=malloc(8);
|
||||||
|
@ -178,13 +179,15 @@ static int install_fs()
|
||||||
};
|
};
|
||||||
static int uninstall_fs()
|
static int uninstall_fs()
|
||||||
{
|
{
|
||||||
|
printf("Uninstalling FS segment\n");
|
||||||
if(fs_seg==0)
|
if(fs_seg==0)
|
||||||
return -1;
|
return -1;
|
||||||
munmap(fs_seg, 0x30000);
|
munmap(fs_seg, 0x30000);
|
||||||
|
fs_installed=0;
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
*/
|
||||||
//WINE_MODREF *local_wm=NULL;
|
//WINE_MODREF *local_wm=NULL;
|
||||||
modref_list* local_wm=NULL;
|
modref_list* local_wm=NULL;
|
||||||
|
|
||||||
|
@ -216,7 +219,7 @@ void MODULE_RemoveFromList(WINE_MODREF *mod)
|
||||||
{
|
{
|
||||||
free(list);
|
free(list);
|
||||||
local_wm=NULL;
|
local_wm=NULL;
|
||||||
uninstall_fs();
|
// uninstall_fs();
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
for(;list;list=list->prev)
|
for(;list;list=list->prev)
|
||||||
|
@ -412,8 +415,8 @@ HMODULE WINAPI LoadLibraryExA(LPCSTR libname, HANDLE hfile, DWORD flags)
|
||||||
SetLastError(ERROR_INVALID_PARAMETER);
|
SetLastError(ERROR_INVALID_PARAMETER);
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
if(fs_installed==0)
|
// if(fs_installed==0)
|
||||||
install_fs();
|
// install_fs();
|
||||||
|
|
||||||
|
|
||||||
wm = MODULE_LoadLibraryExA( libname, hfile, flags );
|
wm = MODULE_LoadLibraryExA( libname, hfile, flags );
|
||||||
|
|
|
@ -55,7 +55,7 @@
|
||||||
#include <wine/module.h>
|
#include <wine/module.h>
|
||||||
#include <wine/debugtools.h>
|
#include <wine/debugtools.h>
|
||||||
|
|
||||||
#include "externals.h"
|
#include "win32.h"
|
||||||
|
|
||||||
#define RVA(x) ((void *)((char *)load_addr+(unsigned int)(x)))
|
#define RVA(x) ((void *)((char *)load_addr+(unsigned int)(x)))
|
||||||
|
|
||||||
|
|
|
@ -338,6 +338,13 @@ ICSendMessage(HIC hic,unsigned int msg,long lParam1,long lParam2) {
|
||||||
// printf("private=%x\n", whic->private);
|
// printf("private=%x\n", whic->private);
|
||||||
__asm__ __volatile__ ("fsave (%0)\n\t": :"r"(&qw));
|
__asm__ __volatile__ ("fsave (%0)\n\t": :"r"(&qw));
|
||||||
STORE_ALL;
|
STORE_ALL;
|
||||||
|
/*__asm__
|
||||||
|
(
|
||||||
|
"pushl %eax\n\t"
|
||||||
|
"movl $0xf,%eax\n\t"
|
||||||
|
"movw %ax, %fs\n\t"
|
||||||
|
"popl %eax\n\t"
|
||||||
|
);*/
|
||||||
ret = whic->driverproc(whic->private,1,msg,lParam1,lParam2);
|
ret = whic->driverproc(whic->private,1,msg,lParam1,lParam2);
|
||||||
REST_ALL;
|
REST_ALL;
|
||||||
__asm__ __volatile__ ("frstor (%0)\n\t": :"r"(&qw));
|
__asm__ __volatile__ ("frstor (%0)\n\t": :"r"(&qw));
|
||||||
|
|
Loading…
Reference in a new issue