vfl.c
上传用户:kjfoods
上传日期:2020-07-06
资源大小:29949k
文件大小:6k
源码类别:

midi

开发平台:

Unix_Linux

  1. /*
  2.  * $Id: cc3b866e22f58aa298a8645e29ddc5c3f7ead1cf $
  3.  *
  4.  * Copyright 1998 Marcus Meissner
  5.  *
  6.  * Modified for use with MPlayer, detailed CVS changelog at
  7.  * http://www.mplayerhq.hu/cgi-bin/cvsweb.cgi/main/
  8.  *
  9.  * File now distributed as part of VLC media player with no modifications.
  10.  *
  11.  * This program is free software; you can redistribute it and/or modify
  12.  * it under the terms of the GNU General Public License as published by
  13.  * the Free Software Foundation; either version 2 of the License, or
  14.  * (at your option) any later version.
  15.  *
  16.  * This program is distributed in the hope that it will be useful,
  17.  * but WITHOUT ANY WARRANTY; without even the implied warranty of
  18.  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  19.  * GNU General Public License for more details.
  20.  *
  21.  * You should have received a copy of the GNU General Public License
  22.  * along with this program; if not, write to the Free Software
  23.  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA.
  24.  */
  25. #include <config.h>
  26. #include <stdio.h>
  27. #include <stdlib.h>
  28. #include <string.h>
  29. #include "win32.h"
  30. #include "loader.h"
  31. #include "wine/winbase.h"
  32. #include "wine/windef.h"
  33. #include "wine/winuser.h"
  34. #include "wine/vfw.h"
  35. #include "wine/winestring.h"
  36. #include "wine/driver.h"
  37. #include "wine/avifmt.h"
  38. #include "driver.h"
  39. #define OpenDriverA DrvOpen
  40. #define CloseDriver DrvClose
  41. /***********************************************************************
  42.  * VideoForWindowsVersion [MSVFW.2][MSVIDEO.2]
  43.  * Returns the version in major.minor form.
  44.  * In Windows95 this returns 0x040003b6 (4.950)
  45.  */
  46. long VFWAPI VideoForWindowsVersion(void) {
  47. return 0x040003B6; /* 4.950 */
  48. }
  49. /* system.ini: [drivers] */
  50. /***********************************************************************
  51.  * ICInfo [MSVFW.33]
  52.  * Get information about an installable compressor. Return TRUE if there
  53.  * is one.
  54.  */
  55. int VFWAPI
  56. ICInfo(
  57. long fccType, /* [in] type of compressor ('vidc') */
  58. long fccHandler, /* [in] <n>th compressor */
  59. ICINFO *lpicinfo /* [out] information about compressor */
  60. ) {
  61. /* does OpenDriver/CloseDriver */
  62. lpicinfo->dwSize = sizeof(ICINFO);
  63. lpicinfo->fccType = fccType;
  64. lpicinfo->dwFlags = 0;
  65. return TRUE;
  66. }
  67. /***********************************************************************
  68.  * ICOpen [MSVFW.37]
  69.  * Opens an installable compressor. Return special handle.
  70.  */
  71. HIC VFWAPI
  72. //ICOpen(long fccType,long fccHandler,unsigned int wMode) {
  73. ICOpen(long filename,long fccHandler,unsigned int wMode) {
  74. ICOPEN icopen;
  75. HDRVR hdrv;
  76. WINE_HIC *whic;
  77. /* Well, lParam2 is in fact a LPVIDEO_OPEN_PARMS, but it has the 
  78.  * same layout as ICOPEN
  79.  */
  80. icopen.fccType = 0x63646976; // "vidc" //fccType;
  81. icopen.fccHandler = fccHandler;
  82. icopen.dwSize = sizeof(ICOPEN);
  83. icopen.dwFlags = wMode;
  84. icopen.pV1Reserved = (void*)filename;
  85. /* FIXME: do we need to fill out the rest too? */
  86. hdrv=OpenDriverA((long)&icopen);
  87. if (!hdrv) return 0;
  88. whic = (WINE_HIC*)malloc(sizeof(WINE_HIC));
  89. whic->hdrv = hdrv;
  90. whic->driverproc= ((DRVR*)hdrv)->DriverProc;
  91. // whic->private = ICSendMessage((HIC)whic,DRV_OPEN,0,(long)&icopen);
  92. whic->driverid = ((DRVR*)hdrv)->dwDriverID;
  93. return (HIC)whic;
  94. }
  95. /***********************************************************************
  96.  * ICGetInfo [MSVFW.30]
  97.  */
  98. LRESULT VFWAPI
  99. ICGetInfo(HIC hic,ICINFO *picinfo,long cb) {
  100. LRESULT ret;
  101. ret = ICSendMessage(hic,ICM_GETINFO,(long)picinfo,cb);
  102. return ret;
  103. }
  104. /***********************************************************************
  105.  * ICCompress [MSVFW.23]
  106.  */
  107. long VFWAPIV
  108. ICCompress(
  109. HIC hic,long dwFlags,LPBITMAPINFOHEADER lpbiOutput,void* lpData,
  110. LPBITMAPINFOHEADER lpbiInput,void* lpBits,long* lpckid,
  111. long* lpdwFlags,long lFrameNum,long dwFrameSize,long dwQuality,
  112. LPBITMAPINFOHEADER lpbiPrev,void* lpPrev
  113. ) {
  114. ICCOMPRESS iccmp;
  115. iccmp.dwFlags = dwFlags;
  116. iccmp.lpbiOutput = lpbiOutput;
  117. iccmp.lpOutput = lpData;
  118. iccmp.lpbiInput = lpbiInput;
  119. iccmp.lpInput = lpBits;
  120. iccmp.lpckid = lpckid;
  121. iccmp.lpdwFlags = lpdwFlags;
  122. iccmp.lFrameNum = lFrameNum;
  123. iccmp.dwFrameSize = dwFrameSize;
  124. iccmp.dwQuality = dwQuality;
  125. iccmp.lpbiPrev = lpbiPrev;
  126. iccmp.lpPrev = lpPrev;
  127. return ICSendMessage(hic,ICM_COMPRESS,(long)&iccmp,sizeof(iccmp));
  128. }
  129. /***********************************************************************
  130.  * ICDecompress [MSVFW.26]
  131.  */
  132. long VFWAPIV 
  133. ICDecompress(HIC hic,long dwFlags,LPBITMAPINFOHEADER lpbiFormat,void* lpData,LPBITMAPINFOHEADER  lpbi,void* lpBits) {
  134. ICDECOMPRESS icd;
  135. int result;
  136. icd.dwFlags = dwFlags;
  137. icd.lpbiInput = lpbiFormat;
  138. icd.lpInput = lpData;
  139. icd.lpbiOutput = lpbi;
  140. icd.lpOutput = lpBits;
  141. icd.ckid = 0;
  142. result=ICSendMessage(hic,ICM_DECOMPRESS,(long)&icd,sizeof(icd));
  143. return result;
  144. }
  145. /***********************************************************************
  146.  * ICDecompressEx [MSVFW.26]
  147.  */
  148. long VFWAPIV 
  149. ICDecompressEx(HIC hic,long dwFlags,LPBITMAPINFOHEADER lpbiFormat,void* lpData,LPBITMAPINFOHEADER  lpbi,void* lpBits) {
  150. ICDECOMPRESSEX icd;
  151. int result;
  152. icd.dwFlags = dwFlags;
  153. icd.lpbiSrc = lpbiFormat;
  154. icd.lpSrc = lpData;
  155. icd.lpbiDst = lpbi;
  156. icd.lpDst = lpBits;
  157. icd.xSrc=icd.ySrc=0;
  158. icd.dxSrc=lpbiFormat->biWidth;
  159. icd.dySrc=abs(lpbiFormat->biHeight);
  160. icd.xDst=icd.yDst=0;
  161. icd.dxDst=lpbi->biWidth;
  162. icd.dyDst=abs(lpbi->biHeight);
  163. //icd.ckid = 0;
  164. result=ICSendMessage(hic,ICM_DECOMPRESSEX,(long)&icd,sizeof(icd));
  165. return result;
  166. }
  167. long VFWAPIV 
  168. ICUniversalEx(HIC hic,int command,LPBITMAPINFOHEADER lpbiFormat,LPBITMAPINFOHEADER lpbi) {
  169. ICDECOMPRESSEX icd;
  170. int result;
  171. icd.dwFlags = 0;
  172. icd.lpbiSrc = lpbiFormat;
  173. icd.lpSrc = 0;
  174. icd.lpbiDst = lpbi;
  175. icd.lpDst = 0;
  176. icd.xSrc=icd.ySrc=0;
  177. icd.dxSrc=lpbiFormat->biWidth;
  178. icd.dySrc=abs(lpbiFormat->biHeight);
  179. icd.xDst=icd.yDst=0;
  180. icd.dxDst=lpbi->biWidth;
  181. icd.dyDst=abs(lpbi->biHeight);
  182. //icd.ckid = 0;
  183. result=ICSendMessage(hic,command,(long)&icd,sizeof(icd));
  184. return result;
  185. }
  186. /***********************************************************************
  187.  * ICSendMessage [MSVFW.40]
  188.  */
  189. LRESULT VFWAPI
  190. ICSendMessage(HIC hic,unsigned int msg,long lParam1,long lParam2) {
  191.     WINE_HIC *whic = (WINE_HIC*)hic;
  192.     return SendDriverMessage(whic->hdrv, msg, lParam1,lParam2);
  193. }
  194. /***********************************************************************
  195.  * ICClose [MSVFW.22]
  196.  */
  197. LRESULT VFWAPI ICClose(HIC hic) {
  198. WINE_HIC *whic = (WINE_HIC*)hic;
  199. /* FIXME: correct? */
  200. // CloseDriver(whic->hdrv,0,0);
  201.         DrvClose(whic->hdrv);
  202. //#warning FIXME: DrvClose
  203. free(whic);
  204. return 0;
  205. }
  206. int VFWAPI ICDoSomething()
  207. {
  208.   return 0;
  209. }