mirror of
https://github.com/mpv-player/mpv
synced 2024-12-24 15:52:25 +00:00
VfwEx support
git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@1298 b3059339-0415-0410-9bf9-f77b7e298cf2
This commit is contained in:
parent
4844ff55e5
commit
728e7eba4c
@ -210,6 +210,7 @@ static short get_driver(char *s,int audioflag)
|
||||
"odivx",
|
||||
"dshow",
|
||||
"ffmpeg",
|
||||
"vfwex",
|
||||
NULL
|
||||
};
|
||||
char **drv=audioflag?audiodrv:videodrv;
|
||||
|
23
dec_video.c
23
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 ) ,
|
||||
|
10
dll_init.c
10
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;
|
||||
|
60
loader/vfl.c
60
loader/vfl.c
@ -282,6 +282,66 @@ ICDecompress(HIC hic,long dwFlags,LPBITMAPINFOHEADER lpbiFormat,void* lpData,LPB
|
||||
return result;
|
||||
}
|
||||
|
||||
/***********************************************************************
|
||||
* 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]
|
||||
*/
|
||||
|
@ -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), \
|
||||
|
Loading…
Reference in New Issue
Block a user