Main Page | Modules | Class Hierarchy | Class List | Directories | File List | Class Members | File Members | Related Pages

vfl.c

00001 /*
00002  * Copyright 1998 Marcus Meissner
00003  *
00004  * Modified for use with MPlayer, detailed CVS changelog at
00005  * http://www.mplayerhq.hu/cgi-bin/cvsweb.cgi/main/
00006  * $Id: vfl.c 11593 2005-06-28 18:02:01Z courmisch $
00007  *
00008  */
00009 #include <config.h>
00010 
00011 #include <stdio.h>
00012 #include <stdlib.h>
00013 #include <string.h>
00014 
00015 #include "win32.h"
00016 #include "loader.h"
00017 
00018 #include "wine/winbase.h"
00019 #include "wine/windef.h"
00020 #include "wine/winuser.h"
00021 #include "wine/vfw.h"
00022 #include "wine/winestring.h"
00023 #include "wine/driver.h"
00024 #include "wine/avifmt.h"
00025 #include "driver.h"
00026 
00027 #define OpenDriverA DrvOpen
00028 #define CloseDriver DrvClose
00029 
00030 /***********************************************************************
00031  *              VideoForWindowsVersion          [MSVFW.2][MSVIDEO.2]
00032  * Returns the version in major.minor form.
00033  * In Windows95 this returns 0x040003b6 (4.950)
00034  */
00035 long VFWAPI VideoForWindowsVersion(void) {
00036         return 0x040003B6; /* 4.950 */
00037 }
00038 
00039 /* system.ini: [drivers] */
00040 
00041 /***********************************************************************
00042  *              ICInfo                          [MSVFW.33]
00043  * Get information about an installable compressor. Return TRUE if there
00044  * is one.
00045  */
00046 int VFWAPI
00047 ICInfo(
00048         long fccType,           /* [in] type of compressor ('vidc') */
00049         long fccHandler,        /* [in] <n>th compressor */
00050         ICINFO *lpicinfo        /* [out] information about compressor */
00051 ) {
00052         /* does OpenDriver/CloseDriver */
00053         lpicinfo->dwSize = sizeof(ICINFO);
00054         lpicinfo->fccType = fccType;
00055         lpicinfo->dwFlags = 0;
00056         return TRUE;
00057 }
00058 
00059 /***********************************************************************
00060  *              ICOpen                          [MSVFW.37]
00061  * Opens an installable compressor. Return special handle.
00062  */
00063 HIC VFWAPI
00064 //ICOpen(long fccType,long fccHandler,unsigned int wMode) {
00065 ICOpen(long filename,long fccHandler,unsigned int wMode) {
00066         ICOPEN          icopen;
00067         HDRVR           hdrv;
00068         WINE_HIC        *whic;
00069 
00070         /* Well, lParam2 is in fact a LPVIDEO_OPEN_PARMS, but it has the 
00071          * same layout as ICOPEN
00072          */
00073         icopen.fccType          = 0x63646976; // "vidc" //fccType;
00074         icopen.fccHandler       = fccHandler;
00075         icopen.dwSize           = sizeof(ICOPEN);
00076         icopen.dwFlags          = wMode;
00077         icopen.pV1Reserved      = (void*)filename;
00078         /* FIXME: do we need to fill out the rest too? */
00079         hdrv=OpenDriverA((long)&icopen);
00080         if (!hdrv) return 0;
00081         whic = (WINE_HIC*)malloc(sizeof(WINE_HIC));
00082         whic->hdrv      = hdrv;
00083         whic->driverproc= ((DRVR*)hdrv)->DriverProc;
00084 //      whic->private   = ICSendMessage((HIC)whic,DRV_OPEN,0,(long)&icopen);
00085         whic->driverid  = ((DRVR*)hdrv)->dwDriverID;
00086         return (HIC)whic;
00087 }
00088 
00089 /***********************************************************************
00090  *              ICGetInfo                       [MSVFW.30]
00091  */
00092 LRESULT VFWAPI
00093 ICGetInfo(HIC hic,ICINFO *picinfo,long cb) {
00094         LRESULT         ret;
00095 
00096         ret = ICSendMessage(hic,ICM_GETINFO,(long)picinfo,cb);
00097         
00098         return ret;
00099 }
00100 
00101 /***********************************************************************
00102  *              ICCompress                      [MSVFW.23]
00103  */
00104 long VFWAPIV
00105 ICCompress(
00106         HIC hic,long dwFlags,LPBITMAPINFOHEADER lpbiOutput,void* lpData,
00107         LPBITMAPINFOHEADER lpbiInput,void* lpBits,long* lpckid,
00108         long* lpdwFlags,long lFrameNum,long dwFrameSize,long dwQuality,
00109         LPBITMAPINFOHEADER lpbiPrev,void* lpPrev
00110 ) {
00111         ICCOMPRESS      iccmp;
00112 
00113         iccmp.dwFlags           = dwFlags;
00114 
00115         iccmp.lpbiOutput        = lpbiOutput;
00116         iccmp.lpOutput          = lpData;
00117         iccmp.lpbiInput         = lpbiInput;
00118         iccmp.lpInput           = lpBits;
00119 
00120         iccmp.lpckid            = lpckid;
00121         iccmp.lpdwFlags         = lpdwFlags;
00122         iccmp.lFrameNum         = lFrameNum;
00123         iccmp.dwFrameSize       = dwFrameSize;
00124         iccmp.dwQuality         = dwQuality;
00125         iccmp.lpbiPrev          = lpbiPrev;
00126         iccmp.lpPrev            = lpPrev;
00127         return ICSendMessage(hic,ICM_COMPRESS,(long)&iccmp,sizeof(iccmp));
00128 }
00129 
00130 /***********************************************************************
00131  *              ICDecompress                    [MSVFW.26]
00132  */
00133 long VFWAPIV 
00134 ICDecompress(HIC hic,long dwFlags,LPBITMAPINFOHEADER lpbiFormat,void* lpData,LPBITMAPINFOHEADER  lpbi,void* lpBits) {
00135         ICDECOMPRESS    icd;
00136         int result;
00137         icd.dwFlags     = dwFlags;
00138         icd.lpbiInput   = lpbiFormat;
00139         icd.lpInput     = lpData;
00140 
00141         icd.lpbiOutput  = lpbi;
00142         icd.lpOutput    = lpBits;
00143         icd.ckid        = 0;
00144         result=ICSendMessage(hic,ICM_DECOMPRESS,(long)&icd,sizeof(icd));
00145         return result;
00146 }
00147 
00148 /***********************************************************************
00149  *              ICDecompressEx                  [MSVFW.26]
00150  */
00151 long VFWAPIV 
00152 ICDecompressEx(HIC hic,long dwFlags,LPBITMAPINFOHEADER lpbiFormat,void* lpData,LPBITMAPINFOHEADER  lpbi,void* lpBits) {
00153         ICDECOMPRESSEX  icd;
00154         int result;
00155         
00156         icd.dwFlags     = dwFlags;
00157 
00158         icd.lpbiSrc     = lpbiFormat;
00159         icd.lpSrc       = lpData;
00160 
00161         icd.lpbiDst     = lpbi;
00162         icd.lpDst       = lpBits;
00163         
00164         icd.xSrc=icd.ySrc=0;
00165         icd.dxSrc=lpbiFormat->biWidth;
00166         icd.dySrc=abs(lpbiFormat->biHeight);
00167 
00168         icd.xDst=icd.yDst=0;
00169         icd.dxDst=lpbi->biWidth;
00170         icd.dyDst=abs(lpbi->biHeight);
00171         
00172         //icd.ckid      = 0;
00173         result=ICSendMessage(hic,ICM_DECOMPRESSEX,(long)&icd,sizeof(icd));
00174         return result;
00175 }
00176 
00177 long VFWAPIV 
00178 ICUniversalEx(HIC hic,int command,LPBITMAPINFOHEADER lpbiFormat,LPBITMAPINFOHEADER lpbi) {
00179         ICDECOMPRESSEX  icd;
00180         int result;
00181         
00182         icd.dwFlags     = 0;
00183 
00184         icd.lpbiSrc     = lpbiFormat;
00185         icd.lpSrc       = 0;
00186 
00187         icd.lpbiDst     = lpbi;
00188         icd.lpDst       = 0;
00189         
00190         icd.xSrc=icd.ySrc=0;
00191         icd.dxSrc=lpbiFormat->biWidth;
00192         icd.dySrc=abs(lpbiFormat->biHeight);
00193 
00194         icd.xDst=icd.yDst=0;
00195         icd.dxDst=lpbi->biWidth;
00196         icd.dyDst=abs(lpbi->biHeight);
00197         
00198         //icd.ckid      = 0;
00199         result=ICSendMessage(hic,command,(long)&icd,sizeof(icd));
00200         return result;
00201 }
00202 
00203 
00204 /***********************************************************************
00205  *              ICSendMessage                   [MSVFW.40]
00206  */
00207 LRESULT VFWAPI
00208 ICSendMessage(HIC hic,unsigned int msg,long lParam1,long lParam2) {
00209     WINE_HIC    *whic = (WINE_HIC*)hic;
00210     return SendDriverMessage(whic->hdrv, msg, lParam1,lParam2);
00211 }
00212 
00213 
00214 /***********************************************************************
00215  *              ICClose                 [MSVFW.22]
00216  */
00217 LRESULT VFWAPI ICClose(HIC hic) {
00218         WINE_HIC        *whic = (WINE_HIC*)hic;
00219         /* FIXME: correct? */
00220 //      CloseDriver(whic->hdrv,0,0);
00221         DrvClose(whic->hdrv);
00222 //#warning FIXME: DrvClose
00223         free(whic);
00224         return 0;
00225 }
00226 
00227 int VFWAPI ICDoSomething()
00228 {
00229   return 0;
00230 }
00231 

Generated on Tue Dec 20 10:14:21 2005 for vlc-0.8.4a by  doxygen 1.4.2