summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/demuxers/demux_avi.c32
-rw-r--r--src/libffmpeg/xine_decoder.c11
-rw-r--r--src/libw32dll/w32codec.c50
-rw-r--r--src/libw32dll/wine/registry.c6
-rw-r--r--src/libw32dll/wine/win32.c80
-rw-r--r--src/xine-engine/buffer.h69
6 files changed, 176 insertions, 72 deletions
diff --git a/src/demuxers/demux_avi.c b/src/demuxers/demux_avi.c
index d9409dbb9..b48a0653f 100644
--- a/src/demuxers/demux_avi.c
+++ b/src/demuxers/demux_avi.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: demux_avi.c,v 1.41 2001/09/12 16:55:42 guenter Exp $
+ * $Id: demux_avi.c,v 1.42 2001/09/18 17:41:47 jkeil Exp $
*
* demultiplexer for avi streams
*
@@ -985,21 +985,33 @@ static void demux_avi_start (demux_plugin_t *this_gen,
buf->size = sizeof (this->avi->bih);
switch (str2ulong((void*)&this->avi->bih.biCompression)) {
- case mmioFOURCC('M', 'P', 'G', '4'):
- case mmioFOURCC('m', 'p', 'g', '4'):
- case mmioFOURCC('M', 'P', '4', '1'):
- case mmioFOURCC('m', 'p', '4', '1'):
- 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('D', 'I', 'V', '3'):
case mmioFOURCC('d', 'i', 'v', '3'):
case mmioFOURCC('D', 'I', 'V', '4'):
case mmioFOURCC('d', 'i', 'v', '4'):
- /* Video in Microsoft MPEG-4 format */
- this->avi->video_type = BUF_VIDEO_MSMPEG4;
+ case mmioFOURCC('D', 'I', 'V', '5'):
+ case mmioFOURCC('d', 'i', 'v', '5'):
+ case mmioFOURCC('D', 'I', 'V', '6'):
+ case mmioFOURCC('d', 'i', 'v', '6'):
+ /* Video in Microsoft MPEG-4 format v3 */
+ this->avi->video_type = BUF_VIDEO_MSMPEG4_V3;
+ break;
+
+ case mmioFOURCC('M', 'P', 'G', '4'):
+ case mmioFOURCC('m', 'p', 'g', '4'):
+ case mmioFOURCC('M', 'P', '4', '1'):
+ case mmioFOURCC('m', 'p', '4', '1'):
+ case mmioFOURCC('M', 'P', '4', '2'):
+ case mmioFOURCC('m', 'p', '4', '2'):
+ case mmioFOURCC('D', 'I', 'V', '2'):
+ case mmioFOURCC('d', 'i', 'v', '2'):
+ /* Video in Microsoft MPEG-4 format v1/v2 */
+ this->avi->video_type = BUF_VIDEO_MSMPEG4_V12;
break;
+
case mmioFOURCC('D', 'I', 'V', 'X'):
case mmioFOURCC('d', 'i', 'v', 'x'):
case mmioFOURCC('D', 'i', 'v', 'x'):
@@ -1007,11 +1019,13 @@ static void demux_avi_start (demux_plugin_t *this_gen,
/* Video in mpeg4 (opendivx) format */
this->avi->video_type = BUF_VIDEO_MPEG4;
break;
+
case mmioFOURCC('d', 'm', 'b', '1'):
case mmioFOURCC('M', 'J', 'P', 'G'):
/* Video in motion jpeg format */
this->avi->video_type = BUF_VIDEO_MJPEG;
break;
+
case mmioFOURCC('I', 'V', '5', '0'):
case mmioFOURCC('i', 'v', '5', '0'):
/* Video in Indeo Video 5.0 format */
diff --git a/src/libffmpeg/xine_decoder.c b/src/libffmpeg/xine_decoder.c
index 6c87f1a54..c67469e09 100644
--- a/src/libffmpeg/xine_decoder.c
+++ b/src/libffmpeg/xine_decoder.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: xine_decoder.c,v 1.12 2001/09/18 11:38:23 jkeil Exp $
+ * $Id: xine_decoder.c,v 1.13 2001/09/18 17:41:47 jkeil Exp $
*
* xine decoder plugin using ffmpeg
*
@@ -100,9 +100,11 @@ static unsigned short str2ushort(void *data)
static int ff_can_handle (video_decoder_t *this_gen, int buf_type) {
buf_type &= 0xFFFF0000;
- return ( buf_type == BUF_VIDEO_MSMPEG4 ||
- buf_type == BUF_VIDEO_MJPEG ||
+ /* ffmpeg currently does not support MSMPEG4 v1/v2 */
+ return ( buf_type == BUF_VIDEO_MSMPEG4_V3 ||
+ /* buf_type == BUF_VIDEO_MSMPEG4_V12 || */
buf_type == BUF_VIDEO_MPEG4 ||
+ buf_type == BUF_VIDEO_MJPEG ||
buf_type == BUF_VIDEO_I263 ||
buf_type == BUF_VIDEO_RV10 ||
buf_type == BUF_VIDEO_JPEG);
@@ -152,7 +154,8 @@ static void ff_decode_data (video_decoder_t *this_gen, buf_element_t *buf) {
*/
switch (buf->type & 0xFFFF0000) {
- case BUF_VIDEO_MSMPEG4:
+ case BUF_VIDEO_MSMPEG4_V12:
+ case BUF_VIDEO_MSMPEG4_V3:
codec = avcodec_find_decoder (CODEC_ID_MSMPEG4);
break;
case BUF_VIDEO_MPEG4 :
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)
diff --git a/src/xine-engine/buffer.h b/src/xine-engine/buffer.h
index d8cd73690..abed6122d 100644
--- a/src/xine-engine/buffer.h
+++ b/src/xine-engine/buffer.h
@@ -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.h,v 1.13 2001/09/12 22:18:47 guenter Exp $
+ * $Id: buffer.h,v 1.14 2001/09/18 17:41:48 jkeil Exp $
*
*
* contents:
@@ -71,48 +71,49 @@ extern "C" {
/* video buffer types: */
-#define BUF_VIDEO_BASE 0x02000000
-#define BUF_VIDEO_MPEG 0x02000000
-#define BUF_VIDEO_MPEG4 0x02010000
-#define BUF_VIDEO_CINEPAK 0x02020000
-#define BUF_VIDEO_SORENSON 0x02030000
-#define BUF_VIDEO_MSMPEG4 0x02040000
-#define BUF_VIDEO_MJPEG 0x02050000
-#define BUF_VIDEO_IV50 0x02060000
-#define BUF_VIDEO_IV41 0x02070000
-#define BUF_VIDEO_IV32 0x02080000
-#define BUF_VIDEO_IV31 0x02090000
-#define BUF_VIDEO_ATIVCR1 0x020a0000
-#define BUF_VIDEO_ATIVCR2 0x020b0000
-#define BUF_VIDEO_I263 0x020c0000
-#define BUF_VIDEO_RV10 0x020d0000
-#define BUF_VIDEO_FILL 0x020e0000
-#define BUF_VIDEO_RGB 0x020f0000
-#define BUF_VIDEO_YUY2 0x02100000
-#define BUF_VIDEO_JPEG 0x02110000
+#define BUF_VIDEO_BASE 0x02000000
+#define BUF_VIDEO_MPEG 0x02000000
+#define BUF_VIDEO_MPEG4 0x02010000
+#define BUF_VIDEO_CINEPAK 0x02020000
+#define BUF_VIDEO_SORENSON 0x02030000
+#define BUF_VIDEO_MSMPEG4_V12 0x02040000
+#define BUF_VIDEO_MSMPEG4_V3 0x02050000
+#define BUF_VIDEO_MJPEG 0x02060000
+#define BUF_VIDEO_IV50 0x02070000
+#define BUF_VIDEO_IV41 0x02080000
+#define BUF_VIDEO_IV32 0x02090000
+#define BUF_VIDEO_IV31 0x020a0000
+#define BUF_VIDEO_ATIVCR1 0x020b0000
+#define BUF_VIDEO_ATIVCR2 0x020c0000
+#define BUF_VIDEO_I263 0x020d0000
+#define BUF_VIDEO_RV10 0x020e0000
+#define BUF_VIDEO_FILL 0x020f0000
+#define BUF_VIDEO_RGB 0x02100000
+#define BUF_VIDEO_YUY2 0x02110000
+#define BUF_VIDEO_JPEG 0x02120000
/* audio buffer types: */
-#define BUF_AUDIO_BASE 0x03000000
-#define BUF_AUDIO_A52 0x03000000
-#define BUF_AUDIO_MPEG 0x03010000
-#define BUF_AUDIO_LPCM_BE 0x03020000
-#define BUF_AUDIO_LPCM_LE 0x03030000
-#define BUF_AUDIO_DIVXA 0x03040000
-#define BUF_AUDIO_DTS 0x03050000
-#define BUF_AUDIO_MSADPCM 0x03060000
-#define BUF_AUDIO_IMAADPCM 0x03070000
-#define BUF_AUDIO_MSGSM 0x03080000
+#define BUF_AUDIO_BASE 0x03000000
+#define BUF_AUDIO_A52 0x03000000
+#define BUF_AUDIO_MPEG 0x03010000
+#define BUF_AUDIO_LPCM_BE 0x03020000
+#define BUF_AUDIO_LPCM_LE 0x03030000
+#define BUF_AUDIO_DIVXA 0x03040000
+#define BUF_AUDIO_DTS 0x03050000
+#define BUF_AUDIO_MSADPCM 0x03060000
+#define BUF_AUDIO_IMAADPCM 0x03070000
+#define BUF_AUDIO_MSGSM 0x03080000
/* spu buffer types: */
-#define BUF_SPU_BASE 0x04000000
-#define BUF_SPU_CLUT 0x04000000
-#define BUF_SPU_PACKAGE 0x04010000
+#define BUF_SPU_BASE 0x04000000
+#define BUF_SPU_CLUT 0x04000000
+#define BUF_SPU_PACKAGE 0x04010000
/* demuxer block types: */
-#define BUF_DEMUX_BLOCK 0x05000000
+#define BUF_DEMUX_BLOCK 0x05000000
typedef struct buf_element_s buf_element_t;
struct buf_element_s {