diff options
author | Juergen Keil <jkeil@users.sourceforge.net> | 2001-09-18 17:41:47 +0000 |
---|---|---|
committer | Juergen Keil <jkeil@users.sourceforge.net> | 2001-09-18 17:41:47 +0000 |
commit | 74158ab4d5dc283712729062fdcf732780ac13a8 (patch) | |
tree | 1e871996fcd9e03bcd1a34a13017863f8efb05df /src/libw32dll | |
parent | dd024e53aa2901d46eaa1da89da5fad14a67f703 (diff) | |
download | xine-lib-74158ab4d5dc283712729062fdcf732780ac13a8.tar.gz xine-lib-74158ab4d5dc283712729062fdcf732780ac13a8.tar.bz2 |
ffmpeg apparently does not support MSMPEG4 v1/v2 format yet. Trying to handle
MSMPEG4 v1/v2 formats using the libw32dll plugin.
But at least for XShm video output, libw32dll is too slow, converting
RGB -> YUY2 in the w32dll plugin, and converting back from YUY2 -> RGB in
the video out driver :-/
CVS patchset: 661
CVS date: 2001/09/18 17:41:47
Diffstat (limited to 'src/libw32dll')
-rw-r--r-- | src/libw32dll/w32codec.c | 50 | ||||
-rw-r--r-- | src/libw32dll/wine/registry.c | 6 | ||||
-rw-r--r-- | src/libw32dll/wine/win32.c | 80 |
3 files changed, 111 insertions, 25 deletions
diff --git a/src/libw32dll/w32codec.c b/src/libw32dll/w32codec.c index bcea81196..25119f7d4 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.24 2001/09/16 23:13:45 f1rmb Exp $ + * $Id: w32codec.c,v 1.25 2001/09/18 17:41:48 jkeil Exp $ * * routines for using w32 codecs * @@ -81,6 +81,18 @@ static char* get_vids_codec_name(w32v_decoder_t *this, this->flipped=0; switch (buf_type) { + case BUF_VIDEO_MSMPEG4_V12: + /* Microsoft MPEG-4 v1/v2 */ + this->yuv_supported=0; + this->flipped=1; + return "mpg4c32.dll"; + + case BUF_VIDEO_MSMPEG4_V3: + /* Microsoft MPEG-4 v3 */ + this->yuv_supported=0; + this->flipped=1; + return "divxc32.dll"; + case BUF_VIDEO_IV50: /* Video in Indeo Video 5 format */ this->yuv_supported=1; /* YUV pic is upside-down :( */ @@ -148,7 +160,9 @@ static char* get_vids_codec_name(w32v_decoder_t *this, static int w32v_can_handle (video_decoder_t *this_gen, int buf_type) { buf_type &= 0xFFFF0000; - return ( buf_type == BUF_VIDEO_IV50 || + return ( buf_type == BUF_VIDEO_MSMPEG4_V12 || + buf_type == BUF_VIDEO_MSMPEG4_V3 || + buf_type == BUF_VIDEO_IV50 || buf_type == BUF_VIDEO_IV41 || buf_type == BUF_VIDEO_IV32 || buf_type == BUF_VIDEO_CINEPAK || @@ -182,14 +196,19 @@ static void w32v_init_codec (w32v_decoder_t *this, int buf_type) { ICMODE_FASTDECOMPRESS); if(!this->hic){ - printf ("ICOpen failed! unknown codec / wrong parameters?\n"); + printf ("ICOpen failed! unknown codec %08lx / wrong parameters?\n", + this->bih.biCompression); this->decoder_ok = 0; return; } ret = ICDecompressGetFormat(this->hic, &this->bih, &this->o_bih); if(ret){ - printf("ICDecompressGetFormat failed: Error %ld\n", (long)ret); + printf("ICDecompressGetFormat (%.4s %08lx/%d) failed: Error %ld\n", + (char*)&this->o_bih.biCompression, + this->bih.biCompression, + this->bih.biBitCount, + (long)ret); this->decoder_ok = 0; return; } @@ -209,7 +228,7 @@ static void w32v_init_codec (w32v_decoder_t *this, int buf_type) { this->o_bih.biBitCount = 16; } - this->o_bih.biSizeImage = this->o_bih.biWidth*this->o_bih.biHeight*this->o_bih.biBitCount/8; + this->o_bih.biSizeImage = this->o_bih.biWidth*this->o_bih.biHeight*(this->o_bih.biBitCount+7)/8; ret = ICDecompressQuery(this->hic, &this->bih, &this->o_bih); @@ -289,20 +308,25 @@ static void w32v_decode_data (video_decoder_t *this_gen, buf_element_t *buf) { &this->bih, this->buf, &this->o_bih, this->img_buffer); - /* now, convert rgb to yuv */ - - { + if (this->yuv_supported) { + /* already decoded into YUY2 format */ + memcpy(img->base[0], this->img_buffer, this->bih.biHeight*this->bih.biWidth*2); + } else { + /* now, convert rgb to yuv (this is to slow) */ int row, col; + for (row=0; row<this->bih.biHeight; row++) { - for (col=0; col<this->o_bih.biWidth; col++) { + + uint16_t *pixel, *out; + + pixel = (uint16_t *) ( (uint8_t *)this->img_buffer + 2 * row * this->o_bih.biWidth ); + out = (uint16_t *) (img->base[0] + 2 * row * this->o_bih.biWidth ); + + for (col=0; col<this->o_bih.biWidth; col++, pixel++, out++) { - uint16_t *pixel, *out; uint8_t r,g,b; uint8_t y,u,v; - pixel = this->img_buffer + 2 * (row * this->o_bih.biWidth + col); - out = (uint16_t *) img->base[0] + 2 * (row * this->o_bih.biWidth + col); - b = (*pixel & 0x003C) << 3; g = (*pixel & 0x03E0) >> 5 << 3; r = (*pixel & 0xF800) >> 10 << 3; diff --git a/src/libw32dll/wine/registry.c b/src/libw32dll/wine/registry.c index 53951831a..f29a4d59d 100644 --- a/src/libw32dll/wine/registry.c +++ b/src/libw32dll/wine/registry.c @@ -396,11 +396,13 @@ long RegCreateKeyExA(long key, const char* name, long reserved, { int qw=45708; v=insert_reg_value(key, name, DIR, &qw, 4); - *status=REG_CREATED_NEW_KEY; + if (status) *status=REG_CREATED_NEW_KEY; // return 0; } else - *status=REG_OPENED_EXISTING_KEY; + { + if (status) *status=REG_OPENED_EXISTING_KEY; + } t=insert_handle(generate_handle(), fullname); *newkey=t->handle; diff --git a/src/libw32dll/wine/win32.c b/src/libw32dll/wine/win32.c index a1bf4768f..381833310 100644 --- a/src/libw32dll/wine/win32.c +++ b/src/libw32dll/wine/win32.c @@ -99,6 +99,7 @@ static void longcount(long long* z) } #endif +int LOADER_DEBUG=1; static void dbgprintf(char* fmt, ...) { #ifdef DETAILED_OUT @@ -108,14 +109,21 @@ static void dbgprintf(char* fmt, ...) vprintf(fmt, va); va_end(va); #else - va_list va; - FILE* f; - va_start(va, fmt); - f=fopen("./log", "a"); - if(f==0)return; - vfprintf(f, fmt, va); - fsync(f); - fclose(f); + if (LOADER_DEBUG) + { + FILE* f; + va_list va; + va_start(va, fmt); + vprintf(fmt, va); + f=fopen("./log", "a"); + if(f) + { + vfprintf(f, fmt, va); + fsync(fileno(f)); + fclose(f); + } + va_end(va); + } #endif #endif } @@ -445,7 +453,6 @@ void WINAPI expGetSystemInfo(SYSTEM_INFO* si) /* FIXME: better values for the two entries below... */ static int cache = 0; static SYSTEM_INFO cachedsi; - HKEY xhkey=0; dbgprintf("GetSystemInfo()\n"); if (cache) { @@ -503,7 +510,6 @@ void WINAPI expGetSystemInfo(SYSTEM_INFO* si) if (!f) return; - xhkey = 0; while (fgets(line,200,f)!=NULL) { char *s,*value; @@ -1150,6 +1156,27 @@ LPCSTR WINAPI expGetEnvironmentStrings() return "\0\0"; } +void * WINAPI expRtlZeroMemory(void *p, size_t len) +{ + void* result=memset(p,0,len); + dbgprintf("RtlZeroMemory(0x%x, len %d) => 0x%x\n",p,len,result); + return result; +} + +void * WINAPI expRtlMoveMemory(void *dst, void *src, size_t len) +{ + void* result=memmove(dst,src,len); + dbgprintf("RtlMoveMemory (dest 0x%x, src 0x%x, len %d) => 0x%x\n",dst,src,len,result); + return result; +} + +void * WINAPI expRtlFillMemory(void *p, int ch, size_t len) +{ + void* result=memset(p,ch,len); + dbgprintf("RtlFillMemory(0x%x, char 0x%x, len %d) => 0x%x\n",p,ch,len,result); + return result; +} + int WINAPI expGetStartupInfoA(STARTUPINFOA *s) { /* int i; */ @@ -1474,6 +1501,20 @@ int WINAPI expReleaseDC(int hwnd, int hdc) return 0; } +static int cursor[100]; + +int WINAPI expLoadCursorA(int handle,LPCSTR name) +{ + dbgprintf("LoadCursorA(%d, 0x%x='%s') => 0x%x\n", handle, name, (int)&cursor[0]); + return (int)&cursor[0]; +} + +int WINAPI expSetCursor(void *cursor) +{ + dbgprintf("SetCursor(0x%x) => 0x%x\n", cursor, cursor); + return (int)cursor; +} + int WINAPI expGetSystemPaletteEntries(int hdc, int iStartIndex, int nEntries, void* lppe) { return 0; @@ -1546,6 +1587,19 @@ int WINAPI expGetEnvironmentVariableA(const char* name, char* field, int size) } +int WINAPI expIsRectEmpty(CONST RECT *lprc) +{ + dbgprintf("IsRectEmpty(0x%x)"); + if((!lprc) || (lprc->right==lprc->left) || (lprc->top==lprc->bottom)) + { + dbgprintf(" => TRUE\n"); + return TRUE; + } + dbgprintf(" => FALSE\n"); + return FALSE; +} + + //HDRVR WINAPI expOpenDriverA(LPCSTR szDriverName, LPCSTR szSectionName, LPARAM lParam2); //HDRVR WINAPI expOpenDriverW(LPCWSTR szDriverName, LPCWSTR szSectionName, LPARAM lParam2); HDRVR WINAPI expOpenDriver(LPCSTR szDriverName, LPCSTR szSectionName, LPARAM lParam2){ @@ -1654,6 +1708,9 @@ FF(OutputDebugStringA, -1) FF(GetLocalTime, -1) FF(GetSystemTime, -1) FF(GetEnvironmentVariableA, -1) +FF(RtlZeroMemory,-1) +FF(RtlMoveMemory,-1) +FF(RtlFillMemory,-1) }; struct exports exp_msvcrt[]={ @@ -1677,6 +1734,9 @@ FF(wsprintfA, -1) FF(GetDC, -1) FF(GetDesktopWindow, -1) FF(ReleaseDC, -1) +FF(IsRectEmpty, -1) +FF(LoadCursorA,-1) +FF(SetCursor,-1) }; struct exports exp_advapi32[]={ FF(RegOpenKeyA, -1) |