-
Notifications
You must be signed in to change notification settings - Fork 1
/
vfw.pas
2248 lines (1738 loc) · 89.1 KB
/
vfw.pas
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
unit vfw;
interface
uses
Windows, MMSystem, Messages;
const
// ------------------------------------------------------------------
// Window Messages WM_CAP... which can be sent to an AVICAP window
// ------------------------------------------------------------------
// Defines start of the message range
WM_CAP_START = WM_USER;
WM_CAP_GET_CAPSTREAMPTR = (WM_CAP_START+ 1);
WM_CAP_SET_CALLBACK_ERROR = (WM_CAP_START+ 2);
WM_CAP_SET_CALLBACK_STATUS = (WM_CAP_START+ 3);
WM_CAP_SET_CALLBACK_YIELD = (WM_CAP_START+ 4);
WM_CAP_SET_CALLBACK_FRAME = (WM_CAP_START+ 5);
WM_CAP_SET_CALLBACK_VIDEOSTREAM = (WM_CAP_START+ 6);
WM_CAP_SET_CALLBACK_WAVESTREAM = (WM_CAP_START+ 7);
WM_CAP_GET_USER_DATA = (WM_CAP_START+ 8);
WM_CAP_SET_USER_DATA = (WM_CAP_START+ 9);
WM_CAP_DRIVER_CONNECT = (WM_CAP_START+ 10);
WM_CAP_DRIVER_DISCONNECT = (WM_CAP_START+ 11);
WM_CAP_DRIVER_GET_NAME = (WM_CAP_START+ 12);
WM_CAP_DRIVER_GET_VERSION = (WM_CAP_START+ 13);
WM_CAP_DRIVER_GET_CAPS = (WM_CAP_START+ 14);
WM_CAP_FILE_SET_CAPTURE_FILE = (WM_CAP_START+ 20);
WM_CAP_FILE_GET_CAPTURE_FILE = (WM_CAP_START+ 21);
WM_CAP_FILE_ALLOCATE = (WM_CAP_START+ 22);
WM_CAP_FILE_SAVEAS = (WM_CAP_START+ 23);
WM_CAP_FILE_SET_INFOCHUNK = (WM_CAP_START+ 24);
WM_CAP_FILE_SAVEDIB = (WM_CAP_START+ 25);
WM_CAP_EDIT_COPY = (WM_CAP_START+ 30);
WM_CAP_SET_AUDIOFORMAT = (WM_CAP_START+ 35);
WM_CAP_GET_AUDIOFORMAT = (WM_CAP_START+ 36);
WM_CAP_DLG_VIDEOFORMAT = (WM_CAP_START+ 41);
WM_CAP_DLG_VIDEOSOURCE = (WM_CAP_START+ 42);
WM_CAP_DLG_VIDEODISPLAY = (WM_CAP_START+ 43);
WM_CAP_GET_VIDEOFORMAT = (WM_CAP_START+ 44);
WM_CAP_SET_VIDEOFORMAT = (WM_CAP_START+ 45);
WM_CAP_DLG_VIDEOCOMPRESSION = (WM_CAP_START+ 46);
WM_CAP_SET_PREVIEW = (WM_CAP_START+ 50);
WM_CAP_SET_OVERLAY = (WM_CAP_START+ 51);
WM_CAP_SET_PREVIEWRATE = (WM_CAP_START+ 52);
WM_CAP_SET_SCALE = (WM_CAP_START+ 53);
WM_CAP_GET_STATUS = (WM_CAP_START+ 54);
WM_CAP_SET_SCROLL = (WM_CAP_START+ 55);
WM_CAP_GRAB_FRAME = (WM_CAP_START+ 60);
WM_CAP_GRAB_FRAME_NOSTOP = (WM_CAP_START+ 61);
WM_CAP_SEQUENCE = (WM_CAP_START+ 62);
WM_CAP_SEQUENCE_NOFILE = (WM_CAP_START+ 63);
WM_CAP_SET_SEQUENCE_SETUP = (WM_CAP_START+ 64);
WM_CAP_GET_SEQUENCE_SETUP = (WM_CAP_START+ 65);
WM_CAP_SET_MCI_DEVICE = (WM_CAP_START+ 66);
WM_CAP_GET_MCI_DEVICE = (WM_CAP_START+ 67);
WM_CAP_STOP = (WM_CAP_START+ 68);
WM_CAP_ABORT = (WM_CAP_START+ 69);
WM_CAP_SINGLE_FRAME_OPEN = (WM_CAP_START+ 70);
WM_CAP_SINGLE_FRAME_CLOSE = (WM_CAP_START+ 71);
WM_CAP_SINGLE_FRAME = (WM_CAP_START+ 72);
WM_CAP_PAL_OPEN = (WM_CAP_START+ 80);
WM_CAP_PAL_SAVE = (WM_CAP_START+ 81);
WM_CAP_PAL_PASTE = (WM_CAP_START+ 82);
WM_CAP_PAL_AUTOCREATE = (WM_CAP_START+ 83);
WM_CAP_PAL_MANUALCREATE = (WM_CAP_START+ 84);
// Following added post VFW 1.1
WM_CAP_SET_CALLBACK_CAPCONTROL = (WM_CAP_START+ 85);
// Defines end of the message range
WM_CAP_END = WM_CAP_SET_CALLBACK_CAPCONTROL;
// dwFlags field of TVIDEOHDR
VHDR_DONE = $00000001; // Done bit */
VHDR_PREPARED= $00000002; // Set if this header has been prepared */
VHDR_INQUEUE = $00000004; // Reserved for driver */
VHDR_KEYFRAME= $00000008; // Key Frame */
// ------------------------------------------------------------------
// Structures
// ------------------------------------------------------------------
type
PCapDriverCaps = ^TCapDriverCaps;
TCapDriverCaps = record
wDeviceIndex :WORD; // Driver index in system.ini
fHasOverlay :BOOL; // Can device overlay?
fHasDlgVideoSource :BOOL; // Has Video source dlg?
fHasDlgVideoFormat :BOOL; // Has Format dlg?
fHasDlgVideoDisplay :BOOL; // Has External out dlg?
fCaptureInitialized :BOOL; // Driver ready to capture?
fDriverSuppliesPalettes :BOOL; // Can driver make palettes?
hVideoIn :THANDLE; // Driver In channel
hVideoOut :THANDLE; // Driver Out channel
hVideoExtIn :THANDLE; // Driver Ext In channel
hVideoExtOut :THANDLE; // Driver Ext Out channel
end;
pCapStatus = ^TCapStatus;
TCapStatus = record
uiImageWidth :UINT; // Width of the image
uiImageHeight :UINT; // Height of the image
fLiveWindow :BOOL; // Now Previewing video?
fOverlayWindow :BOOL; // Now Overlaying video?
fScale :BOOL; // Scale image to client?
ptScroll :TPOINT; // Scroll position
fUsingDefaultPalette :BOOL; // Using default driver palette?
fAudioHardware :BOOL; // Audio hardware present?
fCapFileExists :BOOL; // Does capture file exist?
dwCurrentVideoFrame :DWORD; // # of video frames cap'td
dwCurrentVideoFramesDropped :DWORD; // # of video frames dropped
dwCurrentWaveSamples :DWORD; // # of wave samples cap'td
dwCurrentTimeElapsedMS :DWORD; // Elapsed capture duration
hPalCurrent :HPALETTE; // Current palette in use
fCapturingNow :BOOL; // Capture in progress?
dwReturn :DWORD; // Error value after any operation
wNumVideoAllocated :UINT; // Actual number of video buffers
wNumAudioAllocated :UINT; // Actual number of audio buffers
end;
pCaptureParms = ^TCaptureParms;
TCaptureParms = record // Default values in parenthesis
dwRequestMicroSecPerFrame :DWORD; // Requested capture rate
fMakeUserHitOKToCapture :BOOL; // Show "Hit OK to cap" dlg?
wPercentDropForError :UINT; // Give error msg if > (10%)
fYield :BOOL; // Capture via background task?
dwIndexSize :DWORD; // Max index size in frames (32K)
wChunkGranularity :UINT; // Junk chunk granularity (2K)
fUsingDOSMemory :BOOL; // Use DOS buffers?
wNumVideoRequested :UINT; // # video buffers, If 0, autocalc
fCaptureAudio :BOOL; // Capture audio?
wNumAudioRequested :UINT; // # audio buffers, If 0, autocalc
vKeyAbort :UINT; // Virtual key causing abort
fAbortLeftMouse :BOOL; // Abort on left mouse?
fAbortRightMouse :BOOL; // Abort on right mouse?
fLimitEnabled :BOOL; // Use wTimeLimit?
wTimeLimit :UINT; // Seconds to capture
fMCIControl :BOOL; // Use MCI video source?
fStepMCIDevice :BOOL; // Step MCI device?
dwMCIStartTime :DWORD; // Time to start in MS
dwMCIStopTime :DWORD; // Time to stop in MS
fStepCaptureAt2x :BOOL; // Perform spatial averaging 2x
wStepCaptureAverageFrames :UINT; // Temporal average n Frames
dwAudioBufferSize :DWORD; // Size of audio bufs (0 = default)
fDisableWriteCache :BOOL; // Attempt to disable write cache
AVStreamMaster :UINT; // Which stream controls length?
end;
PCapInfoChunk = ^TCapInfoChunk;
TCapInfoChunk = record
fccInfoID :FOURCC; // Chunk ID, "ICOP" for copyright
lpData :Pointer; // pointer to data
cbData :LongInt; // size of lpData
end;
PVIDEOHDR = ^TVIDEOHDR;
TVIDEOHDR = record
lpData:pByte; // pointer to locked data buffer
dwBufferLength:DWORD; // Length of data buffer
dwBytesUsed:DWORD; // Bytes actually used
dwTimeCaptured:DWORD; // Milliseconds from start of stream
dwUser:DWORD; // for client's use
dwFlags:DWORD; // assorted flags (see defines)
dwReserved: array [0..4] of DWORD; // reserved for driver
end;
// ------------------------------------------------------------------
// Callback Definitions
// ------------------------------------------------------------------
type
TCAPSTATUSCALLBACK = function(hWnd:HWND; nID:Integer; lpsz:PChar):LongInt; stdcall;
TCAPYIELDCALLBACK = function(hWnd:HWND):LongInt; stdcall;
TCAPERRORCALLBACK = function(hWnd:HWND; nID:Integer; lpsz:Pchar):LongInt; stdcall;
TCAPVIDEOSTREAMCALLBACK = function(hWnd:HWND; lpVHdr:PVIDEOHDR):LongInt; stdcall;
TCAPWAVESTREAMCALLBACK = function(hWnd:HWND; lpWHdr:PWAVEHDR):LongInt; stdcall;
TCAPCONTROLCALLBACK = function(hWnd:HWND; nState:Integer):LongInt; stdcall;
// ------------------------------------------------------------------
// CapControlCallback states
// ------------------------------------------------------------------
Const
CONTROLCALLBACK_PREROLL = 1; // Waiting to start capture
CONTROLCALLBACK_CAPTURING = 2; // Now capturing
// ------------------------------------------------------------------
// Message crackers for above
// ------------------------------------------------------------------
function capSetCallbackOnError (hwnd : THandle; fpProc:TCAPERRORCALLBACK):LongInt;
function capSetCallbackOnStatus(hwnd : THandle; fpProc:TCAPSTATUSCALLBACK):LongInt;
function capSetCallbackOnYield (hwnd : THandle; fpProc:TCAPYIELDCALLBACK):LongInt;
function capSetCallbackOnFrame (hwnd : THandle; fpProc:TCAPVIDEOSTREAMCALLBACK):LongInt; // Hier ist der Type der Callbackfunktion nicht klar !
function capSetCallbackOnVideoStream(hwnd:THandle; fpProc:TCAPVIDEOSTREAMCALLBACK):LongInt;
function capSetCallbackOnWaveStream (hwnd:THandle; fpProc: TCAPWAVESTREAMCALLBACK):LongInt;
function capSetCallbackOnCapControl (hwnd:THandle; fpProc:TCAPCONTROLCALLBACK):LongInt;
function capSetUserData(hwnd:THandle; lUser:LongInt):LongInt;
function capGetUserData(hwnd:THandle):LongInt;
function capDriverConnect(hwnd:THandle; I: Word) : boolean;
function capDriverDisconnect(hwnd:THandle):boolean;
function capDriverGetName(hwnd:THandle; szName:PChar; wSize:Word):boolean;
function capDriverGetVersion(hwnd:THandle; szVer:PChar; wSize:Word):Boolean;
function capDriverGetCaps(hwnd:THandle; s:PCapDriverCaps; wSize:Word):boolean;
function capFileSetCaptureFile(hwnd:THandle; szName:PChar):boolean;
function capFileGetCaptureFile(hwnd:THandle; szName:PChar; wSize:Word):boolean;
function capFileAlloc(hwnd:THandle; dwSize:DWORD):boolean;
function capFileSaveAs(hwnd:THandle; szName:Pchar):boolean;
function capFileSetInfoChunk(hwnd:THandle; lpInfoChunk:pCapInfoChunk):boolean ;
function capFileSaveDIB(hwnd:THandle; szName:Pchar):boolean;
function capEditCopy(hwnd : THandle):boolean;
function capSetAudioFormat(hwnd:THandle; s:PWaveFormatEx; wSize:Word):Boolean;
function capGetAudioFormat(hwnd:THandle; s:PWaveFormatEx; wSize:Word):DWORD;
function capGetAudioFormatSize(hwnd:THandle):DWORD;
function capDlgVideoFormat(hwnd:THandle):boolean;
function capDlgVideoSource(hwnd:THandle):boolean;
function capDlgVideoDisplay(hwnd:THandle):boolean;
function capDlgVideoCompression(hwnd:THandle):boolean;
function capGetVideoFormat(hwnd:THandle; s:pBitmapInfo; wSize:Word):DWord;
function capGetVideoFormatSize(hwnd:THandle):DWORD;
function capSetVideoFormat(hwnd:THandle; s:pBitmapInfo; wSize:Word):boolean;
function capPreview(hwnd:THandle; f:boolean):boolean;
function capPreviewRate(hwnd:THandle; wMS:Word):boolean;
function capOverlay(hwnd:THandle; f:boolean):boolean;
function capPreviewScale(hwnd:THandle; f:boolean):boolean;
function capGetStatus(hwnd:THandle; s:pCapStatus; wSize:Word):boolean;
function capSetScrollPos(hwnd:THandle; lpP:pPoint):boolean;
function capGrabFrame(hwnd:THandle):boolean;
function capGrabFrameNoStop(hwnd:THandle):boolean;
function capCaptureSequence(hwnd:THandle):Boolean;
function capCaptureSequenceNoFile(hwnd:THandle):Boolean;
function capCaptureStop(hwnd:THandle):boolean;
function capCaptureAbort(hwnd:THandle):boolean;
function capCaptureSingleFrameOpen(hwnd:THandle):boolean;
function capCaptureSingleFrameClose(hwnd:THandle):boolean;
function capCaptureSingleFrame(hwnd:THandle):boolean;
function capCaptureGetSetup(hwnd:THandle; s:pCaptureParms; wSize:Word):boolean;
function capCaptureSetSetup(hwnd:THandle; s:pCaptureParms; wSize:Word):boolean;
function capSetMCIDeviceName(hwnd:THandle; szName:PChar):boolean;
function capGetMCIDeviceName(hwnd:THandle; szName:PChar; wSize:Word):boolean;
function capPaletteOpen(hwnd:THandle; szName:PChar):boolean;
function capPaletteSave(hwnd:THandle; szName:PChar):boolean;
function capPalettePaste(hwnd:THandle):Boolean;
function capPaletteAuto(hwnd:THandle; iFrames:Word; iColors:word):boolean;
function capPaletteManual(hwnd:THandle; fGrab:Word; iColors:word):boolean;
// ------------------------------------------------------------------
// The only exported functions from AVICAP.DLL
// ------------------------------------------------------------------
function capCreateCaptureWindow (
lpszWindowName : PChar;
dwStyle : DWord;
x, y : Integer;
nWidth, nHeight : Integer;
hwndParent : THandle;
nID : Integer ) : THandle; stdcall;
function capGetDriverDescription (
wDriverIndex : DWord;
lpszName : PChar;
cbName : Integer;
lpszVer : PChar;
cbVer : Integer ) : Boolean; stdcall;
// ------------------------------------------------------------------
// New Information chunk IDs
// ------------------------------------------------------------------
(*
infotypeDIGITIZATION_TIME = mmioStringToFOURCC(PChar('IDIT'), MMIO_TOUPPER);
infotypeSMPTE_TIME = mmioStringToFOURCC(PChar('ISMP'), MMIO_TOUPPER);
*)
// ------------------------------------------------------------------
// String IDs from status and error callbacks
// ------------------------------------------------------------------
Const
IDS_CAP_BEGIN = 300; (* "Capture Start" *)
IDS_CAP_END = 301; (* "Capture End" *)
IDS_CAP_INFO = 401; (* "%s" *)
IDS_CAP_OUTOFMEM = 402; (* "Out of memory" *)
IDS_CAP_FILEEXISTS = 403; (* "File '%s' exists -- overwrite it?" *)
IDS_CAP_ERRORPALOPEN = 404; (* "Error opening palette '%s'" *)
IDS_CAP_ERRORPALSAVE = 405; (* "Error saving palette '%s'" *)
IDS_CAP_ERRORDIBSAVE = 406; (* "Error saving frame '%s'" *)
IDS_CAP_DEFAVIEXT = 407; (* "avi" *)
IDS_CAP_DEFPALEXT = 408; (* "pal" *)
IDS_CAP_CANTOPEN = 409; (* "Cannot open '%s'" *)
IDS_CAP_SEQ_MSGSTART = 410; (* "Select OK to start capture\nof video sequence\nto %s." *)
IDS_CAP_SEQ_MSGSTOP = 411; (* "Hit ESCAPE or click to end capture" *)
IDS_CAP_VIDEDITERR = 412; (* "An error occurred while trying to run VidEdit." *)
IDS_CAP_READONLYFILE = 413; (* "The file '%s' is a read-only file." *)
IDS_CAP_WRITEERROR = 414; (* "Unable to write to file '%s'.\nDisk may be full." *)
IDS_CAP_NODISKSPACE = 415; (* "There is no space to create a capture file on the specified device." *)
IDS_CAP_SETFILESIZE = 416; (* "Set File Size" *)
IDS_CAP_SAVEASPERCENT = 417; (* "SaveAs: %2ld%% Hit Escape to abort." *)
IDS_CAP_DRIVER_ERROR = 418; (* Driver specific error message *)
IDS_CAP_WAVE_OPEN_ERROR = 419; (* "Error: Cannot open the wave input device.\nCheck sample size, frequency, and channels." *)
IDS_CAP_WAVE_ALLOC_ERROR = 420; (* "Error: Out of memory for wave buffers." *)
IDS_CAP_WAVE_PREPARE_ERROR = 421; (* "Error: Cannot prepare wave buffers." *)
IDS_CAP_WAVE_ADD_ERROR = 422; (* "Error: Cannot add wave buffers." *)
IDS_CAP_WAVE_SIZE_ERROR = 423; (* "Error: Bad wave size." *)
IDS_CAP_VIDEO_OPEN_ERROR = 424; (* "Error: Cannot open the video input device." *)
IDS_CAP_VIDEO_ALLOC_ERROR = 425; (* "Error: Out of memory for video buffers." *)
IDS_CAP_VIDEO_PREPARE_ERROR = 426; (* "Error: Cannot prepare video buffers." *)
IDS_CAP_VIDEO_ADD_ERROR = 427; (* "Error: Cannot add video buffers." *)
IDS_CAP_VIDEO_SIZE_ERROR = 428; (* "Error: Bad video size." *)
IDS_CAP_FILE_OPEN_ERROR = 429; (* "Error: Cannot open capture file." *)
IDS_CAP_FILE_WRITE_ERROR = 430; (* "Error: Cannot write to capture file. Disk may be full." *)
IDS_CAP_RECORDING_ERROR = 431; (* "Error: Cannot write to capture file. Data rate too high or disk full." *)
IDS_CAP_RECORDING_ERROR2 = 432; (* "Error while recording" *)
IDS_CAP_AVI_INIT_ERROR = 433; (* "Error: Unable to initialize for capture." *)
IDS_CAP_NO_FRAME_CAP_ERROR = 434; (* "Warning: No frames captured.\nConfirm that vertical sync interrupts\nare configured and enabled." *)
IDS_CAP_NO_PALETTE_WARN = 435; (* "Warning: Using default palette." *)
IDS_CAP_MCI_CONTROL_ERROR = 436; (* "Error: Unable to access MCI device." *)
IDS_CAP_MCI_CANT_STEP_ERROR = 437; (* "Error: Unable to step MCI device." *)
IDS_CAP_NO_AUDIO_CAP_ERROR = 438; (* "Error: No audio data captured.\nCheck audio card settings." *)
IDS_CAP_AVI_DRAWDIB_ERROR = 439; (* "Error: Unable to draw this data format." *)
IDS_CAP_COMPRESSOR_ERROR = 440; (* "Error: Unable to initialize compressor." *)
IDS_CAP_AUDIO_DROP_ERROR = 441; (* "Error: Audio data was lost during capture, reduce capture rate." *)
(* status string IDs *)
IDS_CAP_STAT_LIVE_MODE = 500; (* "Live window" *)
IDS_CAP_STAT_OVERLAY_MODE = 501; (* "Overlay window" *)
IDS_CAP_STAT_CAP_INIT = 502; (* "Setting up for capture - Please wait" *)
IDS_CAP_STAT_CAP_FINI = 503; (* "Finished capture, now writing frame %ld" *)
IDS_CAP_STAT_PALETTE_BUILD = 504; (* "Building palette map" *)
IDS_CAP_STAT_OPTPAL_BUILD = 505; (* "Computing optimal palette" *)
IDS_CAP_STAT_I_FRAMES = 506; (* "%d frames" *)
IDS_CAP_STAT_L_FRAMES = 507; (* "%ld frames" *)
IDS_CAP_STAT_CAP_L_FRAMES = 508; (* "Captured %ld frames" *)
IDS_CAP_STAT_CAP_AUDIO = 509; (* "Capturing audio" *)
IDS_CAP_STAT_VIDEOCURRENT = 510; (* "Captured %ld frames (%ld dropped) %d.%03d sec." *)
IDS_CAP_STAT_VIDEOAUDIO = 511; (* "Captured %d.%03d sec. %ld frames (%ld dropped) (%d.%03d fps). %ld audio bytes (%d,%03d sps)" *)
IDS_CAP_STAT_VIDEOONLY = 512; (* "Captured %d.%03d sec. %ld frames (%ld dropped) (%d.%03d fps)" *)
IDS_CAP_STAT_FRAMESDROPPED = 513; (* "Dropped %ld of %ld frames (%d.%02d%%) during capture." *)
{== DRAWDIB - Routines for drawing to the display ============================}
type
HDRAWDIB = THandle; // hdd
{ == DrawDib Flags ============================================================}
const
DDF_UPDATE = $0002; // re-draw the last DIB
DDF_SAME_HDC = $0004; // HDC same as last call (all setup)
DDF_SAME_DRAW = $0008; // draw params are the same
DDF_DONTDRAW = $0010; // dont draw frame, just decompress
DDF_ANIMATE = $0020; // allow palette animation
DDF_BUFFER = $0040; // always buffer image
DDF_JUSTDRAWIT = $0080; // just draw it with GDI
DDF_FULLSCREEN = $0100; // use DisplayDib
DDF_BACKGROUNDPAL = $0200; // Realize palette in background
DDF_NOTKEYFRAME = $0400; // this is a partial frame update, hint
DDF_HURRYUP = $0800; // hurry up please!
DDF_HALFTONE = $1000; // always halftone
DDF_PREROLL = DDF_DONTDRAW; // Builing up a non-keyframe
DDF_SAME_DIB = DDF_SAME_DRAW;
DDF_SAME_SIZE = DDF_SAME_DRAW;
{== DrawDib functions ========================================================}
{-- DrawDibOpen() ------------------------------------------------------------}
function DrawDibOpen: HDRAWDIB; stdcall;
{-- DrawDibClose() -----------------------------------------------------------}
function DrawDibClose(hdd: HDRAWDIB): BOOL; stdcall;
{-- DrawDibGetBuffer() -------------------------------------------------------}
function DrawDibGetBuffer(hdd: HDRAWDIB; lpbi: PBITMAPINFOHEADER; dwSize: DWORD; dwFlags: DWORD): Pointer;stdcall;
{-- DrawDibGetPalette() - get the palette used for drawing DIBs --------------}
function DrawDibGetPalette(hdd: HDRAWDIB): HPALETTE; stdcall;
{-- DrawDibSetPalette() - set the palette used for drawing DIBs --------------}
function DrawDibSetPalette(hdd: HDRAWDIB; hpal: HPALETTE): BOOL; stdcall;
{-- DrawDibChangePalette() ---------------------------------------------------}
function DrawDibChangePalette(hdd: HDRAWDIB; iStart, iLen: integer; lppe: PPALETTEENTRY): BOOL; stdcall;
{-- DrawDibRealize() - realize the palette in a HDD --------------------------}
function DrawDibRealize(hdd: HDRAWDIB; hdc: HDC; fBackground: BOOL): UINT; stdcall;
{-- DrawDibStart() - start of streaming playback -----------------------------}
function DrawDibStart(hdd: HDRAWDIB; rate: DWORD): BOOL; stdcall;
{-- DrawDibStop() - start of streaming playback ------------------------------}
function DrawDibStop(hdd: HDRAWDIB): BOOL; stdcall;
{-- DrawDibBegin() - prepare to draw -----------------------------------------}
function DrawDibBegin(
hdd : HDRAWDIB;
hdc : HDC;
dxDst : integer;
dyDst : integer;
lpbi : PBITMAPINFOHEADER;
dxSrc : integer;
dySrc : integer;
wFlags : UINT
): BOOL; stdcall;
{-- DrawDibDraw() - actually draw a DIB to the screen ------------------------}
function DrawDibDraw(
hdd : HDRAWDIB;
hdc : HDC;
xDst : integer;
yDst : integer;
dxDst : integer;
dyDst : integer;
lpbi : PBITMAPINFOHEADER;
lpBits : Pointer;
xSrc : integer;
ySrc : integer;
dxSrc : integer;
dySrc : integer;
wFlags : UINT
): BOOL; stdcall;
{-- DrawDibUpdate() - redraw last image (may only be valid with DDF_BUFFER) --}
//function DrawDibUpdate(hdd: HDRAWDIB; hdc: HDC; x, y: integer): BOOL;stdcall;
{-- DrawDibEnd() -------------------------------------------------------------}
function DrawDibEnd(hdd: HDRAWDIB): BOOL; stdcall;
{-- DrawDibTime() - for debugging purposes only ------------------------------}
type
PDRAWDIBTIME = ^TDRAWDIBTIME;
TDRAWDIBTIME = record
timeCount : DWORD;
timeDraw : DWORD;
timeDecompress : DWORD;
timeDither : DWORD;
timeStretch : DWORD;
timeBlt : DWORD;
timeSetDIBits : DWORD;
end;
function DrawDibTime(hdd: HDRAWDIB; lpddtime: PDRAWDIBTIME): BOOL; stdcall;
{-- Display profiling --------------------------------------------------------}
const
PD_CAN_DRAW_DIB = $0001; // if you can draw at all
PD_CAN_STRETCHDIB = $0002; // basicly RC_STRETCHDIB
PD_STRETCHDIB_1_1_OK = $0004; // is it fast?
PD_STRETCHDIB_1_2_OK = $0008; // ...
PD_STRETCHDIB_1_N_OK = $0010; // ...
function DrawDibProfileDisplay(lpbi: PBITMAPINFOHEADER): DWORD; stdcall;
// Helper fucntion for FOURCC
function MKFOURCC(ch0, ch1, ch2, ch3: Char): FOURCC;
{== COMPMAN - Installable Compression Manager ================================}
const
ICVERSION = $0104 ;
type
HIC = THandle; // Handle to an Installable Compressor
//
// this code in biCompression means the DIB must be accesed via
// 48 bit pointers! using *ONLY* the selector given.
//
const
BI_1632 = $32333631; // '1632'
function mmioFOURCC(ch0, ch1, ch2, ch3: Char): FOURCC;
type
TWOCC = Word;
function aviTWOCC(ch0, ch1: Char): TWOCC;
const
ICTYPE_VIDEO = $63646976; // mmioFOURCC('v', 'i', 'd', 'c')
ICTYPE_AUDIO = $63647561; // mmioFOURCC('a', 'u', 'd', 'c')
const
ICERR_OK = 0 ;
ICERR_DONTDRAW = 1 ;
ICERR_NEWPALETTE = 2 ;
ICERR_GOTOKEYFRAME = 3 ;
ICERR_STOPDRAWING = 4 ;
ICERR_UNSUPPORTED = -1 ;
ICERR_BADFORMAT = -2 ;
ICERR_MEMORY = -3 ;
ICERR_INTERNAL = -4 ;
ICERR_BADFLAGS = -5 ;
ICERR_BADPARAM = -6 ;
ICERR_BADSIZE = -7 ;
ICERR_BADHANDLE = -8 ;
ICERR_CANTUPDATE = -9 ;
ICERR_ABORT = -10 ;
ICERR_ERROR = -100 ;
ICERR_BADBITDEPTH = -200 ;
ICERR_BADIMAGESIZE = -201 ;
ICERR_CUSTOM = -400 ; // errors less than ICERR_CUSTOM...
{-- Values for dwFlags of ICOpen() -------------------------------------------}
ICMODE_COMPRESS = 1 ;
ICMODE_DECOMPRESS = 2 ;
ICMODE_FASTDECOMPRESS = 3 ;
ICMODE_QUERY = 4 ;
ICMODE_FASTCOMPRESS = 5 ;
ICMODE_DRAW = 8 ;
{-- Flags for AVI file index -------------------------------------------------}
AVIIF_LIST = $00000001 ;
AVIIF_TWOCC = $00000002 ;
AVIIF_KEYFRAME = $00000010 ;
{-- quality flags ------------------------------------------------------------}
ICQUALITY_LOW = 0 ;
ICQUALITY_HIGH = 10000 ;
ICQUALITY_DEFAULT = -1 ;
{-----------------------------------------------------------------------------}
ICM_USER = (DRV_USER+$0000) ;
ICM_RESERVED_LOW = (DRV_USER+$1000) ;
ICM_RESERVED_HIGH = (DRV_USER+$2000) ;
ICM_RESERVED = ICM_RESERVED_LOW ;
{-- Messages -----------------------------------------------------------------}
ICM_GETSTATE = (ICM_RESERVED+0) ; // Get compressor state
ICM_SETSTATE = (ICM_RESERVED+1) ; // Set compressor state
ICM_GETINFO = (ICM_RESERVED+2) ; // Query info about the compressor
ICM_CONFIGURE = (ICM_RESERVED+10); // show the configure dialog
ICM_ABOUT = (ICM_RESERVED+11); // show the about box
ICM_GETDEFAULTQUALITY = (ICM_RESERVED+30); // get the default value for quality
ICM_GETQUALITY = (ICM_RESERVED+31); // get the current value for quality
ICM_SETQUALITY = (ICM_RESERVED+32); // set the default value for quality
ICM_SET = (ICM_RESERVED+40); // Tell the driver something
ICM_GET = (ICM_RESERVED+41); // Ask the driver something
{-- Constants for ICM_SET: ---------------------------------------------------}
ICM_FRAMERATE = $526D7246; // mmioFOURCC('F','r','m','R')
ICM_KEYFRAMERATE = $5279654B; // mmioFOURCC('K','e','y','R')
{-- ICM specific messages ----------------------------------------------------}
ICM_COMPRESS_GET_FORMAT = (ICM_USER+4) ; // get compress format or size
ICM_COMPRESS_GET_SIZE = (ICM_USER+5) ; // get output size
ICM_COMPRESS_QUERY = (ICM_USER+6) ; // query support for compress
ICM_COMPRESS_BEGIN = (ICM_USER+7) ; // begin a series of compress calls.
ICM_COMPRESS = (ICM_USER+8) ; // compress a frame
ICM_COMPRESS_END = (ICM_USER+9) ; // end of a series of compress calls.
ICM_DECOMPRESS_GET_FORMAT = (ICM_USER+10) ; // get decompress format or size
ICM_DECOMPRESS_QUERY = (ICM_USER+11) ; // query support for dempress
ICM_DECOMPRESS_BEGIN = (ICM_USER+12) ; // start a series of decompress calls
ICM_DECOMPRESS = (ICM_USER+13) ; // decompress a frame
ICM_DECOMPRESS_END = (ICM_USER+14) ; // end a series of decompress calls
ICM_DECOMPRESS_SET_PALETTE = (ICM_USER+29) ; // fill in the DIB color table
ICM_DECOMPRESS_GET_PALETTE = (ICM_USER+30) ; // fill in the DIB color table
ICM_DRAW_QUERY = (ICM_USER+31) ; // query support for dempress
ICM_DRAW_BEGIN = (ICM_USER+15) ; // start a series of draw calls
ICM_DRAW_GET_PALETTE = (ICM_USER+16) ; // get the palette needed for drawing
ICM_DRAW_START = (ICM_USER+18) ; // start decompress clock
ICM_DRAW_STOP = (ICM_USER+19) ; // stop decompress clock
ICM_DRAW_END = (ICM_USER+21) ; // end a series of draw calls
ICM_DRAW_GETTIME = (ICM_USER+32) ; // get value of decompress clock
ICM_DRAW = (ICM_USER+33) ; // generalized "render" message
ICM_DRAW_WINDOW = (ICM_USER+34) ; // drawing window has moved or hidden
ICM_DRAW_SETTIME = (ICM_USER+35) ; // set correct value for decompress clock
ICM_DRAW_REALIZE = (ICM_USER+36) ; // realize palette for drawing
ICM_DRAW_FLUSH = (ICM_USER+37) ; // clear out buffered frames
ICM_DRAW_RENDERBUFFER = (ICM_USER+38) ; // draw undrawn things in queue
ICM_DRAW_START_PLAY = (ICM_USER+39) ; // start of a play
ICM_DRAW_STOP_PLAY = (ICM_USER+40) ; // end of a play
ICM_DRAW_SUGGESTFORMAT = (ICM_USER+50) ; // Like ICGetDisplayFormat
ICM_DRAW_CHANGEPALETTE = (ICM_USER+51) ; // for animating palette
ICM_GETBUFFERSWANTED = (ICM_USER+41) ; // ask about prebuffering
ICM_GETDEFAULTKEYFRAMERATE = (ICM_USER+42) ; // get the default value for key frames
ICM_DECOMPRESSEX_BEGIN = (ICM_USER+60) ; // start a series of decompress calls
ICM_DECOMPRESSEX_QUERY = (ICM_USER+61) ; // start a series of decompress calls
ICM_DECOMPRESSEX = (ICM_USER+62) ; // decompress a frame
ICM_DECOMPRESSEX_END = (ICM_USER+63) ; // end a series of decompress calls
ICM_COMPRESS_FRAMES_INFO = (ICM_USER+70) ; // tell about compress to come
ICM_SET_STATUS_PROC = (ICM_USER+72) ; // set status callback
{-----------------------------------------------------------------------------}
type
PICOPEN = ^TICOPEN;
TICOPEN = record
dwSize : DWORD ; // sizeof(TICOPEN)
fccType : DWORD ; // 'vidc'
fccHandler : DWORD ; //
dwVersion : DWORD ; // version of compman opening you
dwFlags : DWORD ; // LOWORD is type specific
dwError : DWORD ; // error return.
pV1Reserved : Pointer ; // Reserved
pV2Reserved : Pointer ; // Reserved
dnDevNode : DWORD ; // Devnode for PnP devices
end;
{-----------------------------------------------------------------------------}
PICINFO = ^TICINFO ;
TICINFO = record
dwSize : DWORD; // sizeof(TICINFO)
fccType : DWORD; // compressor type 'vidc' 'audc'
fccHandler : DWORD; // compressor sub-type 'rle ' 'jpeg' 'pcm '
dwFlags : DWORD; // flags LOWORD is type specific
dwVersion : DWORD; // version of the driver
dwVersionICM : DWORD; // version of the ICM used
//
// under Win32, the driver always returns UNICODE strings.
//
szName : array[0..15] of WideChar ; // short name
szDescription : array[0..127] of WideChar ; // DWORD name
szDriver : array[0..127] of WideChar ; // driver that contains compressor
end;
{-- Flags for the <dwFlags> field of the <ICINFO> structure. -----------------}
const
VIDCF_QUALITY = $0001 ; // supports quality
VIDCF_CRUNCH = $0002 ; // supports crunching to a frame size
VIDCF_TEMPORAL = $0004 ; // supports inter-frame compress
VIDCF_COMPRESSFRAMES = $0008 ; // wants the compress all frames message
VIDCF_DRAW = $0010 ; // supports drawing
VIDCF_FASTTEMPORALC = $0020 ; // does not need prev frame on compress
VIDCF_FASTTEMPORALD = $0080 ; // does not need prev frame on decompress
//VIDCF_QUALITYTIME = $0040 ; // supports temporal quality
//VIDCF_FASTTEMPORAL = (VIDCF_FASTTEMPORALC or VIDCF_FASTTEMPORALD)
{-----------------------------------------------------------------------------}
ICCOMPRESS_KEYFRAME = $00000001;
type
PICCOMPRESS = ^TICCOMPRESS;
TICCOMPRESS = record
dwFlags : DWORD; // flags
lpbiOutput : PBITMAPINFOHEADER ; // output format
lpOutput : Pointer ; // output data
lpbiInput : PBITMAPINFOHEADER ; // format of frame to compress
lpInput : Pointer ; // frame data to compress
lpckid : PDWORD ; // ckid for data in AVI file
lpdwFlags : PDWORD; // flags in the AVI index.
lFrameNum : DWORD ; // frame number of seq.
dwFrameSize : DWORD ; // reqested size in bytes. (if non zero)
dwQuality : DWORD ; // quality
// these are new fields
lpbiPrev : PBITMAPINFOHEADER ; // format of previous frame
lpPrev : Pointer ; // previous frame
end;
{-----------------------------------------------------------------------------}
const
ICCOMPRESSFRAMES_PADDING = $00000001 ;
type
TICCompressProc = function(lInput: LPARAM; lFrame: DWORD; lpBits: Pointer; len: DWORD): DWORD; stdcall;
PICCOMPRESSFRAMES = ^TICCOMPRESSFRAMES;
TICCOMPRESSFRAMES = record
dwFlags : DWORD ; // flags
lpbiOutput : PBITMAPINFOHEADER ; // output format
lOutput : LPARAM ; // output identifier
lpbiInput : PBITMAPINFOHEADER ; // format of frame to compress
lInput : LPARAM ; // input identifier
lStartFrame : DWORD ; // start frame
lFrameCount : DWORD ; // # of frames
lQuality : DWORD ; // quality
lDataRate : DWORD ; // data rate
lKeyRate : DWORD ; // key frame rate
dwRate : DWORD ; // frame rate, as always
dwScale : DWORD ;
dwOverheadPerFrame : DWORD ;
dwReserved2 : DWORD ;
GetData : TICCompressProc;
PutData : TICCompressProc;
end;
{-- Messages for Status callback ---------------------------------------------}
const
ICSTATUS_START = 0 ;
ICSTATUS_STATUS = 1 ; // l = % done
ICSTATUS_END = 2 ;
ICSTATUS_ERROR = 3 ; // l = error string (LPSTR)
ICSTATUS_YIELD = 4 ;
type
// return nonzero means abort operation in progress
TICStatusProc = function(lParam: LPARAM; message: UINT; l: DWORD): DWORD; stdcall;
PICSETSTATUSPROC = ^TICSETSTATUSPROC;
TICSETSTATUSPROC = record
dwFlags : DWORD ;
lParam : LPARAM ;
Status : TICStatusProc;
end;
{-----------------------------------------------------------------------------}
const
ICDECOMPRESS_HURRYUP = $80000000 ; // don't draw just buffer (hurry up!)
ICDECOMPRESS_UPDATE = $40000000 ; // don't draw just update screen
ICDECOMPRESS_PREROLL = $20000000 ; // this frame is before real start
ICDECOMPRESS_NULLFRAME = $10000000 ; // repeat last frame
ICDECOMPRESS_NOTKEYFRAME = $08000000 ; // this frame is not a key frame
type
PICDECOMPRESS = ^TICDECOMPRESS;
TICDECOMPRESS = record
dwFlags : DWORD ; // flags (from AVI index...)
lpbiInput : PBITMAPINFOHEADER ; // BITMAPINFO of compressed data
// biSizeImage has the chunk size
lpInput : Pointer ; // compressed data
lpbiOutput : PBITMAPINFOHEADER ; // DIB to decompress to
lpOutput : Pointer ;
ckid : DWORD ; // ckid from AVI file
end;
PICDECOMPRESSEX = ^TICDECOMPRESSEX;
TICDECOMPRESSEX = record
//
// same as ICM_DECOMPRESS
//
dwFlags : DWORD;
lpbiSrc : PBITMAPINFOHEADER; // BITMAPINFO of compressed data
lpSrc : Pointer; // compressed data
lpbiDst : PBITMAPINFOHEADER; // DIB to decompress to
lpDst : Pointer; // output data
//
// new for ICM_DECOMPRESSEX
//
xDst : integer ; // destination rectangle
yDst : integer ;
dxDst : integer ;
dyDst : integer ;
xSrc : integer ; // source rectangle
ySrc : integer ;
dxSrc : integer ;
dySrc : integer ;
end;
{-----------------------------------------------------------------------------}
const
ICDRAW_QUERY = $00000001 ; // test for support
ICDRAW_FULLSCREEN = $00000002 ; // draw to full screen
ICDRAW_HDC = $00000004 ; // draw to a HDC/HWND
ICDRAW_ANIMATE = $00000008 ; // expect palette animation
ICDRAW_CONTINUE = $00000010 ; // draw is a continuation of previous draw
ICDRAW_MEMORYDC = $00000020 ; // DC is offscreen, by the way
ICDRAW_UPDATING = $00000040 ; // We're updating, as opposed to playing
ICDRAW_RENDER = $00000080 ; // used to render data not draw it
ICDRAW_BUFFER = $00000100 ; // please buffer this data offscreen, we will need to update it
type
PICDRAWBEGIN = ^TICDRAWBEGIN;
TICDRAWBEGIN = record
dwFlags : DWORD ; // flags
hpal : HPALETTE ; // palette to draw with
hwnd : HWND ; // window to draw to
hdc : HDC ; // HDC to draw to
xDst : integer ; // destination rectangle
yDst : integer ;
dxDst : integer ;
dyDst : integer ;
lpbi : PBITMAPINFOHEADER ;
// format of frame to draw
xSrc : integer ; // source rectangle
ySrc : integer ;
dxSrc : integer ;
dySrc : integer ;
dwRate : DWORD ; // frames/second = (dwRate/dwScale)
dwScale : DWORD ;
end;
{-----------------------------------------------------------------------------}
const
ICDRAW_HURRYUP = $80000000 ; // don't draw just buffer (hurry up!)
ICDRAW_UPDATE = $40000000 ; // don't draw just update screen
ICDRAW_PREROLL = $20000000 ; // this frame is before real start
ICDRAW_NULLFRAME = $10000000 ; // repeat last frame
ICDRAW_NOTKEYFRAME = $08000000 ; // this frame is not a key frame
type
PICDRAW = ^TICDRAW;
TICDRAW = record
dwFlags : DWORD ; // flags
lpFormat : Pointer ; // format of frame to decompress
lpData : Pointer ; // frame data to decompress
cbData : DWORD ;
lTime : DWORD ; // time in drawbegin units (see dwRate and dwScale)
end;
PICDRAWSUGGEST = ^TICDRAWSUGGEST;
TICDRAWSUGGEST = record
lpbiIn : PBITMAPINFOHEADER ; // format to be drawn
lpbiSuggest : PBITMAPINFOHEADER ; // location for suggested format (or NULL to get size)
dxSrc : integer ; // source extent or 0
dySrc : integer ;
dxDst : integer ; // dest extent or 0
dyDst : integer ;
hicDecompressor : HIC ; // decompressor you can talk to
end;
{-----------------------------------------------------------------------------}
PICPALETTE = ^TICPALETTE;
TICPALETTE = record
dwFlags : DWORD ; // flags (from AVI index...)
iStart : integer ; // first palette to change
iLen : integer ; // count of entries to change.
lppe : PPALETTEENTRY ; // palette
end;
{-- ICM function declarations ------------------------------------------------}
function ICInfo(fccType, fccHandler: DWORD; lpicinfo: PICINFO) : BOOL ; stdcall ;
function ICInstall(fccType, fccHandler: DWORD; lParam: LPARAM; szDesc: LPSTR; wFlags: UINT) : BOOL ; stdcall ;
function ICRemove(fccType, fccHandler: DWORD; wFlags: UINT) : BOOL ; stdcall ;
function ICGetInfo(hic: HIC; picinfo: PICINFO; cb: DWORD) : DWORD ; stdcall ;
function ICOpen(fccType, fccHandler: DWORD; wMode: UINT) : HIC ; stdcall ;
function ICOpenFunction(fccType, fccHandler: DWORD; wMode: UINT; lpfnHandler: TFarProc) : HIC ; stdcall ;
function ICClose(hic: HIC) : DWORD; stdcall ;
function ICSendMessage(hic: HIC; msg: UINT; dw1, dw2: integer) : DWORD ; stdcall ;
{-- Values for wFlags of ICInstall -------------------------------------------}
const
ICINSTALL_UNICODE = $8000 ;
ICINSTALL_FUNCTION = $0001 ; // lParam is a DriverProc (function ptr)
ICINSTALL_DRIVER = $0002 ; // lParam is a driver name (string)
ICINSTALL_HDRV = $0004 ; // lParam is a HDRVR (driver handle)
ICINSTALL_DRIVERW = $8002 ; // lParam is a unicode driver name
{-- Query macros -------------------------------------------------------------}
ICMF_CONFIGURE_QUERY = $00000001 ;
ICMF_ABOUT_QUERY = $00000001 ;
function ICQueryAbout(hic: HIC): BOOL;
function ICAbout(hic: HIC; hwnd: HWND): DWORD;
function ICQueryConfigure(hic: HIC): BOOL;
function ICConfigure(hic: HIC; hwnd: HWND): DWORD;
{-- Get/Set state macros -----------------------------------------------------}
function ICGetState(hic: HIC; pv: Pointer; cb: DWORD): DWORD;
function ICSetState(hic: HIC; pv: Pointer; cb: DWORD): DWORD;
function ICGetStateSize(hic: HIC): DWORD;
{-- Get value macros ---------------------------------------------------------}
function ICGetDefaultQuality(hic: HIC): DWORD;
function ICGetDefaultKeyFrameRate(hic: HIC): DWORD;
{-- Draw window macro --------------------------------------------------------}
function ICDrawWindow(hic: HIC; prc: PRECT): DWORD;
{== Compression functions ====================================================}
{-- ICCompress() - compress a single frame -----------------------------------}
function ICCompress(
hic : HIC;
dwFlags : DWORD; // flags
lpbiOutput : PBITMAPINFOHEADER; // output format
lpData : Pointer; // output data
lpbiInput : PBITMAPINFOHEADER; // format of frame to compress
lpBits : Pointer; // frame data to compress
lpckid : PDWORD; // ckid for data in AVI file
lpdwFlags : PDWORD; // flags in the AVI index.
lFrameNum : DWORD; // frame number of seq.
dwFrameSize : DWORD; // reqested size in bytes. (if non zero)
dwQuality : DWORD; // quality within one frame
lpbiPrev : PBITMAPINFOHEADER; // format of previous frame
lpPrev : Pointer // previous frame
) : DWORD; cdecl;
{-- ICCompressBegin() - start compression from a source fmt to a dest fmt ----}
function ICCompressBegin(hic: HIC; lpbiInput: PBITMAPINFOHEADER; lpbiOutput: PBITMAPINFOHEADER): DWORD;