2
// This unit is part of the GLScene Engine https://github.com/glscene
11
(****************************************************************************
13
* VfW.H - Video for windows include file for WIN32
15
* Copyright (c) 1991-1999, Microsoft Corp. All rights reserved.
17
* This include files defines interfaces to the following
20
* COMPMAN - Installable Compression Manager.
21
* DRAWDIB - Routines for drawing to the display.
22
* VIDEO - Video Capture Driver Interface
24
* AVIFMT - AVI File Format structure definitions.
25
* MMREG - FOURCC and other things
27
* AVIFile - Interface for reading AVI Files and AVI Streams
28
* MCIWND - MCI/AVI window class
29
* AVICAP - AVI Capture Window class
31
* MSACM - Audio compression manager.
33
* The following symbols control inclusion of various parts of this file:
35
* NOCOMPMAN - dont include COMPMAN
36
* NODRAWDIB - dont include DRAWDIB
37
* NOVIDEO - dont include video capture interface
39
* NOAVIFMT - dont include AVI file format structs
40
* NOMMREG - dont include MMREG
42
* NOAVIFILE - dont include AVIFile interface
43
* NOMCIWND - dont include AVIWnd class.
44
* NOAVICAP - dont include AVICap class.
46
* NOMSACM - dont include ACM stuff.
48
****************************************************************************)
50
(******************************************************************************)
52
(* VFW.PAS Conversion by Ronald Dittrich *)
54
(* E-Mail: info@swiftsoft.de *)
55
(* http://www.swiftsoft.de *)
57
(******************************************************************************)
59
(******************************************************************************)
61
(* Modyfied: 25.April.2000 *)
64
(* Ivo Steinmann: isteinmann@bluewin.ch *)
66
(* Please send all messages regarding specific errors and lacks of this unit *)
69
(******************************************************************************)
71
(******************************************************************************)
73
(* Modyfied: 2000-12-07 *)
76
(* Peter Haas: PeterJHaas@t-online.de *)
78
(* Only modified line 1380 ( TAVIPALCHANGE.peNew ) *)
80
(******************************************************************************)
90
(****************************************************************************
94
***************************************************************************)
102
(****************************************************************************
104
* VideoForWindowsVersion() - returns version of VfW
106
***************************************************************************)
108
function VideoForWindowsVersion: DWORD; pascal;
110
(****************************************************************************
112
* call these to start stop using VfW from your app.
114
***************************************************************************)
116
function InitVFW: LONG; stdcall;
117
function TermVFW: LONG; stdcall; }
119
(****************************************************************************/
123
/* should we define this?? */
125
/****************************************************************************)
127
function MKFOURCC(ch0, ch1, ch2, ch3: AnsiChar): FOURCC;
129
(****************************************************************************
131
* COMPMAN - Installable Compression Manager.
133
****************************************************************************)
139
HIC = THandle; // Handle to an Installable Compressor
142
// this code in biCompression means the DIB must be accesed via
143
// 48 bit pointers! using *ONLY* the selector given.
146
BI_1632 = $32333631; // '1632'
148
function mmioFOURCC(ch0, ch1, ch2, ch3: AnsiChar): FOURCC;
153
function aviTWOCC(ch0, ch1: AnsiChar): TWOCC;
156
ICTYPE_VIDEO = $63646976; {vidc}
157
ICTYPE_AUDIO = $63647561; {audc}
162
ICERR_NEWPALETTE = 2 ;
163
ICERR_GOTOKEYFRAME = 3 ;
164
ICERR_STOPDRAWING = 4 ;
166
ICERR_UNSUPPORTED = -1 ;
167
ICERR_BADFORMAT = -2 ;
169
ICERR_INTERNAL = -4 ;
170
ICERR_BADFLAGS = -5 ;
171
ICERR_BADPARAM = -6 ;
173
ICERR_BADHANDLE = -8 ;
174
ICERR_CANTUPDATE = -9 ;
177
ICERR_BADBITDEPTH = -200 ;
178
ICERR_BADIMAGESIZE = -201 ;
180
ICERR_CUSTOM = -400 ; // errors less than ICERR_CUSTOM...
182
{-- Values for dwFlags of ICOpen() -------------------------------------------}
184
ICMODE_COMPRESS = 1 ;
185
ICMODE_DECOMPRESS = 2 ;
186
ICMODE_FASTDECOMPRESS = 3 ;
188
ICMODE_FASTCOMPRESS = 5 ;
191
{-- Flags for AVI file index -------------------------------------------------}
193
AVIIF_LIST = $00000001 ;
194
AVIIF_TWOCC = $00000002 ;
195
AVIIF_KEYFRAME = $00000010 ;
197
{-- quality flags ------------------------------------------------------------}
200
ICQUALITY_HIGH = 10000 ;
201
ICQUALITY_DEFAULT = -1 ;
203
(************************************************************************
204
************************************************************************)
206
ICM_USER = (DRV_USER+$0000) ;
208
ICM_RESERVED_LOW = (DRV_USER+$1000) ;
209
ICM_RESERVED_HIGH = (DRV_USER+$2000) ;
210
ICM_RESERVED = ICM_RESERVED_LOW ;
212
(************************************************************************
216
************************************************************************)
218
ICM_GETSTATE = (ICM_RESERVED+0) ; // Get compressor state
219
ICM_SETSTATE = (ICM_RESERVED+1) ; // Set compressor state
220
ICM_GETINFO = (ICM_RESERVED+2) ; // Query info about the compressor
222
ICM_CONFIGURE = (ICM_RESERVED+10); // show the configure dialog
223
ICM_ABOUT = (ICM_RESERVED+11); // show the about box
225
ICM_GETDEFAULTQUALITY = (ICM_RESERVED+30); // get the default value for quality
226
ICM_GETQUALITY = (ICM_RESERVED+31); // get the current value for quality
227
ICM_SETQUALITY = (ICM_RESERVED+32); // set the default value for quality
229
ICM_SET = (ICM_RESERVED+40); // Tell the driver something
230
ICM_GET = (ICM_RESERVED+41); // Ask the driver something
232
{-- Constants for ICM_SET: ---------------------------------------------------}
234
ICM_FRAMERATE = $526D7246; {FrmR}
235
ICM_KEYFRAMERATE = $5279654B; {KeyR}
237
(************************************************************************
239
ICM specific messages.
241
************************************************************************)
243
ICM_COMPRESS_GET_FORMAT = (ICM_USER+4) ; // get compress format or size
244
ICM_COMPRESS_GET_SIZE = (ICM_USER+5) ; // get output size
245
ICM_COMPRESS_QUERY = (ICM_USER+6) ; // query support for compress
246
ICM_COMPRESS_BEGIN = (ICM_USER+7) ; // begin a series of compress calls.
247
ICM_COMPRESS = (ICM_USER+8) ; // compress a frame
248
ICM_COMPRESS_END = (ICM_USER+9) ; // end of a series of compress calls.
250
ICM_DECOMPRESS_GET_FORMAT = (ICM_USER+10) ; // get decompress format or size
251
ICM_DECOMPRESS_QUERY = (ICM_USER+11) ; // query support for dempress
252
ICM_DECOMPRESS_BEGIN = (ICM_USER+12) ; // start a series of decompress calls
253
ICM_DECOMPRESS = (ICM_USER+13) ; // decompress a frame
254
ICM_DECOMPRESS_END = (ICM_USER+14) ; // end a series of decompress calls
255
ICM_DECOMPRESS_SET_PALETTE = (ICM_USER+29) ; // fill in the DIB color table
256
ICM_DECOMPRESS_GET_PALETTE = (ICM_USER+30) ; // fill in the DIB color table
258
ICM_DRAW_QUERY = (ICM_USER+31) ; // query support for dempress
259
ICM_DRAW_BEGIN = (ICM_USER+15) ; // start a series of draw calls
260
ICM_DRAW_GET_PALETTE = (ICM_USER+16) ; // get the palette needed for drawing
261
ICM_DRAW_START = (ICM_USER+18) ; // start decompress clock
262
ICM_DRAW_STOP = (ICM_USER+19) ; // stop decompress clock
263
ICM_DRAW_END = (ICM_USER+21) ; // end a series of draw calls
264
ICM_DRAW_GETTIME = (ICM_USER+32) ; // get value of decompress clock
265
ICM_DRAW = (ICM_USER+33) ; // generalized "render" message
266
ICM_DRAW_WINDOW = (ICM_USER+34) ; // drawing window has moved or hidden
267
ICM_DRAW_SETTIME = (ICM_USER+35) ; // set correct value for decompress clock
268
ICM_DRAW_REALIZE = (ICM_USER+36) ; // realize palette for drawing
269
ICM_DRAW_FLUSH = (ICM_USER+37) ; // clear out buffered frames
270
ICM_DRAW_RENDERBUFFER = (ICM_USER+38) ; // draw undrawn things in queue
272
ICM_DRAW_START_PLAY = (ICM_USER+39) ; // start of a play
273
ICM_DRAW_STOP_PLAY = (ICM_USER+40) ; // end of a play
275
ICM_DRAW_SUGGESTFORMAT = (ICM_USER+50) ; // Like ICGetDisplayFormat
276
ICM_DRAW_CHANGEPALETTE = (ICM_USER+51) ; // for animating palette
278
ICM_GETBUFFERSWANTED = (ICM_USER+41) ; // ask about prebuffering
280
ICM_GETDEFAULTKEYFRAMERATE = (ICM_USER+42) ; // get the default value for key frames
282
ICM_DECOMPRESSEX_BEGIN = (ICM_USER+60) ; // start a series of decompress calls
283
ICM_DECOMPRESSEX_QUERY = (ICM_USER+61) ; // start a series of decompress calls
284
ICM_DECOMPRESSEX = (ICM_USER+62) ; // decompress a frame
285
ICM_DECOMPRESSEX_END = (ICM_USER+63) ; // end a series of decompress calls
287
ICM_COMPRESS_FRAMES_INFO = (ICM_USER+70) ; // tell about compress to come
288
ICM_SET_STATUS_PROC = (ICM_USER+72) ; // set status callback
290
(************************************************************************
291
************************************************************************)
295
TICOPEN = packed record
296
dwSize : DWORD ; // sizeof(ICOPEN)
297
fccType : DWORD ; // 'vidc'
298
fccHandler : DWORD ; //
299
dwVersion : DWORD ; // version of compman opening you
300
dwFlags : DWORD ; // LOWORD is type specific
301
dwError : DWORD ; // error return.
302
pV1Reserved : PVOID ; // Reserved
303
pV2Reserved : PVOID ; // Reserved
304
dnDevNode : DWORD ; // Devnode for PnP devices
307
(************************************************************************
308
************************************************************************)
311
TICINFO = packed record
312
dwSize : DWORD; // sizeof(ICINFO)
313
fccType : DWORD; // compressor type 'vidc' 'audc'
314
fccHandler : DWORD; // compressor sub-type 'rle ' 'jpeg' 'pcm '
315
dwFlags : DWORD; // flags LOWORD is type specific
316
dwVersion : DWORD; // version of the driver
317
dwVersionICM : DWORD; // version of the ICM used
319
// under Win32, the driver always returns UNICODE strings.
321
szName : array[0..15] of WChar ; // short name
322
szDescription : array[0..127] of WChar ; // DWORD name
323
szDriver : array[0..127] of WChar ; // driver that contains compressor
326
{-- Flags for the <dwFlags> field of the <ICINFO> structure. ------------}
329
VIDCF_QUALITY = $0001 ; // supports quality
330
VIDCF_CRUNCH = $0002 ; // supports crunching to a frame size
331
VIDCF_TEMPORAL = $0004 ; // supports inter-frame compress
332
VIDCF_COMPRESSFRAMES = $0008 ; // wants the compress all frames message
333
VIDCF_DRAW = $0010 ; // supports drawing
334
VIDCF_FASTTEMPORALC = $0020 ; // does not need prev frame on compress
335
VIDCF_FASTTEMPORALD = $0080 ; // does not need prev frame on decompress
336
//VIDCF_QUALITYTIME = $0040 ; // supports temporal quality
338
//VIDCF_FASTTEMPORAL = (VIDCF_FASTTEMPORALC or VIDCF_FASTTEMPORALD)
340
(************************************************************************
341
************************************************************************)
343
ICCOMPRESS_KEYFRAME = $00000001;
346
PICCOMPRESS = ^TICCOMPRESS;
347
TICCOMPRESS = packed record
348
dwFlags : DWORD; // flags
350
lpbiOutput : PBITMAPINFOHEADER ; // output format
351
lpOutput : PVOID ; // output data
353
lpbiInput : PBITMAPINFOHEADER ; // format of frame to compress
354
lpInput : PVOID ; // frame data to compress
356
lpckid : PDWORD ; // ckid for data in AVI file
357
lpdwFlags : PDWORD; // flags in the AVI index.
358
lFrameNum : LONG ; // frame number of seq.
359
dwFrameSize : DWORD ; // reqested size in bytes. (if non zero)
361
dwQuality : DWORD ; // quality
363
// these are new fields
365
lpbiPrev : PBITMAPINFOHEADER ; // format of previous frame
366
lpPrev : PVOID ; // previous frame
369
(************************************************************************
370
************************************************************************)
373
ICCOMPRESSFRAMES_PADDING = $00000001 ;
376
TICCompressProc = function(lInputOutput: LPARAM; lFrame: DWORD; lpBits: PVOID; len: LONG): LONG; stdcall;
378
PICCOMPRESSFRAMES = ^TICCOMPRESSFRAMES;
379
TICCOMPRESSFRAMES = packed record
380
dwFlags : DWORD ; // flags
382
lpbiOutput : PBITMAPINFOHEADER ; // output format
383
lOutput : LPARAM ; // output identifier
385
lpbiInput : PBITMAPINFOHEADER ; // format of frame to compress
386
lInput : LPARAM ; // input identifier
388
lStartFrame : LONG ; // start frame
389
lFrameCount : LONG ; // # of frames
391
lQuality : LONG ; // quality
392
lDataRate : LONG ; // data rate
393
lKeyRate : LONG ; // key frame rate
395
dwRate : DWORD ; // frame rate, as always
398
dwOverheadPerFrame : DWORD ;
399
dwReserved2 : DWORD ;
401
GetData : TICCompressProc;
402
PutData : TICCompressProc;
405
{-- Messages for Status callback ---------------------------------------------}
409
ICSTATUS_STATUS = 1 ; // l = % done
411
ICSTATUS_ERROR = 3 ; // l = error string (LPSTR)
415
// return nonzero means abort operation in progress
416
TICStatusProc = function(lParam: LPARAM; message: UINT; l: LONG): LONG; stdcall;
418
PICSETSTATUSPROC = ^TICSETSTATUSPROC;
419
TICSETSTATUSPROC = packed record
422
Status : TICStatusProc;
425
(************************************************************************
426
************************************************************************)
429
ICDECOMPRESS_HURRYUP = $80000000 ; // don't draw just buffer (hurry up!)
430
ICDECOMPRESS_UPDATE = $40000000 ; // don't draw just update screen
431
ICDECOMPRESS_PREROLL = $20000000 ; // this frame is before real start
432
ICDECOMPRESS_NULLFRAME = $10000000 ; // repeat last frame
433
ICDECOMPRESS_NOTKEYFRAME = $08000000 ; // this frame is not a key frame
436
PICDECOMPRESS = ^TICDECOMPRESS;
437
TICDECOMPRESS = packed record
438
dwFlags : DWORD ; // flags (from AVI index...)
439
lpbiInput : PBITMAPINFOHEADER ; // BITMAPINFO of compressed data
440
// biSizeImage has the chunk size
441
lpInput : PVOID ; // compressed data
442
lpbiOutput : PBITMAPINFOHEADER ; // DIB to decompress to
444
ckid : DWORD ; // ckid from AVI file
447
PICDECOMPRESSEX = ^TICDECOMPRESSEX;
448
TICDECOMPRESSEX = packed record
451
// same as ICM_DECOMPRESS
455
lpbiSrc : PBITMAPINFOHEADER; // BITMAPINFO of compressed data
456
lpSrc : PVOID; // compressed data
457
lpbiDst : PBITMAPINFOHEADER; // DIB to decompress to
458
lpDst : PVOID; // output data
461
// new for ICM_DECOMPRESSEX
464
xDst : int; // destination rectangle
469
xSrc : int; // source rectangle
475
(************************************************************************
476
************************************************************************)
479
ICDRAW_QUERY = $00000001 ; // test for support
480
ICDRAW_FULLSCREEN = $00000002 ; // draw to full screen
481
ICDRAW_HDC = $00000004 ; // draw to a HDC/HWND
482
ICDRAW_ANIMATE = $00000008 ; // expect palette animation
483
ICDRAW_CONTINUE = $00000010 ; // draw is a continuation of previous draw
484
ICDRAW_MEMORYDC = $00000020 ; // DC is offscreen, by the way
485
ICDRAW_UPDATING = $00000040 ; // We're updating, as opposed to playing
486
ICDRAW_RENDER = $00000080 ; // used to render data not draw it
487
ICDRAW_BUFFER = $00000100 ; // please buffer this data offscreen, we will need to update it
490
PICDRAWBEGIN = ^TICDRAWBEGIN;
491
TICDRAWBEGIN = packed record
492
dwFlags : DWORD ; // flags
494
hpal : HPALETTE ; // palette to draw with
495
hwnd : HWND ; // window to draw to
496
hdc : HDC ; // HDC to draw to
498
xDst : int ; // destination rectangle
503
lpbi : PBITMAPINFOHEADER ;
504
// format of frame to draw
506
xSrc : int ; // source rectangle
511
dwRate : DWORD ; // frames/second = (dwRate/dwScale)
515
(************************************************************************
516
************************************************************************)
519
ICDRAW_HURRYUP = $80000000 ; // don't draw just buffer (hurry up!)
520
ICDRAW_UPDATE = $40000000 ; // don't draw just update screen
521
ICDRAW_PREROLL = $20000000 ; // this frame is before real start
522
ICDRAW_NULLFRAME = $10000000 ; // repeat last frame
523
ICDRAW_NOTKEYFRAME = $08000000 ; // this frame is not a key frame
527
TICDRAW = packed record
528
dwFlags : DWORD ; // flags
529
lpFormat : PVOID ; // format of frame to decompress
530
lpData : PVOID ; // frame data to decompress
532
lTime : LONG ; // time in drawbegin units (see dwRate and dwScale)
535
PICDRAWSUGGEST = ^TICDRAWSUGGEST;
536
TICDRAWSUGGEST = packed record
537
lpbiIn : PBITMAPINFOHEADER ; // format to be drawn
538
lpbiSuggest : PBITMAPINFOHEADER ; // location for suggested format (or NULL to get size)
539
dxSrc : int ; // source extent or 0
541
dxDst : int ; // dest extent or 0
543
hicDecompressor : HIC ; // decompressor you can talk to
546
(************************************************************************
547
************************************************************************)
549
PICPALETTE = ^TICPALETTE;
550
TICPALETTE = packed record
551
dwFlags : DWORD ; // flags (from AVI index...)
552
iStart : int ; // first palette to change
553
iLen : int ; // count of entries to change.
554
lppe : PPALETTEENTRY ; // palette
557
(************************************************************************
559
ICM function declarations
561
************************************************************************)
563
function ICInfo(fccType, fccHandler: DWORD; lpicinfo: PICINFO) : BOOL ; stdcall ;
564
function ICInstall(fccType, fccHandler: DWORD; lParam: LPARAM; szDesc: LPSTR; wFlags: UINT) : BOOL ; stdcall ;
565
function ICRemove(fccType, fccHandler: DWORD; wFlags: UINT) : BOOL ; stdcall ;
566
function ICGetInfo(hic: HIC; picinfo: PICINFO; cb: DWORD) : DWORD ; stdcall ;
568
function ICOpen(fccType, fccHandler: DWORD; wMode: UINT) : HIC ; stdcall ;
569
function ICOpenFunction(fccType, fccHandler: DWORD; wMode: UINT; lpfnHandler: TFarProc) : HIC ; stdcall ;
570
function ICClose(hic: HIC) : DWORD; stdcall ;
572
function ICSendMessage(hic: HIC; msg: UINT; dw1, dw2: DWORD) : DWORD ; stdcall ;
574
{-- Values for wFlags of ICInstall -------------------------------------------}
577
ICINSTALL_UNICODE = $8000 ;
579
ICINSTALL_FUNCTION = $0001 ; // lParam is a DriverProc (function ptr)
580
ICINSTALL_DRIVER = $0002 ; // lParam is a driver name (string)
581
ICINSTALL_HDRV = $0004 ; // lParam is a HDRVR (driver handle)
583
ICINSTALL_DRIVERW = $8002 ; // lParam is a unicode driver name
585
{-- Query macros -------------------------------------------------------------}
587
ICMF_CONFIGURE_QUERY = $00000001 ;
588
ICMF_ABOUT_QUERY = $00000001 ;
590
function ICQueryAbout(hic: HIC): BOOL;
591
function ICAbout(hic: HIC; hwnd: HWND): DWORD;
592
function ICQueryConfigure(hic: HIC): BOOL;
593
function ICConfigure(hic: HIC; hwnd: HWND): DWORD;
595
{-- Get/Set state macros -----------------------------------------------------}
597
function ICGetState(hic: HIC; pv: PVOID; cb: DWORD): DWORD;
598
function ICSetState(hic: HIC; pv: PVOID; cb: DWORD): DWORD;
599
function ICGetStateSize(hic: HIC): DWORD;
601
{-- Get value macros ---------------------------------------------------------}
603
function ICGetDefaultQuality(hic: HIC): DWORD;
604
function ICGetDefaultKeyFrameRate(hic: HIC): DWORD;
606
{-- Draw window macro --------------------------------------------------------}
608
function ICDrawWindow(hic: HIC; prc: PRECT): DWORD;
610
(************************************************************************
612
compression functions
614
************************************************************************/
618
* compress a single frame
623
dwFlags : DWORD; // flags
624
lpbiOutput : PBITMAPINFOHEADER; // output format
625
lpData : PVOID; // output data
626
lpbiInput : PBITMAPINFOHEADER; // format of frame to compress
627
lpBits : PVOID; // frame data to compress
628
lpckid : PDWORD; // ckid for data in AVI file
629
lpdwFlags : PDWORD; // flags in the AVI index.
630
lFrameNum : DWORD; // frame number of seq.
631
dwFrameSize : DWORD; // reqested size in bytes. (if non zero)
632
dwQuality : DWORD; // quality within one frame
633
lpbiPrev : PBITMAPINFOHEADER; // format of previous frame
634
lpPrev : PVOID // previous frame
640
* start compression from a source format (lpbiInput) to a dest
641
* format (lpbiOuput) is supported.
645
function ICCompressBegin(hic: HIC; lpbiInput: PBITMAPINFOHEADER; lpbiOutput: PBITMAPINFOHEADER): DWORD;
650
* determines if compression from a source format (lpbiInput) to a dest
651
* format (lpbiOuput) is supported.
655
function ICCompressQuery(hic: HIC; lpbiInput, lpbiOutput: PBITMAPINFOHEADER): DWORD;
658
* ICCompressGetFormat()
660
* get the output format, (format of compressed data)
661
* if lpbiOutput is NULL return the size in bytes needed for format.
665
function ICCompressGetFormat(hic: HIC; lpbiInput, lpbiOutput: PBITMAPINFOHEADER): DWORD;
666
function ICCompressGetFormatSize(hic: HIC; lpbi: PBITMAPINFOHEADER): DWORD;
671
* return the maximal size of a compressed frame
675
function ICCompressGetSize(hic: HIC; lpbiInput, lpbiOutput: PBITMAPINFOHEADER): DWORD;
676
function ICCompressEnd(hic: HIC): DWORD;
678
(************************************************************************
680
decompression functions
682
************************************************************************)
687
* decompress a single frame
691
function ICDecompress(
693
dwFlags : DWORD; // flags (from AVI index...)
694
lpbiFormat : PBITMAPINFOHEADER; // BITMAPINFO of compressed data
695
// biSizeImage has the chunk size
696
lpData : PVOID; // data
697
lpbi : PBITMAPINFOHEADER; // DIB to decompress to
702
* ICDecompressBegin()
704
* start compression from a source format (lpbiInput) to a dest
705
* format (lpbiOutput) is supported.
709
function ICDecompressBegin(hic: HIC; lpbiInput, lpbiOutput: PBITMAPINFOHEADER): DWORD;
712
* ICDecompressQuery()
714
* determines if compression from a source format (lpbiInput) to a dest
715
* format (lpbiOutput) is supported.
719
function ICDecompressQuery(hic: HIC; lpbiInput, lpbiOutput: PBITMAPINFOHEADER): DWORD;
722
* ICDecompressGetFormat()
724
* get the output format, (format of un-compressed data)
725
* if lpbiOutput is NULL return the size in bytes needed for format.
729
function ICDecompressGetFormat(hic: HIC; lpbiInput, lpbiOutput: PBITMAPINFOHEADER): DWORD;
730
function ICDecompressGetFormatSize(hic: HIC; lpbi: PBITMAPINFOHEADER): DWORD;
733
* ICDecompressGetPalette()
735
* get the output palette
739
function ICDecompressGetPalette(hic: HIC; lpbiInput, lpbiOutput: PBITMAPINFOHEADER): DWORD;
740
function ICDecompressSetPalette(hic: HIC; lpbiPalette: PBITMAPINFOHEADER): DWORD;
742
function ICDecompressEnd(hic: HIC): DWORD;
744
(************************************************************************
746
decompression (ex) functions
748
************************************************************************)
751
// on Win16 these functions are macros that call ICMessage. ICMessage will
752
// not work on NT. rather than add new entrypoints we have given
753
// them as static inline functions
759
* decompress a single frame
763
function ICDecompressEx(
766
lpbiSrc : PBITMAPINFOHEADER;
772
lpbiDst : PBITMAPINFOHEADER;
781
* ICDecompressExBegin()
783
* start compression from a source format (lpbiInput) to a dest
784
* format (lpbiOutput) is supported.
788
function ICDecompressExBegin(
791
lpbiSrc : PBITMAPINFOHEADER;
797
lpbiDst : PBITMAPINFOHEADER;
806
* ICDecompressExQuery()
810
function ICDecompressExQuery(
813
lpbiSrc : PBITMAPINFOHEADER;
819
lpbiDst : PBITMAPINFOHEADER;
827
function ICDecompressExEnd(hic: HIC): DWORD;
829
(************************************************************************
833
************************************************************************)
838
* start decompressing data with format (lpbiInput) directly to the screen
840
* return zero if the decompressor supports drawing.
846
dwFlags : DWORD; // flags
847
hpal : HPALETTE; // palette to draw with
848
hwnd : HWND; // window to draw to
849
hdc : HDC; // HDC to draw to
850
xDst : int; // destination rectangle
854
lpbi : PBITMAPINFOHEADER; // format of frame to draw
855
xSrc : int; // source rectangle
859
dwRate : DWORD; // frames/second = (dwRate/dwScale)
866
* decompress data directly to the screen
872
dwFlags : DWORD; // flags
873
lpFormat : PVOID; // format of frame to decompress
874
lpData : PVOID; // frame data to decompress
875
cbData : DWORD; // size of data
876
lTime : DWORD // time to draw this frame
879
// ICMessage is not supported on Win32, so provide a static inline function
881
function ICDrawSuggestFormat(
883
lpbiIn : PBITMAPINFOHEADER;
884
lpbiOut : PBITMAPINFOHEADER;
895
* determines if the compressor is willing to render the specified format.
899
function ICDrawQuery(hic: HIC; lpbiInput: PBITMAPINFOHEADER): DWORD;
900
function ICDrawChangePalette(hic: HIC; lpbiInput: PBITMAPINFOHEADER): DWORD;
901
function ICGetBuffersWanted(hic: HIC; lpdwBuffers: PDWORD): DWORD;
902
function ICDrawEnd(hic: HIC): DWORD;
903
function ICDrawStart(hic: HIC): DWORD;
904
function ICDrawStartPlay(hic: HIC; lFrom, lTo: DWORD): DWORD;
905
function ICDrawStop(hic: HIC): DWORD;
906
function ICDrawStopPlay(hic: HIC): DWORD;
907
function ICDrawGetTime(hic: HIC; lplTime: PDWORD): DWORD;
908
function ICDrawSetTime(hic: HIC; lTime: DWORD): DWORD;
909
function ICDrawRealize(hic: HIC; hdc: HDC; fBackground: BOOL): DWORD;
910
function ICDrawFlush(hic: HIC): DWORD;
911
function ICDrawRenderBuffer(hic: HIC): DWORD;
913
(************************************************************************
915
Status callback functions
917
************************************************************************/
922
* Set the status callback function
927
// ICMessage is not supported on NT
928
function ICSetStatusProc(
932
fpfnStatus : TICStatusProc
935
(************************************************************************
937
helper routines for DrawDib and MCIAVI...
939
************************************************************************)
941
function ICLocate(fccType, fccHandler: DWORD; lpbiIn, lpbiOut: PBITMAPINFOHEADER; wFlags: WORD): HIC; stdcall;
942
function ICGetDisplayFormat(hic: HIC; lpbiIn, lpbiOut: PBITMAPINFOHEADER; BitDepth: int; dx, dy: int): HIC; stdcall;
944
function ICDecompressOpen(fccType, fccHandler: DWORD; lpbiIn, lpbiOut: PBITMAPINFOHEADER): HIC;
945
function ICDrawOpen(fccType, fccHandler: DWORD; lpbiIn: PBITMAPINFOHEADER): HIC;
947
(************************************************************************
948
Higher level functions
949
************************************************************************)
951
function ICImageCompress(
952
hic : HIC; // compressor to use
953
uiFlags : UINT; // flags (none yet)
954
lpbiIn : PBITMAPINFO; // format to compress from
955
lpBits : PVOID; // data to compress
956
lpbiOut : PBITMAPINFO; // compress to this (NULL ==> default)
957
lQuality : LONG; // quality to use
958
plSize : PDWORD // compress to this size (0=whatever)
961
function ICImageDecompress(
962
hic : HIC; // compressor to use
963
uiFlags : UINT; // flags (none yet)
964
lpbiIn : PBITMAPINFO; // format to decompress from
965
lpBits : PVOID; // data to decompress
966
lpbiOut : PBITMAPINFO // decompress to this (NULL ==> default)
969
{-- TCompVars ----------------------------------------------------------------}
972
// Structure used by ICSeqCompressFrame and ICCompressorChoose routines
973
// Make sure this matches the autodoc in icm.c!
977
PCOMPVARS = ^TCOMPVARS;
978
TCOMPVARS = packed record
979
cbSize : DWORD; // set to sizeof(COMPVARS) before
980
// calling ICCompressorChoose
981
dwFlags : DWORD; // see below...
982
hic : HIC; // HIC of chosen compressor
983
fccType : DWORD; // basically ICTYPE_VIDEO
984
fccHandler : DWORD; // handler of chosen compressor or
986
lpbiIn : PBITMAPINFO; // input format
987
lpbiOut : PBITMAPINFO; // output format - will compress to this
991
lKey : LONG; // key frames how often?
992
lDataRate : LONG; // desired data rate KB/Sec
993
lQ : LONG; // desired quality
995
lpState : PVOID; // state of compressor
996
cbState : LONG; // size of the state
999
// FLAGS for dwFlags element of COMPVARS structure:
1000
// set this flag if you initialize COMPVARS before calling ICCompressorChoose
1003
ICMF_COMPVARS_VALID = $00000001; // COMPVARS contains valid data
1006
// allows user to choose compressor, quality etc...
1008
function ICCompressorChoose(
1009
hwnd : HWND; // parent window for dialog
1010
uiFlags : UINT; // flags
1011
pvIn : PVOID; // input format (optional)
1012
lpData : PVOID; // input data (optional)
1013
pc : PCOMPVARS; // data about the compressor/dlg
1014
lpszTitle : LPSTR // dialog title (optional)
1017
// defines for uiFlags
1020
ICMF_CHOOSE_KEYFRAME = $0001; // show KeyFrame Every box
1021
ICMF_CHOOSE_DATARATE = $0002; // show DataRate box
1022
ICMF_CHOOSE_PREVIEW = $0004; // allow expanded preview dialog
1023
ICMF_CHOOSE_ALLCOMPRESSORS = $0008; // don't only show those that
1024
// can handle the input format
1027
function ICSeqCompressFrameStart(pc: PCOMPVARS; lpbiIn: PBITMAPINFO): BOOL; stdcall;
1028
procedure ICSeqCompressFrameEnd(pc: PCOMPVARS); stdcall;
1030
function ICSeqCompressFrame(
1031
pc : PCOMPVARS; // set by ICCompressorChoose
1032
uiFlags : UINT; // flags
1033
lpBits : PVOID; // input DIB bits
1034
pfKey : PBOOL; // did it end up being a key frame?
1035
plSize : PDWORD // size to compress to/of returned image
1038
procedure ICCompressorFree(pc: PCOMPVARS); stdcall;
1041
(**************************************************************************
1043
* DRAWDIB - Routines for drawing to the display.
1045
*************************************************************************)
1048
HDRAWDIB = THandle; // hdd
1050
(*********************************************************************
1054
**********************************************************************)
1057
DDF_UPDATE = $0002; // re-draw the last DIB
1058
DDF_SAME_HDC = $0004; // HDC same as last call (all setup)
1059
DDF_SAME_DRAW = $0008; // draw params are the same
1060
DDF_DONTDRAW = $0010; // dont draw frame, just decompress
1061
DDF_ANIMATE = $0020; // allow palette animation
1062
DDF_BUFFER = $0040; // always buffer image
1063
DDF_JUSTDRAWIT = $0080; // just draw it with GDI
1064
DDF_FULLSCREEN = $0100; // use DisplayDib
1065
DDF_BACKGROUNDPAL = $0200; // Realize palette in background
1066
DDF_NOTKEYFRAME = $0400; // this is a partial frame update, hint
1067
DDF_HURRYUP = $0800; // hurry up please!
1068
DDF_HALFTONE = $1000; // always halftone
1070
DDF_PREROLL = DDF_DONTDRAW; // Builing up a non-keyframe
1071
DDF_SAME_DIB = DDF_SAME_DRAW;
1072
DDF_SAME_SIZE = DDF_SAME_DRAW;
1074
(*********************************************************************
1078
*********************************************************************)
1080
{-- DrawDibOpen() ------------------------------------------------------------}
1082
function DrawDibOpen: HDRAWDIB; stdcall;
1084
{-- DrawDibClose() -----------------------------------------------------------}
1086
function DrawDibClose(hdd: HDRAWDIB): BOOL; stdcall;
1088
{-- DrawDibGetBuffer() -------------------------------------------------------}
1090
function DrawDibGetBuffer(hdd: HDRAWDIB; lpbi: PBITMAPINFOHEADER; dwSize: DWORD; dwFlags: DWORD): PVOID; stdcall;
1092
{-- DrawDibGetPalette() - get the palette used for drawing DIBs --------------}
1094
function DrawDibGetPalette(hdd: HDRAWDIB): HPALETTE; stdcall;
1096
{-- DrawDibSetPalette() - set the palette used for drawing DIBs --------------}
1098
function DrawDibSetPalette(hdd: HDRAWDIB; hpal: HPALETTE): BOOL; stdcall;
1100
{-- DrawDibChangePalette() ---------------------------------------------------}
1102
function DrawDibChangePalette(hdd: HDRAWDIB; iStart, iLen: int; lppe: PPALETTEENTRY): BOOL; stdcall;
1104
{-- DrawDibRealize() - realize the palette in a HDD --------------------------}
1106
function DrawDibRealize(hdd: HDRAWDIB; hdc: HDC; fBackground: BOOL): UINT; stdcall;
1108
{-- DrawDibStart() - start of streaming playback -----------------------------}
1110
function DrawDibStart(hdd: HDRAWDIB; rate: DWORD): BOOL; stdcall;
1112
{-- DrawDibStop() - start of streaming playback ------------------------------}
1114
function DrawDibStop(hdd: HDRAWDIB): BOOL; stdcall;
1116
{-- DrawDibBegin() - prepare to draw -----------------------------------------}
1118
function DrawDibBegin(
1123
lpbi : PBITMAPINFOHEADER;
1129
{-- DrawDibDraw() - actually draw a DIB to the screen ------------------------}
1131
function DrawDibDraw(
1138
lpbi : PBITMAPINFOHEADER;
1147
{-- DrawDibUpdate() - redraw last image (may only be valid with DDF_BUFFER) --}
1149
function DrawDibUpdate(hdd: HDRAWDIB; hdc: HDC; x, y: int): BOOL;
1151
{-- DrawDibEnd() -------------------------------------------------------------}
1153
function DrawDibEnd(hdd: HDRAWDIB): BOOL; stdcall;
1155
{-- DrawDibTime() - for debugging purposes only ------------------------------}
1158
PDRAWDIBTIME = ^TDRAWDIBTIME;
1159
TDRAWDIBTIME = packed record
1162
timeDecompress : LONG;
1166
timeSetDIBits : LONG;
1169
function DrawDibTime(hdd: HDRAWDIB; lpddtime: PDRAWDIBTIME): BOOL; stdcall;
1171
{-- Display profiling --------------------------------------------------------}
1174
PD_CAN_DRAW_DIB = $0001; // if you can draw at all
1175
PD_CAN_STRETCHDIB = $0002; // basicly RC_STRETCHDIB
1176
PD_STRETCHDIB_1_1_OK = $0004; // is it fast?
1177
PD_STRETCHDIB_1_2_OK = $0008; // ...
1178
PD_STRETCHDIB_1_N_OK = $0010; // ...
1180
function DrawDibProfileDisplay(lpbi: PBITMAPINFOHEADER): DWORD; stdcall;
1182
(****************************************************************************
1184
* AVIFMT - AVI file format definitions
1186
****************************************************************************)
1189
// The following is a short description of the AVI file format. Please
1190
// see the accompanying documentation for a full explanation.
1192
// An AVI file is the following RIFF form:
1196
// avih(<MainAVIHeader>)
1198
// strh(<Stream header>)
1199
// strf(<Stream format>)
1200
// ... additional header data
1210
// The main file header specifies how many streams are present. For
1211
// each one, there must be a stream header chunk and a stream format
1212
// chunk, enlosed in a 'strl' LIST chunk. The 'strf' chunk contains
1213
// type-specific format information; for a video stream, this should
1214
// be a BITMAPINFO structure, including palette. For an audio stream,
1215
// this should be a WAVEFORMAT (or PCMWAVEFORMAT) structure.
1217
// The actual data is contained in subchunks within the 'movi' LIST
1218
// chunk. The first two characters of each data chunk are the
1219
// stream number with which that data is associated.
1221
// Some defined chunk types:
1223
// ##db: RGB DIB bits
1224
// ##dc: RLE8 compressed DIB bits
1225
// ##pc: Palette Change
1228
// ##wb: waveform audio bytes
1230
// The grouping into LIST 'rec' chunks implies only that the contents of
1231
// the chunk should be read into memory at the same time. This
1232
// grouping is used for files specifically intended to be played from
1235
// The index chunk at the end of the file should contain one entry for
1236
// each data chunk in the file.
1238
// Limitations for the current software:
1239
// Only one video stream and one audio stream are allowed.
1240
// The streams must start at the beginning of the file.
1243
// To register codec types please obtain a copy of the Multimedia
1244
// Developer Registration Kit from:
1246
// Microsoft Corporation
1247
// Multimedia Systems Group
1250
// Redmond, WA 98052-6399
1253
{-- form types, list types and chunk types -----------------------------------}
1256
formtypeAVI = $20495641; // mmioFOURCC('A', 'V', 'I', ' ')
1257
listtypeAVIHEADER = $6C726468; // mmioFOURCC('h', 'd', 'r', 'l')
1258
ckidAVIMAINHDR = $68697661; // mmioFOURCC('a', 'v', 'i', 'h')
1259
listtypeSTREAMHEADER = $6C727473; // mmioFOURCC('s', 't', 'r', 'l')
1260
ckidSTREAMHEADER = $68727473; // mmioFOURCC('s', 't', 'r', 'h')
1261
ckidSTREAMFORMAT = $66727473; // mmioFOURCC('s', 't', 'r', 'f')
1262
ckidSTREAMHANDLERDATA = $64727473; // mmioFOURCC('s', 't', 'r', 'd')
1263
ckidSTREAMNAME = $6E727473; // mmioFOURCC('s', 't', 'r', 'n')
1265
listtypeAVIMOVIE = $69766F6D; // mmioFOURCC('m', 'o', 'v', 'i')
1266
listtypeAVIRECORD = $20636572; // mmioFOURCC('r', 'e', 'c', ' ')
1268
ckidAVINEWINDEX = $31786469; // mmioFOURCC('i', 'd', 'x', '1')
1270
{-- Stream types for the <fccType> field of the stream header ----------------}
1272
streamtypeVIDEO = $73646976; // mmioFOURCC('v', 'i', 'd', 's')
1273
streamtypeAUDIO = $73647561; // mmioFOURCC('a', 'u', 'd', 's')
1274
streamtypeMIDI = $7364696D; // mmioFOURCC('m', 'i', 'd', 's')
1275
streamtypeTEXT = $73747874; // mmioFOURCC('t', 'x', 't', 's')
1277
{-- Basic chunk types --------------------------------------------------------}
1279
cktypeDIBbits = $6264; // aviTWOCC('d', 'b')
1280
cktypeDIBcompressed = $6364; // aviTWOCC('d', 'c')
1281
cktypePALchange = $6370; // aviTWOCC('p', 'c')
1282
cktypeWAVEbytes = $6277; // aviTWOCC('w', 'b')
1284
{-- Chunk id to use for extra chunks for padding -----------------------------}
1286
ckidAVIPADDING = $4B4E554A; // mmioFOURCC('J', 'U', 'N', 'K')
1291
** Warning: These are nasty macro, and MS C 6.0 compiles some of them
1292
** incorrectly if optimizations are on. Ack.
1295
{-- Macro to get stream number out of a FOURCC ckid --------------------------}
1297
function FromHex(n: BYTE): BYTE;
1298
function StreamFromFOURCC(fcc: DWORD): BYTE;
1300
{-- Macro to get TWOCC chunk type out of a FOURCC ckid -----------------------}
1302
function TWOCCFromFOURCC(fcc: DWORD): WORD;
1304
{-- Macro to make a ckid for a chunk out of a TWOCC and a stream num (0-255) -}
1306
function ToHex(n: BYTE): BYTE;
1307
function MAKEAVICKID(tcc: WORD; stream: BYTE): DWORD;
1309
{-- Main AVI file header -----------------------------------------------------}
1311
{-- flags for use in <dwFlags> in AVIFileHdr ---------------------------------}
1314
AVIF_HASINDEX = $00000010; // Index at end of file?
1315
AVIF_MUSTUSEINDEX = $00000020;
1316
AVIF_ISINTERLEAVED = $00000100;
1317
AVIF_TRUSTCKTYPE = $00000800; // Use CKType to find key frames?
1318
AVIF_WASCAPTUREFILE = $00010000;
1319
AVIF_COPYRIGHTED = $00020000;
1321
{-- The AVI File Header LIST chunk should be padded to this size -------------}
1324
AVI_HEADERSIZE = 2048; // size of AVI header list
1327
PMainAVIHeader = ^TMainAVIHeader;
1328
TMainAVIHeader = packed record
1329
dwMicroSecPerFrame : DWORD; // frame display rate (or 0L)
1330
dwMaxBytesPerSec : DWORD; // max. transfer rate
1331
dwPaddingGranularity : DWORD; // pad to multiples of this
1332
// size; normally 2K.
1333
dwFlags : DWORD; // the ever-present flags
1334
dwTotalFrames : DWORD; // # frames in file
1335
dwInitialFrames : DWORD;
1337
dwSuggestedBufferSize : DWORD;
1342
dwReserved : array[0..3] of DWORD;
1345
{-- Stream header ------------------------------------------------------------}
1348
AVISF_DISABLED = $00000001;
1350
AVISF_VIDEO_PALCHANGES = $00010000;
1353
PAVIStreamHeader = ^TAVIStreamHeader;
1354
TAVIStreamHeader = packed record
1356
fccHandler : FOURCC;
1357
dwFlags : DWORD; // Contains AVITF_* flags
1360
dwInitialFrames : DWORD;
1362
dwRate : DWORD; // dwRate / dwScale == samples/second
1364
dwLength : DWORD; // In units above...
1365
dwSuggestedBufferSize : DWORD;
1367
dwSampleSize : DWORD;
1371
{-- Flags for index ----------------------------------------------------------}
1374
AVIIF_NOTIME = $00000100; // this frame doesn't take any time
1375
AVIIF_COMPUSE = $0FFF0000; // these bits are for compressor use
1378
PAVIINDEXENTRY = ^TAVIINDEXENTRY;
1379
TAVIINDEXENTRY = packed record
1382
dwChunkOffset : DWORD; // Position of chunk
1383
dwChunkLength : DWORD; // Length of chunk
1386
{-- Palette change chunk (used in video streams) -----------------------------}
1388
PAVIPALCHANGE = ^TAVIPALCHANGE;
1389
TAVIPALCHANGE = packed record
1390
bFirstEntry : BYTE; // first entry to change
1391
bNumEntries : BYTE; // # entries to change (0 if 256)
1392
wFlags : WORD; // Mostly to preserve alignment...
1393
peNew : array[0..0] of TPALETTEENTRY; // New color specifications
1396
(****************************************************************************
1398
* AVIFile - routines for reading/writing standard AVI files
1400
***************************************************************************)
1403
// Ansi - Unicode thunking.
1405
// Unicode or Ansi-only apps can call the avifile APIs.
1406
// any Win32 app who wants to use
1407
// any of the AVI COM interfaces must be UNICODE - the AVISTREAMINFO and
1408
// AVIFILEINFO structures used in the Info methods of these interfaces are
1409
// the unicode variants, and no thunking to or from ansi takes place
1410
// except in the AVIFILE api entrypoints.
1412
// For Ansi/Unicode thunking: for each entrypoint or structure that
1413
// uses chars or strings, two versions are declared in the Win32 version,
1414
// ApiNameW and ApiNameA. The default name ApiName is #defined to one or
1415
// other of these depending on whether UNICODE is defined (during
1416
// compilation of the app that is including this header). The source will
1417
// contain ApiName and ApiNameA (with ApiName being the Win16 implementation,
1418
// and also #defined to ApiNameW, and ApiNameA being the thunk entrypoint).
1421
// For GetFrame::SetFormat - use the best format for the display
1424
AVIGETFRAMEF_BESTDISPLAYFMT = 1;
1427
// Structures used by AVIStreamInfo & AVIFileInfo.
1429
// These are related to, but not identical to, the header chunks
1433
{-- AVISTREAMINFO ------------------------------------------------------------}
1435
// for Unicode/Ansi thunking we need to declare three versions of this!
1438
PAVIStreamInfoW = ^TAVIStreamInfoW;
1439
TAVIStreamInfoW = packed record
1442
dwFlags : DWORD; // Contains AVITF_* flags
1447
dwRate : DWORD; // dwRate / dwScale == samples/second
1449
dwLength : DWORD; // In units above...
1450
dwInitialFrames : DWORD;
1451
dwSuggestedBufferSize : DWORD;
1453
dwSampleSize : DWORD;
1455
dwEditCount : DWORD;
1456
dwFormatChangeCount : DWORD;
1457
szName : array[0..63] of WideChar;
1460
PAVIStreamInfoA = ^TAVIStreamInfoA;
1461
TAVIStreamInfoA = packed record
1464
dwFlags : DWORD; // Contains AVITF_* flags
1469
dwRate : DWORD; // dwRate / dwScale == samples/second
1471
dwLength : DWORD; // In units above...
1472
dwInitialFrames : DWORD;
1473
dwSuggestedBufferSize : DWORD;
1475
dwSampleSize : DWORD;
1477
dwEditCount : DWORD;
1478
dwFormatChangeCount : DWORD;
1479
szName : array[0..63] of AnsiChar;
1482
PAVIStreamInfo = ^TAVIStreamInfo;
1484
TAVIStreamInfo = TAVIStreamInfoW;
1486
TAVIStreamInfo = TAVIStreamInfoA;
1490
AVISTREAMINFO_DISABLED = $00000001;
1491
AVISTREAMINFO_FORMATCHANGES = $00010000;
1493
{-- AVIFILEINFO --------------------------------------------------------------}
1496
PAVIFileInfoW = ^TAVIFileInfoW;
1497
TAVIFileInfoW = packed record
1498
dwMaxBytesPerSec : DWORD; // max. transfer rate
1499
dwFlags : DWORD; // the ever-present flags
1502
dwSuggestedBufferSize : DWORD;
1508
dwRate : DWORD; // dwRate / dwScale == samples/second
1511
dwEditCount : DWORD;
1513
szFileType : array[0..63] of WideChar;
1514
// descriptive string for file type?
1517
PAVIFileInfoA = ^TAVIFileInfoA;
1518
TAVIFileInfoA = packed record
1519
dwMaxBytesPerSec : DWORD; // max. transfer rate
1520
dwFlags : DWORD; // the ever-present flags
1523
dwSuggestedBufferSize : DWORD;
1529
dwRate : DWORD; // dwRate / dwScale == samples/second
1532
dwEditCount : DWORD;
1534
szFileType : array[0..63] of AnsiChar;
1535
// descriptive string for file type?
1538
PAVIFileInfo = ^TAVIFileInfo;
1540
TAVIFileInfo = TAVIFileInfoW;
1542
TAVIFileInfo = TAVIFileInfoA;
1545
{-- Flags for dwFlags --------------------------------------------------------}
1548
AVIFILEINFO_HASINDEX = $00000010;
1549
AVIFILEINFO_MUSTUSEINDEX = $00000020;
1550
AVIFILEINFO_ISINTERLEAVED = $00000100;
1551
AVIFILEINFO_WASCAPTUREFILE = $00010000;
1552
AVIFILEINFO_COPYRIGHTED = $00020000;
1554
{-- Flags for dwCaps ---------------------------------------------------------}
1556
AVIFILECAPS_CANREAD = $00000001;
1557
AVIFILECAPS_CANWRITE = $00000002;
1558
AVIFILECAPS_ALLKEYFRAMES = $00000010;
1559
AVIFILECAPS_NOCOMPRESSION = $00000020;
1562
TAVISAVECALLBACK = function(i: int): BOOL; pascal;
1564
{-- AVICOMPRESSOPTIONS -------------------------------------------------------}
1566
// Make sure it matches the AutoDoc in avisave.c !!!
1569
PAVICOMPRESSOPTIONS = ^TAVICOMPRESSOPTIONS;
1570
TAVICOMPRESSOPTIONS = packed record
1571
fccType : DWORD; // stream type, for consistency
1572
fccHandler : DWORD; // compressor
1573
dwKeyFrameEvery : DWORD; // keyframe rate
1574
dwQuality : DWORD; // compress quality 0-10,000
1575
dwBytesPerSecond : DWORD; // bytes per second
1576
dwFlags : DWORD; // flags... see below
1577
lpFormat : PVOID; // save format
1579
lpParms : PVOID; // compressor options
1581
dwInterleaveEvery : DWORD; // for non-video streams only
1585
// Defines for the dwFlags field of the AVICOMPRESSOPTIONS struct
1586
// Each of these flags determines if the appropriate field in the structure
1587
// (dwInterleaveEvery, dwBytesPerSecond, and dwKeyFrameEvery) is payed
1588
// attention to. See the autodoc in avisave.c for details.
1592
AVICOMPRESSF_INTERLEAVE = $00000001; // interleave
1593
AVICOMPRESSF_DATARATE = $00000002; // use a data rate
1594
AVICOMPRESSF_KEYFRAMES = $00000004; // use keyframes
1595
AVICOMPRESSF_VALID = $00000008; // has valid data?
1597
(* - - - - - - - - */
1600
/****** AVI Stream Interface *******************************************)
1603
IAVIStream = interface(IUnknown)
1604
function Create(lParam1, lParam2: LPARAM): HResult; stdcall;
1605
function Info(var psi: TAVIStreamInfoW; lSize: LONG): HResult; stdcall;
1606
function FindSample(lPos: LONG; lFlags: LONG): LONG; stdcall;
1607
function ReadFormat(lPos: LONG; lpFormat: PVOID; var lpcbFormat: LONG): HResult; stdcall;
1608
function SetFormat(lPos: LONG; lpFormat: PVOID; cbFormat: LONG): HResult; stdcall;
1609
function Read(lStart: LONG; lSamples: LONG; lpBuffer: PVOID; cbBuffer: LONG; var plBytes, plSamples: LONG): HResult; stdcall;
1610
function Write(lStart: LONG; lSamples: LONG; lpBuffer: PVOID; cbBuffer: LONG; dwFlags: DWORD; var plSampWritten, plBytesWritten: LONG): HResult; stdcall;
1611
function Delete(lStart: LONG; lSamples: LONG): HResult; stdcall;
1612
function ReadData(fcc: DWORD; lp: PVOID; var lpcb: LONG): HResult; stdcall;
1613
function WriteData(fcc: DWORD; lp: PVOID; cb: LONG): HResult; stdcall;
1614
function SetInfo(var lpInfo: TAVIStreamInfoW; cbInfo: LONG): HResult; stdcall;
1617
IAVIStreaming = interface(IUnknown)
1618
function _Begin(lStart, lEnd : LONG; lRate : LONG): HResult; stdcall;
1619
function _End: HResult; stdcall;
1622
IAVIEditStream = interface(IUnknown)
1623
function Cut(var plStart, plLength: LONG; var ppResult: IAVIStream): HResult; stdcall;
1624
function Copy(var plStart, plLength: LONG; var ppResult: IAVIStream): HResult; stdcall;
1625
function Paste(var plPos: LONG; var plLength: LONG; pstream: IAVIStream; lStart, lEnd: LONG): HResult; stdcall;
1626
function Clone(var ppResult: IAVIStream): HResult; stdcall;
1627
function SetInfo(var lpInfo: TAVIStreamInfoW; cbInfo: LONG): HResult; stdcall;
1630
{-- AVIFile ------------------------------------------------------------------}
1632
IAVIFile = interface(IUnknown)
1633
function Info(var pfi: TAVIFileInfoW; iSize: LONG): HResult; stdcall;
1634
function GetStream(var ppStream: IAVISTREAM; fccType: DWORD; lParam: LONG): HResult; stdcall;
1635
function CreateStream(var ppStream: IAVISTREAM; var psi: TAVIStreamInfoW): HResult; stdcall;
1636
function WriteData(ckid: DWORD; lpData: PVOID; cbData: LONG): HResult; stdcall;
1637
function ReadData(ckid: DWORD; lpData: PVOID; lpcbData: PLONG): HResult; stdcall;
1638
function EndRecord: HResult; stdcall;
1639
function DeleteStream(fccType: DWORD; lParam: LONG): HResult; stdcall;
1642
{-- GetFrame -----------------------------------------------------------------}
1644
// The functions 'BeginExtraction' and 'EndExtraction' have actually
1645
// the names 'Begin' and 'End', but we cannot use that identifiers for
1648
IGetFrame = interface(IUnknown)
1649
function GetFrame(lPos: LONG): PBitmapInfoHeader; stdcall;
1650
function BeginExtraction(lStart, lEnd, lRate: LONG): HResult; stdcall;
1651
function EndExtraction: HResult; stdcall;
1652
function SetFormat(var lpbi: TBitmapInfoHeader; lpBits: Pointer; x, y, dx, dy: Integer): HResult; stdcall;
1655
{-- GUIDs --------------------------------------------------------------------}
1658
IID_IAVIFile : TGUID = (D1: $00020020; D2: $0; D3: $0; D4:($C0,$0,$0,$0,$0,$0,$0,$46));
1659
IID_IAVIStream : TGUID = (D1: $00020021; D2: $0; D3: $0; D4:($C0,$0,$0,$0,$0,$0,$0,$46));
1660
IID_IAVIStreaming : TGUID = (D1: $00020022; D2: $0; D3: $0; D4:($C0,$0,$0,$0,$0,$0,$0,$46));
1661
IID_IGetFrame : TGUID = (D1: $00020023; D2: $0; D3: $0; D4:($C0,$0,$0,$0,$0,$0,$0,$46));
1662
IID_IAVIEditStream: TGUID = (D1: $00020024; D2: $0; D3: $0; D4:($C0,$0,$0,$0,$0,$0,$0,$46));
1664
CLSID_AVISimpleUnMarshal : TGUID = (D1: $00020009; D2: $0; D3: $0; D4:($C0,$0,$0,$0,$0,$0,$0,$46));
1665
CLSID_AVIFile : TGUID = (D1: $00020000; D2: $0; D3: $0; D4:($C0,$0,$0,$0,$0,$0,$0,$46));
1667
AVIFILEHANDLER_CANREAD = $0001;
1668
AVIFILEHANDLER_CANWRITE = $0002;
1669
AVIFILEHANDLER_CANACCEPTNONRGB = $0004;
1671
{-- Functions ----------------------------------------------------------------}
1673
procedure AVIFileInit; stdcall; // Call this first!
1674
procedure AVIFileExit; stdcall;
1676
function AVIFileAddRef(pfile: IAVIFile): ULONG; stdcall;
1677
function AVIFileRelease(pfile: IAVIFile): ULONG; stdcall;
1679
function AVIFileOpenA(var ppfile: IAVIFile; szFile: LPCSTR; uMode: UINT; lpHandler: PCLSID): HResult; stdcall;
1680
function AVIFileOpenW(var ppfile: IAVIFile; szFile: LPCWSTR; uMode: UINT; lpHandler: PCLSID): HResult; stdcall;
1683
function AVIFileOpen(var ppfile: IAVIFile; szFile: LPCWSTR; uMode: UINT; lpHandler: PCLSID): HResult; stdcall;
1685
function AVIFileOpen(var ppfile: IAVIFile; szFile: LPCSTR; uMode: UINT; lpHandler: PCLSID): HResult; stdcall;
1688
function AVIFileInfoW(pfile: IAVIFile; var pfi: TAVIFILEINFOW; lSize: LONG): HResult; stdcall;
1689
function AVIFileInfoA(pfile: IAVIFile; var pfi: TAVIFILEINFOA; lSize: LONG): HResult; stdcall;
1691
function AVIFileInfo(pfile: IAVIFile; var pfi: TAVIFILEINFO; lSize: LONG): HResult; stdcall;
1693
function AVIFileGetStream(pfile: IAVIFile; var ppavi: IAVISTREAM; fccType: DWORD; lParam: LONG): HResult; stdcall;
1695
function AVIFileCreateStreamW(pfile: IAVIFile; var ppavi: IAVISTREAM; var psi: TAVISTREAMINFOW): HResult; stdcall;
1696
function AVIFileCreateStreamA(pfile: IAVIFile; var ppavi: IAVISTREAM; var psi: TAVISTREAMINFOA): HResult; stdcall;
1698
function AVIFileCreateStream(pfile: IAVIFile; var ppavi: IAVISTREAM; var psi: TAVISTREAMINFO): HResult; stdcall;
1700
function AVIFileWriteData(pfile: IAVIFile; ckid: DWORD; lpData: PVOID; cbData: LONG): HResult; stdcall;
1701
function AVIFileReadData(pfile: IAVIFile; ckid: DWORD; lpData: PVOID; var lpcbData: LONG): HResult; stdcall;
1702
function AVIFileEndRecord(pfile: IAVIFile): HResult; stdcall;
1704
function AVIStreamAddRef(pavi: IAVIStream): ULONG; stdcall;
1705
function AVIStreamRelease(pavi: IAVIStream): ULONG; stdcall;
1707
function AVIStreamInfoW (pavi: IAVIStream; var psi: TAVISTREAMINFOW; lSize: LONG): HResult; stdcall;
1708
function AVIStreamInfoA (pavi: IAVIStream; var psi: TAVISTREAMINFOA; lSize: LONG): HResult; stdcall;
1710
function AVIStreamInfo(pavi: IAVIStream; var psi: TAVISTREAMINFO; lSize: LONG): HResult; stdcall;
1712
function AVIStreamFindSample(pavi: IAVIStream; lPos: LONG; lFlags: LONG): LONG; stdcall;
1713
function AVIStreamReadFormat(pavi: IAVIStream; lPos: LONG; lpFormat: PVOID; lpcbFormat: PLONG): HResult; stdcall;
1714
function AVIStreamSetFormat(pavi: IAVIStream; lPos: LONG; lpFormat: PVOID; cbFormat: LONG): HResult; stdcall;
1715
function AVIStreamReadData(pavi: IAVIStream; fcc: DWORD; lp: PVOID; lpcb: PLONG): HResult; stdcall;
1716
function AVIStreamWriteData(pavi: IAVIStream; fcc: DWORD; lp: PVOID; cb: LONG): HResult; stdcall;
1718
function AVIStreamRead(
1726
): HResult; stdcall;
1729
AVISTREAMREAD_CONVENIENT = -1;
1731
function AVIStreamWrite(
1738
plSampWritten : PLONG;
1739
plBytesWritten : PLONG
1740
): HResult; stdcall;
1742
// Right now, these just use AVIStreamInfo() to get information, then
1743
// return some of it. Can they be more efficient?
1745
function AVIStreamStart(pavi: IAVIStream): LONG; stdcall;
1746
function AVIStreamLength(pavi: IAVIStream): LONG; stdcall;
1747
function AVIStreamTimeToSample(pavi: IAVIStream; lTime: LONG): LONG; stdcall;
1748
function AVIStreamSampleToTime(pavi: IAVIStream; lSample: LONG): LONG; stdcall;
1750
function AVIStreamBeginStreaming(pavi: IAVIStream; lStart, lEnd: LONG; lRate: LONG): HResult; stdcall;
1751
function AVIStreamEndStreaming(pavi: IAVIStream): HResult; stdcall;
1753
{-- Helper functions for using IGetFrame -------------------------------------}
1755
function AVIStreamGetFrameOpen(pavi: IAVIStream; lpbiWanted: PBitmapInfoHeader): IGetFrame; stdcall;
1756
function AVIStreamGetFrame(pg: IGetFrame; lPos: LONG): PBitmapInfoHeader; stdcall;
1757
function AVIStreamGetFrameClose(pg: IGetFrame): HResult; stdcall;
1759
// !!! We need some way to place an advise on a stream....
1760
// STDAPI AVIStreamHasChanged (PAVISTREAM pavi);
1762
{-- Shortcut function --------------------------------------------------------}
1764
function AVIStreamOpenFromFileA(var ppavi: IAVISTREAM; szFile: LPCSTR; fccType: DWORD;
1765
lParam: LONG; mode: UINT; pclsidHandler: PCLSID): HResult; stdcall;
1766
function AVIStreamOpenFromFileW(var ppavi: IAVISTREAM; szFile: LPCWSTR; fccType: DWORD;
1767
lParam: LONG; mode: UINT; pclsidHandler: PCLSID): HResult; stdcall;
1770
function AVIStreamOpenFromFile(var ppavi: IAVISTREAM; szFile: LPCWSTR; fccType: DWORD;
1771
lParam: LONG; mode: UINT; pclsidHandler: PCLSID): HResult; stdcall;
1773
function AVIStreamOpenFromFile(var ppavi: IAVISTREAM; szFile: LPCSTR; fccType: DWORD;
1774
lParam: LONG; mode: UINT; pclsidHandler: PCLSID): HResult; stdcall;
1777
{-- Use to create disembodied streams ----------------------------------------}
1779
function AVIStreamCreate(var ppavi: IAVISTREAM; lParam1, lParam2: LONG; pclsidHandler: PCLSID): HResult; stdcall;
1781
// PHANDLER AVIAPI AVIGetHandler (PAVISTREAM pavi, PAVISTREAMHANDLER psh);
1782
// PAVISTREAM AVIAPI AVIGetStream (PHANDLER p);
1784
{-- Flags for AVIStreamFindSample --------------------------------------------}
1787
FIND_DIR = $0000000F; // direction
1788
FIND_NEXT = $00000001; // go forward
1789
FIND_PREV = $00000004; // go backward
1790
FIND_FROM_START = $00000008; // start at the logical beginning
1792
FIND_TYPE = $000000F0; // type mask
1793
FIND_KEY = $00000010; // find key frame.
1794
FIND_ANY = $00000020; // find any (non-empty) sample
1795
FIND_FORMAT = $00000040; // find format change
1797
FIND_RET = $0000F000; // return mask
1798
FIND_POS = $00000000; // return logical position
1799
FIND_LENGTH = $00001000; // return logical size
1800
FIND_OFFSET = $00002000; // return physical position
1801
FIND_SIZE = $00003000; // return physical size
1802
FIND_INDEX = $00004000; // return physical index position
1804
{-- Stuff to support backward compat. ----------------------------------------}
1806
function AVIStreamFindKeyFrame(var pavi: IAVISTREAM; lPos: LONG; lFlags: LONG): DWORD; stdcall; // AVIStreamFindSample
1808
// Non-portable: this is alias for method name
1809
// FindKeyFrame FindSample
1811
function AVIStreamClose(pavi: IAVISTREAM): ULONG; stdcall; // AVIStreamRelease
1812
function AVIFileClose(pfile: IAVIFILE): ULONG; stdcall; // AVIFileRelease
1813
procedure AVIStreamInit; stdcall; // AVIFileInit
1814
procedure AVIStreamExit; stdcall; // AVIFileExit
1817
SEARCH_NEAREST = FIND_PREV;
1818
SEARCH_BACKWARD = FIND_PREV;
1819
SEARCH_FORWARD = FIND_NEXT;
1820
SEARCH_KEY = FIND_KEY;
1821
SEARCH_ANY = FIND_ANY;
1823
{-- Helper macros ------------------------------------------------------------}
1825
function AVIStreamSampleToSample(pavi1, pavi2: IAVISTREAM; l: LONG): LONG;
1826
function AVIStreamNextSample(pavi: IAVISTREAM; l: LONG): LONG;
1827
function AVIStreamPrevSample(pavi: IAVISTREAM; l: LONG): LONG;
1828
function AVIStreamNearestSample(pavi: IAVISTREAM; l: LONG): LONG;
1829
function AVIStreamNextKeyFrame(pavi: IAVISTREAM; l: LONG): LONG;
1830
function AVIStreamPrevKeyFrame(pavi: IAVISTREAM; l: LONG): LONG;
1831
function AVIStreamNearestKeyFrame(pavi: IAVISTREAM; l: LONG): LONG;
1832
function AVIStreamIsKeyFrame(pavi: IAVISTREAM; l: LONG): BOOL;
1833
function AVIStreamPrevSampleTime(pavi: IAVISTREAM; t: LONG): LONG;
1834
function AVIStreamNextSampleTime(pavi: IAVISTREAM; t: LONG): LONG;
1835
function AVIStreamNearestSampleTime(pavi: IAVISTREAM; t: LONG): LONG;
1836
function AVIStreamNextKeyFrameTime(pavi: IAVISTREAM; t: LONG): LONG;
1837
function AVIStreamPrevKeyFrameTime(pavi: IAVISTREAM; t: LONG): LONG;
1838
function AVIStreamNearestKeyFrameTime(pavi: IAVISTREAM; t: LONG): LONG;
1839
function AVIStreamStartTime(pavi: IAVISTREAM): LONG;
1840
function AVIStreamLengthTime(pavi: IAVISTREAM): LONG;
1841
function AVIStreamEnd(pavi: IAVISTREAM): LONG;
1842
function AVIStreamEndTime(pavi: IAVISTREAM): LONG;
1843
function AVIStreamSampleSize(pavi: IAVISTREAM; lPos: LONG; plSize: PLONG): LONG;
1844
function AVIStreamFormatSize(pavi: IAVISTREAM; lPos: LONG; plSize: PLONG): HResult;
1845
function AVIStreamDataSize(pavi: IAVISTREAM; fcc: DWORD; plSize: PLONG): HResult;
1847
{== AVISave routines and structures ==========================================}
1850
comptypeDIB = $20424944; // mmioFOURCC('D', 'I', 'B', ' ')
1852
function AVIMakeCompressedStream(
1853
var ppsCompressed : IAVISTREAM;
1854
ppsSource : IAVISTREAM;
1855
lpOptions : PAVICOMPRESSOPTIONS;
1856
pclsidHandler : PCLSID
1857
): HResult; stdcall;
1859
// Non-portable: uses variable number of params
1860
// EXTERN_C HRESULT CDECL AVISaveA (LPCSTR szFile,
1861
// CLSID FAR *pclsidHandler,
1862
// AVISAVECALLBACK lpfnCallback,
1865
// LPAVICOMPRESSOPTIONS lpOptions,
1870
pclsidHandler : PCLSID;
1871
lpfnCallback : TAVISAVECALLBACK;
1873
var ppavi : IAVISTREAM;
1874
var plpOptions : PAVICOMPRESSOPTIONS
1875
): HResult; stdcall;
1877
// Non-portable: uses variable number of params
1878
// EXTERN_C HRESULT CDECL AVISaveW (LPCWSTR szFile,
1879
// CLSID FAR *pclsidHandler,
1880
// AVISAVECALLBACK lpfnCallback,
1883
// LPAVICOMPRESSOPTIONS lpOptions,
1888
pclsidHandler : PCLSID;
1889
lpfnCallback : TAVISAVECALLBACK;
1891
var ppavi : IAVISTREAM;
1892
var plpOptions : PAVICOMPRESSOPTIONS
1893
): HResult; stdcall;
1895
// #define AVISave AVISaveA
1899
pclsidHandler : PCLSID;
1900
lpfnCallback : TAVISAVECALLBACK;
1902
var ppavi : IAVISTREAM;
1903
var plpOptions : PAVICOMPRESSOPTIONS
1904
): HResult; stdcall; // AVISaveVA
1906
function AVISaveOptions(
1910
var ppavi : IAVISTREAM;
1911
var plpOptions : PAVICOMPRESSOPTIONS
1914
function AVISaveOptionsFree(nStreams: int; var plpOptions: PAVICOMPRESSOPTIONS): HResult; stdcall;
1916
{-- FLAGS FOR uiFlags --------------------------------------------------------}
1918
// Same as the flags for ICCompressorChoose (see compman.h)
1919
// These determine what the compression options dialog for video streams
1922
function AVIBuildFilterW(lpszFilter: LPWSTR; cbFilter: LONG; fSaving: BOOL): HResult; stdcall;
1923
function AVIBuildFilterA(lpszFilter: LPSTR; cbFilter: LONG; fSaving: BOOL): HResult; stdcall;
1925
function AVIBuildFilter(lpszFilter: LPSTR; cbFilter: LONG; fSaving: BOOL): HResult; stdcall; // AVIBuildFilterA
1927
function AVIMakeFileFromStreams(var ppfile: IAVIFILE; nStreams: int; var papStreams: IAVISTREAM): HResult; stdcall;
1929
function AVIMakeStreamFromClipboard(cfFormat: UINT; hGlobal: THANDLE; var ppstream: IAVISTREAM): HResult; stdcall;
1931
{-- Clipboard routines -------------------------------------------------------}
1933
function AVIPutFileOnClipboard(pf: IAVIFILE): HResult; stdcall;
1934
function AVIGetFromClipboard(var lppf: IAVIFILE): HResult; stdcall;
1935
function AVIClearClipboard: HResult; stdcall;
1937
{-- Editing routines ---------------------------------------------------------}
1939
function CreateEditableStream(var ppsEditable: IAVISTREAM; psSource: IAVISTREAM): HResult; stdcall;
1941
function EditStreamCut(pavi: IAVISTREAM; var plStart, plLength: LONG; var ppResult: IAVISTREAM): HResult; stdcall;
1943
function EditStreamCopy(pavi: IAVISTREAM; var plStart, plLength: LONG; var ppResult: IAVISTREAM): HResult; stdcall;
1945
function EditStreamPaste(pavi: IAVISTREAM; var plPos, plLength: LONG; pstream: IAVISTREAM; lStart, lEnd: LONG): HResult; stdcall;
1947
function EditStreamClone(pavi: IAVISTREAM; var ppResult: IAVISTREAM): HResult; stdcall;
1949
function EditStreamSetNameA(pavi: IAVISTREAM; lpszName: LPCSTR): HResult; stdcall;
1950
function EditStreamSetNameW(pavi: IAVISTREAM; lpszName: LPCWSTR): HResult; stdcall;
1951
function EditStreamSetInfoW(pavi: IAVISTREAM; lpInfo: PAVISTREAMINFOW; cbInfo: LONG): HResult; stdcall;
1952
function EditStreamSetInfoA(pavi: IAVISTREAM; lpInfo: PAVISTREAMINFOA; cbInfo: LONG): HResult; stdcall;
1954
function EditStreamSetInfo(pavi: IAVISTREAM; lpInfo: PAVISTREAMINFOA; cbInfo: LONG): HResult; stdcall; // EditStreamSetInfoA
1955
function EditStreamSetName(pavi: IAVISTREAM; lpszName: LPCSTR): HResult; stdcall; // EditStreamSetNameA
1957
{-- Error handling -----------------------------------------------------------}
1962
// !!! Questions to be answered:
1963
// How can you get a string form of these errors?
1964
// Which of these errors should be replaced by errors in SCODE.H?
1967
AVIERR_UNSUPPORTED = $80044065; // MAKE_AVIERR(101)
1968
AVIERR_BADFORMAT = $80044066; // MAKE_AVIERR(102)
1969
AVIERR_MEMORY = $80044067; // MAKE_AVIERR(103)
1970
AVIERR_INTERNAL = $80044068; // MAKE_AVIERR(104)
1971
AVIERR_BADFLAGS = $80044069; // MAKE_AVIERR(105)
1972
AVIERR_BADPARAM = $8004406A; // MAKE_AVIERR(106)
1973
AVIERR_BADSIZE = $8004406B; // MAKE_AVIERR(107)
1974
AVIERR_BADHANDLE = $8004406C; // MAKE_AVIERR(108)
1975
AVIERR_FILEREAD = $8004406D; // MAKE_AVIERR(109)
1976
AVIERR_FILEWRITE = $8004406E; // MAKE_AVIERR(110)
1977
AVIERR_FILEOPEN = $8004406F; // MAKE_AVIERR(111)
1978
AVIERR_COMPRESSOR = $80044070; // MAKE_AVIERR(112)
1979
AVIERR_NOCOMPRESSOR = $80044071; // MAKE_AVIERR(113)
1980
AVIERR_READONLY = $80044072; // MAKE_AVIERR(114)
1981
AVIERR_NODATA = $80044073; // MAKE_AVIERR(115)
1982
AVIERR_BUFFERTOOSMALL = $80044074; // MAKE_AVIERR(116)
1983
AVIERR_CANTCOMPRESS = $80044075; // MAKE_AVIERR(117)
1984
AVIERR_USERABORT = $800440C6; // MAKE_AVIERR(198)
1985
AVIERR_ERROR = $800440C7; // MAKE_AVIERR(199)
1987
{== MCIWnd - Window class for MCI objects ====================================}
1992
// MCIWnd window class header file.
1994
// the MCIWnd window class is a window class for controling MCI devices
1995
// MCI devices include, wave files, midi files, AVI Video, cd audio,
1996
// vcr, video disc, and others..
1998
// to learn more about MCI and mci command sets see the
1999
// "Microsoft Multimedia Programmers's guide" in the Win31 SDK
2001
// the easiest use of the MCIWnd class is like so:
2003
// hwnd = MCIWndCreate(hwndParent, hInstance, 0, "chimes.wav");
2007
// MCIWndPause(hwnd);
2009
// MCIWndDestroy(hwnd);
2011
// this will create a window with a play/pause, stop and a playbar
2012
// and start the wave file playing.
2014
// mciwnd.h defines macros for all the most common MCI commands, but
2015
// any string command can be used if needed.
2017
// Note: unlike the mciSendString() API, no alias or file name needs
2018
// to be specifed, since the device to use is implied by the window handle.
2020
// MCIWndSendString(hwnd, "setaudio stream to 2");
2022
// (C) Copyright Microsoft Corp. 1991-1995. All rights reserved.
2026
// MCIWnd supports both ansi and unicode interfaces. For any message that
2027
// takes or returns a text string, two versions of the message are defined,
2028
// appended with A or W for Ansi or Wide Char. The message or api itself
2029
// is defined to be one or other of these depending on whether you have
2030
// UNICODE defined in your application.
2031
// Thus for the api MCIWndCreate, there are in fact two apis,
2032
// MCIWndCreateA and MCIWndCreateW. If you call MCIWndCreate, this will be
2033
// re-routed to MCIWndCreateA unless UNICODE is defined when building your
2034
// application. In any one application, you can mix calls to the
2035
// Ansi and Unicode entrypoints.
2037
// If you use SendMessage instead of the macros below such as MCIWndOpen(),
2038
// you will see that the messages have changed for WIN32, to support Ansi
2039
// and Unicode entrypoints. In particular, MCI_OPEN has been replaced by
2040
// MCWNDM_OPENA, or MCIWNDM_OPENW (MCIWNDM_OPEN is defined to be one or
2043
// Also, note that the WIN32 implementation of MCIWnd uses UNICODE
2044
// so all apis and messages supporting ANSI strings do so by mapping them
2045
// UNICODE strings and then calling the corresponding UNICODE entrypoint.
2048
function MCIWndSM(hWnd: HWND; Msg: UINT; wParam: WPARAM; lParam: LPARAM): DWORD;
2051
MCIWND_WINDOW_CLASS = 'MCIWndClass' ;
2053
function MCIWndCreateA(hwndParent: HWND; hInstance: HINST; dwStyle: DWORd; szFile: LPCSTR): HWND; cdecl;
2054
function MCIWndCreateW(hwndParent: HWND; hInstance: HINST; dwStyle: DWORd; szFile: LPCWSTR): HWND; cdecl;
2056
function MCIWndCreate(hwndParent: HWND; hInstance: HINST; dwStyle: DWORd; szFile: LPCSTR): HWND; cdecl; // MCIWndCreateA
2058
function MCIWndRegisterClass: BOOL; cdecl;
2060
{-- Flags for the MCIWndOpen command -----------------------------------------}
2063
MCIWNDOPENF_NEW = $0001; // open a new file
2065
{-- Window styles ------------------------------------------------------------}
2067
MCIWNDF_NOAUTOSIZEWINDOW = $0001; // when movie size changes
2068
MCIWNDF_NOPLAYBAR = $0002; // no toolbar
2069
MCIWNDF_NOAUTOSIZEMOVIE = $0004; // when window size changes
2070
MCIWNDF_NOMENU = $0008; // no popup menu from RBUTTONDOWN
2071
MCIWNDF_SHOWNAME = $0010; // show name in caption
2072
MCIWNDF_SHOWPOS = $0020; // show position in caption
2073
MCIWNDF_SHOWMODE = $0040; // show mode in caption
2074
MCIWNDF_SHOWALL = $0070; // show all
2076
MCIWNDF_NOTIFYMODE = $0100; // tell parent of mode change
2077
MCIWNDF_NOTIFYPOS = $0200; // tell parent of pos change
2078
MCIWNDF_NOTIFYSIZE = $0400; // tell parent of size change
2079
MCIWNDF_NOTIFYERROR = $1000; // tell parent of an error
2080
MCIWNDF_NOTIFYALL = $1F00; // tell all
2082
MCIWNDF_NOTIFYANSI = $0080;
2084
// The MEDIA notification includes a text string.
2085
// To receive notifications in ANSI instead of unicode set the
2086
// MCIWNDF_NOTIFYANSI style bit. The macro below includes this bit
2087
// by default unless you define UNICODE in your application.
2089
MCIWNDF_NOTIFYMEDIAA = $0880; // tell parent of media change
2090
MCIWNDF_NOTIFYMEDIAW = $0800; // tell parent of media change
2092
MCIWNDF_NOTIFYMEDIA = MCIWNDF_NOTIFYMEDIAA;
2094
MCIWNDF_RECORD = $2000; // Give a record button
2095
MCIWNDF_NOERRORDLG = $4000; // Show Error Dlgs for MCI cmds?
2096
MCIWNDF_NOOPEN = $8000; // Don't allow user to open things
2098
{-- Can macros ---------------------------------------------------------------}
2100
function MCIWndCanPlay(hwnd: HWND): BOOL;
2101
function MCIWndCanRecord(hwnd: HWND): BOOL;
2102
function MCIWndCanSave(hwnd: HWND): BOOL;
2103
function MCIWndCanWindow(hwnd: HWND): BOOL;
2104
function MCIWndCanEject(hwnd: HWND): BOOL;
2105
function MCIWndCanConfig(hwnd: HWND): BOOL;
2106
function MCIWndPaletteKick(hwnd: HWND): BOOL;
2108
function MCIWndSave(hwnd: HWND; szFile: LPCSTR): DWORD;
2109
function MCIWndSaveDialog(hwnd: HWND): DWORD;
2111
// If you dont give a device it will use the current device....
2113
function MCIWndNew(hwnd: HWND; lp: PVOID): DWORD;
2114
function MCIWndRecord(hwnd: HWND): DWORD;
2115
function MCIWndOpen(hwnd: HWND; sz: LPCSTR; f: BOOL): DWORD;
2116
function MCIWndOpenDialog(hwnd: HWND): DWORD;
2117
function MCIWndClose(hwnd: HWND): DWORD;
2118
function MCIWndPlay(hwnd: HWND): DWORD;
2119
function MCIWndStop(hwnd: HWND): DWORD;
2120
function MCIWndPause(hwnd: HWND): DWORD;
2121
function MCIWndResume(hwnd: HWND): DWORD;
2122
function MCIWndSeek(hwnd: HWND; lPos: DWORD): DWORD;
2123
function MCIWndEject(hwnd: HWND): DWORD;
2125
function MCIWndHome(hwnd: HWND): DWORD;
2126
function MCIWndEnd(hwnd: HWND): DWORD;
2128
function MCIWndGetSource(hwnd: HWND; prc: PRECT): DWORD;
2129
function MCIWndPutSource(hwnd: HWND; prc: PRECT): DWORD;
2131
function MCIWndGetDest(hwnd: HWND; prc: PRECT): DWORD;
2132
function MCIWndPutDest(hwnd: HWND; prc: PRECT): DWORD;
2134
function MCIWndPlayReverse(hwnd: HWND): DWORD;
2135
function MCIWndPlayFrom(hwnd: HWND; lPos: DWORD): DWORD;
2136
function MCIWndPlayTo(hwnd: HWND; lPos: DWORD): DWORD;
2137
function MCIWndPlayFromTo(hwnd: HWND; lStart, lEnd: DWORD): DWORD;
2139
function MCIWndGetDeviceID(hwnd: HWND): UINT;
2140
function MCIWndGetAlias(hwnd: HWND): UINT;
2141
function MCIWndGetMode(hwnd: HWND; lp: LPSTR; len: UINT): DWORD;
2142
function MCIWndGetPosition(hwnd: HWND): DWORD;
2143
function MCIWndGetPositionString(hwnd: HWND; lp: LPSTR; len: UINT): DWORD;
2144
function MCIWndGetStart(hwnd: HWND): DWORD;
2145
function MCIWndGetLength(hwnd: HWND): DWORD;
2146
function MCIWndGetEnd(hwnd: HWND): DWORD;
2148
function MCIWndStep(hwnd: HWND; n: DWORD): DWORD;
2150
procedure MCIWndDestroy(hwnd: HWND);
2151
procedure MCIWndSetZoom(hwnd: HWND; iZoom: UINT);
2152
function MCIWndGetZoom(hwnd: HWND): UINT;
2153
function MCIWndSetVolume(hwnd: HWND; iVol: UINT): DWORD;
2154
function MCIWndGetVolume(hwnd: HWND): DWORD;
2155
function MCIWndSetSpeed(hwnd: HWND; iSpeed: UINT): DWORD;
2156
function MCIWndGetSpeed(hwnd: HWND): DWORD;
2157
function MCIWndSetTimeFormat(hwnd: HWND; lp: LPCSTR): DWORD;
2158
function MCIWndGetTimeFormat(hwnd: HWND; lp: LPSTR; len: UINT): DWORD;
2159
procedure MCIWndValidateMedia(hwnd: HWND);
2161
procedure MCIWndSetRepeat(hwnd: HWND; f: BOOL);
2162
function MCIWndGetRepeat(hwnd: HWND): BOOL;
2164
function MCIWndUseFrames(hwnd: HWND): DWORD;
2165
function MCIWndUseTime(hwnd: HWND): DWORD;
2167
procedure MCIWndSetActiveTimer(hwnd: HWND; active: UINT);
2168
procedure MCIWndSetInactiveTimer(hwnd: HWND; inactive: UINT);
2169
procedure MCIWndSetTimers(hwnd: HWND; active, inactive: UINT);
2170
function MCIWndGetActiveTimer(hwnd: HWND): UINT;
2171
function MCIWndGetInactiveTimer(hwnd: HWND): UINT;
2173
function MCIWndRealize(hwnd: HWND; fBkgnd: BOOL): DWORD;
2175
function MCIWndSendString(hwnd: HWND; sz: LPCSTR): DWORD;
2176
function MCIWndReturnString(hwnd: HWND; lp: LPSTR; len: UINT): DWORD;
2177
function MCIWndGetError(hwnd: HWND; lp: LPSTR; len: UINT): DWORD;
2179
// #define MCIWndActivate(hwnd, f) (void)MCIWndSM(hwnd, WM_ACTIVATE, (WPARAM)(BOOL)(f), 0)
2181
function MCIWndGetPalette(hwnd: HWND): HPALETTE;
2182
function MCIWndSetPalette(hwnd: HWND; hpal: HPALETTE): DWORD;
2184
function MCIWndGetFileName(hwnd: HWND; lp: LPSTR; len: UINT): DWORD;
2185
function MCIWndGetDevice(hwnd: HWND; lp: LPSTR; len: UINT): DWORD;
2187
function MCIWndGetStyles(hwnd: HWND): UINT;
2188
function MCIWndChangeStyles(hwnd: HWND; mask: UINT; value: DWORD): DWORD;
2191
PUnknown = ^IUnknown;
2193
function MCIWndOpenInterface(hwnd: HWND; pUnk: PUnknown): DWORD;
2195
function MCIWndSetOwner(hwnd: HWND; hwndP: HWND): DWORD;
2197
{-- Messages an app will send to MCIWND --------------------------------------}
2199
// all the text-related messages are defined out of order above (they need
2200
// to be defined before the MCIWndOpen() macros
2203
MCIWNDM_GETDEVICEID = WM_USER + 100;
2204
MCIWNDM_GETSTART = WM_USER + 103;
2205
MCIWNDM_GETLENGTH = WM_USER + 104;
2206
MCIWNDM_GETEND = WM_USER + 105;
2207
MCIWNDM_EJECT = WM_USER + 107;
2208
MCIWNDM_SETZOOM = WM_USER + 108;
2209
MCIWNDM_GETZOOM = WM_USER + 109;
2210
MCIWNDM_SETVOLUME = WM_USER + 110;
2211
MCIWNDM_GETVOLUME = WM_USER + 111;
2212
MCIWNDM_SETSPEED = WM_USER + 112;
2213
MCIWNDM_GETSPEED = WM_USER + 113;
2214
MCIWNDM_SETREPEAT = WM_USER + 114;
2215
MCIWNDM_GETREPEAT = WM_USER + 115;
2216
MCIWNDM_REALIZE = WM_USER + 118;
2217
MCIWNDM_VALIDATEMEDIA = WM_USER + 121;
2218
MCIWNDM_PLAYFROM = WM_USER + 122;
2219
MCIWNDM_PLAYTO = WM_USER + 123;
2220
MCIWNDM_GETPALETTE = WM_USER + 126;
2221
MCIWNDM_SETPALETTE = WM_USER + 127;
2222
MCIWNDM_SETTIMERS = WM_USER + 129;
2223
MCIWNDM_SETACTIVETIMER = WM_USER + 130;
2224
MCIWNDM_SETINACTIVETIMER = WM_USER + 131;
2225
MCIWNDM_GETACTIVETIMER = WM_USER + 132;
2226
MCIWNDM_GETINACTIVETIMER = WM_USER + 133;
2227
MCIWNDM_CHANGESTYLES = WM_USER + 135;
2228
MCIWNDM_GETSTYLES = WM_USER + 136;
2229
MCIWNDM_GETALIAS = WM_USER + 137;
2230
MCIWNDM_PLAYREVERSE = WM_USER + 139;
2231
MCIWNDM_GET_SOURCE = WM_USER + 140;
2232
MCIWNDM_PUT_SOURCE = WM_USER + 141;
2233
MCIWNDM_GET_DEST = WM_USER + 142;
2234
MCIWNDM_PUT_DEST = WM_USER + 143;
2235
MCIWNDM_CAN_PLAY = WM_USER + 144;
2236
MCIWNDM_CAN_WINDOW = WM_USER + 145;
2237
MCIWNDM_CAN_RECORD = WM_USER + 146;
2238
MCIWNDM_CAN_SAVE = WM_USER + 147;
2239
MCIWNDM_CAN_EJECT = WM_USER + 148;
2240
MCIWNDM_CAN_CONFIG = WM_USER + 149;
2241
MCIWNDM_PALETTEKICK = WM_USER + 150;
2242
MCIWNDM_OPENINTERFACE = WM_USER + 151;
2243
MCIWNDM_SETOWNER = WM_USER + 152;
2245
{-- Define both A and W messages ---------------------------------------------}
2247
MCIWNDM_SENDSTRINGA = WM_USER + 101;
2248
MCIWNDM_GETPOSITIONA = WM_USER + 102;
2249
MCIWNDM_GETMODEA = WM_USER + 106;
2250
MCIWNDM_SETTIMEFORMATA = WM_USER + 119;
2251
MCIWNDM_GETTIMEFORMATA = WM_USER + 120;
2252
MCIWNDM_GETFILENAMEA = WM_USER + 124;
2253
MCIWNDM_GETDEVICEA = WM_USER + 125;
2254
MCIWNDM_GETERRORA = WM_USER + 128;
2255
MCIWNDM_NEWA = WM_USER + 134;
2256
MCIWNDM_RETURNSTRINGA = WM_USER + 138;
2257
MCIWNDM_OPENA = WM_USER + 153;
2259
MCIWNDM_SENDSTRINGW = WM_USER + 201;
2260
MCIWNDM_GETPOSITIONW = WM_USER + 202;
2261
MCIWNDM_GETMODEW = WM_USER + 206;
2262
MCIWNDM_SETTIMEFORMATW = WM_USER + 219;
2263
MCIWNDM_GETTIMEFORMATW = WM_USER + 220;
2264
MCIWNDM_GETFILENAMEW = WM_USER + 224;
2265
MCIWNDM_GETDEVICEW = WM_USER + 225;
2266
MCIWNDM_GETERRORW = WM_USER + 228;
2267
MCIWNDM_NEWW = WM_USER + 234;
2268
MCIWNDM_RETURNSTRINGW = WM_USER + 238;
2269
MCIWNDM_OPENW = WM_USER + 252;
2271
{-- Map defaults to A --------------------------------------------------------}
2273
MCIWNDM_SENDSTRING = MCIWNDM_SENDSTRINGA;
2274
MCIWNDM_GETPOSITION = MCIWNDM_GETPOSITIONA;
2275
MCIWNDM_GETMODE = MCIWNDM_GETMODEA;
2276
MCIWNDM_SETTIMEFORMAT = MCIWNDM_SETTIMEFORMATA;
2277
MCIWNDM_GETTIMEFORMAT = MCIWNDM_GETTIMEFORMATA;
2278
MCIWNDM_GETFILENAME = MCIWNDM_GETFILENAMEA;
2279
MCIWNDM_GETDEVICE = MCIWNDM_GETDEVICEA;
2280
MCIWNDM_GETERROR = MCIWNDM_GETERRORA;
2281
MCIWNDM_NEW = MCIWNDM_NEWA;
2282
MCIWNDM_RETURNSTRING = MCIWNDM_RETURNSTRINGA;
2283
MCIWNDM_OPEN = MCIWNDM_OPENA;
2285
// note that the source text for MCIWND will thus contain
2286
// support for eg MCIWNDM_SENDSTRING (both the 16-bit entrypoint and
2287
// in win32 mapped to MCIWNDM_SENDSTRINGW), and MCIWNDM_SENDSTRINGA (the
2288
// win32 ansi thunk).
2290
{-- Messages MCIWND will send to an app --------------------------------------}
2293
MCIWNDM_NOTIFYMODE = WM_USER + 200; // wp = hwnd, lp = mode
2294
MCIWNDM_NOTIFYPOS = WM_USER + 201; // wp = hwnd, lp = pos
2295
MCIWNDM_NOTIFYSIZE = WM_USER + 202; // wp = hwnd
2296
MCIWNDM_NOTIFYMEDIA = WM_USER + 203; // wp = hwnd, lp = fn
2297
MCIWNDM_NOTIFYERROR = WM_USER + 205; // wp = hwnd, lp = error
2299
{-- Special seek values for START and END ------------------------------------}
2301
MCIWND_START = dword(-1) ;
2302
MCIWND_END = dword(-2) ;
2304
{== VIDEO - Video capture driver interface ===================================}
2310
{-- Error return values ------------------------------------------------------}
2313
DV_ERR_OK = 0; // No error
2314
DV_ERR_BASE = 1; // Error Base
2315
DV_ERR_NONSPECIFIC = DV_ERR_BASE;
2316
DV_ERR_BADFORMAT = DV_ERR_BASE + 1; // unsupported video format
2317
DV_ERR_STILLPLAYING = DV_ERR_BASE + 2; // still something playing
2318
DV_ERR_UNPREPARED = DV_ERR_BASE + 3; // header not prepared
2319
DV_ERR_SYNC = DV_ERR_BASE + 4; // device is synchronous
2320
DV_ERR_TOOMANYCHANNELS = DV_ERR_BASE + 5; // number of channels exceeded
2321
DV_ERR_NOTDETECTED = DV_ERR_BASE + 6; // HW not detected
2322
DV_ERR_BADINSTALL = DV_ERR_BASE + 7; // Can not get Profile
2323
DV_ERR_CREATEPALETTE = DV_ERR_BASE + 8;
2324
DV_ERR_SIZEFIELD = DV_ERR_BASE + 9;
2325
DV_ERR_PARAM1 = DV_ERR_BASE + 10;
2326
DV_ERR_PARAM2 = DV_ERR_BASE + 11;
2327
DV_ERR_CONFIG1 = DV_ERR_BASE + 12;
2328
DV_ERR_CONFIG2 = DV_ERR_BASE + 13;
2329
DV_ERR_FLAGS = DV_ERR_BASE + 14;
2330
DV_ERR_13 = DV_ERR_BASE + 15;
2332
DV_ERR_NOTSUPPORTED = DV_ERR_BASE + 16; // function not suported
2333
DV_ERR_NOMEM = DV_ERR_BASE + 17; // out of memory
2334
DV_ERR_ALLOCATED = DV_ERR_BASE + 18; // device is allocated
2335
DV_ERR_BADDEVICEID = DV_ERR_BASE + 19;
2336
DV_ERR_INVALHANDLE = DV_ERR_BASE + 20;
2337
DV_ERR_BADERRNUM = DV_ERR_BASE + 21;
2338
DV_ERR_NO_BUFFERS = DV_ERR_BASE + 22; // out of buffers
2340
DV_ERR_MEM_CONFLICT = DV_ERR_BASE + 23; // Mem conflict detected
2341
DV_ERR_IO_CONFLICT = DV_ERR_BASE + 24; // I/O conflict detected
2342
DV_ERR_DMA_CONFLICT = DV_ERR_BASE + 25; // DMA conflict detected
2343
DV_ERR_INT_CONFLICT = DV_ERR_BASE + 26; // Interrupt conflict detected
2344
DV_ERR_PROTECT_ONLY = DV_ERR_BASE + 27; // Can not run in standard mode
2345
DV_ERR_LASTERROR = DV_ERR_BASE + 27;
2347
DV_ERR_USER_MSG = DV_ERR_BASE + 1000; // Hardware specific errors
2349
{-- Callback messages --------------------------------------------------------}
2351
// Note that the values for all installable driver callback messages are
2352
// identical, (ie. MM_DRVM_DATA has the same value for capture drivers,
2353
// installable video codecs, and the audio compression manager).
2356
DV_VM_OPEN = MM_DRVM_OPEN; // Obsolete messages
2357
DV_VM_CLOSE = MM_DRVM_CLOSE;
2358
DV_VM_DATA = MM_DRVM_DATA;
2359
DV_VM_ERROR = MM_DRVM_ERROR;
2361
{== Structures ===============================================================}
2363
{-- Video data block header --------------------------------------------------}
2366
PVIDEOHDR = ^TVIDEOHDR;
2368
lpData : PBYTE; // pointer to locked data buffer
2369
dwBufferLength : DWORD; // Length of data buffer
2370
dwBytesUsed : DWORD; // Bytes actually used
2371
dwTimeCaptured : DWORD; // Milliseconds from start of stream
2372
dwUser : DWORD; // for client's use
2373
dwFlags : DWORD; // assorted flags (see defines)
2374
dwReserved : array[0..3] of DWORD; // reserved for driver
2377
{-- dwFlags field of VIDEOHDR ------------------------------------------------}
2380
VHDR_DONE = $00000001; // Done bit
2381
VHDR_PREPARED = $00000002; // Set if this header has been prepared
2382
VHDR_INQUEUE = $00000004; // Reserved for driver
2383
VHDR_KEYFRAME = $00000008; // Key Frame
2385
{-- Channel capabilities structure -------------------------------------------}
2388
PCHANNEL_CAPS = ^TCHANNEL_CAPS;
2389
TCHANNEL_CAPS = record
2390
dwFlags : DWORD; // Capability flags
2391
dwSrcRectXMod : DWORD; // Granularity of src rect in x
2392
dwSrcRectYMod : DWORD; // Granularity of src rect in y
2393
dwSrcRectWidthMod : DWORD; // Granularity of src rect width
2394
dwSrcRectHeightMod : DWORD; // Granularity of src rect height
2395
dwDstRectXMod : DWORD; // Granularity of dst rect in x
2396
dwDstRectYMod : DWORD; // Granularity of dst rect in y
2397
dwDstRectWidthMod : DWORD; // Granularity of dst rect width
2398
dwDstRectHeightMod : DWORD; // Granularity of dst rect height
2401
{-- dwFlags of CHANNEL_CAPS --------------------------------------------------}
2404
VCAPS_OVERLAY = $00000001; // overlay channel
2405
VCAPS_SRC_CAN_CLIP = $00000002; // src rect can clip
2406
VCAPS_DST_CAN_CLIP = $00000004; // dst rect can clip
2407
VCAPS_CAN_SCALE = $00000008; // allows src != dst
2409
{== API flags ================================================================}
2411
{-- Types of channels to open with the videoOpen function --------------------}
2414
VIDEO_EXTERNALIN = $0001;
2415
VIDEO_EXTERNALOUT = $0002;
2419
{-- Is a driver dialog available for this channel ----------------------------}
2421
VIDEO_DLG_QUERY = $0010;
2423
{-- videoConfigure (both GET and SET) ----------------------------------------}
2425
VIDEO_CONFIGURE_QUERY = $8000;
2427
{-- videoConfigure (SET only) ------------------------------------------------}
2429
VIDEO_CONFIGURE_SET = $1000;
2431
{-- videoConfigure (GET only) ------------------------------------------------}
2433
VIDEO_CONFIGURE_GET = $2000;
2434
VIDEO_CONFIGURE_QUERYSIZE = $0001;
2436
VIDEO_CONFIGURE_CURRENT = $0010;
2437
VIDEO_CONFIGURE_NOMINAL = $0020;
2438
VIDEO_CONFIGURE_MIN = $0040;
2439
VIDEO_CONFIGURE_MAX = $0080;
2441
{== Configure messages =======================================================}
2445
DVM_CONFIGURE_START = $1000;
2446
DVM_CONFIGURE_END = $1FFF;
2448
DVM_PALETTE = DVM_CONFIGURE_START + 1;
2449
DVM_FORMAT = DVM_CONFIGURE_START + 2;
2450
DVM_PALETTERGB555 = DVM_CONFIGURE_START + 3;
2451
DVM_SRC_RECT = DVM_CONFIGURE_START + 4;
2452
DVM_DST_RECT = DVM_CONFIGURE_START + 5;
2454
{== AVICAP - Window class for AVI capture ====================================}
2456
function AVICapSM(hwnd: HWND; m: UINT; w: WPARAM; l: LPARAM): DWORD;
2458
{-- Window messages WM_CAP... which can be sent to an AVICAP window ----------}
2462
// The Win32 version of AVICAP on NT supports UNICODE applications:
2463
// for each API or message that takes a char or string parameter, there are
2464
// two versions, ApiNameA and ApiNameW. The default name ApiName is #defined
2465
// to one or other depending on whether UNICODE is defined. Apps can call
2466
// the A and W apis directly, and mix them.
2468
// The 32-bit AVICAP on NT uses unicode exclusively internally.
2469
// ApiNameA() will be implemented as a call to ApiNameW() together with
2470
// translation of strings.
2472
// Defines start of the message range
2474
WM_CAP_START = WM_USER;
2475
WM_CAP_UNICODE_START = WM_USER + 100;
2477
WM_CAP_GET_CAPSTREAMPTR = WM_CAP_START + 1;
2479
WM_CAP_SET_CALLBACK_ERRORW = WM_CAP_UNICODE_START + 2;
2480
WM_CAP_SET_CALLBACK_STATUSW = WM_CAP_UNICODE_START + 3;
2481
WM_CAP_SET_CALLBACK_ERRORA = WM_CAP_START + 2;
2482
WM_CAP_SET_CALLBACK_STATUSA = WM_CAP_START + 3;
2483
WM_CAP_SET_CALLBACK_ERROR = WM_CAP_SET_CALLBACK_ERRORA;
2484
WM_CAP_SET_CALLBACK_STATUS = WM_CAP_SET_CALLBACK_STATUSA;
2486
WM_CAP_SET_CALLBACK_YIELD = WM_CAP_START + 4;
2487
WM_CAP_SET_CALLBACK_FRAME = WM_CAP_START + 5;
2488
WM_CAP_SET_CALLBACK_VIDEOSTREAM = WM_CAP_START + 6;
2489
WM_CAP_SET_CALLBACK_WAVESTREAM = WM_CAP_START + 7;
2490
WM_CAP_GET_USER_DATA = WM_CAP_START + 8;
2491
WM_CAP_SET_USER_DATA = WM_CAP_START + 9;
2493
WM_CAP_DRIVER_CONNECT = WM_CAP_START + 10;
2494
WM_CAP_DRIVER_DISCONNECT = WM_CAP_START + 11;
2496
WM_CAP_DRIVER_GET_NAMEA = WM_CAP_START + 12;
2497
WM_CAP_DRIVER_GET_VERSIONA = WM_CAP_START + 13;
2498
WM_CAP_DRIVER_GET_NAMEW = WM_CAP_UNICODE_START + 12;
2499
WM_CAP_DRIVER_GET_VERSIONW = WM_CAP_UNICODE_START + 13;
2500
WM_CAP_DRIVER_GET_NAME = WM_CAP_DRIVER_GET_NAMEA;
2501
WM_CAP_DRIVER_GET_VERSION = WM_CAP_DRIVER_GET_VERSIONA;
2503
WM_CAP_DRIVER_GET_CAPS = WM_CAP_START + 14;
2505
WM_CAP_FILE_SET_CAPTURE_FILEA = WM_CAP_START + 20;
2506
WM_CAP_FILE_GET_CAPTURE_FILEA = WM_CAP_START + 21;
2507
WM_CAP_FILE_SAVEASA = WM_CAP_START + 23;
2508
WM_CAP_FILE_SAVEDIBA = WM_CAP_START + 25;
2509
WM_CAP_FILE_SET_CAPTURE_FILEW = WM_CAP_UNICODE_START + 20;
2510
WM_CAP_FILE_GET_CAPTURE_FILEW = WM_CAP_UNICODE_START + 21;
2511
WM_CAP_FILE_SAVEASW = WM_CAP_UNICODE_START + 23;
2512
WM_CAP_FILE_SAVEDIBW = WM_CAP_UNICODE_START + 25;
2513
WM_CAP_FILE_SET_CAPTURE_FILE = WM_CAP_FILE_SET_CAPTURE_FILEA;
2514
WM_CAP_FILE_GET_CAPTURE_FILE = WM_CAP_FILE_GET_CAPTURE_FILEA;
2515
WM_CAP_FILE_SAVEAS = WM_CAP_FILE_SAVEASA;
2516
WM_CAP_FILE_SAVEDIB = WM_CAP_FILE_SAVEDIBA;
2518
// out of order to save on ifdefs
2520
WM_CAP_FILE_ALLOCATE = WM_CAP_START + 22;
2521
WM_CAP_FILE_SET_INFOCHUNK = WM_CAP_START + 24;
2523
WM_CAP_EDIT_COPY = WM_CAP_START + 30;
2525
WM_CAP_SET_AUDIOFORMAT = WM_CAP_START + 35;
2526
WM_CAP_GET_AUDIOFORMAT = WM_CAP_START + 36;
2528
WM_CAP_DLG_VIDEOFORMAT = WM_CAP_START + 41;
2529
WM_CAP_DLG_VIDEOSOURCE = WM_CAP_START + 42;
2530
WM_CAP_DLG_VIDEODISPLAY = WM_CAP_START + 43;
2531
WM_CAP_GET_VIDEOFORMAT = WM_CAP_START + 44;
2532
WM_CAP_SET_VIDEOFORMAT = WM_CAP_START + 45;
2533
WM_CAP_DLG_VIDEOCOMPRESSION = WM_CAP_START + 46;
2535
WM_CAP_SET_PREVIEW = WM_CAP_START + 50;
2536
WM_CAP_SET_OVERLAY = WM_CAP_START + 51;
2537
WM_CAP_SET_PREVIEWRATE = WM_CAP_START + 52;
2538
WM_CAP_SET_SCALE = WM_CAP_START + 53;
2539
WM_CAP_GET_STATUS = WM_CAP_START + 54;
2540
WM_CAP_SET_SCROLL = WM_CAP_START + 55;
2542
WM_CAP_GRAB_FRAME = WM_CAP_START + 60;
2543
WM_CAP_GRAB_FRAME_NOSTOP = WM_CAP_START + 61;
2545
WM_CAP_SEQUENCE = WM_CAP_START + 62;
2546
WM_CAP_SEQUENCE_NOFILE = WM_CAP_START + 63;
2547
WM_CAP_SET_SEQUENCE_SETUP = WM_CAP_START + 64;
2548
WM_CAP_GET_SEQUENCE_SETUP = WM_CAP_START + 65;
2550
WM_CAP_SET_MCI_DEVICEA = WM_CAP_START + 66;
2551
WM_CAP_GET_MCI_DEVICEA = WM_CAP_START + 67;
2552
WM_CAP_SET_MCI_DEVICEW = WM_CAP_UNICODE_START + 66;
2553
WM_CAP_GET_MCI_DEVICEW = WM_CAP_UNICODE_START + 67;
2554
WM_CAP_SET_MCI_DEVICE = WM_CAP_SET_MCI_DEVICEA;
2555
WM_CAP_GET_MCI_DEVICE = WM_CAP_GET_MCI_DEVICEA;
2557
WM_CAP_STOP = WM_CAP_START + 68;
2558
WM_CAP_ABORT = WM_CAP_START + 69;
2560
WM_CAP_SINGLE_FRAME_OPEN = WM_CAP_START + 70;
2561
WM_CAP_SINGLE_FRAME_CLOSE = WM_CAP_START + 71;
2562
WM_CAP_SINGLE_FRAME = WM_CAP_START + 72;
2564
WM_CAP_PAL_OPENA = WM_CAP_START + 80;
2565
WM_CAP_PAL_SAVEA = WM_CAP_START + 81;
2566
WM_CAP_PAL_OPENW = WM_CAP_UNICODE_START + 80;
2567
WM_CAP_PAL_SAVEW = WM_CAP_UNICODE_START + 81;
2568
WM_CAP_PAL_OPEN = WM_CAP_PAL_OPENA;
2569
WM_CAP_PAL_SAVE = WM_CAP_PAL_SAVEA;
2571
WM_CAP_PAL_PASTE = WM_CAP_START + 82;
2572
WM_CAP_PAL_AUTOCREATE = WM_CAP_START + 83;
2573
WM_CAP_PAL_MANUALCREATE = WM_CAP_START + 84;
2575
// Following added post VFW 1.1
2577
WM_CAP_SET_CALLBACK_CAPCONTROL = WM_CAP_START + 85;
2579
// Defines end of the message range
2581
WM_CAP_UNICODE_END = WM_CAP_PAL_SAVEW;
2582
WM_CAP_END = WM_CAP_UNICODE_END;
2584
{-- Callback definitions -----------------------------------------------------}
2587
TCAPYIELDCALLBACK = function(hWnd: HWND): DWORD; stdcall;
2589
TCAPSTATUSCALLBACKW = function(hWnd: HWND; nID: int; lpsz: LPCWSTR): DWORD; stdcall;
2590
TCAPERRORCALLBACKW = function(hWnd: HWND; nID: int; lpsz: LPCWSTR): DWORD; stdcall;
2591
TCAPSTATUSCALLBACKA = function(hWnd: HWND; nID: int; lpsz: LPCSTR): DWORD; stdcall;
2592
TCAPERRORCALLBACKA = function(hWnd: HWND; nID: int; lpsz: LPCSTR): DWORD; stdcall;
2594
TCAPSTATUSCALLBACK = TCAPSTATUSCALLBACKA;
2595
TCAPERRORCALLBACK = TCAPERRORCALLBACKA;
2597
TCAPVIDEOCALLBACK = function(hWnd: HWND; lpVHdr: PVIDEOHDR): DWORD; stdcall;
2598
TCAPWAVECALLBACK = function(hWnd: HWND; lpWHdr: PWAVEHDR): DWORD; stdcall;
2599
TCAPCONTROLCALLBACK = function(hWnd: HWND; nState: int): DWORD; stdcall;
2601
{-- Structures ---------------------------------------------------------------}
2604
PCAPDRIVERCAPS = ^TCAPDRIVERCAPS;
2605
TCAPDRIVERCAPS = record
2606
wDeviceIndex : UINT; // Driver index in system.ini
2607
fHasOverlay : BOOL; // Can device overlay?
2608
fHasDlgVideoSource : BOOL; // Has Video source dlg?
2609
fHasDlgVideoFormat : BOOL; // Has Format dlg?
2610
fHasDlgVideoDisplay : BOOL; // Has External out dlg?
2611
fCaptureInitialized : BOOL; // Driver ready to capture?
2612
fDriverSuppliesPalettes : BOOL; // Can driver make palettes?
2614
// following always NULL on Win32.
2615
hVideoIn : THANDLE; // Driver In channel
2616
hVideoOut : THANDLE; // Driver Out channel
2617
hVideoExtIn : THANDLE; // Driver Ext In channel
2618
hVideoExtOut : THANDLE; // Driver Ext Out channel
2621
PCAPSTATUS = ^TCAPSTATUS;
2623
uiImageWidth : UINT ; // Width of the image
2624
uiImageHeight : UINT ; // Height of the image
2625
fLiveWindow : BOOL ; // Now Previewing video?
2626
fOverlayWindow : BOOL ; // Now Overlaying video?
2627
fScale : BOOL ; // Scale image to client?
2628
ptScroll : TPOINT ; // Scroll position
2629
fUsingDefaultPalette : BOOL ; // Using default driver palette?
2630
fAudioHardware : BOOL ; // Audio hardware present?
2631
fCapFileExists : BOOL ; // Does capture file exist?
2632
dwCurrentVideoFrame : DWORD ; // # of video frames cap'td
2633
dwCurrentVideoFramesDropped : DWORD ; // # of video frames dropped
2634
dwCurrentWaveSamples : DWORD ; // # of wave samples cap'td
2635
dwCurrentTimeElapsedMS : DWORD ; // Elapsed capture duration
2636
hPalCurrent : HPALETTE; // Current palette in use
2637
fCapturingNow : BOOL ; // Capture in progress?
2638
dwReturn : DWORD ; // Error value after any operation
2639
wNumVideoAllocated : UINT ; // Actual number of video buffers
2640
wNumAudioAllocated : UINT ; // Actual number of audio buffers
2643
// Default values in parenthesis
2645
PCAPTUREPARMS = ^TCAPTUREPARMS;
2646
TCAPTUREPARMS = record
2647
dwRequestMicroSecPerFrame : DWORD ; // Requested capture rate
2648
fMakeUserHitOKToCapture : BOOL ; // Show "Hit OK to cap" dlg?
2649
wPercentDropForError : UINT ; // Give error msg if > (10%)
2650
fYield : BOOL ; // Capture via background task?
2651
dwIndexSize : DWORD ; // Max index size in frames (32K)
2652
wChunkGranularity : UINT ; // Junk chunk granularity (2K)
2653
fUsingDOSMemory : BOOL ; // Use DOS buffers?
2654
wNumVideoRequested : UINT ; // # video buffers, If 0, autocalc
2655
fCaptureAudio : BOOL ; // Capture audio?
2656
wNumAudioRequested : UINT ; // # audio buffers, If 0, autocalc
2657
vKeyAbort : UINT ; // Virtual key causing abort
2658
fAbortLeftMouse : BOOL ; // Abort on left mouse?
2659
fAbortRightMouse : BOOL ; // Abort on right mouse?
2660
fLimitEnabled : BOOL ; // Use wTimeLimit?
2661
wTimeLimit : UINT ; // Seconds to capture
2662
fMCIControl : BOOL ; // Use MCI video source?
2663
fStepMCIDevice : BOOL ; // Step MCI device?
2664
dwMCIStartTime : DWORD ; // Time to start in MS
2665
dwMCIStopTime : DWORD ; // Time to stop in MS
2666
fStepCaptureAt2x : BOOL ; // Perform spatial averaging 2x
2667
wStepCaptureAverageFrames : UINT ; // Temporal average n Frames
2668
dwAudioBufferSize : DWORD ; // Size of audio bufs (0 = default)
2669
fDisableWriteCache : BOOL ; // Attempt to disable write cache
2670
AVStreamMaster : UINT ; // Which stream controls length?
2673
{-- AVStreamMaster -----------------------------------------------------------}
2675
// Since Audio and Video streams generally use non-synchronized capture
2676
// clocks, this flag determines whether the audio stream is to be considered
2677
// the master or controlling clock when writing the AVI file:
2679
// AVSTREAMMASTER_AUDIO - Audio is master, video frame duration is forced
2680
// to match audio duration (VFW 1.0, 1.1 default)
2681
// AVSTREAMMASTER_NONE - No master, audio and video streams may be of
2685
AVSTREAMMASTER_AUDIO = 0; // Audio master (VFW 1.0, 1.1)
2686
AVSTREAMMASTER_NONE = 1; // No master
2689
PCAPINFOCHUNK = ^TCAPINFOCHUNK;
2690
TCAPINFOCHUNK = record
2691
fccInfoID : FOURCC; // Chunk ID, "ICOP" for copyright
2692
lpData : PVOID; // pointer to data
2693
cbData : DWORD; // size of lpData
2696
{-- CapControlCallback states ------------------------------------------------}
2699
CONTROLCALLBACK_PREROLL = 1; // Waiting to start capture
2700
CONTROLCALLBACK_CAPTURING = 2; // Now capturing
2702
{-- Message crackers for above -----------------------------------------------}
2704
// message wrapper macros are defined for the default messages only. Apps
2705
// that wish to mix Ansi and UNICODE message sending will have to
2706
// reference the _A and _W messages directly
2708
function capSetCallbackOnError(hwnd: HWND; fpProc: TCAPERRORCALLBACK): BOOL;
2709
function capSetCallbackOnStatus(hwnd: HWND; fpProc: TCAPSTATUSCALLBACK): BOOL;
2710
function capSetCallbackOnYield(hwnd: HWND; fpProc: TCAPYIELDCALLBACK): BOOL;
2711
function capSetCallbackOnFrame(hwnd: HWND; fpProc: TCAPVIDEOCALLBACK): BOOL;
2712
function capSetCallbackOnVideoStream(hwnd: HWND; fpProc: TCAPVIDEOCALLBACK): BOOL;
2713
function capSetCallbackOnWaveStream(hwnd: HWND; fpProc: TCAPWAVECALLBACK): BOOL;
2714
function capSetCallbackOnCapControl(hwnd: HWND; fpProc: TCAPCONTROLCALLBACK): BOOL;
2716
function capSetUserData(hwnd: HWND; lUser: DWORD): BOOL;
2717
function capGetUserData(hwnd: HWND): DWORD;
2719
function capDriverConnect(hwnd: HWND; i: INT): BOOL;
2720
function capDriverDisconnect(hwnd: HWND): BOOL;
2721
function capDriverGetName(hwnd: HWND; szName: LPSTR; wSize: WORD): BOOL;
2722
function capDriverGetVersion(hwnd: HWND; szVer: LPSTR; wSize: WORD): BOOL;
2723
function capDriverGetCaps(hwnd: HWND; s: PCAPDRIVERCAPS; wSize: WORD): BOOL;
2725
function capFileSetCaptureFile(hwnd: HWND; szName: LPCSTR): BOOL;
2726
function capFileGetCaptureFile(hwnd: HWND; szName: LPSTR; wSize: WORD): BOOL;
2727
function capFileAlloc(hwnd: HWND; dwSize: DWORD): BOOL;
2728
function capFileSaveAs(hwnd: HWND; szName: LPCSTR): BOOL;
2729
function capFileSetInfoChunk(hwnd: HWND; lpInfoChunk: PCAPINFOCHUNK): BOOL;
2730
function capFileSaveDIB(hwnd: HWND; szName: LPCSTR): BOOL;
2732
function capEditCopy(hwnd: HWND): BOOL;
2734
function capSetAudioFormat(hwnd: HWND; s: PWAVEFORMATEX; wSize: WORD): BOOL;
2735
function capGetAudioFormat(hwnd: HWND; s: PWAVEFORMATEX; wSize: WORD): DWORD;
2736
function capGetAudioFormatSize(hwnd: HWND): DWORD;
2738
function capDlgVideoFormat(hwnd: HWND): BOOL;
2739
function capDlgVideoSource(hwnd: HWND): BOOL;
2740
function capDlgVideoDisplay(hwnd: HWND): BOOL;
2741
function capDlgVideoCompression(hwnd: HWND): BOOL;
2743
function capGetVideoFormat(hwnd: HWND; s: PVOID; wSize: WORD): DWORD;
2744
function capGetVideoFormatSize(hwnd: HWND): DWORD;
2745
function capSetVideoFormat(hwnd: HWND; s: PVOID; wSize: WORD): BOOL;
2747
function capPreview(hwnd: HWND; f: BOOL): BOOL;
2748
function capPreviewRate(hwnd: HWND; wMS: WORD): BOOL;
2749
function capOverlay(hwnd: HWND; f: BOOL): BOOL;
2750
function capPreviewScale(hwnd: HWND; f: BOOL): BOOL;
2751
function capGetStatus(hwnd: HWND; s: PCAPSTATUS; wSize: WORD): BOOL;
2752
function capSetScrollPos(hwnd: HWND; lpP: PPOINT): BOOL;
2754
function capGrabFrame(hwnd: HWND): BOOL;
2755
function capGrabFrameNoStop(hwnd: HWND): BOOL;
2757
function capCaptureSequence(hwnd: HWND): BOOL;
2758
function capCaptureSequenceNoFile(hwnd: HWND): BOOL;
2759
function capCaptureStop(hwnd: HWND): BOOL;
2760
function capCaptureAbort(hwnd: HWND): BOOL;
2762
function capCaptureSingleFrameOpen(hwnd: HWND): BOOL;
2763
function capCaptureSingleFrameClose(hwnd: HWND): BOOL;
2764
function capCaptureSingleFrame(hwnd: HWND): BOOL;
2766
function capCaptureGetSetup(hwnd: HWND; s: PCAPTUREPARMS; wSize: WORD): BOOL;
2767
function capCaptureSetSetup(hwnd: HWND; s: PCAPTUREPARMS; wSize: WORD): BOOL;
2769
function capSetMCIDeviceName(hwnd: HWND; szName: LPCSTR): BOOL;
2770
function capGetMCIDeviceName(hwnd: HWND; szName: LPSTR; wSize: WORD): BOOL;
2772
function capPaletteOpen(hwnd: HWND; szName: LPCSTR): BOOL;
2773
function capPaletteSave(hwnd: HWND; szName: LPCSTR): BOOL;
2774
function capPalettePaste(hwnd: HWND): BOOL;
2775
function capPaletteAuto(hwnd: HWND; iFrames, iColors: INT): BOOL;
2776
function capPaletteManual(hwnd: HWND; fGrab: BOOL; iColors: INT): BOOL;
2778
{-- The only exported functions from AVICAP.DLL ------------------------------}
2780
function capCreateCaptureWindowA(
2781
lpszWindowName : LPCSTR;
2784
nWidth, nHeight : int;
2789
function capGetDriverDescriptionA(
2790
wDriverIndex : UINT;
2797
function capCreateCaptureWindowW(
2798
lpszWindowName : LPCWSTR;
2801
nWidth, nHeight : int;
2806
function capGetDriverDescriptionW(
2807
wDriverIndex : UINT;
2814
function capCreateCaptureWindow(
2815
lpszWindowName : LPCSTR;
2818
nWidth, nHeight : int;
2821
): HWND; stdcall; // capCreateCaptureWindowA
2823
function capGetDriverDescription(
2824
wDriverIndex : UINT;
2829
): BOOL; stdcall; // capGetDriverDescriptionA
2831
{-- New information chunk IDs ------------------------------------------------}
2834
infotypeDIGITIZATION_TIME = $54494449; // mmioFOURCC ('I','D','I','T')
2835
infotypeSMPTE_TIME = $504D5349; // mmioFOURCC ('I','S','M','P')
2837
{-- String IDs from status and error callbacks -------------------------------}
2839
IDS_CAP_BEGIN = 300; // "Capture Start"
2840
IDS_CAP_END = 301; // "Capture End"
2842
IDS_CAP_INFO = 401; // "%s"
2843
IDS_CAP_OUTOFMEM = 402; // "Out of memory"
2844
IDS_CAP_FILEEXISTS = 403; // "File '%s' exists -- overwrite it?"
2845
IDS_CAP_ERRORPALOPEN = 404; // "Error opening palette '%s'"
2846
IDS_CAP_ERRORPALSAVE = 405; // "Error saving palette '%s'"
2847
IDS_CAP_ERRORDIBSAVE = 406; // "Error saving frame '%s'"
2848
IDS_CAP_DEFAVIEXT = 407; // "avi"
2849
IDS_CAP_DEFPALEXT = 408; // "pal"
2850
IDS_CAP_CANTOPEN = 409; // "Cannot open '%s'"
2851
IDS_CAP_SEQ_MSGSTART = 410; // "Select OK to start capture\nof video sequence\nto %s."
2852
IDS_CAP_SEQ_MSGSTOP = 411; // "Hit ESCAPE or click to end capture"
2854
IDS_CAP_VIDEDITERR = 412; // "An error occurred while trying to run VidEdit."
2855
IDS_CAP_READONLYFILE = 413; // "The file '%s' is a read-only file."
2856
IDS_CAP_WRITEERROR = 414; // "Unable to write to file '%s'.\nDisk may be full."
2857
IDS_CAP_NODISKSPACE = 415; // "There is no space to create a capture file on the specified device."
2858
IDS_CAP_SETFILESIZE = 416; // "Set File Size"
2859
IDS_CAP_SAVEASPERCENT = 417; // "SaveAs: %2ld%% Hit Escape to abort."
2861
IDS_CAP_DRIVER_ERROR = 418; // Driver specific error message
2863
IDS_CAP_WAVE_OPEN_ERROR = 419; // "Error: Cannot open the wave input device.\nCheck sample size, frequency, and channels."
2864
IDS_CAP_WAVE_ALLOC_ERROR = 420; // "Error: Out of memory for wave buffers."
2865
IDS_CAP_WAVE_PREPARE_ERROR = 421; // "Error: Cannot prepare wave buffers."
2866
IDS_CAP_WAVE_ADD_ERROR = 422; // "Error: Cannot add wave buffers."
2867
IDS_CAP_WAVE_SIZE_ERROR = 423; // "Error: Bad wave size."
2869
IDS_CAP_VIDEO_OPEN_ERROR = 424; // "Error: Cannot open the video input device."
2870
IDS_CAP_VIDEO_ALLOC_ERROR = 425; // "Error: Out of memory for video buffers."
2871
IDS_CAP_VIDEO_PREPARE_ERROR = 426; // "Error: Cannot prepare video buffers."
2872
IDS_CAP_VIDEO_ADD_ERROR = 427; // "Error: Cannot add video buffers."
2873
IDS_CAP_VIDEO_SIZE_ERROR = 428; // "Error: Bad video size."
2875
IDS_CAP_FILE_OPEN_ERROR = 429; // "Error: Cannot open capture file."
2876
IDS_CAP_FILE_WRITE_ERROR = 430; // "Error: Cannot write to capture file. Disk may be full."
2877
IDS_CAP_RECORDING_ERROR = 431; // "Error: Cannot write to capture file. Data rate too high or disk full."
2878
IDS_CAP_RECORDING_ERROR2 = 432; // "Error while recording"
2879
IDS_CAP_AVI_INIT_ERROR = 433; // "Error: Unable to initialize for capture."
2880
IDS_CAP_NO_FRAME_CAP_ERROR = 434; // "Warning: No frames captured.\nConfirm that vertical sync interrupts\nare configured and enabled."
2881
IDS_CAP_NO_PALETTE_WARN = 435; // "Warning: Using default palette."
2882
IDS_CAP_MCI_CONTROL_ERROR = 436; // "Error: Unable to access MCI device."
2883
IDS_CAP_MCI_CANT_STEP_ERROR = 437; // "Error: Unable to step MCI device."
2884
IDS_CAP_NO_AUDIO_CAP_ERROR = 438; // "Error: No audio data captured.\nCheck audio card settings."
2885
IDS_CAP_AVI_DRAWDIB_ERROR = 439; // "Error: Unable to draw this data format."
2886
IDS_CAP_COMPRESSOR_ERROR = 440; // "Error: Unable to initialize compressor."
2887
IDS_CAP_AUDIO_DROP_ERROR = 441; // "Error: Audio data was lost during capture, reduce capture rate."
2889
{-- Status string IDs --------------------------------------------------------}
2891
IDS_CAP_STAT_LIVE_MODE = 500; // "Live window"
2892
IDS_CAP_STAT_OVERLAY_MODE = 501; // "Overlay window"
2893
IDS_CAP_STAT_CAP_INIT = 502; // "Setting up for capture - Please wait"
2894
IDS_CAP_STAT_CAP_FINI = 503; // "Finished capture, now writing frame %ld"
2895
IDS_CAP_STAT_PALETTE_BUILD = 504; // "Building palette map"
2896
IDS_CAP_STAT_OPTPAL_BUILD = 505; // "Computing optimal palette"
2897
IDS_CAP_STAT_I_FRAMES = 506; // "%d frames"
2898
IDS_CAP_STAT_L_FRAMES = 507; // "%ld frames"
2899
IDS_CAP_STAT_CAP_L_FRAMES = 508; // "Captured %ld frames"
2900
IDS_CAP_STAT_CAP_AUDIO = 509; // "Capturing audio"
2901
IDS_CAP_STAT_VIDEOCURRENT = 510; // "Captured %ld frames (%ld dropped) %d.%03d sec."
2902
IDS_CAP_STAT_VIDEOAUDIO = 511; // "Captured %d.%03d sec. %ld frames (%ld dropped) (%d.%03d fps). %ld audio bytes (%d,%03d sps)"
2903
IDS_CAP_STAT_VIDEOONLY = 512; // "Captured %d.%03d sec. %ld frames (%ld dropped) (%d.%03d fps)"
2904
IDS_CAP_STAT_FRAMESDROPPED = 513; // "Dropped %ld of %ld frames (%d.%02d%%) during capture."
2906
{== FilePreview dialog =======================================================}
2908
function GetOpenFileNamePreviewA(lpofn: POPENFILENAMEA): BOOL; stdcall;
2909
function GetSaveFileNamePreviewA(lpofn: POPENFILENAMEA): BOOL; stdcall;
2911
function GetOpenFileNamePreviewW(lpofn: POPENFILENAMEW): BOOL; stdcall;
2912
function GetSaveFileNamePreviewW(lpofn: POPENFILENAMEW): BOOL; stdcall;
2914
function GetOpenFileNamePreview(lpofn: POPENFILENAMEA): BOOL; stdcall; // GetOpenFileNamePreviewA
2915
function GetSaveFileNamePreview(lpofn: POPENFILENAMEA): BOOL; stdcall; // GetSaveFileNamePreviewA
2919
function MKFOURCC( ch0, ch1, ch2, ch3: AnsiChar ): FOURCC;
2921
Result := (DWord(Ord(ch0))) or
2922
(DWord(Ord(ch1)) shl 8) or
2923
(DWord(Ord(ch2)) shl 16) or
2924
(DWord(Ord(ch3)) shl 24);
2927
function mmioFOURCC( ch0, ch1, ch2, ch3: AnsiChar ): FOURCC;
2929
Result := MKFOURCC(ch0,ch1,ch2,ch3);
2932
function aviTWOCC(ch0, ch1: AnsiChar): TWOCC;
2934
Result := (Word(Ord(ch0))) or (Word(Ord(ch1)) shl 8);
2937
{-- Query macros -------------------------------------------------------------}
2939
function ICQueryAbout(hic: HIC): BOOL;
2941
Result := ICSendMessage(hic, ICM_ABOUT, dword(-1), ICMF_ABOUT_QUERY) = ICERR_OK;
2944
function ICAbout(hic: HIC; hwnd: HWND): DWORD;
2946
Result := ICSendMessage(hic, ICM_ABOUT, hwnd, 0);
2949
function ICQueryConfigure(hic: HIC): BOOL;
2951
Result := ICSendMessage(hic, ICM_CONFIGURE, dword(-1), ICMF_CONFIGURE_QUERY) = ICERR_OK;
2954
function ICConfigure(hic: HIC; hwnd: HWND): DWORD;
2956
Result := ICSendMessage(hic, ICM_CONFIGURE, hwnd, 0);
2959
{-- Get/Set state macros -----------------------------------------------------}
2961
function ICGetState(hic: HIC; pv: PVOID; cb: DWORD): DWORD;
2963
Result := ICSendMessage(hic, ICM_GETSTATE, DWORD(pv), cb);
2966
function ICSetState(hic: HIC; pv: PVOID; cb: DWORD): DWORD;
2968
Result := ICSendMessage(hic, ICM_SETSTATE, DWORD(pv), cb);
2971
function ICGetStateSize(hic: HIC): DWORD;
2973
Result := ICGetState(hic, nil, 0);
2976
{-- Get value macros ---------------------------------------------------------}
2978
function ICGetDefaultQuality(hic: HIC): DWORD;
2980
ICSendMessage(hic, ICM_GETDEFAULTQUALITY, DWORD(@Result), sizeof(Result));
2983
function ICGetDefaultKeyFrameRate(hic: HIC): DWORD;
2985
ICSendMessage(hic, ICM_GETDEFAULTKEYFRAMERATE, DWORD(@Result), sizeof(Result));
2988
{-- Draw window macro --------------------------------------------------------}
2990
function ICDrawWindow(hic: HIC; prc: PRECT): DWORD;
2992
Result := ICSendMessage(hic, ICM_DRAW_WINDOW, DWORD(prc), sizeof(prc^));
2995
{-- ICCompressBegin() - start compression from a source fmt to a dest fmt ----}
2997
function ICCompressBegin(hic: HIC; lpbiInput, lpbiOutput: PBITMAPINFOHEADER): DWORD;
2999
Result := ICSendMessage(hic, ICM_COMPRESS_BEGIN, DWORD(lpbiInput), DWORD(lpbiOutput));
3002
{-- ICCompressQuery() - determines if compression from src to dst is supp ----}
3004
function ICCompressQuery(hic: HIC; lpbiInput, lpbiOutput: PBITMAPINFOHEADER): DWORD;
3006
Result := ICSendMessage(hic, ICM_COMPRESS_QUERY, DWORD(lpbiInput), DWORD(lpbiOutput));
3009
{-- ICCompressGetFormat() - get the output format (fmt of compressed) --------}
3011
// if lpbiOutput is nil return the size in bytes needed for format.
3013
function ICCompressGetFormat(hic: HIC; lpbiInput, lpbiOutput: PBITMAPINFOHEADER): DWORD;
3015
Result := ICSendMessage(hic, ICM_COMPRESS_GET_FORMAT, DWORD(lpbiInput), DWORD(lpbiOutput));
3018
function ICCompressGetFormatSize(hic: HIC; lpbi: PBITMAPINFOHEADER): DWORD;
3020
Result := ICCompressGetFormat(hic, lpbi, nil);
3023
{-- ICCompressSize() - return the maximal size of a compressed frame ---------}
3025
function ICCompressGetSize(hic: HIC; lpbiInput, lpbiOutput: PBITMAPINFOHEADER): DWORD;
3027
Result := ICSendMessage(hic, ICM_COMPRESS_GET_SIZE, DWORD(lpbiInput), DWORD(lpbiOutput));
3030
function ICCompressEnd(hic: HIC): DWORD;
3032
Result := ICSendMessage(hic, ICM_COMPRESS_END, 0, 0);
3035
{-- ICDecompressBegin() - start compression from src fmt to a dest fmt -------}
3037
function ICDecompressBegin(hic: HIC; lpbiInput, lpbiOutput: PBITMAPINFOHEADER): DWORD;
3039
Result := ICSendMessage(hic, ICM_DECOMPRESS_BEGIN, DWORD(lpbiInput), DWORD(lpbiOutput));
3042
{-- ICDecompressQuery() - determines if compression is supported -------------}
3044
function ICDecompressQuery(hic: HIC; lpbiInput, lpbiOutput: PBITMAPINFOHEADER): DWORD;
3046
Result := ICSendMessage(hic, ICM_DECOMPRESS_QUERY, DWORD(lpbiInput), DWORD(lpbiOutput));
3049
{-- ICDecompressGetFormat - get the output fmt (fmt of uncompressed data) ----}
3051
// if lpbiOutput is NULL return the size in bytes needed for format.
3053
function ICDecompressGetFormat(hic: HIC; lpbiInput, lpbiOutput: PBITMAPINFOHEADER): DWORD;
3055
Result := ICSendMessage(hic, ICM_DECOMPRESS_GET_FORMAT, DWORD(lpbiInput), DWORD(lpbiOutput));
3058
function ICDecompressGetFormatSize(hic: HIC; lpbi: PBITMAPINFOHEADER): DWORD;
3060
Result := ICDecompressGetFormat(hic, lpbi, nil);
3063
{-- ICDecompressGetPalette() - get the output palette ------------------------}
3065
function ICDecompressGetPalette(hic: HIC; lpbiInput, lpbiOutput: PBITMAPINFOHEADER): DWORD;
3067
Result := ICSendMessage(hic, ICM_DECOMPRESS_GET_PALETTE, DWORD(lpbiInput), DWORD(lpbiOutput));
3070
function ICDecompressSetPalette(hic: HIC; lpbiPalette: PBITMAPINFOHEADER): DWORD;
3072
Result := ICSendMessage(hic, ICM_DECOMPRESS_SET_PALETTE, DWORD(lpbiPalette), 0);
3075
function ICDecompressEnd(hic: HIC): DWORD;
3077
Result := ICSendMessage(hic, ICM_DECOMPRESS_END, 0, 0);
3080
{-- ICDecompressEx() - decompress a single frame -----------------------------}
3082
function ICDecompressEx(
3085
lpbiSrc : PBITMAPINFOHEADER;
3091
lpbiDst : PBITMAPINFOHEADER;
3099
ic : TICDECOMPRESSEX;
3101
ic.dwFlags := dwFlags;
3102
ic.lpbiSrc := lpbiSrc;
3108
ic.lpbiDst := lpbiDst;
3115
// note that ICM swaps round the length and pointer
3116
// length in lparam2, pointer in lparam1
3117
Result := ICSendMessage(hic, ICM_DECOMPRESSEX, DWORD(@ic), sizeof(ic));
3120
{-- ICDecompressExBegin() - start compression from a src fmt to a dest fmt ---}
3122
function ICDecompressExBegin(
3125
lpbiSrc : PBITMAPINFOHEADER;
3131
lpbiDst : PBITMAPINFOHEADER;
3139
ic : TICDECOMPRESSEX ;
3141
ic.dwFlags := dwFlags;
3142
ic.lpbiSrc := lpbiSrc;
3148
ic.lpbiDst := lpbiDst;
3155
// note that ICM swaps round the length and pointer
3156
// length in lparam2, pointer in lparam1
3157
Result := ICSendMessage(hic, ICM_DECOMPRESSEX_BEGIN, DWORD(@ic), sizeof(ic));
3160
{-- ICDecompressExQuery() ----------------------------------------------------}
3162
function ICDecompressExQuery(
3165
lpbiSrc : PBITMAPINFOHEADER;
3171
lpbiDst : PBITMAPINFOHEADER;
3179
ic : TICDECOMPRESSEX;
3181
ic.dwFlags := dwFlags;
3182
ic.lpbiSrc := lpbiSrc;
3188
ic.lpbiDst := lpbiDst;
3195
// note that ICM swaps round the length and pointer
3196
// length in lparam2, pointer in lparam1
3197
Result := ICSendMessage(hic, ICM_DECOMPRESSEX_QUERY, DWORD(@ic), sizeof(ic));
3200
function ICDecompressExEnd(hic: HIC): DWORD;
3202
Result := ICSendMessage(hic, ICM_DECOMPRESSEX_END, 0, 0)
3205
function ICDrawSuggestFormat(
3207
lpbiIn : PBITMAPINFOHEADER;
3208
lpbiOut : PBITMAPINFOHEADER;
3216
ic : TICDRAWSUGGEST;
3218
ic.lpbiIn := lpbiIn;
3219
ic.lpbiSuggest := lpbiOut;
3224
ic.hicDecompressor := hicDecomp;
3226
// note that ICM swaps round the length and pointer
3227
// length in lparam2, pointer in lparam1
3228
Result := ICSendMessage(hic, ICM_DRAW_SUGGESTFORMAT, DWORD(@ic), sizeof(ic));
3231
{-- ICDrawQuery() - determines if the compressor is willing to render fmt ----}
3233
function ICDrawQuery(hic: HIC; lpbiInput: PBITMAPINFOHEADER): DWORD;
3235
Result := ICSendMessage(hic, ICM_DRAW_QUERY, DWORD(lpbiInput), 0);
3238
function ICDrawChangePalette(hic: HIC; lpbiInput: PBITMAPINFOHEADER): DWORD;
3240
Result := ICSendMessage(hic, ICM_DRAW_CHANGEPALETTE, DWORD(lpbiInput), 0);
3243
function ICGetBuffersWanted(hic: HIC; lpdwBuffers: PDWORD): DWORD;
3245
Result := ICSendMessage(hic, ICM_GETBUFFERSWANTED, DWORD(lpdwBuffers), 0);
3248
function ICDrawEnd(hic: HIC): DWORD;
3250
Result := ICSendMessage(hic, ICM_DRAW_END, 0, 0);
3253
function ICDrawStart(hic: HIC): DWORD;
3255
Result := ICSendMessage(hic, ICM_DRAW_START, 0, 0);
3258
function ICDrawStartPlay(hic: HIC; lFrom, lTo: DWORD): DWORD;
3260
Result := ICSendMessage(hic, ICM_DRAW_START_PLAY, lFrom, lTo);
3263
function ICDrawStop(hic: HIC): DWORD;
3265
Result := ICSendMessage(hic, ICM_DRAW_STOP, 0, 0);
3268
function ICDrawStopPlay(hic: HIC): DWORD;
3270
Result := ICSendMessage(hic, ICM_DRAW_STOP_PLAY, 0, 0);
3273
function ICDrawGetTime(hic: HIC; lplTime: PDWORD): DWORD;
3275
Result := ICSendMessage(hic, ICM_DRAW_GETTIME, DWORD(lplTime), 0);
3278
function ICDrawSetTime(hic: HIC; lTime: DWORD): DWORD;
3280
Result := ICSendMessage(hic, ICM_DRAW_SETTIME, lTime, 0);
3283
function ICDrawRealize(hic: HIC; hdc: HDC; fBackground: BOOL): DWORD;
3285
Result := ICSendMessage(hic, ICM_DRAW_REALIZE, DWORD(hdc), DWORD(fBackground));
3288
function ICDrawFlush(hic: HIC): DWORD;
3290
Result := ICSendMessage(hic, ICM_DRAW_FLUSH, 0, 0);
3293
function ICDrawRenderBuffer(hic: HIC): DWORD;
3295
Result := ICSendMessage(hic, ICM_DRAW_RENDERBUFFER, 0, 0);
3298
{-- ICSetStatusProc() - Set the status callback function ---------------------}
3300
// ICMessage is not supported on NT
3302
function ICSetStatusProc(
3306
fpfnStatus : TICStatusProc
3309
ic : TICSETSTATUSPROC;
3311
ic.dwFlags := dwFlags;
3312
ic.lParam := lParam;
3313
ic.Status := fpfnStatus;
3315
// note that ICM swaps round the length and pointer
3316
// length in lparam2, pointer in lparam1
3317
Result := ICSendMessage(hic, ICM_SET_STATUS_PROC, DWORD(@ic), sizeof(ic));
3320
{== Helper routines for DrawDib and MCIAVI... ================================}
3322
function ICDecompressOpen(fccType, fccHandler: DWORD; lpbiIn, lpbiOut: PBITMAPINFOHEADER): HIC;
3324
Result := ICLocate(fccType, fccHandler, lpbiIn, lpbiOut, ICMODE_DECOMPRESS);
3327
function ICDrawOpen(fccType, fccHandler: DWORD; lpbiIn: PBITMAPINFOHEADER): HIC;
3329
Result := ICLocate(fccType, fccHandler, lpbiIn, nil, ICMODE_DRAW);
3332
{-- DrawDibUpdate() - redraw last image (may only be valid with DDF_BUFFER) --}
3334
function DrawDibUpdate(hdd: HDRAWDIB; hdc: HDC; x, y: int): BOOL;
3336
Result := DrawDibDraw(hdd, hdc, x, y, 0, 0, nil, nil, 0, 0, 0, 0, DDF_UPDATE);
3339
{== Useful macros ============================================================}
3341
{-- Macro to get stream number out of a FOURCC ckid --------------------------}
3343
function FromHex(n: BYTE): BYTE;
3345
if n >= Ord('A') then
3346
Result := Ord(n) + 10 - Ord('A')
3348
Result := Ord(n) - Ord('0');
3351
function StreamFromFOURCC(fcc: DWORD): BYTE;
3353
Result := (FromHex(Lo(LoWord(fcc))) shl 4) + FromHex(Hi(LoWord(fcc)));
3356
{-- Macro to get TWOCC chunk type out of a FOURCC ckid -----------------------}
3358
function TWOCCFromFOURCC(fcc: DWORD): WORD;
3360
Result := HiWord(fcc);
3363
{-- Macro to make a ckid for a chunk out of a TWOCC and a stream num (0-255) -}
3365
function ToHex(n: BYTE): BYTE;
3368
Result := n - 10 + Ord('A')
3370
Result := n + Ord('0');
3373
function MAKEAVICKID(tcc: WORD; stream: BYTE): DWORD;
3375
Result := MakeLONG((ToHex(stream and $0F) shl 8) or ToHex((stream and $F0) shr 4),tcc);
3378
{-- Helper macros ------------------------------------------------------------}
3380
function AVIStreamSampleToSample(pavi1, pavi2: IAVISTREAM; l: LONG): LONG;
3382
Result := AVIStreamTimeToSample(pavi1,AVIStreamSampleToTime(pavi2, l));
3385
function AVIStreamNextSample(pavi: IAVISTREAM; l: LONG): LONG;
3387
Result := AVIStreamFindSample(pavi,l+1,FIND_NEXT or FIND_ANY);
3390
function AVIStreamPrevSample(pavi: IAVISTREAM; l: LONG): LONG;
3392
Result := AVIStreamFindSample(pavi,l-1,FIND_PREV or FIND_ANY);
3395
function AVIStreamNearestSample(pavi: IAVISTREAM; l: LONG): LONG;
3397
Result := AVIStreamFindSample(pavi,l,FIND_PREV or FIND_ANY);
3400
function AVIStreamNextKeyFrame(pavi: IAVISTREAM; l: LONG): LONG;
3402
Result := AVIStreamFindSample(pavi,l+1,FIND_NEXT or FIND_KEY);
3405
function AVIStreamPrevKeyFrame(pavi: IAVISTREAM; l: LONG): LONG;
3407
Result := AVIStreamFindSample(pavi,l-1,FIND_PREV or FIND_KEY);
3410
function AVIStreamNearestKeyFrame(pavi: IAVISTREAM; l: LONG): LONG;
3412
Result := AVIStreamFindSample(pavi,l,FIND_PREV or FIND_KEY)
3415
function AVIStreamIsKeyFrame(pavi: IAVISTREAM; l: LONG): BOOL;
3417
Result := AVIStreamNearestKeyFrame(pavi,l) = l;
3420
function AVIStreamPrevSampleTime(pavi: IAVISTREAM; t: LONG): LONG;
3422
Result := AVIStreamSampleToTime(pavi, AVIStreamPrevSample(pavi,AVIStreamTimeToSample(pavi,t)));
3425
function AVIStreamNextSampleTime(pavi: IAVISTREAM; t: LONG): LONG;
3427
Result := AVIStreamSampleToTime(pavi, AVIStreamNextSample(pavi,AVIStreamTimeToSample(pavi,t)));
3430
function AVIStreamNearestSampleTime(pavi: IAVISTREAM; t: LONG): LONG;
3432
Result := AVIStreamSampleToTime(pavi, AVIStreamNearestSample(pavi,AVIStreamTimeToSample(pavi,t)));
3435
function AVIStreamNextKeyFrameTime(pavi: IAVISTREAM; t: LONG): LONG;
3437
Result := AVIStreamSampleToTime(pavi, AVIStreamNextKeyFrame(pavi,AVIStreamTimeToSample(pavi, t)));
3440
function AVIStreamPrevKeyFrameTime(pavi: IAVISTREAM; t: LONG): LONG;
3442
Result := AVIStreamSampleToTime(pavi, AVIStreamPrevKeyFrame(pavi,AVIStreamTimeToSample(pavi, t)));
3445
function AVIStreamNearestKeyFrameTime(pavi: IAVISTREAM; t: LONG): LONG;
3447
Result := AVIStreamSampleToTime(pavi, AVIStreamNearestKeyFrame(pavi,AVIStreamTimeToSample(pavi, t)));
3450
function AVIStreamStartTime(pavi: IAVISTREAM): LONG;
3452
Result := AVIStreamSampleToTime(pavi, AVIStreamStart(pavi));
3455
function AVIStreamLengthTime(pavi: IAVISTREAM): LONG;
3457
Result := AVIStreamSampleToTime(pavi, AVIStreamLength(pavi));
3460
function AVIStreamEnd(pavi: IAVISTREAM): LONG;
3462
Result := AVIStreamStart(pavi) + AVIStreamLength(pavi);
3465
function AVIStreamEndTime(pavi: IAVISTREAM): LONG;
3467
Result := AVIStreamSampleToTime(pavi, AVIStreamEnd(pavi));
3470
function AVIStreamSampleSize(pavi: IAVISTREAM; lPos: LONG; plSize: PLONG): LONG;
3472
Result := AVIStreamRead(pavi,lPos,1,nil,0,plSize,nil);
3475
function AVIStreamFormatSize(pavi: IAVISTREAM; lPos: LONG; plSize: PLONG): HResult;
3477
Result := AVIStreamReadFormat(pavi,lPos,nil,plSize);
3480
function AVIStreamDataSize(pavi: IAVISTREAM; fcc: DWORD; plSize: PLONG): HResult;
3482
Result := AVIStreamReadData(pavi,fcc,nil,plSize)
3485
{== MCIWnd ===================================================================}
3487
function MCIWndSM(hWnd: HWND; Msg: UINT; wParam: WPARAM; lParam: LPARAM): DWORD;
3489
Result := SendMessage(hWnd, Msg, wParam, lParam);
3492
{-- Can macros ---------------------------------------------------------------}
3494
function MCIWndCanPlay(hwnd: HWND): BOOL;
3496
Result := MCIWndSM(hwnd,MCIWNDM_CAN_PLAY,0,0) <> 0;
3499
function MCIWndCanRecord(hwnd: HWND): BOOL;
3501
Result := MCIWndSM(hwnd,MCIWNDM_CAN_RECORD,0,0) <> 0;
3504
function MCIWndCanSave(hwnd: HWND): BOOL;
3506
Result := MCIWndSM(hwnd,MCIWNDM_CAN_SAVE,0,0) <> 0;
3509
function MCIWndCanWindow(hwnd: HWND): BOOL;
3511
Result := MCIWndSM(hwnd,MCIWNDM_CAN_WINDOW,0,0) <> 0;
3514
function MCIWndCanEject(hwnd: HWND): BOOL;
3516
Result := MCIWndSM(hwnd,MCIWNDM_CAN_EJECT,0,0) <> 0;
3519
function MCIWndCanConfig(hwnd: HWND): BOOL;
3521
Result := MCIWndSM(hwnd,MCIWNDM_CAN_CONFIG,0,0) <> 0;
3524
function MCIWndPaletteKick(hwnd: HWND): BOOL;
3526
Result := MCIWndSM(hwnd,MCIWNDM_PALETTEKICK,0,0) <> 0;
3529
function MCIWndSave(hwnd: HWND; szFile: LPCSTR): DWORD;
3531
Result := MCIWndSM(hwnd, MCI_SAVE, 0, LPARAM(szFile));
3534
function MCIWndSaveDialog(hwnd: HWND): DWORD;
3536
Result := MCIWndSave(hwnd, LPCSTR(-1));
3539
// If you dont give a device it will use the current device....
3541
function MCIWndNew(hwnd: HWND; lp: PVOID): DWORD;
3543
Result := MCIWndSM(hwnd, MCIWNDM_NEW, 0, LPARAM(lp));
3546
function MCIWndRecord(hwnd: HWND): DWORD;
3548
Result := MCIWndSM(hwnd, MCI_RECORD, 0, 0);
3551
function MCIWndOpen(hwnd: HWND; sz: LPCSTR; f: BOOL): DWORD;
3553
Result := MCIWndSM(hwnd, MCIWNDM_OPEN, WPARAM(f), LPARAM(sz));
3556
function MCIWndOpenDialog(hwnd: HWND): DWORD;
3558
Result := MCIWndOpen(hwnd, LPCSTR(-1), False);
3561
function MCIWndClose(hwnd: HWND): DWORD;
3563
Result := MCIWndSM(hwnd, MCI_CLOSE, 0, 0);
3566
function MCIWndPlay(hwnd: HWND): DWORD;
3568
Result := MCIWndSM(hwnd, MCI_PLAY, 0, 0);
3571
function MCIWndStop(hwnd: HWND): DWORD;
3573
Result := MCIWndSM(hwnd, MCI_STOP, 0, 0);
3576
function MCIWndPause(hwnd: HWND): DWORD;
3578
Result := MCIWndSM(hwnd, MCI_PAUSE, 0, 0);
3581
function MCIWndResume(hwnd: HWND): DWORD;
3583
Result := MCIWndSM(hwnd, MCI_RESUME, 0, 0);
3586
function MCIWndSeek(hwnd: HWND; lPos: DWORD): DWORD;
3588
Result := MCIWndSM(hwnd, MCI_SEEK, 0, lPos);
3591
function MCIWndEject(hwnd: HWND): DWORD;
3593
Result := MCIWndSM(hwnd, MCIWNDM_EJECT, 0, 0);
3596
function MCIWndHome(hwnd: HWND): DWORD;
3598
Result := MCIWndSeek(hwnd, MCIWND_START);
3601
function MCIWndEnd(hwnd: HWND): DWORD;
3603
Result := MCIWndSeek(hwnd, MCIWND_END);
3606
function MCIWndGetSource(hwnd: HWND; prc: PRECT): DWORD;
3608
Result := MCIWndSM(hwnd, MCIWNDM_GET_SOURCE, 0, LPARAM(prc));
3611
function MCIWndPutSource(hwnd: HWND; prc: PRECT): DWORD;
3613
Result := MCIWndSM(hwnd, MCIWNDM_PUT_SOURCE, 0, LPARAM(prc));
3616
function MCIWndGetDest(hwnd: HWND; prc: PRECT): DWORD;
3618
Result := MCIWndSM(hwnd, MCIWNDM_GET_DEST, 0, LPARAM(prc));
3621
function MCIWndPutDest(hwnd: HWND; prc: PRECT): DWORD;
3623
Result := MCIWndSM(hwnd, MCIWNDM_PUT_DEST, 0, LPARAM(prc));
3626
function MCIWndPlayReverse(hwnd: HWND): DWORD;
3628
Result := MCIWndSM(hwnd, MCIWNDM_PLAYREVERSE, 0, 0);
3631
function MCIWndPlayFrom(hwnd: HWND; lPos: DWORD): DWORD;
3633
Result := MCIWndSM(hwnd, MCIWNDM_PLAYFROM, 0, lPos);
3636
function MCIWndPlayTo(hwnd: HWND; lPos: DWORD): DWORD;
3638
Result := MCIWndSM(hwnd, MCIWNDM_PLAYTO, 0, lPos);
3641
function MCIWndPlayFromTo(hwnd: HWND; lStart, lEnd: DWORD): DWORD;
3643
MCIWndSeek(hwnd, lStart);
3644
Result := MCIWndPlayTo(hwnd, lEnd);
3647
function MCIWndGetDeviceID(hwnd: HWND): UINT;
3649
Result := MCIWndSM(hwnd, MCIWNDM_GETDEVICEID, 0, 0);
3652
function MCIWndGetAlias(hwnd: HWND): UINT;
3654
Result := MCIWndSM(hwnd, MCIWNDM_GETALIAS, 0, 0);
3657
function MCIWndGetMode(hwnd: HWND; lp: LPCSTR; len: UINT): DWORD;
3659
Result := MCIWndSM(hwnd, MCIWNDM_GETMODE, len, LPARAM(lp));
3662
function MCIWndGetPosition(hwnd: HWND): DWORD;
3664
Result := MCIWndSM(hwnd, MCIWNDM_GETPOSITION, 0, 0);
3667
function MCIWndGetPositionString(hwnd: HWND; lp: LPCSTR; len: UINT): DWORD;
3669
Result := MCIWndSM(hwnd, MCIWNDM_GETPOSITION, len, LPARAM(lp));
3672
function MCIWndGetStart(hwnd: HWND): DWORD;
3674
Result := MCIWndSM(hwnd, MCIWNDM_GETSTART, 0, 0);
3677
function MCIWndGetLength(hwnd: HWND): DWORD;
3679
Result := MCIWndSM(hwnd, MCIWNDM_GETLENGTH, 0, 0);
3682
function MCIWndGetEnd(hwnd: HWND): DWORD;
3684
Result := MCIWndSM(hwnd, MCIWNDM_GETEND, 0, 0);
3687
function MCIWndStep(hwnd: HWND; n: DWORD): DWORD;
3689
Result := MCIWndSM(hwnd, MCI_STEP, 0, n);
3692
procedure MCIWndDestroy(hwnd: HWND);
3694
MCIWndSM(hwnd, WM_CLOSE, 0, 0);
3697
procedure MCIWndSetZoom(hwnd: HWND; iZoom: UINT);
3699
MCIWndSM(hwnd, MCIWNDM_SETZOOM, 0, iZoom);
3702
function MCIWndGetZoom(hwnd: HWND): UINT;
3704
Result := MCIWndSM(hwnd, MCIWNDM_GETZOOM, 0, 0);
3707
function MCIWndSetVolume(hwnd: HWND; iVol: UINT): DWORD;
3709
Result := MCIWndSM(hwnd, MCIWNDM_SETVOLUME, 0, iVol);
3712
function MCIWndGetVolume(hwnd: HWND): DWORD;
3714
Result := MCIWndSM(hwnd, MCIWNDM_GETVOLUME, 0, 0);
3717
function MCIWndSetSpeed(hwnd: HWND; iSpeed: UINT): DWORD;
3719
Result := MCIWndSM(hwnd, MCIWNDM_SETSPEED, 0, iSpeed);
3722
function MCIWndGetSpeed(hwnd: HWND): DWORD;
3724
Result := MCIWndSM(hwnd, MCIWNDM_GETSPEED, 0, 0);
3727
function MCIWndSetTimeFormat(hwnd: HWND; lp: LPCSTR): DWORD;
3729
Result := MCIWndSM(hwnd, MCIWNDM_SETTIMEFORMAT, 0, LPARAM(lp));
3732
function MCIWndGetTimeFormat(hwnd: HWND; lp: LPCSTR; len: UINT): DWORD;
3734
Result := MCIWndSM(hwnd, MCIWNDM_GETTIMEFORMAT, len, LPARAM(lp));
3737
procedure MCIWndValidateMedia(hwnd: HWND);
3739
MCIWndSM(hwnd, MCIWNDM_VALIDATEMEDIA, 0, 0);
3742
procedure MCIWndSetRepeat(hwnd: HWND; f: BOOL);
3744
MCIWndSM(hwnd, MCIWNDM_SETREPEAT, 0, LPARAM(f));
3747
function MCIWndGetRepeat(hwnd: HWND): BOOL;
3749
Result := MCIWndSM(hwnd, MCIWNDM_GETREPEAT, 0, 0) <> 0;
3752
function MCIWndUseFrames(hwnd: HWND): DWORD;
3754
Result := MCIWndSetTimeFormat(hwnd, 'frames');
3757
function MCIWndUseTime(hwnd: HWND): DWORD;
3759
Result := MCIWndSetTimeFormat(hwnd, 'ms');
3762
procedure MCIWndSetActiveTimer(hwnd: HWND; active: UINT);
3764
MCIWndSM(hwnd, MCIWNDM_SETACTIVETIMER, active, 0);
3767
procedure MCIWndSetInactiveTimer(hwnd: HWND; inactive: UINT);
3769
MCIWndSM(hwnd, MCIWNDM_SETINACTIVETIMER, inactive, 0);
3772
procedure MCIWndSetTimers(hwnd: HWND; active, inactive: UINT);
3774
MCIWndSM(hwnd, MCIWNDM_SETTIMERS, active, inactive);
3777
function MCIWndGetActiveTimer(hwnd: HWND): UINT;
3779
Result := MCIWndSM(hwnd, MCIWNDM_GETACTIVETIMER, 0, 0);
3782
function MCIWndGetInactiveTimer(hwnd: HWND): UINT;
3784
Result := MCIWndSM(hwnd, MCIWNDM_GETINACTIVETIMER, 0, 0);
3787
function MCIWndRealize(hwnd: HWND; fBkgnd: BOOL): DWORD;
3789
Result := MCIWndSM(hwnd, MCIWNDM_REALIZE, WPARAM(fBkgnd), 0);
3792
function MCIWndSendString(hwnd: HWND; sz: LPCSTR): DWORD;
3794
Result := MCIWndSM(hwnd, MCIWNDM_SENDSTRING, 0, LPARAM(sz));
3797
function MCIWndReturnString(hwnd: HWND; lp: LPSTR; len: UINT): DWORD;
3799
Result := MCIWndSM(hwnd, MCIWNDM_RETURNSTRING, len, LPARAM(lp));
3802
function MCIWndGetError(hwnd: HWND; lp: LPSTR; len: UINT): DWORD;
3804
Result := MCIWndSM(hwnd, MCIWNDM_GETERROR, len, LPARAM(lp));
3807
function MCIWndGetPalette(hwnd: HWND): HPALETTE;
3809
Result := MCIWndSM(hwnd, MCIWNDM_GETPALETTE, 0, 0);
3812
function MCIWndSetPalette(hwnd: HWND; hpal: HPALETTE): DWORD;
3814
Result := MCIWndSM(hwnd, MCIWNDM_SETPALETTE, hpal, 0);
3817
function MCIWndGetFileName(hwnd: HWND; lp: LPCSTR; len: UINT): DWORD;
3819
Result := MCIWndSM(hwnd, MCIWNDM_GETFILENAME, len, LPARAM(lp));
3822
function MCIWndGetDevice(hwnd: HWND; lp: LPCSTR; len: UINT): DWORD;
3824
Result := MCIWndSM(hwnd, MCIWNDM_GETDEVICE, len, LPARAM(lp));
3827
function MCIWndGetStyles(hwnd: HWND): UINT;
3829
Result := MCIWndSM(hwnd, MCIWNDM_GETSTYLES, 0, 0);
3832
function MCIWndChangeStyles(hwnd: HWND; mask: UINT; value: DWORD): DWORD;
3834
Result := MCIWndSM(hwnd, MCIWNDM_CHANGESTYLES, mask, value);
3837
function MCIWndOpenInterface(hwnd: HWND; pUnk: PUNKNOWN): DWORD;
3839
Result := MCIWndSM(hwnd, MCIWNDM_OPENINTERFACE, 0, LPARAM(pUnk));
3842
function MCIWndSetOwner(hwnd: HWND; hwndP: HWND): DWORD;
3844
Result := MCIWndSM(hwnd, MCIWNDM_SETOWNER, hwndP, 0);
3847
{== AVICAP - Window class for AVI capture ====================================}
3849
function AVICapSM(hwnd: HWND; m: UINT; w: WPARAM; l: LPARAM): DWORD;
3851
if IsWindow(hwnd) then
3852
Result := SendMessage(hwnd,m,w,l)
3857
{-- Message crackers for above -----------------------------------------------}
3859
function capSetCallbackOnError(hwnd: HWND; fpProc: TCAPERRORCALLBACK): BOOL;
3861
Result := AVICapSM(hwnd, WM_CAP_SET_CALLBACK_ERROR, 0, LPARAM(@fpProc)) <> 0;
3864
function capSetCallbackOnStatus(hwnd: HWND; fpProc: TCAPSTATUSCALLBACK): BOOL;
3866
Result := AVICapSM(hwnd, WM_CAP_SET_CALLBACK_STATUS, 0, LPARAM(@fpProc)) <> 0;
3869
function capSetCallbackOnYield(hwnd: HWND; fpProc: TCAPYIELDCALLBACK): BOOL;
3871
Result := AVICapSM(hwnd, WM_CAP_SET_CALLBACK_YIELD, 0, LPARAM(@fpProc)) <> 0;
3874
function capSetCallbackOnFrame(hwnd: HWND; fpProc: TCAPVIDEOCALLBACK): BOOL;
3876
Result := AVICapSM(hwnd, WM_CAP_SET_CALLBACK_FRAME, 0, LPARAM(@fpProc)) <> 0;
3879
function capSetCallbackOnVideoStream(hwnd: HWND; fpProc: TCAPVIDEOCALLBACK): BOOL;
3881
Result := AVICapSM(hwnd, WM_CAP_SET_CALLBACK_VIDEOSTREAM, 0, LPARAM(@fpProc)) <> 0;
3884
function capSetCallbackOnWaveStream(hwnd: HWND; fpProc: TCAPWAVECALLBACK): BOOL;
3886
Result := AVICapSM(hwnd, WM_CAP_SET_CALLBACK_WAVESTREAM, 0, LPARAM(@fpProc)) <> 0;
3889
function capSetCallbackOnCapControl(hwnd: HWND; fpProc: TCAPCONTROLCALLBACK): BOOL;
3891
Result := AVICapSM(hwnd, WM_CAP_SET_CALLBACK_CAPCONTROL, 0, LPARAM(@fpProc)) <> 0;
3894
function capSetUserData(hwnd: HWND; lUser: DWORD): BOOL;
3896
Result := AVICapSM(hwnd, WM_CAP_SET_USER_DATA, 0, lUser) <> 0;
3899
function capGetUserData(hwnd: HWND): DWORD;
3901
Result := AVICapSM(hwnd, WM_CAP_GET_USER_DATA, 0, 0);
3904
function capDriverConnect(hwnd: HWND; i: INT): BOOL;
3906
Result := AVICapSM(hwnd, WM_CAP_DRIVER_CONNECT, i, 0) <> 0;
3909
function capDriverDisconnect(hwnd: HWND): BOOL;
3911
Result := AVICapSM(hwnd, WM_CAP_DRIVER_DISCONNECT, 0, 0) <> 0;
3914
function capDriverGetName(hwnd: HWND; szName: LPSTR; wSize: WORD): BOOL;
3916
Result := AVICapSM(hwnd, WM_CAP_DRIVER_GET_NAME, wSize, LPARAM(szName)) <> 0;
3919
function capDriverGetVersion(hwnd: HWND; szVer: LPSTR; wSize: WORD): BOOL;
3921
Result := AVICapSM(hwnd, WM_CAP_DRIVER_GET_VERSION, wSize, LPARAM(szVer)) <> 0;
3924
function capDriverGetCaps(hwnd: HWND; s: PCAPDRIVERCAPS; wSize: WORD): BOOL;
3926
Result := AVICapSM(hwnd, WM_CAP_DRIVER_GET_CAPS, wSize, LPARAM(s)) <> 0;
3929
function capFileSetCaptureFile(hwnd: HWND; szName: LPCSTR): BOOL;
3931
Result := AVICapSM(hwnd, WM_CAP_FILE_SET_CAPTURE_FILE, 0, LPARAM(szName)) <> 0;
3934
function capFileGetCaptureFile(hwnd: HWND; szName: LPSTR; wSize: WORD): BOOL;
3936
Result := AVICapSM(hwnd, WM_CAP_FILE_GET_CAPTURE_FILE, wSize, LPARAM(szName)) <> 0;
3939
function capFileAlloc(hwnd: HWND; dwSize: DWORD): BOOL;
3941
Result := AVICapSM(hwnd, WM_CAP_FILE_ALLOCATE, 0, dwSize) <> 0;
3944
function capFileSaveAs(hwnd: HWND; szName: LPCSTR): BOOL;
3946
Result := AVICapSM(hwnd, WM_CAP_FILE_SAVEAS, 0, LPARAM(szName)) <> 0;
3949
function capFileSetInfoChunk(hwnd: HWND; lpInfoChunk: PCAPINFOCHUNK): BOOL;
3951
Result := AVICapSM(hwnd, WM_CAP_FILE_SET_INFOCHUNK, 0, LPARAM(lpInfoChunk)) <> 0;
3954
function capFileSaveDIB(hwnd: HWND; szName: LPCSTR): BOOL;
3956
Result := AVICapSM(hwnd, WM_CAP_FILE_SAVEDIB, 0, LPARAM(szName)) <> 0;
3959
function capEditCopy(hwnd: HWND): BOOL;
3961
Result := AVICapSM(hwnd, WM_CAP_EDIT_COPY, 0, 0) <> 0;
3964
function capSetAudioFormat(hwnd: HWND; s: PWAVEFORMATEX; wSize: WORD): BOOL;
3966
Result := AVICapSM(hwnd, WM_CAP_SET_AUDIOFORMAT, wSize, LPARAM(s)) <> 0;
3969
function capGetAudioFormat(hwnd: HWND; s: PWAVEFORMATEX; wSize: WORD): DWORD;
3971
Result := AVICapSM(hwnd, WM_CAP_GET_AUDIOFORMAT, wSize, LPARAM(s));
3974
function capGetAudioFormatSize(hwnd: HWND): DWORD;
3976
Result := AVICapSM(hwnd, WM_CAP_GET_AUDIOFORMAT, 0, 0);
3979
function capDlgVideoFormat(hwnd: HWND): BOOL;
3981
Result := AVICapSM(hwnd, WM_CAP_DLG_VIDEOFORMAT, 0, 0) <> 0;
3984
function capDlgVideoSource(hwnd: HWND): BOOL;
3986
Result := AVICapSM(hwnd, WM_CAP_DLG_VIDEOSOURCE, 0, 0) <> 0;
3989
function capDlgVideoDisplay(hwnd: HWND): BOOL;
3991
Result := AVICapSM(hwnd, WM_CAP_DLG_VIDEODISPLAY, 0, 0) <> 0;
3994
function capDlgVideoCompression(hwnd: HWND): BOOL;
3996
Result := AVICapSM(hwnd, WM_CAP_DLG_VIDEOCOMPRESSION, 0, 0) <> 0;
3999
function capGetVideoFormat(hwnd: HWND; s: PVOID; wSize: WORD): DWORD;
4001
Result := AVICapSM(hwnd, WM_CAP_GET_VIDEOFORMAT, wSize, LPARAM(s));
4004
function capGetVideoFormatSize(hwnd: HWND): DWORD;
4006
Result := AVICapSM(hwnd, WM_CAP_GET_VIDEOFORMAT, 0, 0);
4009
function capSetVideoFormat(hwnd: HWND; s: PVOID; wSize: WORD): BOOL;
4011
Result := AVICapSM(hwnd, WM_CAP_SET_VIDEOFORMAT, wSize, LPARAM(s)) <> 0;
4014
function capPreview(hwnd: HWND; f: BOOL): BOOL;
4016
Result := AVICapSM(hwnd, WM_CAP_SET_PREVIEW, WPARAM(f), 0) <> 0;
4019
function capPreviewRate(hwnd: HWND; wMS: WORD): BOOL;
4021
Result := AVICapSM(hwnd, WM_CAP_SET_PREVIEWRATE, wMS, 0) <> 0;
4024
function capOverlay(hwnd: HWND; f: BOOL): BOOL;
4026
Result := AVICapSM(hwnd, WM_CAP_SET_OVERLAY, WPARAM(f), 0) <> 0;
4029
function capPreviewScale(hwnd: HWND; f: BOOL): BOOL;
4031
Result := AVICapSM(hwnd, WM_CAP_SET_SCALE, WPARAM(f), 0) <> 0;
4034
function capGetStatus(hwnd: HWND; s: PCAPSTATUS; wSize: WORD): BOOL;
4036
Result := AVICapSM(hwnd, WM_CAP_GET_STATUS, wSize, LPARAM(s)) <> 0;
4039
function capSetScrollPos(hwnd: HWND; lpP: PPOINT): BOOL;
4041
Result := AVICapSM(hwnd, WM_CAP_SET_SCROLL, 0, LPARAM(lpP)) <> 0;
4044
function capGrabFrame(hwnd: HWND): BOOL;
4046
Result := AVICapSM(hwnd, WM_CAP_GRAB_FRAME, 0, 0) <> 0;
4049
function capGrabFrameNoStop(hwnd: HWND): BOOL;
4051
Result := AVICapSM(hwnd, WM_CAP_GRAB_FRAME_NOSTOP, 0, 0) <> 0;
4054
function capCaptureSequence(hwnd: HWND): BOOL;
4056
Result := AVICapSM(hwnd, WM_CAP_SEQUENCE, 0, 0) <> 0;
4059
function capCaptureSequenceNoFile(hwnd: HWND): BOOL;
4061
Result := AVICapSM(hwnd, WM_CAP_SEQUENCE_NOFILE, 0, 0) <> 0;
4064
function capCaptureStop(hwnd: HWND): BOOL;
4066
Result := AVICapSM(hwnd, WM_CAP_STOP, 0, 0) <> 0;
4069
function capCaptureAbort(hwnd: HWND): BOOL;
4071
Result := AVICapSM(hwnd, WM_CAP_ABORT, 0, 0) <> 0;
4074
function capCaptureSingleFrameOpen(hwnd: HWND): BOOL;
4076
Result := AVICapSM(hwnd, WM_CAP_SINGLE_FRAME_OPEN, 0, 0) <> 0;
4079
function capCaptureSingleFrameClose(hwnd: HWND): BOOL;
4081
Result := AVICapSM(hwnd, WM_CAP_SINGLE_FRAME_CLOSE, 0, 0) <> 0;
4084
function capCaptureSingleFrame(hwnd: HWND): BOOL;
4086
Result := AVICapSM(hwnd, WM_CAP_SINGLE_FRAME, 0, 0) <> 0;
4089
function capCaptureGetSetup(hwnd: HWND; s: PCAPTUREPARMS; wSize: WORD): BOOL;
4091
Result := AVICapSM(hwnd, WM_CAP_GET_SEQUENCE_SETUP, wSize, LPARAM(s)) <> 0;
4094
function capCaptureSetSetup(hwnd: HWND; s: PCAPTUREPARMS; wSize: WORD): BOOL;
4096
Result := AVICapSM(hwnd, WM_CAP_SET_SEQUENCE_SETUP, wSize, LPARAM(s)) <> 0;
4099
function capSetMCIDeviceName(hwnd: HWND; szName: LPCSTR): BOOL;
4101
Result := AVICapSM(hwnd, WM_CAP_SET_MCI_DEVICE, 0, LPARAM(szName)) <> 0;
4104
function capGetMCIDeviceName(hwnd: HWND; szName: LPSTR; wSize: WORD): BOOL;
4106
Result := AVICapSM(hwnd, WM_CAP_GET_MCI_DEVICE, wSize, LPARAM(szName)) <> 0;
4109
function capPaletteOpen(hwnd: HWND; szName: LPCSTR): BOOL;
4111
Result := AVICapSM(hwnd, WM_CAP_PAL_OPEN, 0, LPARAM(szName)) <> 0;
4114
function capPaletteSave(hwnd: HWND; szName: LPCSTR): BOOL;
4116
Result := AVICapSM(hwnd, WM_CAP_PAL_SAVE, 0, LPARAM(szName)) <> 0;
4119
function capPalettePaste(hwnd: HWND): BOOL;
4121
Result := AVICapSM(hwnd, WM_CAP_PAL_PASTE, 0, 0) <> 0;
4124
function capPaletteAuto(hwnd: HWND; iFrames, iColors: INT): BOOL;
4126
Result := AVICapSM(hwnd, WM_CAP_PAL_AUTOCREATE, iFrames, iColors) <> 0;
4129
function capPaletteManual(hwnd: HWND; fGrab: BOOL; iColors: INT): BOOL;
4131
Result := AVICapSM(hwnd, WM_CAP_PAL_MANUALCREATE, WPARAM(fGrab), iColors) <> 0;
4134
{== Externals ================================================================}
4137
VFWDLL = 'MSVFW32.DLL';
4138
AVIFILDLL = 'AVIFIL32.DLL';
4139
AVICAPDLL = 'AVICAP32.DLL';
4141
{-- Returns version of VFW ---------------------------------------------------}
4143
function VideoForWindowsVersion: DWord; pascal; external VFWDLL;
4145
{-- Call these to start stop using VfW from your app -------------------------}
4147
{ TODO: Where are these functions? }
4149
function InitVFW: LONG; stdcall;
4150
function TermVFW: LONG; stdcall; }
4152
{-- ICM function declarations ------------------------------------------------}
4154
function ICInfo(fccType, fccHandler: DWORD; lpicinfo: PICINFO) : BOOL ; stdcall ; external VFWDLL;
4155
function ICInstall(fccType, fccHandler: DWORD; lParam: LPARAM; szDesc: LPSTR; wFlags: UINT) : BOOL ; stdcall ; external VFWDLL;
4156
function ICRemove(fccType, fccHandler: DWORD; wFlags: UINT) : BOOL ; stdcall ; external VFWDLL;
4157
function ICGetInfo(hic: HIC; picinfo: PICINFO; cb: DWORD) : DWORD ; stdcall ; external VFWDLL;
4159
function ICOpen(fccType, fccHandler: DWORD; wMode: UINT) : HIC ; stdcall ; external VFWDLL;
4160
function ICOpenFunction(fccType, fccHandler: DWORD; wMode: UINT; lpfnHandler: TFarProc) : HIC ; stdcall ; external VFWDLL;
4161
function ICClose(hic: HIC) : DWORD ; stdcall ; external VFWDLL;
4163
function ICSendMessage(hic: HIC; msg: UINT; dw1, dw2: DWORD) : DWORD ; stdcall ; external VFWDLL;
4165
{== Compression functions ====================================================}
4167
{-- ICCompress() - compress a single frame -----------------------------------}
4171
dwFlags : DWORD; // flags
4172
lpbiOutput : PBITMAPINFOHEADER; // output format
4173
lpData : PVOID; // output data
4174
lpbiInput : PBITMAPINFOHEADER; // format of frame to compress
4175
lpBits : PVOID; // frame data to compress
4176
lpckid : PDWORD; // ckid for data in AVI file
4177
lpdwFlags : PDWORD; // flags in the AVI index.
4178
lFrameNum : DWORD; // frame number of seq.
4179
dwFrameSize : DWORD; // reqested size in bytes. (if non zero)
4180
dwQuality : DWORD; // quality within one frame
4181
lpbiPrev : PBITMAPINFOHEADER; // format of previous frame
4182
lpPrev : PVOID // previous frame
4183
) : DWORD; cdecl; external VFWDLL;
4185
{== Decompression functions ==================================================}
4187
{-- ICDecompress() - decompress a single frame -------------------------------}
4189
function ICDecompress(
4191
dwFlags : DWORD; // flags (from AVI index...)
4192
lpbiFormat : PBITMAPINFOHEADER; // BITMAPINFO of compressed data
4193
// biSizeImage has the chunk size
4194
lpData : PVOID; // data
4195
lpbi : PBITMAPINFOHEADER; // DIB to decompress to
4197
): DWORD; cdecl; external VFWDLL;
4199
{== Drawing functions ========================================================}
4201
{-- ICDrawBegin() - start decompressing data with fmt directly to screen -----}
4203
// return zero if the decompressor supports drawing.
4205
function ICDrawBegin(
4207
dwFlags : DWORD; // flags
4208
hpal : HPALETTE; // palette to draw with
4209
hwnd : HWND; // window to draw to
4210
hdc : HDC; // HDC to draw to
4211
xDst : int; // destination rectangle
4215
lpbi : PBITMAPINFOHEADER; // format of frame to draw
4216
xSrc : int; // source rectangle
4220
dwRate : DWORD; // frames/second = (dwRate/dwScale)
4222
): DWORD; cdecl; external VFWDLL;
4224
{-- ICDraw() - decompress data directly to the screen ------------------------}
4228
dwFlags : DWORD; // flags
4229
lpFormat : PVOID; // format of frame to decompress
4230
lpData : PVOID; // frame data to decompress
4231
cbData : DWORD; // size of data
4232
lTime : DWORD // time to draw this frame
4233
): DWORD; cdecl; external VFWDLL;
4235
{== Helper routines for DrawDib and MCIAVI... ================================}
4237
function ICLocate(fccType, fccHandler: DWORD; lpbiIn, lpbiOut: PBITMAPINFOHEADER; wFlags: WORD): HIC; stdcall; external VFWDLL;
4238
function ICGetDisplayFormat(hic: HIC; lpbiIn, lpbiOut: PBITMAPINFOHEADER; BitDepth: int; dx, dy: int): HIC; stdcall; external VFWDLL;
4240
{== Higher level functions ===================================================}
4242
function ICImageCompress(
4243
hic : HIC; // compressor to use
4244
uiFlags : UINT; // flags (none yet)
4245
lpbiIn : PBITMAPINFO; // format to compress from
4246
lpBits : PVOID; // data to compress
4247
lpbiOut : PBITMAPINFO; // compress to this (NULL ==> default)
4248
lQuality : LONG; // quality to use
4249
plSize : PDWORD // compress to this size (0=whatever)
4250
): THANDLE; stdcall; external VFWDLL;
4252
function ICImageDecompress(
4253
hic : HIC; // compressor to use
4254
uiFlags : UINT; // flags (none yet)
4255
lpbiIn : PBITMAPINFO; // format to decompress from
4256
lpBits : PVOID; // data to decompress
4257
lpbiOut : PBITMAPINFO // decompress to this (NULL ==> default)
4258
): THANDLE; stdcall; external VFWDLL;
4260
{-- ICCompressorChoose() - allows user to choose compressor, quality etc... --}
4262
function ICCompressorChoose(
4263
hwnd : HWND; // parent window for dialog
4264
uiFlags : UINT; // flags
4265
pvIn : PVOID; // input format (optional)
4266
lpData : PVOID; // input data (optional)
4267
pc : PCOMPVARS; // data about the compressor/dlg
4268
lpszTitle : LPSTR // dialog title (optional)
4269
): BOOL; stdcall; external VFWDLL;
4271
function ICSeqCompressFrameStart(pc: PCOMPVARS; lpbiIn: PBITMAPINFO): BOOL; stdcall; external VFWDLL;
4272
procedure ICSeqCompressFrameEnd(pc: PCOMPVARS); stdcall; external VFWDLL;
4274
function ICSeqCompressFrame(
4275
pc : PCOMPVARS; // set by ICCompressorChoose
4276
uiFlags : UINT; // flags
4277
lpBits : PVOID; // input DIB bits
4278
pfKey : PBOOL; // did it end up being a key frame?
4279
plSize : PDWORD // size to compress to/of returned image
4280
): PVOID; stdcall; external VFWDLL;
4282
procedure ICCompressorFree(pc: PCOMPVARS); stdcall; external VFWDLL;
4284
{== DrawDib functions ========================================================}
4286
{-- DrawDibOpen() ------------------------------------------------------------}
4288
function DrawDibOpen: HDRAWDIB; stdcall; external VFWDLL;
4290
{-- DrawDibClose() -----------------------------------------------------------}
4292
function DrawDibClose(hdd: HDRAWDIB): BOOL; stdcall; external VFWDLL;
4294
{-- DrawDibGetBuffer() -------------------------------------------------------}
4296
function DrawDibGetBuffer(hdd: HDRAWDIB; lpbi: PBITMAPINFOHEADER; dwSize: DWORD; dwFlags: DWORD): PVOID; stdcall; external VFWDLL;
4298
{-- DrawDibGetPalette() - get the palette used for drawing DIBs --------------}
4300
function DrawDibGetPalette(hdd: HDRAWDIB): HPALETTE; stdcall; external VFWDLL;
4302
{-- DrawDibSetPalette() - set the palette used for drawing DIBs --------------}
4304
function DrawDibSetPalette(hdd: HDRAWDIB; hpal: HPALETTE): BOOL; stdcall; external VFWDLL;
4306
{-- DrawDibChangePalette() ---------------------------------------------------}
4308
function DrawDibChangePalette(hdd: HDRAWDIB; iStart, iLen: int; lppe: PPALETTEENTRY): BOOL; stdcall; external VFWDLL;
4310
{-- DrawDibRealize() - realize the palette in a HDD --------------------------}
4312
function DrawDibRealize(hdd: HDRAWDIB; hdc: HDC; fBackground: BOOL): UINT; stdcall; external VFWDLL;
4314
{-- DrawDibStart() - start of streaming playback -----------------------------}
4316
function DrawDibStart(hdd: HDRAWDIB; rate: DWORD): BOOL; stdcall; external VFWDLL;
4318
{-- DrawDibStop() - start of streaming playback ------------------------------}
4320
function DrawDibStop(hdd: HDRAWDIB): BOOL; stdcall; external VFWDLL;
4322
{-- DrawDibBegin() - prepare to draw -----------------------------------------}
4324
function DrawDibBegin(
4329
lpbi : PBITMAPINFOHEADER;
4333
): BOOL; stdcall; external VFWDLL;
4335
{-- DrawDibDraw() - actually draw a DIB to the screen ------------------------}
4337
function DrawDibDraw(
4344
lpbi : PBITMAPINFOHEADER;
4351
): BOOL; stdcall; external VFWDLL;
4353
{-- DrawDibEnd() -------------------------------------------------------------}
4355
function DrawDibEnd(hdd: HDRAWDIB): BOOL; stdcall; external VFWDLL;
4357
{-- DrawDibTime() - for debugging purposes only ------------------------------}
4359
function DrawDibTime(hdd: HDRAWDIB; lpddtime: PDRAWDIBTIME): BOOL; stdcall; external VFWDLL;
4361
{-- Display profiling --------------------------------------------------------}
4363
function DrawDibProfileDisplay(lpbi: PBITMAPINFOHEADER): DWORD; stdcall; external VFWDLL;
4365
{-- Functions ----------------------------------------------------------------}
4367
procedure AVIFileInit; stdcall; external AVIFILDLL; // Call this first!
4368
procedure AVIFileExit; stdcall; external AVIFILDLL;
4370
function AVIFileAddRef(pfile: IAVIFILE): ULONG; stdcall; external AVIFILDLL;
4371
function AVIFileRelease(pfile: IAVIFILE): ULONG; stdcall; external AVIFILDLL;
4373
function AVIFileOpenA(var ppfile: IAVIFILE; szFile: LPCSTR; uMode: UINT; lpHandler: PCLSID): HResult; stdcall; external AVIFILDLL;
4374
function AVIFileOpenW(var ppfile: IAVIFILE; szFile: LPCWSTR; uMode: UINT; lpHandler: PCLSID): HResult; stdcall; external AVIFILDLL;
4377
function AVIFileOpen(var ppfile: IAVIFILE; szFile: LPCWSTR; uMode: UINT; lpHandler: PCLSID): HResult; stdcall; external AVIFILDLL name 'AVIFileOpenW';
4379
function AVIFileOpen(var ppfile: IAVIFILE; szFile: LPCSTR; uMode: UINT; lpHandler: PCLSID): HResult; stdcall; external AVIFILDLL name 'AVIFileOpenA';
4382
function AVIFileInfoW(pfile: IAVIFILE; var pfi: TAVIFILEINFOW; lSize: LONG): HResult; stdcall; external AVIFILDLL;
4383
function AVIFileInfoA(pfile: IAVIFILE; var pfi: TAVIFILEINFOA; lSize: LONG): HResult; stdcall; external AVIFILDLL;
4386
function AVIFileInfo(pfile: IAVIFILE; var pfi: TAVIFILEINFO; lSize: LONG): HResult; stdcall; external AVIFILDLL name 'AVIFileInfoW';
4388
function AVIFileInfo(pfile: IAVIFILE; var pfi: TAVIFILEINFO; lSize: LONG): HResult; stdcall; external AVIFILDLL name 'AVIFileInfoA';
4391
function AVIFileGetStream(pfile: IAVIFILE; var ppavi: IAVISTREAM; fccType: DWORD; lParam: LONG): HResult; stdcall; external AVIFILDLL;
4393
function AVIFileCreateStreamW(pfile: IAVIFILE; var ppavi: IAVISTREAM; var psi: TAVISTREAMINFOW): HResult; stdcall; external AVIFILDLL;
4394
function AVIFileCreateStreamA(pfile: IAVIFILE; var ppavi: IAVISTREAM; var psi: TAVISTREAMINFOA): HResult; stdcall; external AVIFILDLL;
4397
function AVIFileCreateStream(pfile: IAVIFILE; var ppavi: IAVISTREAM; var psi: TAVISTREAMINFO): HResult; stdcall; external AVIFILDLL name 'AVIFileCreateStreamW';
4399
function AVIFileCreateStream(pfile: IAVIFILE; var ppavi: IAVISTREAM; var psi: TAVISTREAMINFO): HResult; stdcall; external AVIFILDLL name 'AVIFileCreateStreamA';
4402
function AVIFileWriteData(pfile: IAVIFILE; ckid: DWORD; lpData: PVOID; cbData: LONG): HResult; stdcall; external AVIFILDLL;
4403
function AVIFileReadData(pfile: IAVIFILE; ckid: DWORD; lpData: PVOID; var lpcbData: LONG): HResult; stdcall; external AVIFILDLL;
4404
function AVIFileEndRecord(pfile: IAVIFILE): HResult; stdcall; external AVIFILDLL;
4406
function AVIStreamAddRef(pavi: IAVISTREAM): ULONG; stdcall; external AVIFILDLL;
4407
function AVIStreamRelease(pavi: IAVISTREAM): ULONG; stdcall; external AVIFILDLL;
4409
function AVIStreamInfoW (pavi: IAVISTREAM; var psi: TAVISTREAMINFOW; lSize: LONG): HResult; stdcall; external AVIFILDLL;
4410
function AVIStreamInfoA (pavi: IAVISTREAM; var psi: TAVISTREAMINFOA; lSize: LONG): HResult; stdcall; external AVIFILDLL;
4413
function AVIStreamInfo(pavi: IAVISTREAM; var psi: TAVISTREAMINFO; lSize: LONG): HResult; stdcall; external AVIFILDLL name 'AVIStreamInfoW';
4415
function AVIStreamInfo(pavi: IAVISTREAM; var psi: TAVISTREAMINFO; lSize: LONG): HResult; stdcall; external AVIFILDLL name 'AVIStreamInfoA';
4419
function AVIStreamFindSample(pavi: IAVISTREAM; lPos: LONG; lFlags: LONG): LONG; stdcall; external AVIFILDLL;
4420
function AVIStreamReadFormat(pavi: IAVISTREAM; lPos: LONG; lpFormat: PVOID; lpcbFormat: PLONG): HResult; stdcall; external AVIFILDLL;
4421
function AVIStreamSetFormat(pavi: IAVISTREAM; lPos: LONG; lpFormat: PVOID; cbFormat: LONG): HResult; stdcall; external AVIFILDLL;
4422
function AVIStreamReadData(pavi: IAVISTREAM; fcc: DWORD; lp: PVOID; lpcb: PLONG): HResult; stdcall; external AVIFILDLL;
4423
function AVIStreamWriteData(pavi: IAVISTREAM; fcc: DWORD; lp: PVOID; cb: LONG): HResult; stdcall; external AVIFILDLL;
4425
function AVIStreamRead(
4433
): HResult; stdcall; external AVIFILDLL;
4435
function AVIStreamWrite(
4442
plSampWritten : PLONG;
4443
plBytesWritten : PLONG
4444
): HResult; stdcall; external AVIFILDLL;
4446
// Right now, these just use AVIStreamInfo() to get information, then
4447
// return some of it. Can they be more efficient?
4449
function AVIStreamStart(pavi: IAVISTREAM): LONG; stdcall; external AVIFILDLL;
4450
function AVIStreamLength(pavi: IAVISTREAM): LONG; stdcall; external AVIFILDLL;
4451
function AVIStreamTimeToSample(pavi: IAVISTREAM; lTime: LONG): LONG; stdcall; external AVIFILDLL;
4452
function AVIStreamSampleToTime(pavi: IAVISTREAM; lSample: LONG): LONG; stdcall; external AVIFILDLL;
4454
function AVIStreamBeginStreaming(pavi: IAVISTREAM; lStart, lEnd: LONG; lRate: LONG): HResult; stdcall; external AVIFILDLL;
4455
function AVIStreamEndStreaming(pavi: IAVISTREAM): HResult; stdcall; external AVIFILDLL;
4457
{-- Helper functions for using IGetFrame -------------------------------------}
4459
function AVIStreamGetFrameOpen_(pavi: IAVISTREAM; lpbiWanted: PBitmapInfoHeader): pointer; stdcall; external AVIFILDLL name 'AVIStreamGetFrameOpen';
4460
function AVIStreamGetFrame(pg: IGETFRAME; lPos: LONG): PBitmapInfoHeader; stdcall; external AVIFILDLL;
4461
function AVIStreamGetFrameClose(pg: IGETFRAME): HResult; stdcall; external AVIFILDLL;
4463
function AVIStreamGetFrameOpen(pavi: IAVIStream; lpbiWanted: PBitmapInfoHeader): IGetFrame; stdcall;
4465
pointer(Result) := AVIStreamGetFrameOpen_(pavi, lpbiWanted);
4468
// !!! We need some way to place an advise on a stream....
4469
// STDAPI AVIStreamHasChanged (PAVISTREAM pavi);
4471
{-- Shortcut function --------------------------------------------------------}
4473
function AVIStreamOpenFromFileA(var ppavi: IAVISTREAM; szFile: LPCSTR; fccType: DWORD;
4474
lParam: LONG; mode: UINT; pclsidHandler: PCLSID): HResult; stdcall; external AVIFILDLL;
4475
function AVIStreamOpenFromFileW(var ppavi: IAVISTREAM; szFile: LPCWSTR; fccType: DWORD;
4476
lParam: LONG; mode: UINT; pclsidHandler: PCLSID): HResult; stdcall; external AVIFILDLL;
4479
function AVIStreamOpenFromFile(var ppavi: IAVISTREAM; szFile: LPCWSTR; fccType: DWORD;
4480
lParam: LONG; mode: UINT; pclsidHandler: PCLSID): HResult; stdcall; external AVIFILDLL name 'AVIStreamOpenFromFileW';
4482
function AVIStreamOpenFromFile(var ppavi: IAVISTREAM; szFile: LPCSTR; fccType: DWORD;
4483
lParam: LONG; mode: UINT; pclsidHandler: PCLSID): HResult; stdcall; external AVIFILDLL name 'AVIStreamOpenFromFileA';
4486
{-- Use to create disembodied streams ----------------------------------------}
4488
function AVIStreamCreate(var ppavi: IAVISTREAM; lParam1, lParam2: LONG;
4489
pclsidHandler: PCLSID): HResult; stdcall; external AVIFILDLL;
4491
// PHANDLER AVIAPI AVIGetHandler (PAVISTREAM pavi, PAVISTREAMHANDLER psh);
4492
// PAVISTREAM AVIAPI AVIGetStream (PHANDLER p);
4494
{-- Stuff to support backward compat. ----------------------------------------}
4496
function AVIStreamFindKeyFrame(var pavi: IAVISTREAM; lPos: LONG; lFlags: LONG): DWORD; stdcall; external AVIFILDLL name 'AVIStreamFindSample';
4498
// Non-portable: this is alias for method name
4499
// FindKeyFrame FindSample
4501
function AVIStreamClose(pavi: IAVISTREAM): ULONG; stdcall; external AVIFILDLL name 'AVIStreamRelease';
4502
function AVIFileClose(pfile: IAVIFILE): ULONG; stdcall; external AVIFILDLL name 'AVIFileRelease';
4503
procedure AVIStreamInit; stdcall; external AVIFILDLL name 'AVIFileInit';
4504
procedure AVIStreamExit; stdcall; external AVIFILDLL name 'AVIFileExit';
4506
{== AVISave routines and structures ==========================================}
4508
function AVIMakeCompressedStream(
4509
var ppsCompressed : IAVISTREAM;
4510
ppsSource : IAVISTREAM;
4511
lpOptions : PAVICOMPRESSOPTIONS;
4512
pclsidHandler : PCLSID
4513
): HResult; stdcall; external AVIFILDLL;
4515
// Non-portable: uses variable number of params
4516
// EXTERN_C HRESULT CDECL AVISaveA (LPCSTR szFile,
4517
// CLSID FAR *pclsidHandler,
4518
// AVISAVECALLBACK lpfnCallback,
4521
// LPAVICOMPRESSOPTIONS lpOptions,
4526
pclsidHandler : PCLSID;
4527
lpfnCallback : TAVISAVECALLBACK;
4529
var ppavi : IAVISTREAM;
4530
var plpOptions : PAVICOMPRESSOPTIONS
4531
): HResult; stdcall; external AVIFILDLL;
4533
// Non-portable: uses variable number of params
4534
// EXTERN_C HRESULT CDECL AVISaveW (LPCWSTR szFile,
4535
// CLSID FAR *pclsidHandler,
4536
// AVISAVECALLBACK lpfnCallback,
4539
// LPAVICOMPRESSOPTIONS lpOptions,
4544
pclsidHandler : PCLSID;
4545
lpfnCallback : TAVISAVECALLBACK;
4547
var ppavi : IAVISTREAM;
4548
var plpOptions : PAVICOMPRESSOPTIONS
4549
): HResult; stdcall; external AVIFILDLL;
4551
// #define AVISave AVISaveA
4555
pclsidHandler : PCLSID;
4556
lpfnCallback : TAVISAVECALLBACK;
4558
var ppavi : IAVISTREAM;
4559
var plpOptions : PAVICOMPRESSOPTIONS
4560
): HResult; stdcall; external AVIFILDLL name 'AVISaveVA';
4562
function AVISaveOptions(
4566
var ppavi : IAVISTREAM;
4567
var plpOptions : PAVICOMPRESSOPTIONS
4568
): BOOL; stdcall; external AVIFILDLL;
4570
function AVISaveOptionsFree(nStreams: int; var plpOptions: PAVICOMPRESSOPTIONS): HResult; stdcall; external AVIFILDLL;
4572
{-----------------------------------------------------------------------------}
4574
function AVIBuildFilterW(lpszFilter: LPWSTR; cbFilter: LONG; fSaving: BOOL): HResult; stdcall; external AVIFILDLL;
4575
function AVIBuildFilterA(lpszFilter: LPSTR; cbFilter: LONG; fSaving: BOOL): HResult; stdcall; external AVIFILDLL;
4577
function AVIBuildFilter(lpszFilter: LPSTR; cbFilter: LONG; fSaving: BOOL): HResult; stdcall; external AVIFILDLL name 'AVIBuildFilterA';
4579
function AVIMakeFileFromStreams(var ppfile: IAVIFILE; nStreams: int; var papStreams: IAVISTREAM): HResult; stdcall; external AVIFILDLL;
4581
function AVIMakeStreamFromClipboard(cfFormat: UINT; hGlobal: THANDLE; var ppstream: IAVISTREAM): HResult; stdcall; external AVIFILDLL;
4583
{-- Clipboard routines -------------------------------------------------------}
4585
function AVIPutFileOnClipboard(pf: IAVIFILE): HResult; stdcall; external AVIFILDLL;
4586
function AVIGetFromClipboard(var lppf: IAVIFILE): HResult; stdcall; external AVIFILDLL;
4587
function AVIClearClipboard: HResult; stdcall; external AVIFILDLL;
4589
{-- Editing routines ---------------------------------------------------------}
4591
function CreateEditableStream(var ppsEditable: IAVISTREAM; psSource: IAVISTREAM): HResult; stdcall; external AVIFILDLL;
4593
function EditStreamCut(pavi: IAVISTREAM; var plStart, plLength: LONG; var ppResult: IAVISTREAM): HResult; stdcall; external AVIFILDLL;
4594
function EditStreamCopy(pavi: IAVISTREAM; var plStart, plLength: LONG; var ppResult: IAVISTREAM): HResult; stdcall; external AVIFILDLL;
4595
function EditStreamPaste(pavi: IAVISTREAM; var plPos, plLength: LONG; pstream: IAVISTREAM; lStart, lEnd: LONG): HResult; stdcall; external AVIFILDLL;
4596
function EditStreamClone(pavi: IAVISTREAM; var ppResult: IAVISTREAM): HResult; stdcall; external AVIFILDLL;
4598
function EditStreamSetNameA(pavi: IAVISTREAM; lpszName: LPCSTR): HResult; stdcall; external AVIFILDLL;
4599
function EditStreamSetNameW(pavi: IAVISTREAM; lpszName: LPCWSTR): HResult; stdcall; external AVIFILDLL;
4600
function EditStreamSetInfoW(pavi: IAVISTREAM; lpInfo: PAVISTREAMINFOW; cbInfo: LONG): HResult; stdcall; external AVIFILDLL;
4601
function EditStreamSetInfoA(pavi: IAVISTREAM; lpInfo: PAVISTREAMINFOA; cbInfo: LONG): HResult; stdcall; external AVIFILDLL;
4603
function EditStreamSetInfo(pavi: IAVISTREAM; lpInfo: PAVISTREAMINFOA; cbInfo: LONG): HResult; stdcall; external AVIFILDLL name 'EditStreamSetInfoA';
4604
function EditStreamSetName(pavi: IAVISTREAM; lpszName: LPCSTR): HResult; stdcall; external AVIFILDLL name 'EditStreamSetNameA';
4606
{-- MCIWnd -------------------------------------------------------------------}
4608
function MCIWndCreateA(hwndParent: HWND; hInstance: HINST; dwStyle: DWORd; szFile: LPCSTR): HWND; cdecl; external VFWDLL;
4609
function MCIWndCreateW(hwndParent: HWND; hInstance: HINST; dwStyle: DWORd; szFile: LPCWSTR): HWND; cdecl; external VFWDLL;
4611
function MCIWndCreate(hwndParent: HWND; hInstance: HINST; dwStyle: DWORd; szFile: LPCSTR): HWND; cdecl; external VFWDLL name 'MCIWndCreateA';
4613
function MCIWndRegisterClass: BOOL; cdecl; external VFWDLL;
4615
{== AVICAP - Window class for AVI capture ====================================}
4617
{-- The only exported functions from AVICAP.DLL ------------------------------}
4619
function capCreateCaptureWindowA(
4620
lpszWindowName : LPCSTR;
4623
nWidth, nHeight : int;
4626
): HWND; stdcall; external AVICAPDLL;
4628
function capGetDriverDescriptionA(
4629
wDriverIndex : UINT;
4634
): BOOL; stdcall; external AVICAPDLL;
4636
function capCreateCaptureWindowW(
4637
lpszWindowName : LPCWSTR;
4640
nWidth, nHeight : int;
4643
): HWND; stdcall; external AVICAPDLL;
4645
function capGetDriverDescriptionW(
4646
wDriverIndex : UINT;
4651
): BOOL; stdcall; external AVICAPDLL;
4653
function capCreateCaptureWindow(
4654
lpszWindowName : LPCSTR;
4657
nWidth, nHeight : int;
4660
): HWND; stdcall; external AVICAPDLL name 'capCreateCaptureWindowA';
4662
function capGetDriverDescription(
4663
wDriverIndex : UINT;
4668
): BOOL; stdcall; external AVICAPDLL name 'capGetDriverDescriptionA';
4670
{== FilePreview dialog =======================================================}
4672
function GetOpenFileNamePreviewA(lpofn: POPENFILENAMEA): BOOL; stdcall; external VFWDLL;
4673
function GetSaveFileNamePreviewA(lpofn: POPENFILENAMEA): BOOL; stdcall; external VFWDLL;
4675
function GetOpenFileNamePreviewW(lpofn: POPENFILENAMEW): BOOL; stdcall; external VFWDLL;
4676
function GetSaveFileNamePreviewW(lpofn: POPENFILENAMEW): BOOL; stdcall; external VFWDLL;
4678
function GetOpenFileNamePreview(lpofn: POPENFILENAMEA): BOOL; stdcall; external VFWDLL name 'GetOpenFileNamePreviewA';
4679
function GetSaveFileNamePreview(lpofn: POPENFILENAMEA): BOOL; stdcall; external VFWDLL name 'GetSaveFileNamePreviewA';