# HG changeset patch # User arpi # Date 994612846 0 # Node ID 200c0367217804cc03eb1df0c0184da77a7a6d20 # Parent 32f5d26baf86f5fb6bd08af1db6745553aa7a60b VfwEx support diff -r 32f5d26baf86 -r 200c03672178 codec-cfg.c --- a/codec-cfg.c Sun Jul 08 13:11:01 2001 +0000 +++ b/codec-cfg.c Sun Jul 08 17:20:46 2001 +0000 @@ -210,6 +210,7 @@ "odivx", "dshow", "ffmpeg", + "vfwex", NULL }; char **drv=audioflag?audiodrv:videodrv; diff -r 32f5d26baf86 -r 200c03672178 dec_video.c --- a/dec_video.c Sun Jul 08 13:11:01 2001 +0000 +++ b/dec_video.c Sun Jul 08 17:20:46 2001 +0000 @@ -30,7 +30,7 @@ extern picture_t *picture; // exported from libmpeg2/decode.c -extern int init_video_codec(sh_video_t *sh_video); +extern int init_video_codec(sh_video_t *sh_video,int ex); #ifdef USE_DIRECTSHOW #include "loader/DirectShow/DS_VideoDec.h" @@ -77,7 +77,7 @@ switch(sh_video->codec->driver){ case 2: { - if(!init_video_codec(sh_video)) { + if(!init_video_codec(sh_video,0)) { // GUI_MSG( mplUnknowError ) // exit(1); return 0; @@ -85,6 +85,15 @@ if(verbose) printf("INFO: Win32 video codec init OK!\n"); break; } + case 6: { + if(!init_video_codec(sh_video,1)) { +// GUI_MSG( mplUnknowError ) +// exit(1); + return 0; + } + if(verbose) printf("INFO: Win32Ex video codec init OK!\n"); + break; + } case 4: { // Win32/DirectShow #ifndef USE_DIRECTSHOW fprintf(stderr,"MPlayer was compiled WITHOUT directshow support!\n"); @@ -309,6 +318,7 @@ break; } #endif + case 6: case 2: { HRESULT ret; unsigned int t=GetTimer(); @@ -320,6 +330,15 @@ // sh_video->bih->biWidth = 1280; // sh_video->o_bih.biWidth = 1280; // ret = ICDecompress(avi_header.hic, ICDECOMPRESS_NOTKEYFRAME|(ICDECOMPRESS_HURRYUP|ICDECOMPRESS_PREROL), + +if(sh_video->codec->driver==6) + ret = ICDecompressEx(sh_video->hic, + ( (sh_video->ds->flags&1) ? 0 : ICDECOMPRESS_NOTKEYFRAME ) | + ( (drop_frame==2 && !(sh_video->ds->flags&1))?(ICDECOMPRESS_HURRYUP|ICDECOMPRESS_PREROL):0 ) , + sh_video->bih, start, + &sh_video->o_bih, + drop_frame ? 0 : sh_video->our_out_buffer); +else ret = ICDecompress(sh_video->hic, ( (sh_video->ds->flags&1) ? 0 : ICDECOMPRESS_NOTKEYFRAME ) | ( (drop_frame==2 && !(sh_video->ds->flags&1))?(ICDECOMPRESS_HURRYUP|ICDECOMPRESS_PREROL):0 ) , diff -r 32f5d26baf86 -r 200c03672178 dll_init.c --- a/dll_init.c Sun Jul 08 13:11:01 2001 +0000 +++ b/dll_init.c Sun Jul 08 17:20:46 2001 +0000 @@ -145,7 +145,7 @@ -int init_video_codec(sh_video_t *sh_video){ +int init_video_codec(sh_video_t *sh_video,int ex){ HRESULT ret; int yuv=0; unsigned int outfmt=sh_video->codec->outfmt[sh_video->outfmtidx]; @@ -267,14 +267,18 @@ printf(" biSizeImage %ld\n", sh_video->o_bih.biSizeImage); } - ret = ICDecompressQuery(sh_video->hic, sh_video->bih, &sh_video->o_bih); + ret = ex ? + ICDecompressQueryEx(sh_video->hic, sh_video->bih, &sh_video->o_bih) : + ICDecompressQuery(sh_video->hic, sh_video->bih, &sh_video->o_bih); if(ret){ printf("ICDecompressQuery failed: Error %d\n", (int)ret); return 0; } if(verbose) printf("ICDecompressQuery OK\n"); - ret = ICDecompressBegin(sh_video->hic, sh_video->bih, &sh_video->o_bih); + ret = ex ? + ICDecompressBeginEx(sh_video->hic, sh_video->bih, &sh_video->o_bih) : + ICDecompressBegin(sh_video->hic, sh_video->bih, &sh_video->o_bih); if(ret){ printf("ICDecompressBegin failed: Error %d\n", (int)ret); return 0; diff -r 32f5d26baf86 -r 200c03672178 loader/vfl.c --- a/loader/vfl.c Sun Jul 08 13:11:01 2001 +0000 +++ b/loader/vfl.c Sun Jul 08 17:20:46 2001 +0000 @@ -283,6 +283,66 @@ } /*********************************************************************** + * ICDecompressEx [MSVFW.26] + */ +long VFWAPIV +ICDecompressEx(HIC hic,long dwFlags,LPBITMAPINFOHEADER lpbiFormat,void* lpData,LPBITMAPINFOHEADER lpbi,void* lpBits) { + ICDECOMPRESSEX icd; + int result; + + icd.dwFlags = dwFlags; + + icd.lpbiSrc = lpbiFormat; + icd.lpSrc = lpData; + + icd.lpbiDst = lpbi; + icd.lpDst = lpBits; + + icd.xSrc=icd.ySrc=0; + icd.dxSrc=lpbiFormat->biWidth; + icd.dySrc=abs(lpbiFormat->biHeight); + + icd.xDst=icd.yDst=0; + icd.dxDst=lpbi->biWidth; + icd.dyDst=abs(lpbi->biHeight); + + //icd.ckid = 0; + STORE_ALL; + result=ICSendMessage(hic,ICM_DECOMPRESSEX,(long)&icd,sizeof(icd)); + REST_ALL; + return result; +} + +long VFWAPIV +ICUniversalEx(HIC hic,int command,LPBITMAPINFOHEADER lpbiFormat,LPBITMAPINFOHEADER lpbi) { + ICDECOMPRESSEX icd; + int result; + + icd.dwFlags = 0; + + icd.lpbiSrc = lpbiFormat; + icd.lpSrc = 0; + + icd.lpbiDst = lpbi; + icd.lpDst = 0; + + icd.xSrc=icd.ySrc=0; + icd.dxSrc=lpbiFormat->biWidth; + icd.dySrc=abs(lpbiFormat->biHeight); + + icd.xDst=icd.yDst=0; + icd.dxDst=lpbi->biWidth; + icd.dyDst=abs(lpbi->biHeight); + + //icd.ckid = 0; + STORE_ALL; + result=ICSendMessage(hic,command,(long)&icd,sizeof(icd)); + REST_ALL; + return result; +} + + +/*********************************************************************** * ICSendMessage [MSVFW.40] */ LRESULT VFWAPI diff -r 32f5d26baf86 -r 200c03672178 loader/wine/vfw.h --- a/loader/wine/vfw.h Sun Jul 08 13:11:01 2001 +0000 +++ b/loader/wine/vfw.h Sun Jul 08 17:20:46 2001 +0000 @@ -377,6 +377,7 @@ long VFWAPIV ICDecompress(HIC hic,long dwFlags,LPBITMAPINFOHEADER lpbiFormat,void* lpData,LPBITMAPINFOHEADER lpbi,void* lpBits); +long VFWAPIV ICDecompressEx(HIC hic,long dwFlags,LPBITMAPINFOHEADER lpbiFormat,void* lpData,LPBITMAPINFOHEADER lpbi,void* lpBits); #define ICDecompressBegin(hic, lpbiInput, lpbiOutput) \ @@ -385,12 +386,24 @@ (long)(void*)(lpbiOutput) \ ) +#define ICDecompressBeginEx(hic, lpbiInput, lpbiOutput) \ + ICUniversalEx( \ + hic, ICM_DECOMPRESSEX_BEGIN, (long)(void*)(lpbiInput), \ + (long)(void*)(lpbiOutput) \ + ) + #define ICDecompressQuery(hic, lpbiInput, lpbiOutput) \ ICSendMessage( \ hic,ICM_DECOMPRESS_QUERY, (long)(void*)(lpbiInput), \ (long) (void*)(lpbiOutput) \ ) +#define ICDecompressQueryEx(hic, lpbiInput, lpbiOutput) \ + ICUniversalEx( \ + hic,ICM_DECOMPRESSEX_QUERY, (long)(void*)(lpbiInput), \ + (long) (void*)(lpbiOutput) \ + ) + #define ICDecompressGetFormat(hic, lpbiInput, lpbiOutput) \ ((long)ICSendMessage( \ hic,ICM_DECOMPRESS_GET_FORMAT, (long)(void*)(lpbiInput), \