| 1 | #ifndef __WINE_VFW_H | 
|---|
| 2 | #define __WINE_VFW_H | 
|---|
| 3 |  | 
|---|
| 4 | #include "windef.h" | 
|---|
| 5 | #include "mmsystem.h" | 
|---|
| 6 | #include "wingdi.h" | 
|---|
| 7 | #include "unknwn.h" | 
|---|
| 8 |  | 
|---|
| 9 | #ifndef __cplusplus | 
|---|
| 10 | #ifndef inline | 
|---|
| 11 | #define inline | 
|---|
| 12 | #endif | 
|---|
| 13 | #endif | 
|---|
| 14 |  | 
|---|
| 15 | #define VFWAPI  WINAPI | 
|---|
| 16 | #define VFWAPIV WINAPIV | 
|---|
| 17 |  | 
|---|
| 18 | #ifdef __cplusplus | 
|---|
| 19 | extern "C" { | 
|---|
| 20 | #endif  /* __cplusplus */ | 
|---|
| 21 |  | 
|---|
| 22 | typedef HANDLE HDRAWDIB; | 
|---|
| 23 |  | 
|---|
| 24 | HWND        VFWAPIV MCIWndCreateA(HWND hwndParent, HINSTANCE hInstance, DWORD dwStyle, LPCSTR szFile); | 
|---|
| 25 | HWND        VFWAPIV MCIWndCreateW(HWND hwndParent, HINSTANCE hInstance, DWORD dwStyle, LPCWSTR szFile); | 
|---|
| 26 | #define     MCIWndCreate WINELIB_NAME_AW(MCIWndCreate) | 
|---|
| 27 | DWORD       VFWAPI  VideoForWindowsVersion(void); | 
|---|
| 28 | LONG        VFWAPI  InitVFW(void); | 
|---|
| 29 | LONG        VFWAPI  TermVFW(void); | 
|---|
| 30 |  | 
|---|
| 31 | #ifndef mmioFOURCC | 
|---|
| 32 | #define mmioFOURCC( ch0, ch1, ch2, ch3 )                                \ | 
|---|
| 33 | ( (DWORD)(BYTE)(ch0) | ( (DWORD)(BYTE)(ch1) << 8 ) |            \ | 
|---|
| 34 | ( (DWORD)(BYTE)(ch2) << 16 ) | ( (DWORD)(BYTE)(ch3) << 24 ) ) | 
|---|
| 35 | #endif | 
|---|
| 36 |  | 
|---|
| 37 | #ifndef aviTWOCC | 
|---|
| 38 | #define aviTWOCC(ch0, ch1) ((WORD)(BYTE)(ch0) | ((WORD)(BYTE)(ch1) << 8)) | 
|---|
| 39 | #endif | 
|---|
| 40 |  | 
|---|
| 41 | #define ICTYPE_VIDEO    mmioFOURCC('v', 'i', 'd', 'c') | 
|---|
| 42 | #define ICTYPE_AUDIO    mmioFOURCC('a', 'u', 'd', 'c') | 
|---|
| 43 |  | 
|---|
| 44 | /***************************************************************************** | 
|---|
| 45 | * Predeclare the interfaces | 
|---|
| 46 | */ | 
|---|
| 47 | typedef struct IAVIStream IAVIStream,*PAVISTREAM; | 
|---|
| 48 | typedef struct IAVIFile IAVIFile,*PAVIFILE; | 
|---|
| 49 | typedef struct IGetFrame IGetFrame,*PGETFRAME; | 
|---|
| 50 |  | 
|---|
| 51 | /* Installable Compressor Manager */ | 
|---|
| 52 |  | 
|---|
| 53 | DECLARE_HANDLE(HIC); | 
|---|
| 54 |  | 
|---|
| 55 | #ifdef __WINE__ | 
|---|
| 56 | /* HIC struct (same layout as Win95 one) */ | 
|---|
| 57 | typedef struct tagWINE_HIC { | 
|---|
| 58 | DWORD           magic;          /* 00: 'Smag' */ | 
|---|
| 59 | HANDLE          curthread;      /* 04: */ | 
|---|
| 60 | DWORD           type;           /* 08: */ | 
|---|
| 61 | DWORD           handler;        /* 0C: */ | 
|---|
| 62 | HDRVR           hdrv;           /* 10: */ | 
|---|
| 63 | #ifdef __WIN32OS2__ | 
|---|
| 64 | DWORD           privatevfw;     /* 14:(handled by SendDriverMessage)*/ | 
|---|
| 65 | #else | 
|---|
| 66 | DWORD           private;        /* 14:(handled by SendDriverMessage)*/ | 
|---|
| 67 | #endif | 
|---|
| 68 | FARPROC         driverproc;     /* 18:(handled by SendDriverMessage)*/ | 
|---|
| 69 | DWORD           x1;             /* 1c: name? */ | 
|---|
| 70 | WORD            x2;             /* 20: */ | 
|---|
| 71 | DWORD           x3;             /* 22: */ | 
|---|
| 72 | /* 26: */ | 
|---|
| 73 | } WINE_HIC; | 
|---|
| 74 | #endif | 
|---|
| 75 |  | 
|---|
| 76 | /* error return codes */ | 
|---|
| 77 | #define ICERR_OK                0 | 
|---|
| 78 | #define ICERR_DONTDRAW          1 | 
|---|
| 79 | #define ICERR_NEWPALETTE        2 | 
|---|
| 80 | #define ICERR_GOTOKEYFRAME      3 | 
|---|
| 81 | #define ICERR_STOPDRAWING       4 | 
|---|
| 82 |  | 
|---|
| 83 | #define ICERR_UNSUPPORTED       -1 | 
|---|
| 84 | #define ICERR_BADFORMAT         -2 | 
|---|
| 85 | #define ICERR_MEMORY            -3 | 
|---|
| 86 | #define ICERR_INTERNAL          -4 | 
|---|
| 87 | #define ICERR_BADFLAGS          -5 | 
|---|
| 88 | #define ICERR_BADPARAM          -6 | 
|---|
| 89 | #define ICERR_BADSIZE           -7 | 
|---|
| 90 | #define ICERR_BADHANDLE         -8 | 
|---|
| 91 | #define ICERR_CANTUPDATE        -9 | 
|---|
| 92 | #define ICERR_ABORT             -10 | 
|---|
| 93 | #define ICERR_ERROR             -100 | 
|---|
| 94 | #define ICERR_BADBITDEPTH       -200 | 
|---|
| 95 | #define ICERR_BADIMAGESIZE      -201 | 
|---|
| 96 |  | 
|---|
| 97 | #define ICERR_CUSTOM            -400 | 
|---|
| 98 |  | 
|---|
| 99 | /* ICM Messages */ | 
|---|
| 100 | #define ICM_USER                (DRV_USER+0x0000) | 
|---|
| 101 |  | 
|---|
| 102 | /* ICM driver message range */ | 
|---|
| 103 | #define ICM_RESERVED_LOW        (DRV_USER+0x1000) | 
|---|
| 104 | #define ICM_RESERVED_HIGH       (DRV_USER+0x2000) | 
|---|
| 105 | #define ICM_RESERVED            ICM_RESERVED_LOW | 
|---|
| 106 |  | 
|---|
| 107 | #define ICM_GETSTATE            (ICM_RESERVED+0) | 
|---|
| 108 | #define ICM_SETSTATE            (ICM_RESERVED+1) | 
|---|
| 109 | #define ICM_GETINFO             (ICM_RESERVED+2) | 
|---|
| 110 |  | 
|---|
| 111 | #define ICM_CONFIGURE           (ICM_RESERVED+10) | 
|---|
| 112 | #define ICM_ABOUT               (ICM_RESERVED+11) | 
|---|
| 113 | /* */ | 
|---|
| 114 |  | 
|---|
| 115 | #define ICM_GETDEFAULTQUALITY   (ICM_RESERVED+30) | 
|---|
| 116 | #define ICM_GETQUALITY          (ICM_RESERVED+31) | 
|---|
| 117 | #define ICM_SETQUALITY          (ICM_RESERVED+32) | 
|---|
| 118 |  | 
|---|
| 119 | #define ICM_SET                 (ICM_RESERVED+40) | 
|---|
| 120 | #define ICM_GET                 (ICM_RESERVED+41) | 
|---|
| 121 |  | 
|---|
| 122 | /* 2 constant FOURCC codes */ | 
|---|
| 123 | #define ICM_FRAMERATE           mmioFOURCC('F','r','m','R') | 
|---|
| 124 | #define ICM_KEYFRAMERATE        mmioFOURCC('K','e','y','R') | 
|---|
| 125 |  | 
|---|
| 126 | #define ICM_COMPRESS_GET_FORMAT         (ICM_USER+4) | 
|---|
| 127 | #define ICM_COMPRESS_GET_SIZE           (ICM_USER+5) | 
|---|
| 128 | #define ICM_COMPRESS_QUERY              (ICM_USER+6) | 
|---|
| 129 | #define ICM_COMPRESS_BEGIN              (ICM_USER+7) | 
|---|
| 130 | #define ICM_COMPRESS                    (ICM_USER+8) | 
|---|
| 131 | #define ICM_COMPRESS_END                (ICM_USER+9) | 
|---|
| 132 |  | 
|---|
| 133 | #define ICM_DECOMPRESS_GET_FORMAT       (ICM_USER+10) | 
|---|
| 134 | #define ICM_DECOMPRESS_QUERY            (ICM_USER+11) | 
|---|
| 135 | #define ICM_DECOMPRESS_BEGIN            (ICM_USER+12) | 
|---|
| 136 | #define ICM_DECOMPRESS                  (ICM_USER+13) | 
|---|
| 137 | #define ICM_DECOMPRESS_END              (ICM_USER+14) | 
|---|
| 138 | #define ICM_DECOMPRESS_SET_PALETTE      (ICM_USER+29) | 
|---|
| 139 | #define ICM_DECOMPRESS_GET_PALETTE      (ICM_USER+30) | 
|---|
| 140 |  | 
|---|
| 141 | #define ICM_DRAW_QUERY                  (ICM_USER+31) | 
|---|
| 142 | #define ICM_DRAW_BEGIN                  (ICM_USER+15) | 
|---|
| 143 | #define ICM_DRAW_GET_PALETTE            (ICM_USER+16) | 
|---|
| 144 | #define ICM_DRAW_START                  (ICM_USER+18) | 
|---|
| 145 | #define ICM_DRAW_STOP                   (ICM_USER+19) | 
|---|
| 146 | #define ICM_DRAW_END                    (ICM_USER+21) | 
|---|
| 147 | #define ICM_DRAW_GETTIME                (ICM_USER+32) | 
|---|
| 148 | #define ICM_DRAW                        (ICM_USER+33) | 
|---|
| 149 | #define ICM_DRAW_WINDOW                 (ICM_USER+34) | 
|---|
| 150 | #define ICM_DRAW_SETTIME                (ICM_USER+35) | 
|---|
| 151 | #define ICM_DRAW_REALIZE                (ICM_USER+36) | 
|---|
| 152 | #define ICM_DRAW_FLUSH                  (ICM_USER+37) | 
|---|
| 153 | #define ICM_DRAW_RENDERBUFFER           (ICM_USER+38) | 
|---|
| 154 |  | 
|---|
| 155 | #define ICM_DRAW_START_PLAY             (ICM_USER+39) | 
|---|
| 156 | #define ICM_DRAW_STOP_PLAY              (ICM_USER+40) | 
|---|
| 157 |  | 
|---|
| 158 | #define ICM_DRAW_SUGGESTFORMAT          (ICM_USER+50) | 
|---|
| 159 | #define ICM_DRAW_CHANGEPALETTE          (ICM_USER+51) | 
|---|
| 160 |  | 
|---|
| 161 | #define ICM_GETBUFFERSWANTED            (ICM_USER+41) | 
|---|
| 162 |  | 
|---|
| 163 | #define ICM_GETDEFAULTKEYFRAMERATE      (ICM_USER+42) | 
|---|
| 164 |  | 
|---|
| 165 | #define ICM_DECOMPRESSEX_BEGIN          (ICM_USER+60) | 
|---|
| 166 | #define ICM_DECOMPRESSEX_QUERY          (ICM_USER+61) | 
|---|
| 167 | #define ICM_DECOMPRESSEX                (ICM_USER+62) | 
|---|
| 168 | #define ICM_DECOMPRESSEX_END            (ICM_USER+63) | 
|---|
| 169 |  | 
|---|
| 170 | #define ICM_COMPRESS_FRAMES_INFO        (ICM_USER+70) | 
|---|
| 171 | #define ICM_SET_STATUS_PROC             (ICM_USER+72) | 
|---|
| 172 |  | 
|---|
| 173 | /* structs */ | 
|---|
| 174 |  | 
|---|
| 175 | /* NOTE: Only the 16 bit structs are packed. Structs that are packed anyway | 
|---|
| 176 | * have not been changed. If a structure is later extended, you may need to create | 
|---|
| 177 | * two versions of it. | 
|---|
| 178 | */ | 
|---|
| 179 |  | 
|---|
| 180 | typedef struct { | 
|---|
| 181 | DWORD   dwSize;         /* 00: size */ | 
|---|
| 182 | DWORD   fccType;        /* 04: type 'vidc' usually */ | 
|---|
| 183 | DWORD   fccHandler;     /* 08: */ | 
|---|
| 184 | DWORD   dwVersion;      /* 0c: version of compman opening you */ | 
|---|
| 185 | DWORD   dwFlags;        /* 10: LOWORD is type specific */ | 
|---|
| 186 | LRESULT dwError;        /* 14: */ | 
|---|
| 187 | LPVOID  pV1Reserved;    /* 18: */ | 
|---|
| 188 | LPVOID  pV2Reserved;    /* 1c: */ | 
|---|
| 189 | DWORD   dnDevNode;      /* 20: */ | 
|---|
| 190 | /* 24: */ | 
|---|
| 191 | } ICOPEN,*LPICOPEN; | 
|---|
| 192 |  | 
|---|
| 193 | #define ICCOMPRESS_KEYFRAME     0x00000001L | 
|---|
| 194 |  | 
|---|
| 195 | typedef struct { | 
|---|
| 196 | DWORD               dwFlags; | 
|---|
| 197 | LPBITMAPINFOHEADER  lpbiOutput; | 
|---|
| 198 | LPVOID              lpOutput; | 
|---|
| 199 | LPBITMAPINFOHEADER  lpbiInput; | 
|---|
| 200 | LPVOID              lpInput; | 
|---|
| 201 | LPDWORD             lpckid; | 
|---|
| 202 | LPDWORD             lpdwFlags; | 
|---|
| 203 | LONG                lFrameNum; | 
|---|
| 204 | DWORD               dwFrameSize; | 
|---|
| 205 | DWORD               dwQuality; | 
|---|
| 206 | LPBITMAPINFOHEADER  lpbiPrev; | 
|---|
| 207 | LPVOID              lpPrev; | 
|---|
| 208 | } ICCOMPRESS; | 
|---|
| 209 |  | 
|---|
| 210 | DWORD VFWAPIV ICCompress( | 
|---|
| 211 | HIC hic,DWORD dwFlags,LPBITMAPINFOHEADER lpbiOutput,LPVOID lpData, | 
|---|
| 212 | LPBITMAPINFOHEADER lpbiInput,LPVOID lpBits,LPDWORD lpckid, | 
|---|
| 213 | LPDWORD lpdwFlags,LONG lFrameNum,DWORD dwFrameSize,DWORD dwQuality, | 
|---|
| 214 | LPBITMAPINFOHEADER lpbiPrev,LPVOID lpPrev | 
|---|
| 215 | ); | 
|---|
| 216 |  | 
|---|
| 217 | #define ICCompressGetFormat(hic, lpbiInput, lpbiOutput)                 \ | 
|---|
| 218 | ICSendMessage(                                                  \ | 
|---|
| 219 | hic,ICM_COMPRESS_GET_FORMAT,(DWORD)(LPVOID)(lpbiInput),     \ | 
|---|
| 220 | (DWORD)(LPVOID)(lpbiOutput)                                 \ | 
|---|
| 221 | ) | 
|---|
| 222 |  | 
|---|
| 223 | #define ICCompressGetFormatSize(hic,lpbi) ICCompressGetFormat(hic,lpbi,NULL) | 
|---|
| 224 |  | 
|---|
| 225 | #define ICCompressBegin(hic, lpbiInput, lpbiOutput)                     \ | 
|---|
| 226 | ICSendMessage(                                                      \ | 
|---|
| 227 | hic, ICM_COMPRESS_BEGIN, (DWORD)(LPVOID)(lpbiInput),            \ | 
|---|
| 228 | (DWORD)(LPVOID)(lpbiOutput)                                     \ | 
|---|
| 229 | ) | 
|---|
| 230 |  | 
|---|
| 231 | #define ICCompressGetSize(hic, lpbiInput, lpbiOutput)                   \ | 
|---|
| 232 | ICSendMessage(                                                      \ | 
|---|
| 233 | hic, ICM_COMPRESS_GET_SIZE, (DWORD)(LPVOID)(lpbiInput),         \ | 
|---|
| 234 | (DWORD)(LPVOID)(lpbiOutput)                                     \ | 
|---|
| 235 | ) | 
|---|
| 236 |  | 
|---|
| 237 | #define ICCompressQuery(hic, lpbiInput, lpbiOutput)             \ | 
|---|
| 238 | ICSendMessage(                                              \ | 
|---|
| 239 | hic, ICM_COMPRESS_QUERY, (DWORD)(LPVOID)(lpbiInput),    \ | 
|---|
| 240 | (DWORD)(LPVOID)(lpbiOutput)                             \ | 
|---|
| 241 | ) | 
|---|
| 242 |  | 
|---|
| 243 | #define ICCompressEnd(hic) ICSendMessage(hic, ICM_COMPRESS_END, 0, 0) | 
|---|
| 244 |  | 
|---|
| 245 | /* ICCOMPRESSFRAMES.dwFlags */ | 
|---|
| 246 | #define ICCOMPRESSFRAMES_PADDING        0x00000001 | 
|---|
| 247 | typedef struct { | 
|---|
| 248 | DWORD               dwFlags; | 
|---|
| 249 | LPBITMAPINFOHEADER  lpbiOutput; | 
|---|
| 250 | LPARAM              lOutput; | 
|---|
| 251 | LPBITMAPINFOHEADER  lpbiInput; | 
|---|
| 252 | LPARAM              lInput; | 
|---|
| 253 | LONG                lStartFrame; | 
|---|
| 254 | LONG                lFrameCount; | 
|---|
| 255 | LONG                lQuality; | 
|---|
| 256 | LONG                lDataRate; | 
|---|
| 257 | LONG                lKeyRate; | 
|---|
| 258 | DWORD               dwRate; | 
|---|
| 259 | DWORD               dwScale; | 
|---|
| 260 | DWORD               dwOverheadPerFrame; | 
|---|
| 261 | DWORD               dwReserved2; | 
|---|
| 262 | #ifdef __WIN32OS2__ | 
|---|
| 263 | LONG (* CALLBACK GetData)(LPARAM lInput,LONG lFrame,LPVOID lpBits,LONG len); | 
|---|
| 264 | LONG (* CALLBACK PutData)(LPARAM lOutput,LONG lFrame,LPVOID lpBits,LONG len); | 
|---|
| 265 | #else | 
|---|
| 266 | LONG CALLBACK (*GetData)(LPARAM lInput,LONG lFrame,LPVOID lpBits,LONG len); | 
|---|
| 267 | LONG CALLBACK (*PutData)(LPARAM lOutput,LONG lFrame,LPVOID lpBits,LONG len); | 
|---|
| 268 | #endif | 
|---|
| 269 | } ICCOMPRESSFRAMES; | 
|---|
| 270 |  | 
|---|
| 271 | typedef struct { | 
|---|
| 272 | DWORD               dwFlags; | 
|---|
| 273 | LPARAM              lParam; | 
|---|
| 274 | /* messages for Status callback */ | 
|---|
| 275 | #define ICSTATUS_START      0 | 
|---|
| 276 | #define ICSTATUS_STATUS     1 | 
|---|
| 277 | #define ICSTATUS_END        2 | 
|---|
| 278 | #define ICSTATUS_ERROR      3 | 
|---|
| 279 | #define ICSTATUS_YIELD      4 | 
|---|
| 280 | /* FIXME: some X11 libs define Status as int... */ | 
|---|
| 281 | /* LONG CALLBACK (*zStatus)(LPARAM lParam, UINT message, LONG l); */ | 
|---|
| 282 | #ifdef __WIN32OS2__ | 
|---|
| 283 | LONG (* CALLBACK zStatus)(LPARAM lParam, UINT message, LONG l); | 
|---|
| 284 | #else | 
|---|
| 285 | LONG CALLBACK (*zStatus)(LPARAM lParam, UINT message, LONG l); | 
|---|
| 286 | #endif | 
|---|
| 287 | } ICSETSTATUSPROC; | 
|---|
| 288 |  | 
|---|
| 289 | /* Values for wMode of ICOpen() */ | 
|---|
| 290 | #define ICMODE_COMPRESS         1 | 
|---|
| 291 | #define ICMODE_DECOMPRESS       2 | 
|---|
| 292 | #define ICMODE_FASTDECOMPRESS   3 | 
|---|
| 293 | #define ICMODE_QUERY            4 | 
|---|
| 294 | #define ICMODE_FASTCOMPRESS     5 | 
|---|
| 295 | #define ICMODE_DRAW             8 | 
|---|
| 296 |  | 
|---|
| 297 | /* quality flags */ | 
|---|
| 298 | #define ICQUALITY_LOW       0 | 
|---|
| 299 | #define ICQUALITY_HIGH      10000 | 
|---|
| 300 | #define ICQUALITY_DEFAULT   -1 | 
|---|
| 301 |  | 
|---|
| 302 | typedef struct { | 
|---|
| 303 | DWORD   dwSize;         /* 00: */ | 
|---|
| 304 | DWORD   fccType;        /* 04:compressor type     'vidc' 'audc' */ | 
|---|
| 305 | DWORD   fccHandler;     /* 08:compressor sub-type 'rle ' 'jpeg' 'pcm '*/ | 
|---|
| 306 | DWORD   dwFlags;        /* 0c:flags LOWORD is type specific */ | 
|---|
| 307 | DWORD   dwVersion;      /* 10:version of the driver */ | 
|---|
| 308 | DWORD   dwVersionICM;   /* 14:version of the ICM used */ | 
|---|
| 309 | /* | 
|---|
| 310 | * under Win32, the driver always returns UNICODE strings. | 
|---|
| 311 | */ | 
|---|
| 312 | WCHAR   szName[16];             /* 18:short name */ | 
|---|
| 313 | WCHAR   szDescription[128];     /* 38:long name */ | 
|---|
| 314 | WCHAR   szDriver[128];          /* 138:driver that contains compressor*/ | 
|---|
| 315 | /* 238: */ | 
|---|
| 316 | } ICINFO; | 
|---|
| 317 |  | 
|---|
| 318 | /* ICINFO.dwFlags */ | 
|---|
| 319 | #define VIDCF_QUALITY           0x0001  /* supports quality */ | 
|---|
| 320 | #define VIDCF_CRUNCH            0x0002  /* supports crunching to a frame size */ | 
|---|
| 321 | #define VIDCF_TEMPORAL          0x0004  /* supports inter-frame compress */ | 
|---|
| 322 | #define VIDCF_COMPRESSFRAMES    0x0008  /* wants the compress all frames message */ | 
|---|
| 323 | #define VIDCF_DRAW              0x0010  /* supports drawing */ | 
|---|
| 324 | #define VIDCF_FASTTEMPORALC     0x0020  /* does not need prev frame on compress */ | 
|---|
| 325 | #define VIDCF_FASTTEMPORALD     0x0080  /* does not need prev frame on decompress */ | 
|---|
| 326 | #define VIDCF_QUALITYTIME       0x0040  /* supports temporal quality */ | 
|---|
| 327 |  | 
|---|
| 328 | #define VIDCF_FASTTEMPORAL      (VIDCF_FASTTEMPORALC|VIDCF_FASTTEMPORALD) | 
|---|
| 329 |  | 
|---|
| 330 |  | 
|---|
| 331 | /* function shortcuts */ | 
|---|
| 332 | /* ICM_ABOUT */ | 
|---|
| 333 | #define ICMF_ABOUT_QUERY         0x00000001 | 
|---|
| 334 |  | 
|---|
| 335 | #define ICQueryAbout(hic) \ | 
|---|
| 336 | (ICSendMessage(hic,ICM_ABOUT,(DWORD)-1,ICMF_ABOUT_QUERY)==ICERR_OK) | 
|---|
| 337 |  | 
|---|
| 338 | #define ICAbout(hic, hwnd) ICSendMessage(hic,ICM_ABOUT,(DWORD)(UINT)(hwnd),0) | 
|---|
| 339 |  | 
|---|
| 340 | /* ICM_CONFIGURE */ | 
|---|
| 341 | #define ICMF_CONFIGURE_QUERY    0x00000001 | 
|---|
| 342 | #define ICQueryConfigure(hic) \ | 
|---|
| 343 | (ICSendMessage(hic,ICM_CONFIGURE,(DWORD)-1,ICMF_CONFIGURE_QUERY)==ICERR_OK) | 
|---|
| 344 |  | 
|---|
| 345 | #define ICConfigure(hic,hwnd) \ | 
|---|
| 346 | ICSendMessage(hic,ICM_CONFIGURE,(DWORD)(UINT)(hwnd),0) | 
|---|
| 347 |  | 
|---|
| 348 | /* Decompression stuff */ | 
|---|
| 349 | #define ICDECOMPRESS_HURRYUP            0x80000000      /* don't draw just buffer (hurry up!) */ | 
|---|
| 350 | #define ICDECOMPRESS_UPDATE             0x40000000      /* don't draw just update screen */ | 
|---|
| 351 | #define ICDECOMPRESS_PREROLL            0x20000000      /* this frame is before real start */ | 
|---|
| 352 | #define ICDECOMPRESS_NULLFRAME          0x10000000      /* repeat last frame */ | 
|---|
| 353 | #define ICDECOMPRESS_NOTKEYFRAME        0x08000000      /* this frame is not a key frame */ | 
|---|
| 354 |  | 
|---|
| 355 | typedef struct { | 
|---|
| 356 | DWORD               dwFlags;        /* flags (from AVI index...) */ | 
|---|
| 357 | LPBITMAPINFOHEADER  lpbiInput;      /* BITMAPINFO of compressed data */ | 
|---|
| 358 | LPVOID              lpInput;        /* compressed data */ | 
|---|
| 359 | LPBITMAPINFOHEADER  lpbiOutput;     /* DIB to decompress to */ | 
|---|
| 360 | LPVOID              lpOutput; | 
|---|
| 361 | DWORD               ckid;           /* ckid from AVI file */ | 
|---|
| 362 | } ICDECOMPRESS; | 
|---|
| 363 |  | 
|---|
| 364 | typedef struct { | 
|---|
| 365 | DWORD               dwFlags; | 
|---|
| 366 | LPBITMAPINFOHEADER  lpbiSrc; | 
|---|
| 367 | LPVOID              lpSrc; | 
|---|
| 368 | LPBITMAPINFOHEADER  lpbiDst; | 
|---|
| 369 | LPVOID              lpDst; | 
|---|
| 370 |  | 
|---|
| 371 | /* changed for ICM_DECOMPRESSEX */ | 
|---|
| 372 | INT                 xDst;       /* destination rectangle */ | 
|---|
| 373 | INT                 yDst; | 
|---|
| 374 | INT                 dxDst; | 
|---|
| 375 | INT                 dyDst; | 
|---|
| 376 |  | 
|---|
| 377 | INT                 xSrc;       /* source rectangle */ | 
|---|
| 378 | INT                 ySrc; | 
|---|
| 379 | INT                 dxSrc; | 
|---|
| 380 | INT                 dySrc; | 
|---|
| 381 | } ICDECOMPRESSEX; | 
|---|
| 382 |  | 
|---|
| 383 | DWORD VFWAPIV ICDecompress(HIC hic,DWORD dwFlags,LPBITMAPINFOHEADER lpbiFormat,LPVOID lpData,LPBITMAPINFOHEADER lpbi,LPVOID lpBits); | 
|---|
| 384 |  | 
|---|
| 385 | #define ICDecompressBegin(hic, lpbiInput, lpbiOutput)   \ | 
|---|
| 386 | ICSendMessage(                                              \ | 
|---|
| 387 | hic, ICM_DECOMPRESS_BEGIN, (DWORD)(LPVOID)(lpbiInput),  \ | 
|---|
| 388 | (DWORD)(LPVOID)(lpbiOutput)                             \ | 
|---|
| 389 | ) | 
|---|
| 390 |  | 
|---|
| 391 | #define ICDecompressQuery(hic, lpbiInput, lpbiOutput)   \ | 
|---|
| 392 | ICSendMessage(                                              \ | 
|---|
| 393 | hic,ICM_DECOMPRESS_QUERY, (DWORD)(LPVOID)(lpbiInput),   \ | 
|---|
| 394 | (DWORD) (LPVOID)(lpbiOutput)                            \ | 
|---|
| 395 | ) | 
|---|
| 396 |  | 
|---|
| 397 | #define ICDecompressGetFormat(hic, lpbiInput, lpbiOutput)               \ | 
|---|
| 398 | ((LONG)ICSendMessage(                                               \ | 
|---|
| 399 | hic,ICM_DECOMPRESS_GET_FORMAT, (DWORD)(LPVOID)(lpbiInput),      \ | 
|---|
| 400 | (DWORD)(LPVOID)(lpbiOutput)                                     \ | 
|---|
| 401 | )) | 
|---|
| 402 |  | 
|---|
| 403 | #define ICDecompressGetFormatSize(hic, lpbi)                            \ | 
|---|
| 404 | ICDecompressGetFormat(hic, lpbi, NULL) | 
|---|
| 405 |  | 
|---|
| 406 | #define ICDecompressGetPalette(hic, lpbiInput, lpbiOutput)              \ | 
|---|
| 407 | ICSendMessage(                                                      \ | 
|---|
| 408 | hic, ICM_DECOMPRESS_GET_PALETTE, (DWORD)(LPVOID)(lpbiInput),    \ | 
|---|
| 409 | (DWORD)(LPVOID)(lpbiOutput)                                     \ | 
|---|
| 410 | ) | 
|---|
| 411 |  | 
|---|
| 412 | #define ICDecompressSetPalette(hic,lpbiPalette) \ | 
|---|
| 413 | ICSendMessage(                          \ | 
|---|
| 414 | hic,ICM_DECOMPRESS_SET_PALETTE,         \ | 
|---|
| 415 | (DWORD)(LPVOID)(lpbiPalette),0          \ | 
|---|
| 416 | ) | 
|---|
| 417 |  | 
|---|
| 418 | #define ICDecompressEnd(hic) ICSendMessage(hic, ICM_DECOMPRESS_END, 0, 0) | 
|---|
| 419 |  | 
|---|
| 420 | LRESULT VFWAPI  ICSendMessage(HIC hic, UINT msg, DWORD dw1, DWORD dw2); | 
|---|
| 421 |  | 
|---|
| 422 | inline static LRESULT VFWAPI ICDecompressEx(HIC hic, DWORD dwFlags, | 
|---|
| 423 | LPBITMAPINFOHEADER lpbiSrc, LPVOID lpSrc, | 
|---|
| 424 | int xSrc, int ySrc, int dxSrc, int dySrc, | 
|---|
| 425 | LPBITMAPINFOHEADER lpbiDst, LPVOID lpDst, | 
|---|
| 426 | int xDst, int yDst, int dxDst, int dyDst) | 
|---|
| 427 | { | 
|---|
| 428 | ICDECOMPRESSEX ic; | 
|---|
| 429 |  | 
|---|
| 430 | ic.dwFlags = dwFlags; | 
|---|
| 431 | ic.lpbiSrc = lpbiSrc; | 
|---|
| 432 | ic.lpSrc = lpSrc; | 
|---|
| 433 | ic.xSrc = xSrc; | 
|---|
| 434 | ic.ySrc = ySrc; | 
|---|
| 435 | ic.dxSrc = dxSrc; | 
|---|
| 436 | ic.dySrc = dySrc; | 
|---|
| 437 | ic.lpbiDst = lpbiDst; | 
|---|
| 438 | ic.lpDst = lpDst; | 
|---|
| 439 | ic.xDst = xDst; | 
|---|
| 440 | ic.yDst = yDst; | 
|---|
| 441 | ic.dxDst = dxDst; | 
|---|
| 442 | ic.dyDst = dyDst; | 
|---|
| 443 | return ICSendMessage(hic, ICM_DECOMPRESSEX, (DWORD)&ic, sizeof(ic)); | 
|---|
| 444 | } | 
|---|
| 445 |  | 
|---|
| 446 | inline static LRESULT VFWAPI ICDecompressExBegin(HIC hic, DWORD dwFlags, | 
|---|
| 447 | LPBITMAPINFOHEADER lpbiSrc, | 
|---|
| 448 | LPVOID lpSrc, | 
|---|
| 449 | int xSrc, int ySrc, int dxSrc, int dySrc, | 
|---|
| 450 | LPBITMAPINFOHEADER lpbiDst, | 
|---|
| 451 | LPVOID lpDst, | 
|---|
| 452 | int xDst, | 
|---|
| 453 | int yDst, | 
|---|
| 454 | int dxDst, | 
|---|
| 455 | int dyDst) | 
|---|
| 456 | { | 
|---|
| 457 | ICDECOMPRESSEX ic; | 
|---|
| 458 |  | 
|---|
| 459 | ic.dwFlags = dwFlags; | 
|---|
| 460 | ic.lpbiSrc = lpbiSrc; | 
|---|
| 461 | ic.lpSrc = lpSrc; | 
|---|
| 462 | ic.xSrc = xSrc; | 
|---|
| 463 | ic.ySrc = ySrc; | 
|---|
| 464 | ic.dxSrc = dxSrc; | 
|---|
| 465 | ic.dySrc = dySrc; | 
|---|
| 466 | ic.lpbiDst = lpbiDst; | 
|---|
| 467 | ic.lpDst = lpDst; | 
|---|
| 468 | ic.xDst = xDst; | 
|---|
| 469 | ic.yDst = yDst; | 
|---|
| 470 | ic.dxDst = dxDst; | 
|---|
| 471 | ic.dyDst = dyDst; | 
|---|
| 472 | return ICSendMessage(hic, ICM_DECOMPRESSEX_BEGIN, (DWORD)&ic, sizeof(ic)); | 
|---|
| 473 | } | 
|---|
| 474 | inline static LRESULT VFWAPI ICDecompressExQuery(HIC hic, DWORD dwFlags, | 
|---|
| 475 | LPBITMAPINFOHEADER lpbiSrc, | 
|---|
| 476 | LPVOID lpSrc, | 
|---|
| 477 | int xSrc, int ySrc, int dxSrc, int dySrc, | 
|---|
| 478 | LPBITMAPINFOHEADER lpbiDst, | 
|---|
| 479 | LPVOID lpDst, | 
|---|
| 480 | int xDst, | 
|---|
| 481 | int yDst, | 
|---|
| 482 | int dxDst, | 
|---|
| 483 | int dyDst) | 
|---|
| 484 | { | 
|---|
| 485 | ICDECOMPRESSEX ic; | 
|---|
| 486 |  | 
|---|
| 487 | ic.dwFlags = dwFlags; | 
|---|
| 488 | ic.lpbiSrc = lpbiSrc; | 
|---|
| 489 | ic.lpSrc = lpSrc; | 
|---|
| 490 | ic.xSrc = xSrc; | 
|---|
| 491 | ic.ySrc = ySrc; | 
|---|
| 492 | ic.dxSrc = dxSrc; | 
|---|
| 493 | ic.dySrc = dySrc; | 
|---|
| 494 | ic.lpbiDst = lpbiDst; | 
|---|
| 495 | ic.lpDst = lpDst; | 
|---|
| 496 | ic.xDst = xDst; | 
|---|
| 497 | ic.yDst = yDst; | 
|---|
| 498 | ic.dxDst = dxDst; | 
|---|
| 499 | ic.dyDst = dyDst; | 
|---|
| 500 | return ICSendMessage(hic, ICM_DECOMPRESSEX_QUERY, (DWORD)&ic, sizeof(ic)); | 
|---|
| 501 | } | 
|---|
| 502 |  | 
|---|
| 503 | #define ICDecompressExEnd(hic) \ | 
|---|
| 504 | ICSendMessage(hic, ICM_DECOMPRESSEX_END, 0, 0) | 
|---|
| 505 |  | 
|---|
| 506 | #define ICDRAW_QUERY        0x00000001L   /* test for support */ | 
|---|
| 507 | #define ICDRAW_FULLSCREEN   0x00000002L   /* draw to full screen */ | 
|---|
| 508 | #define ICDRAW_HDC          0x00000004L   /* draw to a HDC/HWND */ | 
|---|
| 509 | #define ICDRAW_ANIMATE      0x00000008L   /* expect palette animation */ | 
|---|
| 510 | #define ICDRAW_CONTINUE     0x00000010L   /* draw is a continuation of previous draw */ | 
|---|
| 511 | #define ICDRAW_MEMORYDC     0x00000020L   /* DC is offscreen, by the way */ | 
|---|
| 512 | #define ICDRAW_UPDATING     0x00000040L   /* We're updating, as opposed to playing */ | 
|---|
| 513 | #define ICDRAW_RENDER       0x00000080L   /* used to render data not draw it */ | 
|---|
| 514 | #define ICDRAW_BUFFER       0x00000100L   /* buffer data offscreen, we will need to update it */ | 
|---|
| 515 |  | 
|---|
| 516 | #define ICDecompressOpen(fccType, fccHandler, lpbiIn, lpbiOut) \ | 
|---|
| 517 | ICLocate(fccType, fccHandler, lpbiIn, lpbiOut, ICMODE_DECOMPRESS) | 
|---|
| 518 |  | 
|---|
| 519 | #define ICDrawOpen(fccType, fccHandler, lpbiIn) \ | 
|---|
| 520 | ICLocate(fccType, fccHandler, lpbiIn, NULL, ICMODE_DRAW) | 
|---|
| 521 |  | 
|---|
| 522 | HANDLE VFWAPI ICImageCompress(HIC hic, UINT uiFlags, LPBITMAPINFO lpbiIn, | 
|---|
| 523 | LPVOID lpBits, LPBITMAPINFO lpbiOut, LONG lQuality, | 
|---|
| 524 | LONG* plSize); | 
|---|
| 525 |  | 
|---|
| 526 | HANDLE VFWAPI ICImageDecompress(HIC hic, UINT uiFlags, LPBITMAPINFO lpbiIn, | 
|---|
| 527 | LPVOID lpBits, LPBITMAPINFO lpbiOut); | 
|---|
| 528 |  | 
|---|
| 529 | BOOL    VFWAPI  ICInfo(DWORD fccType, DWORD fccHandler, ICINFO * lpicinfo); | 
|---|
| 530 | BOOL    VFWAPI  ICInstall(DWORD fccType, DWORD fccHandler, LPARAM lParam, LPSTR szDesc, UINT wFlags); | 
|---|
| 531 | BOOL    VFWAPI  ICRemove(DWORD fccType, DWORD fccHandler, UINT wFlags); | 
|---|
| 532 | LRESULT VFWAPI  ICGetInfo(HIC hic,ICINFO *picinfo, DWORD cb); | 
|---|
| 533 | HIC     VFWAPI  ICOpen(DWORD fccType, DWORD fccHandler, UINT wMode); | 
|---|
| 534 | HIC     VFWAPI  ICOpenFunction(DWORD fccType, DWORD fccHandler, UINT wMode, FARPROC lpfnHandler); | 
|---|
| 535 |  | 
|---|
| 536 | LRESULT VFWAPI  ICClose(HIC hic); | 
|---|
| 537 | HIC     VFWAPI  ICLocate(DWORD fccType, DWORD fccHandler, LPBITMAPINFOHEADER lpbiIn, LPBITMAPINFOHEADER lpbiOut, WORD wFlags); | 
|---|
| 538 | HIC     VFWAPI  ICGetDisplayFormat(HIC hic, LPBITMAPINFOHEADER lpbiIn, LPBITMAPINFOHEADER lpbiOut, int BitDepth, int dx, int dy); | 
|---|
| 539 |  | 
|---|
| 540 | /* Values for wFlags of ICInstall() */ | 
|---|
| 541 | #define ICINSTALL_UNICODE       0x8000 | 
|---|
| 542 | #define ICINSTALL_FUNCTION      0x0001 | 
|---|
| 543 | #define ICINSTALL_DRIVER        0x0002 | 
|---|
| 544 | #define ICINSTALL_HDRV          0x0004 | 
|---|
| 545 | #define ICINSTALL_DRIVERW       0x8002 | 
|---|
| 546 |  | 
|---|
| 547 | #define ICGetState(hic, pv, cb) \ | 
|---|
| 548 | ICSendMessage(hic, ICM_GETSTATE, (DWORD)(LPVOID)(pv), (DWORD)(cb)) | 
|---|
| 549 | #define ICSetState(hic, pv, cb) \ | 
|---|
| 550 | ICSendMessage(hic, ICM_SETSTATE, (DWORD)(LPVOID)(pv), (DWORD)(cb)) | 
|---|
| 551 | #define ICGetStateSize(hic) \ | 
|---|
| 552 | ICGetState(hic, NULL, 0) | 
|---|
| 553 |  | 
|---|
| 554 | inline static DWORD ICGetDefaultQuality(HIC hic) | 
|---|
| 555 | { | 
|---|
| 556 | DWORD dwICValue; | 
|---|
| 557 | ICSendMessage(hic, ICM_GETDEFAULTQUALITY, (DWORD)(LPVOID)&dwICValue, sizeof(DWORD)); | 
|---|
| 558 | return dwICValue; | 
|---|
| 559 | } | 
|---|
| 560 |  | 
|---|
| 561 | inline static DWORD ICGetDefaultKeyFrameRate(HIC hic) | 
|---|
| 562 | { | 
|---|
| 563 | DWORD dwICValue; | 
|---|
| 564 | ICSendMessage(hic, ICM_GETDEFAULTKEYFRAMERATE, (DWORD)(LPVOID)&dwICValue, sizeof(DWORD)); | 
|---|
| 565 | return dwICValue; | 
|---|
| 566 | } | 
|---|
| 567 |  | 
|---|
| 568 | #define ICDrawWindow(hic, prc) \ | 
|---|
| 569 | ICSendMessage(hic, ICM_DRAW_WINDOW, (DWORD)(LPVOID)(prc), sizeof(RECT)) | 
|---|
| 570 |  | 
|---|
| 571 | /* As passed to ICM_DRAW_SUGGESTFORMAT */ | 
|---|
| 572 | typedef struct { | 
|---|
| 573 | DWORD dwFlags; | 
|---|
| 574 | LPBITMAPINFOHEADER lpbiIn; | 
|---|
| 575 | LPBITMAPINFOHEADER lpbiSuggest; | 
|---|
| 576 | INT dxSrc; | 
|---|
| 577 | INT dySrc; | 
|---|
| 578 | INT dxDst; | 
|---|
| 579 | INT dyDst; | 
|---|
| 580 | HIC hicDecompressor; | 
|---|
| 581 | } ICDRAWSUGGEST; | 
|---|
| 582 |  | 
|---|
| 583 | typedef struct { | 
|---|
| 584 | DWORD               dwFlags; | 
|---|
| 585 | int                 iStart; | 
|---|
| 586 | int                 iLen; | 
|---|
| 587 | LPPALETTEENTRY      lppe; | 
|---|
| 588 | } ICPALETTE; | 
|---|
| 589 |  | 
|---|
| 590 | DWORD   VFWAPIV ICDrawBegin( | 
|---|
| 591 | HIC                     hic, | 
|---|
| 592 | DWORD                   dwFlags,/* flags */ | 
|---|
| 593 | HPALETTE                hpal,   /* palette to draw with */ | 
|---|
| 594 | HWND                    hwnd,   /* window to draw to */ | 
|---|
| 595 | HDC                     hdc,    /* HDC to draw to */ | 
|---|
| 596 | INT                     xDst,   /* destination rectangle */ | 
|---|
| 597 | INT                     yDst, | 
|---|
| 598 | INT                     dxDst, | 
|---|
| 599 | INT                     dyDst, | 
|---|
| 600 | LPBITMAPINFOHEADER      lpbi,   /* format of frame to draw */ | 
|---|
| 601 | INT                     xSrc,   /* source rectangle */ | 
|---|
| 602 | INT                     ySrc, | 
|---|
| 603 | INT                     dxSrc, | 
|---|
| 604 | INT                     dySrc, | 
|---|
| 605 | DWORD                   dwRate, /* frames/second = (dwRate/dwScale) */ | 
|---|
| 606 | DWORD                   dwScale | 
|---|
| 607 | ); | 
|---|
| 608 |  | 
|---|
| 609 | /* as passed to ICM_DRAW_BEGIN */ | 
|---|
| 610 | typedef struct { | 
|---|
| 611 | DWORD           dwFlags; | 
|---|
| 612 | HPALETTE        hpal; | 
|---|
| 613 | HWND            hwnd; | 
|---|
| 614 | HDC             hdc; | 
|---|
| 615 | INT             xDst; | 
|---|
| 616 | INT             yDst; | 
|---|
| 617 | INT             dxDst; | 
|---|
| 618 | INT             dyDst; | 
|---|
| 619 | LPBITMAPINFOHEADER      lpbi; | 
|---|
| 620 | INT             xSrc; | 
|---|
| 621 | INT             ySrc; | 
|---|
| 622 | INT             dxSrc; | 
|---|
| 623 | INT             dySrc; | 
|---|
| 624 | DWORD           dwRate; | 
|---|
| 625 | DWORD           dwScale; | 
|---|
| 626 | } ICDRAWBEGIN; | 
|---|
| 627 |  | 
|---|
| 628 | #define ICDRAW_HURRYUP      0x80000000L   /* don't draw just buffer (hurry up!) */ | 
|---|
| 629 | #define ICDRAW_UPDATE       0x40000000L   /* don't draw just update screen */ | 
|---|
| 630 | #define ICDRAW_PREROLL      0x20000000L   /* this frame is before real start */ | 
|---|
| 631 | #define ICDRAW_NULLFRAME    0x10000000L   /* repeat last frame */ | 
|---|
| 632 | #define ICDRAW_NOTKEYFRAME  0x08000000L   /* this frame is not a key frame */ | 
|---|
| 633 |  | 
|---|
| 634 | typedef struct { | 
|---|
| 635 | DWORD   dwFlags; | 
|---|
| 636 | LPVOID  lpFormat; | 
|---|
| 637 | LPVOID  lpData; | 
|---|
| 638 | DWORD   cbData; | 
|---|
| 639 | LONG    lTime; | 
|---|
| 640 | } ICDRAW; | 
|---|
| 641 |  | 
|---|
| 642 | DWORD VFWAPIV ICDraw(HIC hic,DWORD dwFlags,LPVOID lpFormat,LPVOID lpData,DWORD cbData,LONG lTime); | 
|---|
| 643 |  | 
|---|
| 644 | inline static LRESULT VFWAPI ICDrawSuggestFormat(HIC hic, LPBITMAPINFOHEADER lpbiIn, | 
|---|
| 645 | LPBITMAPINFOHEADER lpbiOut, | 
|---|
| 646 | int dxSrc, int dySrc, | 
|---|
| 647 | int dxDst, int dyDst, | 
|---|
| 648 | HIC hicDecomp) | 
|---|
| 649 | { | 
|---|
| 650 | ICDRAWSUGGEST ic; | 
|---|
| 651 |  | 
|---|
| 652 | ic.lpbiIn = lpbiIn; | 
|---|
| 653 | ic.lpbiSuggest = lpbiOut; | 
|---|
| 654 | ic.dxSrc = dxSrc; | 
|---|
| 655 | ic.dySrc = dySrc; | 
|---|
| 656 | ic.dxDst = dxDst; | 
|---|
| 657 | ic.dyDst = dyDst; | 
|---|
| 658 | ic.hicDecompressor = hicDecomp; | 
|---|
| 659 | return ICSendMessage(hic, ICM_DRAW_SUGGESTFORMAT, (DWORD)&ic, sizeof(ic)); | 
|---|
| 660 | } | 
|---|
| 661 |  | 
|---|
| 662 | #define ICDrawQuery(hic, lpbiInput) \ | 
|---|
| 663 | ICSendMessage(hic, ICM_DRAW_QUERY, (DWORD)(LPVOID)(lpbiInput), 0L) | 
|---|
| 664 |  | 
|---|
| 665 | #define ICDrawChangePalette(hic, lpbiInput) \ | 
|---|
| 666 | ICSendMessage(hic, ICM_DRAW_CHANGEPALETTE, (DWORD)(LPVOID)(lpbiInput), 0L) | 
|---|
| 667 |  | 
|---|
| 668 | #define ICGetBuffersWanted(hic, lpdwBuffers) \ | 
|---|
| 669 | ICSendMessage(hic, ICM_GETBUFFERSWANTED, (DWORD)(LPVOID)(lpdwBuffers), 0) | 
|---|
| 670 |  | 
|---|
| 671 | #define ICDrawEnd(hic) \ | 
|---|
| 672 | ICSendMessage(hic, ICM_DRAW_END, 0, 0) | 
|---|
| 673 |  | 
|---|
| 674 | #define ICDrawStart(hic) \ | 
|---|
| 675 | ICSendMessage(hic, ICM_DRAW_START, 0, 0) | 
|---|
| 676 |  | 
|---|
| 677 | #define ICDrawStartPlay(hic, lFrom, lTo) \ | 
|---|
| 678 | ICSendMessage(hic, ICM_DRAW_START_PLAY, (DWORD)(lFrom), (DWORD)(lTo)) | 
|---|
| 679 |  | 
|---|
| 680 | #define ICDrawStop(hic) \ | 
|---|
| 681 | ICSendMessage(hic, ICM_DRAW_STOP, 0, 0) | 
|---|
| 682 |  | 
|---|
| 683 | #define ICDrawStopPlay(hic) \ | 
|---|
| 684 | ICSendMessage(hic, ICM_DRAW_STOP_PLAY, 0, 0) | 
|---|
| 685 |  | 
|---|
| 686 | #define ICDrawGetTime(hic, lplTime) \ | 
|---|
| 687 | ICSendMessage(hic, ICM_DRAW_GETTIME, (DWORD)(LPVOID)(lplTime), 0) | 
|---|
| 688 |  | 
|---|
| 689 | #define ICDrawSetTime(hic, lTime) \ | 
|---|
| 690 | ICSendMessage(hic, ICM_DRAW_SETTIME, (DWORD)lTime, 0) | 
|---|
| 691 |  | 
|---|
| 692 | #define ICDrawRealize(hic, hdc, fBackground) \ | 
|---|
| 693 | ICSendMessage(hic, ICM_DRAW_REALIZE, (DWORD)(UINT)(HDC)(hdc), (DWORD)(BOOL)(fBackground)) | 
|---|
| 694 |  | 
|---|
| 695 | #define ICDrawFlush(hic) \ | 
|---|
| 696 | ICSendMessage(hic, ICM_DRAW_FLUSH, 0, 0) | 
|---|
| 697 |  | 
|---|
| 698 | #define ICDrawRenderBuffer(hic) \ | 
|---|
| 699 | ICSendMessage(hic, ICM_DRAW_RENDERBUFFER, 0, 0) | 
|---|
| 700 |  | 
|---|
| 701 | inline static LRESULT VFWAPI ICSetStatusProc(HIC hic, DWORD dwFlags, LRESULT lParam, | 
|---|
| 702 | #ifdef __WIN32OS2__ | 
|---|
| 703 | LONG (* CALLBACK fpfnStatus)(LPARAM, UINT, LONG)) | 
|---|
| 704 | #else | 
|---|
| 705 | LONG (CALLBACK *fpfnStatus)(LPARAM, UINT, LONG)) | 
|---|
| 706 | #endif | 
|---|
| 707 | { | 
|---|
| 708 | ICSETSTATUSPROC ic; | 
|---|
| 709 |  | 
|---|
| 710 | ic.dwFlags = dwFlags; | 
|---|
| 711 | ic.lParam = lParam; | 
|---|
| 712 | /* FIXME: see comment in ICSETSTATUSPROC definition */ | 
|---|
| 713 | ic.zStatus = fpfnStatus; | 
|---|
| 714 |  | 
|---|
| 715 | return ICSendMessage(hic, ICM_SET_STATUS_PROC, (DWORD)&ic, sizeof(ic)); | 
|---|
| 716 | } | 
|---|
| 717 |  | 
|---|
| 718 | typedef struct { | 
|---|
| 719 | LONG                cbSize; | 
|---|
| 720 | DWORD               dwFlags; | 
|---|
| 721 | HIC                 hic; | 
|---|
| 722 | DWORD               fccType; | 
|---|
| 723 | DWORD               fccHandler; | 
|---|
| 724 | LPBITMAPINFO        lpbiIn; | 
|---|
| 725 | LPBITMAPINFO        lpbiOut; | 
|---|
| 726 | LPVOID              lpBitsOut; | 
|---|
| 727 | LPVOID              lpBitsPrev; | 
|---|
| 728 | LONG                lFrame; | 
|---|
| 729 | LONG                lKey; | 
|---|
| 730 | LONG                lDataRate; | 
|---|
| 731 | LONG                lQ; | 
|---|
| 732 | LONG                lKeyCount; | 
|---|
| 733 | LPVOID              lpState; | 
|---|
| 734 | LONG                cbState; | 
|---|
| 735 | } COMPVARS, *PCOMPVARS; | 
|---|
| 736 |  | 
|---|
| 737 | #define ICMF_COMPVARS_VALID     0x00000001 | 
|---|
| 738 |  | 
|---|
| 739 | BOOL VFWAPI ICCompressorChoose(HWND hwnd, UINT uiFlags, LPVOID pvIn, LPVOID lpData, | 
|---|
| 740 | PCOMPVARS pc, LPSTR lpszTitle); | 
|---|
| 741 |  | 
|---|
| 742 | #define ICMF_CHOOSE_KEYFRAME            0x0001 | 
|---|
| 743 | #define ICMF_CHOOSE_DATARATE            0x0002 | 
|---|
| 744 | #define ICMF_CHOOSE_PREVIEW             0x0004 | 
|---|
| 745 | #define ICMF_CHOOSE_ALLCOMPRESSORS      0x0008 | 
|---|
| 746 |  | 
|---|
| 747 | BOOL VFWAPI ICSeqCompressFrameStart(PCOMPVARS pc, LPBITMAPINFO lpbiIn); | 
|---|
| 748 | void VFWAPI ICSeqCompressFrameEnd(PCOMPVARS pc); | 
|---|
| 749 |  | 
|---|
| 750 | LPVOID VFWAPI ICSeqCompressFrame(PCOMPVARS pc, UINT uiFlags, LPVOID lpBits, | 
|---|
| 751 | BOOL *pfKey, LONG *plSize); | 
|---|
| 752 | void VFWAPI ICCompressorFree(PCOMPVARS pc); | 
|---|
| 753 |  | 
|---|
| 754 | /********************* AVIFILE function declarations *************************/ | 
|---|
| 755 | #define formtypeAVI             mmioFOURCC('A', 'V', 'I', ' ') | 
|---|
| 756 | #define listtypeAVIHEADER       mmioFOURCC('h', 'd', 'r', 'l') | 
|---|
| 757 | #define ckidAVIMAINHDR          mmioFOURCC('a', 'v', 'i', 'h') | 
|---|
| 758 | #define listtypeSTREAMHEADER    mmioFOURCC('s', 't', 'r', 'l') | 
|---|
| 759 | #define ckidSTREAMHEADER        mmioFOURCC('s', 't', 'r', 'h') | 
|---|
| 760 | #define ckidSTREAMFORMAT        mmioFOURCC('s', 't', 'r', 'f') | 
|---|
| 761 | #define ckidSTREAMHANDLERDATA   mmioFOURCC('s', 't', 'r', 'd') | 
|---|
| 762 | #define ckidSTREAMNAME          mmioFOURCC('s', 't', 'r', 'n') | 
|---|
| 763 |  | 
|---|
| 764 | #define listtypeAVIMOVIE        mmioFOURCC('m', 'o', 'v', 'i') | 
|---|
| 765 | #define listtypeAVIRECORD       mmioFOURCC('r', 'e', 'c', ' ') | 
|---|
| 766 |  | 
|---|
| 767 | #define ckidAVINEWINDEX         mmioFOURCC('i', 'd', 'x', '1') | 
|---|
| 768 |  | 
|---|
| 769 | #define streamtypeVIDEO         mmioFOURCC('v', 'i', 'd', 's') | 
|---|
| 770 | #define streamtypeAUDIO         mmioFOURCC('a', 'u', 'd', 's') | 
|---|
| 771 | #define streamtypeMIDI          mmioFOURCC('m', 'i', 'd', 's') | 
|---|
| 772 | #define streamtypeTEXT          mmioFOURCC('t', 'x', 't', 's') | 
|---|
| 773 |  | 
|---|
| 774 | /* Basic chunk types */ | 
|---|
| 775 | #define cktypeDIBbits           aviTWOCC('d', 'b') | 
|---|
| 776 | #define cktypeDIBcompressed     aviTWOCC('d', 'c') | 
|---|
| 777 | #define cktypePALchange         aviTWOCC('p', 'c') | 
|---|
| 778 | #define cktypeWAVEbytes         aviTWOCC('w', 'b') | 
|---|
| 779 |  | 
|---|
| 780 | /* Chunk id to use for extra chunks for padding. */ | 
|---|
| 781 | #define ckidAVIPADDING          mmioFOURCC('J', 'U', 'N', 'K') | 
|---|
| 782 |  | 
|---|
| 783 | /* AVIFileHdr.dwFlags */ | 
|---|
| 784 | #define AVIF_HASINDEX           0x00000010      /* Index at end of file? */ | 
|---|
| 785 | #define AVIF_MUSTUSEINDEX       0x00000020 | 
|---|
| 786 | #define AVIF_ISINTERLEAVED      0x00000100 | 
|---|
| 787 | #define AVIF_TRUSTCKTYPE        0x00000800      /* Use CKType to find key frames*/ | 
|---|
| 788 | #define AVIF_WASCAPTUREFILE     0x00010000 | 
|---|
| 789 | #define AVIF_COPYRIGHTED        0x00020000 | 
|---|
| 790 |  | 
|---|
| 791 | #define AVI_HEADERSIZE  2048 | 
|---|
| 792 |  | 
|---|
| 793 | typedef struct _MainAVIHeader | 
|---|
| 794 | { | 
|---|
| 795 | DWORD       dwMicroSecPerFrame; | 
|---|
| 796 | DWORD       dwMaxBytesPerSec; | 
|---|
| 797 | DWORD       dwPaddingGranularity; | 
|---|
| 798 | DWORD       dwFlags; | 
|---|
| 799 | DWORD       dwTotalFrames; | 
|---|
| 800 | DWORD       dwInitialFrames; | 
|---|
| 801 | DWORD       dwStreams; | 
|---|
| 802 | DWORD       dwSuggestedBufferSize; | 
|---|
| 803 | DWORD       dwWidth; | 
|---|
| 804 | DWORD       dwHeight; | 
|---|
| 805 | DWORD       dwReserved[4]; | 
|---|
| 806 | } MainAVIHeader; | 
|---|
| 807 |  | 
|---|
| 808 | /* AVIStreamHeader.dwFlags */ | 
|---|
| 809 | #define AVISF_DISABLED                  0x00000001 | 
|---|
| 810 | #define AVISF_VIDEO_PALCHANGES          0x00010000 | 
|---|
| 811 |  | 
|---|
| 812 | typedef struct { | 
|---|
| 813 | FOURCC      fccType; | 
|---|
| 814 | FOURCC      fccHandler; | 
|---|
| 815 | DWORD       dwFlags;        /* AVISF_* */ | 
|---|
| 816 | WORD        wPriority; | 
|---|
| 817 | WORD        wLanguage; | 
|---|
| 818 | DWORD       dwInitialFrames; | 
|---|
| 819 | DWORD       dwScale; | 
|---|
| 820 | DWORD       dwRate; /* dwRate / dwScale == samples/second */ | 
|---|
| 821 | DWORD       dwStart; | 
|---|
| 822 | DWORD       dwLength; /* In units above... */ | 
|---|
| 823 | DWORD       dwSuggestedBufferSize; | 
|---|
| 824 | DWORD       dwQuality; | 
|---|
| 825 | DWORD       dwSampleSize; | 
|---|
| 826 | struct { SHORT left, top, right, bottom; } rcFrame; /* word.word - word.word in file */ | 
|---|
| 827 | } AVIStreamHeader; | 
|---|
| 828 |  | 
|---|
| 829 | /* AVIINDEXENTRY.dwFlags */ | 
|---|
| 830 | #define AVIIF_LIST      0x00000001      /* chunk is a 'LIST' */ | 
|---|
| 831 | #define AVIIF_TWOCC     0x00000002 | 
|---|
| 832 | #define AVIIF_KEYFRAME  0x00000010      /* this frame is a key frame. */ | 
|---|
| 833 |  | 
|---|
| 834 | #define AVIIF_NOTIME    0x00000100      /* this frame doesn't take any time */ | 
|---|
| 835 | #define AVIIF_COMPUSE   0x0FFF0000 | 
|---|
| 836 |  | 
|---|
| 837 | typedef struct _AVIINDEXENTRY { | 
|---|
| 838 | DWORD       ckid; | 
|---|
| 839 | DWORD       dwFlags; | 
|---|
| 840 | DWORD       dwChunkOffset; | 
|---|
| 841 | DWORD       dwChunkLength; | 
|---|
| 842 | } AVIINDEXENTRY; | 
|---|
| 843 |  | 
|---|
| 844 | typedef struct _AVIPALCHANGE { | 
|---|
| 845 | BYTE                bFirstEntry; | 
|---|
| 846 | BYTE                bNumEntries; | 
|---|
| 847 | WORD                wFlags;         /* pad */ | 
|---|
| 848 | PALETTEENTRY        peNew[1]; | 
|---|
| 849 | } AVIPALCHANGE; | 
|---|
| 850 |  | 
|---|
| 851 | #define AVIIF_KEYFRAME  0x00000010      /* this frame is a key frame. */ | 
|---|
| 852 |  | 
|---|
| 853 | #define AVIGETFRAMEF_BESTDISPLAYFMT     1 | 
|---|
| 854 |  | 
|---|
| 855 | typedef struct _AVISTREAMINFOA { | 
|---|
| 856 | DWORD       fccType; | 
|---|
| 857 | DWORD       fccHandler; | 
|---|
| 858 | DWORD       dwFlags;        /* AVIIF_* */ | 
|---|
| 859 | DWORD       dwCaps; | 
|---|
| 860 | WORD        wPriority; | 
|---|
| 861 | WORD        wLanguage; | 
|---|
| 862 | DWORD       dwScale; | 
|---|
| 863 | DWORD       dwRate;         /* dwRate / dwScale == samples/second */ | 
|---|
| 864 | DWORD       dwStart; | 
|---|
| 865 | DWORD       dwLength;       /* In units above... */ | 
|---|
| 866 | DWORD       dwInitialFrames; | 
|---|
| 867 | DWORD       dwSuggestedBufferSize; | 
|---|
| 868 | DWORD       dwQuality; | 
|---|
| 869 | DWORD       dwSampleSize; | 
|---|
| 870 | RECT        rcFrame; | 
|---|
| 871 | DWORD       dwEditCount; | 
|---|
| 872 | DWORD       dwFormatChangeCount; | 
|---|
| 873 | CHAR        szName[64]; | 
|---|
| 874 | } AVISTREAMINFOA, * LPAVISTREAMINFOA, *PAVISTREAMINFOA; | 
|---|
| 875 |  | 
|---|
| 876 | typedef struct _AVISTREAMINFOW { | 
|---|
| 877 | DWORD       fccType; | 
|---|
| 878 | DWORD       fccHandler; | 
|---|
| 879 | DWORD       dwFlags; | 
|---|
| 880 | DWORD       dwCaps; | 
|---|
| 881 | WORD        wPriority; | 
|---|
| 882 | WORD        wLanguage; | 
|---|
| 883 | DWORD       dwScale; | 
|---|
| 884 | DWORD       dwRate;         /* dwRate / dwScale == samples/second */ | 
|---|
| 885 | DWORD       dwStart; | 
|---|
| 886 | DWORD       dwLength;       /* In units above... */ | 
|---|
| 887 | DWORD       dwInitialFrames; | 
|---|
| 888 | DWORD       dwSuggestedBufferSize; | 
|---|
| 889 | DWORD       dwQuality; | 
|---|
| 890 | DWORD       dwSampleSize; | 
|---|
| 891 | RECT        rcFrame; | 
|---|
| 892 | DWORD       dwEditCount; | 
|---|
| 893 | DWORD       dwFormatChangeCount; | 
|---|
| 894 | WCHAR       szName[64]; | 
|---|
| 895 | } AVISTREAMINFOW, * LPAVISTREAMINFOW, *PAVISTREAMINFOW; | 
|---|
| 896 | DECL_WINELIB_TYPE_AW(AVISTREAMINFO) | 
|---|
| 897 | DECL_WINELIB_TYPE_AW(LPAVISTREAMINFO) | 
|---|
| 898 | DECL_WINELIB_TYPE_AW(PAVISTREAMINFO) | 
|---|
| 899 |  | 
|---|
| 900 | #define AVISTREAMINFO_DISABLED          0x00000001 | 
|---|
| 901 | #define AVISTREAMINFO_FORMATCHANGES     0x00010000 | 
|---|
| 902 |  | 
|---|
| 903 | /* AVIFILEINFO.dwFlags */ | 
|---|
| 904 | #define AVIFILEINFO_HASINDEX            0x00000010 | 
|---|
| 905 | #define AVIFILEINFO_MUSTUSEINDEX        0x00000020 | 
|---|
| 906 | #define AVIFILEINFO_ISINTERLEAVED       0x00000100 | 
|---|
| 907 | #define AVIFILEINFO_WASCAPTUREFILE      0x00010000 | 
|---|
| 908 | #define AVIFILEINFO_COPYRIGHTED         0x00020000 | 
|---|
| 909 |  | 
|---|
| 910 | /* AVIFILEINFO.dwCaps */ | 
|---|
| 911 | #define AVIFILECAPS_CANREAD             0x00000001 | 
|---|
| 912 | #define AVIFILECAPS_CANWRITE            0x00000002 | 
|---|
| 913 | #define AVIFILECAPS_ALLKEYFRAMES        0x00000010 | 
|---|
| 914 | #define AVIFILECAPS_NOCOMPRESSION       0x00000020 | 
|---|
| 915 |  | 
|---|
| 916 | typedef struct _AVIFILEINFOW { | 
|---|
| 917 | DWORD               dwMaxBytesPerSec; | 
|---|
| 918 | DWORD               dwFlags; | 
|---|
| 919 | DWORD               dwCaps; | 
|---|
| 920 | DWORD               dwStreams; | 
|---|
| 921 | DWORD               dwSuggestedBufferSize; | 
|---|
| 922 | DWORD               dwWidth; | 
|---|
| 923 | DWORD               dwHeight; | 
|---|
| 924 | DWORD               dwScale; | 
|---|
| 925 | DWORD               dwRate; | 
|---|
| 926 | DWORD               dwLength; | 
|---|
| 927 | DWORD               dwEditCount; | 
|---|
| 928 | WCHAR               szFileType[64]; | 
|---|
| 929 | } AVIFILEINFOW, * LPAVIFILEINFOW, *PAVIFILEINFOW; | 
|---|
| 930 | typedef struct _AVIFILEINFOA { | 
|---|
| 931 | DWORD               dwMaxBytesPerSec; | 
|---|
| 932 | DWORD               dwFlags; | 
|---|
| 933 | DWORD               dwCaps; | 
|---|
| 934 | DWORD               dwStreams; | 
|---|
| 935 | DWORD               dwSuggestedBufferSize; | 
|---|
| 936 | DWORD               dwWidth; | 
|---|
| 937 | DWORD               dwHeight; | 
|---|
| 938 | DWORD               dwScale; | 
|---|
| 939 | DWORD               dwRate; | 
|---|
| 940 | DWORD               dwLength; | 
|---|
| 941 | DWORD               dwEditCount; | 
|---|
| 942 | CHAR                szFileType[64]; | 
|---|
| 943 | } AVIFILEINFOA, * LPAVIFILEINFOA, *PAVIFILEINFOA; | 
|---|
| 944 | DECL_WINELIB_TYPE_AW(AVIFILEINFO) | 
|---|
| 945 | DECL_WINELIB_TYPE_AW(PAVIFILEINFO) | 
|---|
| 946 | DECL_WINELIB_TYPE_AW(LPAVIFILEINFO) | 
|---|
| 947 |  | 
|---|
| 948 | /* AVICOMPRESSOPTIONS.dwFlags. determines presence of fields in below struct */ | 
|---|
| 949 | #define AVICOMPRESSF_INTERLEAVE 0x00000001 | 
|---|
| 950 | #define AVICOMPRESSF_DATARATE   0x00000002 | 
|---|
| 951 | #define AVICOMPRESSF_KEYFRAMES  0x00000004 | 
|---|
| 952 | #define AVICOMPRESSF_VALID      0x00000008 | 
|---|
| 953 |  | 
|---|
| 954 | typedef struct { | 
|---|
| 955 | DWORD       fccType;                /* stream type, for consistency */ | 
|---|
| 956 | DWORD       fccHandler;             /* compressor */ | 
|---|
| 957 | DWORD       dwKeyFrameEvery;        /* keyframe rate */ | 
|---|
| 958 | DWORD       dwQuality;              /* compress quality 0-10,000 */ | 
|---|
| 959 | DWORD       dwBytesPerSecond;       /* bytes per second */ | 
|---|
| 960 | DWORD       dwFlags;                /* flags... see below */ | 
|---|
| 961 | LPVOID      lpFormat;               /* save format */ | 
|---|
| 962 | DWORD       cbFormat; | 
|---|
| 963 | LPVOID      lpParms;                /* compressor options */ | 
|---|
| 964 | DWORD       cbParms; | 
|---|
| 965 | DWORD       dwInterleaveEvery;      /* for non-video streams only */ | 
|---|
| 966 | } AVICOMPRESSOPTIONS, *LPAVICOMPRESSOPTIONS,*PAVICOMPRESSOPTIONS; | 
|---|
| 967 |  | 
|---|
| 968 |  | 
|---|
| 969 |  | 
|---|
| 970 | #define DEFINE_AVIGUID(name, l, w1, w2) \ | 
|---|
| 971 | DEFINE_GUID(name, l, w1, w2, 0xC0,0,0,0,0,0,0,0x46) | 
|---|
| 972 |  | 
|---|
| 973 | DEFINE_AVIGUID(IID_IAVIFile,            0x00020020, 0, 0); | 
|---|
| 974 | DEFINE_AVIGUID(IID_IAVIStream,          0x00020021, 0, 0); | 
|---|
| 975 | DEFINE_AVIGUID(IID_IAVIStreaming,       0x00020022, 0, 0); | 
|---|
| 976 | DEFINE_AVIGUID(IID_IGetFrame,           0x00020023, 0, 0); | 
|---|
| 977 | DEFINE_AVIGUID(IID_IAVIEditStream,      0x00020024, 0, 0); | 
|---|
| 978 |  | 
|---|
| 979 | DEFINE_AVIGUID(CLSID_AVIFile,           0x00020000, 0, 0); | 
|---|
| 980 |  | 
|---|
| 981 | /***************************************************************************** | 
|---|
| 982 | * IAVIStream interface | 
|---|
| 983 | */ | 
|---|
| 984 | #define ICOM_INTERFACE IAVIStream | 
|---|
| 985 | #define IAVIStream_METHODS                                              \ | 
|---|
| 986 | ICOM_METHOD2(HRESULT,Create,     LPARAM,lParam1, LPARAM,lParam2) \ | 
|---|
| 987 | ICOM_METHOD2(HRESULT,Info,       AVISTREAMINFOW*,psi, LONG,lSize) \ | 
|---|
| 988 | ICOM_METHOD2(LONG,   FindSample, LONG,lPos, LONG,lFlags) \ | 
|---|
| 989 | ICOM_METHOD3(HRESULT,ReadFormat, LONG,lPos, LPVOID,lpFormat, LONG*,lpcbFormat) \ | 
|---|
| 990 | ICOM_METHOD3(HRESULT,SetFormat,  LONG,lPos, LPVOID,lpFormat, LONG,cbFormat) \ | 
|---|
| 991 | ICOM_METHOD6(HRESULT,Read,       LONG,lStart, LONG,lSamples, LPVOID,lpBuffer, LONG,cbBuffer, LONG*,plBytes, LONG*,plSamples) \ | 
|---|
| 992 | ICOM_METHOD7(HRESULT,Write,      LONG,lStart, LONG,lSamples, LPVOID,lpBuffer, LONG,cbBuffer, DWORD,dwFlags, LONG*,plSampWritten, LONG*,plBytesWritten) \ | 
|---|
| 993 | ICOM_METHOD2(HRESULT,Delete,     LONG,lStart, LONG,lSamples) \ | 
|---|
| 994 | ICOM_METHOD3(HRESULT,ReadData,   DWORD,fcc, LPVOID,lpBuffer, LONG*,lpcbBuffer) \ | 
|---|
| 995 | ICOM_METHOD3(HRESULT,WriteData,  DWORD,fcc, LPVOID,lpBuffer, LONG,cbBuffer) \ | 
|---|
| 996 | ICOM_METHOD2(HRESULT,SetInfo,    AVISTREAMINFOW*,plInfo, LONG,cbInfo) | 
|---|
| 997 | #define IAVIStream_IMETHODS     \ | 
|---|
| 998 | IUnknown_IMETHODS       \ | 
|---|
| 999 | IAVIStream_METHODS | 
|---|
| 1000 | ICOM_DEFINE(IAVIStream, IUnknown) | 
|---|
| 1001 | #undef ICOM_INTERFACE | 
|---|
| 1002 |  | 
|---|
| 1003 | /*** IUnknown methods ***/ | 
|---|
| 1004 | #define IAVIStream_QueryInterface(p,a,b) ICOM_CALL2(QueryInterface,p,a,b) | 
|---|
| 1005 | #define IAVIStream_AddRef(p)             ICOM_CALL (AddRef,p) | 
|---|
| 1006 | #define IAVIStream_Release(p)            ICOM_CALL (Release,p) | 
|---|
| 1007 | /*** IAVIStream methods ***/ | 
|---|
| 1008 | #define IAVIStream_Create(p,a,b)          ICOM_CALL2(Create,p,a,b) | 
|---|
| 1009 | #define IAVIStream_Info(p,a,b)            ICOM_CALL2(Info,p,a,b) | 
|---|
| 1010 | #define IAVIStream_FindSample(p,a,b)      ICOM_CALL2(FindSample,p,a,b) | 
|---|
| 1011 | #define IAVIStream_ReadFormat(p,a,b,c)    ICOM_CALL3(ReadFormat,p,a,b,c) | 
|---|
| 1012 | #define IAVIStream_SetFormat(p,a,b,c)     ICOM_CALL3(SetFormat,p,a,b,c) | 
|---|
| 1013 | #define IAVIStream_Read(p,a,b,c,d,e,f)    ICOM_CALL6(Read,p,a,b,c,d,e,f) | 
|---|
| 1014 | #define IAVIStream_Write(p,a,b,c,d,e,f,g) ICOM_CALL7(Write,p,a,b,c,d,e,f,g) | 
|---|
| 1015 | #define IAVIStream_Delete(p,a,b)          ICOM_CALL2(Delete,p,a,b) | 
|---|
| 1016 | #define IAVIStream_ReadData(p,a,b,c)      ICOM_CALL3(ReadData,p,a,b,c) | 
|---|
| 1017 | #define IAVIStream_WriteData(p,a,b,c)     ICOM_CALL3(WriteData,p,a,b,c) | 
|---|
| 1018 | #define IAVIStream_SetInfo(p,a,b)         ICOM_CALL2(SetInfo,p,a,b) | 
|---|
| 1019 |  | 
|---|
| 1020 | HRESULT WINAPI AVIMakeCompressedStream(PAVISTREAM*ppsCompressed,PAVISTREAM ppsSource,AVICOMPRESSOPTIONS *lpOptions,CLSID*pclsidHandler); | 
|---|
| 1021 |  | 
|---|
| 1022 | HRESULT WINAPI AVIStreamInfoA(PAVISTREAM iface,AVISTREAMINFOA *asi,LONG size); | 
|---|
| 1023 | HRESULT WINAPI AVIStreamInfoW(PAVISTREAM iface,AVISTREAMINFOW *asi,LONG size); | 
|---|
| 1024 | #define AVIStreamInfo WINELIB_NAME_AW(AVIStreamInfo) | 
|---|
| 1025 | LPVOID WINAPI AVIStreamGetFrame(PGETFRAME pg,LONG pos); | 
|---|
| 1026 | HRESULT WINAPI AVIStreamGetFrameClose(PGETFRAME pg); | 
|---|
| 1027 | PGETFRAME WINAPI AVIStreamGetFrameOpen(PAVISTREAM pavi,LPBITMAPINFOHEADER lpbiWanted); | 
|---|
| 1028 | LONG WINAPI AVIStreamLength(PAVISTREAM iface); | 
|---|
| 1029 | HRESULT WINAPI AVIStreamRead(PAVISTREAM iface,LONG start,LONG samples,LPVOID buffer,LONG buffersize,LONG *bytesread,LONG *samplesread); | 
|---|
| 1030 | HRESULT WINAPI AVIStreamReadData(PAVISTREAM iface,DWORD fcc,LPVOID lp,LONG *lpread); | 
|---|
| 1031 | HRESULT WINAPI AVIStreamReadFormat(PAVISTREAM iface,LONG pos,LPVOID format,LONG *formatsize); | 
|---|
| 1032 | ULONG WINAPI AVIStreamRelease(PAVISTREAM iface); | 
|---|
| 1033 | HRESULT WINAPI AVIStreamSetFormat(PAVISTREAM iface,LONG pos,LPVOID format,LONG formatsize); | 
|---|
| 1034 | LONG WINAPI AVIStreamStart(PAVISTREAM iface); | 
|---|
| 1035 | HRESULT WINAPI AVIStreamWrite(PAVISTREAM iface,LONG start,LONG samples,LPVOID buffer,LONG buffersize,DWORD flags,LONG *sampwritten,LONG *byteswritten); | 
|---|
| 1036 | HRESULT WINAPI AVIStreamWriteData(PAVISTREAM iface,DWORD fcc,LPVOID lp,LONG size); | 
|---|
| 1037 | HRESULT WINAPI AVIStreamOpenFromFileA(PAVISTREAM *ppavi, LPCSTR szFile, | 
|---|
| 1038 | DWORD fccType, LONG lParam, | 
|---|
| 1039 | UINT mode, CLSID *pclsidHandler); | 
|---|
| 1040 | HRESULT WINAPI AVIStreamOpenFromFileW(PAVISTREAM *ppavi, LPCWSTR szFile, | 
|---|
| 1041 | DWORD fccType, LONG lParam, | 
|---|
| 1042 | UINT mode, CLSID *pclsidHandler); | 
|---|
| 1043 | #define AVIStreamOpenFromFile WINELIB_NAME_AW(AVIStreamOpenFromFile) | 
|---|
| 1044 |  | 
|---|
| 1045 | #define AVIStreamFormatSize(pavi, lPos, plSize) \ | 
|---|
| 1046 | AVIStreamReadFormat(pavi, lPos, NULL, plSize) | 
|---|
| 1047 |  | 
|---|
| 1048 | /***************************************************************************** | 
|---|
| 1049 | * IAVIFile interface | 
|---|
| 1050 | */ | 
|---|
| 1051 | /* In Win32 this interface uses UNICODE only */ | 
|---|
| 1052 | #define ICOM_INTERFACE IAVIFile | 
|---|
| 1053 | #define IAVIFile_METHODS                                                \ | 
|---|
| 1054 | ICOM_METHOD2(HRESULT,Info,         AVIFILEINFOW*,pfi, LONG,lSize) \ | 
|---|
| 1055 | ICOM_METHOD3(HRESULT,GetStream,    PAVISTREAM*,ppStream, DWORD,fccType, LONG,lParam) \ | 
|---|
| 1056 | ICOM_METHOD2(HRESULT,CreateStream, PAVISTREAM*,ppStream, AVISTREAMINFOW*,psi) \ | 
|---|
| 1057 | ICOM_METHOD3(HRESULT,WriteData,    DWORD,fcc, LPVOID,lpBuffer, LONG,cbBuffer) \ | 
|---|
| 1058 | ICOM_METHOD3(HRESULT,ReadData,     DWORD,fcc, LPVOID,lpBuffer, LONG*,lpcbBuffer) \ | 
|---|
| 1059 | ICOM_METHOD (HRESULT,EndRecord)                                 \ | 
|---|
| 1060 | ICOM_METHOD2(HRESULT,DeleteStream, DWORD,fccType, LONG,lParam) | 
|---|
| 1061 | #define IAVIFile_IMETHODS       \ | 
|---|
| 1062 | IUnknown_IMETHODS       \ | 
|---|
| 1063 | IAVIFile_METHODS | 
|---|
| 1064 | ICOM_DEFINE(IAVIFile,IUnknown) | 
|---|
| 1065 | #undef ICOM_INTERFACE | 
|---|
| 1066 |  | 
|---|
| 1067 | /*** IUnknown methods ***/ | 
|---|
| 1068 | #define IAVIFile_QueryInterface(p,a,b) ICOM_CALL2(QueryInterface,p,a,b) | 
|---|
| 1069 | #define IAVIFile_AddRef(p)             ICOM_CALL (AddRef,p) | 
|---|
| 1070 | #define IAVIFile_Release(p)            ICOM_CALL (Release,p) | 
|---|
| 1071 | /*** IAVIFile methods ***/ | 
|---|
| 1072 | #define IAVIFile_Info(p,a,b)         ICOM_CALL2(Info,p,a,b) | 
|---|
| 1073 | #define IAVIFile_GetStream(p,a,b,c)  ICOM_CALL3(GetStream,p,a,b,c) | 
|---|
| 1074 | #define IAVIFile_CreateStream(p,a,b) ICOM_CALL2(CreateStream,p,a,b) | 
|---|
| 1075 | #define IAVIFile_WriteData(p,a,b,c)  ICOM_CALL3(WriteData,p,a,b,c) | 
|---|
| 1076 | #define IAVIFile_ReadData(p,a,b,c)   ICOM_CALL3(ReadData,p,a,b,c) | 
|---|
| 1077 | #define IAVIFile_EndRecord(p)        ICOM_CALL (EndRecord,p) | 
|---|
| 1078 | #define IAVIFile_DeleteStream(p,a,b) ICOM_CALL2(DeleteStream,p,a,b) | 
|---|
| 1079 |  | 
|---|
| 1080 | HRESULT WINAPI AVIFileCreateStreamA(PAVIFILE pfile,PAVISTREAM* ppavi,AVISTREAMINFOA* psi); | 
|---|
| 1081 | HRESULT WINAPI AVIFileCreateStreamW(PAVIFILE pfile,PAVISTREAM* ppavi,AVISTREAMINFOW* psi); | 
|---|
| 1082 | #define AVIFileCreateStream WINELIB_NAME_AW(AVIFileCreateStream) | 
|---|
| 1083 | void WINAPI AVIFileExit(void); | 
|---|
| 1084 | HRESULT WINAPI AVIFileGetStream(PAVIFILE pfile,PAVISTREAM* avis,DWORD fccType,LONG lParam); | 
|---|
| 1085 | HRESULT WINAPI AVIFileInfoA(PAVIFILE pfile,PAVIFILEINFOA pfi,LONG lSize); | 
|---|
| 1086 | HRESULT WINAPI AVIFileInfoW(PAVIFILE pfile,PAVIFILEINFOW pfi,LONG lSize); | 
|---|
| 1087 | #define AVIFileInfo WINELIB_NAME_AW(AVIFileInfo) | 
|---|
| 1088 | void WINAPI AVIFileInit(void); | 
|---|
| 1089 | HRESULT WINAPI AVIFileOpenA(PAVIFILE* ppfile,LPCSTR szFile,UINT uMode,LPCLSID lpHandler); | 
|---|
| 1090 | HRESULT WINAPI AVIFileOpenW(PAVIFILE* ppfile,LPCWSTR szFile,UINT uMode,LPCLSID lpHandler); | 
|---|
| 1091 | #define AVIFileOpen WINELIB_NAME_AW(AVIFileOpen) | 
|---|
| 1092 | ULONG WINAPI AVIFileRelease(PAVIFILE iface); | 
|---|
| 1093 |  | 
|---|
| 1094 |  | 
|---|
| 1095 | /***************************************************************************** | 
|---|
| 1096 | * IGetFrame interface | 
|---|
| 1097 | */ | 
|---|
| 1098 | #define ICOM_INTERFACE IGetFrame | 
|---|
| 1099 | #define IGetFrame_METHODS                                       \ | 
|---|
| 1100 | ICOM_METHOD1(LPVOID, GetFrame,  LONG,lPos) \ | 
|---|
| 1101 | ICOM_METHOD3(HRESULT,Begin,     LONG,lStart, LONG,lEnd, LONG,lRate) \ | 
|---|
| 1102 | ICOM_METHOD (HRESULT,End)                               \ | 
|---|
| 1103 | ICOM_METHOD6(HRESULT,SetFormat, LPBITMAPINFOHEADER,lpbi, LPVOID,lpBits, INT,x, INT,y, INT,dx, INT,dy) | 
|---|
| 1104 | #define IGetFrame_IMETHODS      \ | 
|---|
| 1105 | IUnknown_IMETHODS       \ | 
|---|
| 1106 | IGetFrame_METHODS | 
|---|
| 1107 | ICOM_DEFINE(IGetFrame,IUnknown) | 
|---|
| 1108 | #undef ICOM_INTERFACE | 
|---|
| 1109 |  | 
|---|
| 1110 | /*** IUnknown methods ***/ | 
|---|
| 1111 | #define IGetFrame_QueryInterface(p,a,b) ICOM_CALL2(QueryInterface,p,a,b) | 
|---|
| 1112 | #define IGetFrame_AddRef(p)             ICOM_CALL (AddRef,p) | 
|---|
| 1113 | #define IGetFrame_Release(p)            ICOM_CALL (Release,p) | 
|---|
| 1114 | /*** IGetFrame methods ***/ | 
|---|
| 1115 | #define IGetFrame_GetFrame(p,a)            ICOM_CALL1(GetFrame,p,a) | 
|---|
| 1116 | #define IGetFrame_Begin(p,a,b,c)           ICOM_CALL3(Begin,p,a,b,c) | 
|---|
| 1117 | #define IGetFrame_End(p)                   ICOM_CALL (End,p) | 
|---|
| 1118 | #define IGetFrame_SetFormat(p,a,b,c,d,e,f) ICOM_CALL6(SetFormat,p,a,b,c,d,e,f) | 
|---|
| 1119 |  | 
|---|
| 1120 | #define AVIERR_OK               0 | 
|---|
| 1121 | #define MAKE_AVIERR(error)      MAKE_SCODE(SEVERITY_ERROR,FACILITY_ITF,0x4000+error) | 
|---|
| 1122 |  | 
|---|
| 1123 | #define AVIERR_UNSUPPORTED      MAKE_AVIERR(101) | 
|---|
| 1124 | #define AVIERR_BADFORMAT        MAKE_AVIERR(102) | 
|---|
| 1125 | #define AVIERR_MEMORY           MAKE_AVIERR(103) | 
|---|
| 1126 | #define AVIERR_INTERNAL         MAKE_AVIERR(104) | 
|---|
| 1127 | #define AVIERR_BADFLAGS         MAKE_AVIERR(105) | 
|---|
| 1128 | #define AVIERR_BADPARAM         MAKE_AVIERR(106) | 
|---|
| 1129 | #define AVIERR_BADSIZE          MAKE_AVIERR(107) | 
|---|
| 1130 | #define AVIERR_BADHANDLE        MAKE_AVIERR(108) | 
|---|
| 1131 | #define AVIERR_FILEREAD         MAKE_AVIERR(109) | 
|---|
| 1132 | #define AVIERR_FILEWRITE        MAKE_AVIERR(110) | 
|---|
| 1133 | #define AVIERR_FILEOPEN         MAKE_AVIERR(111) | 
|---|
| 1134 | #define AVIERR_COMPRESSOR       MAKE_AVIERR(112) | 
|---|
| 1135 | #define AVIERR_NOCOMPRESSOR     MAKE_AVIERR(113) | 
|---|
| 1136 | #define AVIERR_READONLY         MAKE_AVIERR(114) | 
|---|
| 1137 | #define AVIERR_NODATA           MAKE_AVIERR(115) | 
|---|
| 1138 | #define AVIERR_BUFFERTOOSMALL   MAKE_AVIERR(116) | 
|---|
| 1139 | #define AVIERR_CANTCOMPRESS     MAKE_AVIERR(117) | 
|---|
| 1140 | #define AVIERR_USERABORT        MAKE_AVIERR(198) | 
|---|
| 1141 | #define AVIERR_ERROR            MAKE_AVIERR(199) | 
|---|
| 1142 |  | 
|---|
| 1143 | /******************************************** | 
|---|
| 1144 | * DrawDib declarations | 
|---|
| 1145 | */ | 
|---|
| 1146 |  | 
|---|
| 1147 | HDRAWDIB VFWAPI DrawDibOpen( void ); | 
|---|
| 1148 | UINT VFWAPI DrawDibRealize(HDRAWDIB hdd, HDC hdc, BOOL fBackground); | 
|---|
| 1149 |  | 
|---|
| 1150 | BOOL VFWAPI DrawDibBegin(HDRAWDIB hdd, HDC hdc, INT dxDst, INT dyDst, | 
|---|
| 1151 | LPBITMAPINFOHEADER lpbi, INT dxSrc, INT dySrc, UINT wFlags); | 
|---|
| 1152 |  | 
|---|
| 1153 | BOOL VFWAPI DrawDibDraw(HDRAWDIB hdd, HDC hdc, INT xDst, INT yDst, INT dxDst, INT dyDst, | 
|---|
| 1154 | LPBITMAPINFOHEADER lpbi, LPVOID lpBits, | 
|---|
| 1155 | INT xSrc, INT ySrc, INT dxSrc, INT dySrc, UINT wFlags); | 
|---|
| 1156 |  | 
|---|
| 1157 | /* DrawDibDraw flags */ | 
|---|
| 1158 |  | 
|---|
| 1159 | #define DDF_UPDATE                      0x0002 | 
|---|
| 1160 | #define DDF_SAME_HDC                    0x0004 | 
|---|
| 1161 | #define DDF_SAME_DRAW                   0x0008 | 
|---|
| 1162 | #define DDF_DONTDRAW                    0x0010 | 
|---|
| 1163 | #define DDF_ANIMATE                     0x0020 | 
|---|
| 1164 | #define DDF_BUFFER                      0x0040 | 
|---|
| 1165 | #define DDF_JUSTDRAWIT                  0x0080 | 
|---|
| 1166 | #define DDF_FULLSCREEN                  0x0100 | 
|---|
| 1167 | #define DDF_BACKGROUNDPAL               0x0200 | 
|---|
| 1168 | #define DDF_NOTKEYFRAME                 0x0400 | 
|---|
| 1169 | #define DDF_HURRYUP                     0x0800 | 
|---|
| 1170 | #define DDF_HALFTONE                    0x1000 | 
|---|
| 1171 |  | 
|---|
| 1172 | #define DDF_PREROLL                     DDF_DONTDRAW | 
|---|
| 1173 | #define DDF_SAME_DIB                    DDF_SAME_DRAW | 
|---|
| 1174 | #define DDF_SAME_SIZE                   DDF_SAME_DRAW | 
|---|
| 1175 |  | 
|---|
| 1176 | BOOL VFWAPI DrawDibSetPalette(HDRAWDIB hdd, HPALETTE hpal); | 
|---|
| 1177 | HPALETTE VFWAPI DrawDibGetPalette(HDRAWDIB hdd); | 
|---|
| 1178 | BOOL VFWAPI DrawDibChangePalette(HDRAWDIB hdd, int iStart, int iLen, LPPALETTEENTRY lppe); | 
|---|
| 1179 | LPVOID VFWAPI DrawDibGetBuffer(HDRAWDIB hdd, LPBITMAPINFOHEADER lpbi, DWORD dwSize, DWORD dwFlags); | 
|---|
| 1180 |  | 
|---|
| 1181 | BOOL VFWAPI DrawDibStart(HDRAWDIB hdd, DWORD rate); | 
|---|
| 1182 | BOOL VFWAPI DrawDibStop(HDRAWDIB hdd); | 
|---|
| 1183 | #define DrawDibUpdate(hdd, hdc, x, y) \ | 
|---|
| 1184 | DrawDibDraw(hdd, hdc, x, y, 0, 0, NULL, NULL, 0, 0, 0, 0, DDF_UPDATE) | 
|---|
| 1185 |  | 
|---|
| 1186 | BOOL VFWAPI DrawDibEnd(HDRAWDIB hdd); | 
|---|
| 1187 | BOOL VFWAPI DrawDibClose(HDRAWDIB hdd); | 
|---|
| 1188 |  | 
|---|
| 1189 | /* display profiling */ | 
|---|
| 1190 | #define PD_CAN_DRAW_DIB         0x0001 | 
|---|
| 1191 | #define PD_CAN_STRETCHDIB       0x0002 | 
|---|
| 1192 | #define PD_STRETCHDIB_1_1_OK    0x0004 | 
|---|
| 1193 | #define PD_STRETCHDIB_1_2_OK    0x0008 | 
|---|
| 1194 | #define PD_STRETCHDIB_1_N_OK    0x0010 | 
|---|
| 1195 |  | 
|---|
| 1196 | DWORD VFWAPI DrawDibProfileDisplay(LPBITMAPINFOHEADER lpbi); | 
|---|
| 1197 |  | 
|---|
| 1198 | #ifdef __cplusplus | 
|---|
| 1199 | } | 
|---|
| 1200 | #endif  /* __cplusplus */ | 
|---|
| 1201 |  | 
|---|
| 1202 | #endif /* __WINE_VFW_H */ | 
|---|