summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorarpi <arpi@b3059339-0415-0410-9bf9-f77b7e298cf2>2001-07-08 17:20:46 +0000
committerarpi <arpi@b3059339-0415-0410-9bf9-f77b7e298cf2>2001-07-08 17:20:46 +0000
commit728e7eba4cebb564e8d9fd98d94748e21b89c0b7 (patch)
tree20ce683189e6198ae35d82a8318c6a4461733109
parent4844ff55e50fdd1689be0783ed0ae803590efcbc (diff)
downloadmpv-728e7eba4cebb564e8d9fd98d94748e21b89c0b7.tar.bz2
mpv-728e7eba4cebb564e8d9fd98d94748e21b89c0b7.tar.xz
VfwEx support
git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@1298 b3059339-0415-0410-9bf9-f77b7e298cf2
-rw-r--r--codec-cfg.c1
-rw-r--r--dec_video.c23
-rw-r--r--dll_init.c10
-rw-r--r--loader/vfl.c60
-rw-r--r--loader/wine/vfw.h13
5 files changed, 102 insertions, 5 deletions
diff --git a/codec-cfg.c b/codec-cfg.c
index f2b5263d06..9da6fedea7 100644
--- a/codec-cfg.c
+++ b/codec-cfg.c
@@ -210,6 +210,7 @@ static short get_driver(char *s,int audioflag)
"odivx",
"dshow",
"ffmpeg",
+ "vfwex",
NULL
};
char **drv=audioflag?audiodrv:videodrv;
diff --git a/dec_video.c b/dec_video.c
index 41965bad1d..5080f948f9 100644
--- a/dec_video.c
+++ b/dec_video.c
@@ -30,7 +30,7 @@ extern double vout_time_usage;
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 @@ unsigned int out_fmt=sh_video->codec->outfmt[sh_video->outfmtidx];
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 @@ switch(sh_video->codec->driver){
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 @@ switch(sh_video->codec->driver){
break;
}
#endif
+ case 6:
case 2: {
HRESULT ret;
unsigned int t=GetTimer();
@@ -320,6 +330,15 @@ switch(sh_video->codec->driver){
// 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 --git a/dll_init.c b/dll_init.c
index 0941450639..9d8bb8e8df 100644
--- a/dll_init.c
+++ b/dll_init.c
@@ -145,7 +145,7 @@ int acm_decode_audio(sh_audio_t *sh_audio, void* a_buffer,int minlen,int maxlen)
-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 @@ int init_video_codec(sh_video_t *sh_video){
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 --git a/loader/vfl.c b/loader/vfl.c
index 6af2d42bc1..a16986aa33 100644
--- a/loader/vfl.c
+++ b/loader/vfl.c
@@ -283,6 +283,66 @@ ICDecompress(HIC hic,long dwFlags,LPBITMAPINFOHEADER lpbiFormat,void* lpData,LPB
}
/***********************************************************************
+ * 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 --git a/loader/wine/vfw.h b/loader/wine/vfw.h
index e60f83c502..a72da79c89 100644
--- a/loader/wine/vfw.h
+++ b/loader/wine/vfw.h
@@ -377,6 +377,7 @@ typedef struct {
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 VFWAPIV ICDecompress(HIC hic,long dwFlags,LPBITMAPINFOHEADER lpbiFormat,voi
(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), \