?? vfw_gai.pas
字號:
unit vfw_Gai;
interface
{$UNDEF UNICODE}
(****************************************************************************
*
* VfW.H - Video for windows include file for WIN32
*
* Copyright (c) 1991-1999, Microsoft Corp. All rights reserved.
*
* This include files defines interfaces to the following
* video components
*
* COMPMAN - Installable Compression Manager.
* DRAWDIB - Routines for drawing to the display.
* VIDEO - Video Capture Driver Interface
*
* AVIFMT - AVI File Format structure definitions.
* MMREG - FOURCC and other things
*
* AVIFile - Interface for reading AVI Files and AVI Streams
* MCIWND - MCI/AVI window class
* AVICAP - AVI Capture Window class
*
* MSACM - Audio compression manager.
*
* The following symbols control inclusion of various parts of this file:
*
* NOCOMPMAN - dont include COMPMAN
* NODRAWDIB - dont include DRAWDIB
* NOVIDEO - dont include video capture interface
*
* NOAVIFMT - dont include AVI file format structs
* NOMMREG - dont include MMREG
*
* NOAVIFILE - dont include AVIFile interface
* NOMCIWND - dont include AVIWnd class.
* NOAVICAP - dont include AVICap class.
*
* NOMSACM - dont include ACM stuff.
*
****************************************************************************)
(******************************************************************************)
(* *)
(* VFW.PAS Conversion by Ronald Dittrich *)
(* *)
(* E-Mail: info@swiftsoft.de *)
(* http://www.swiftsoft.de *)
(* *)
(******************************************************************************)
(******************************************************************************)
(* *)
(* Modyfied: 25.April.2000 *)
(* *)
(* E-Mail: *)
(* Ivo Steinmann: isteinmann@bluewin.ch *)
(* *)
(* Please send all messages regarding specific errors and lacks of this unit *)
(* to Ivo Steinmann *)
(* *)
(******************************************************************************)
(******************************************************************************)
(* *)
(* Modyfied: 2000-12-07 *)
(* *)
(* E-Mail: *)
(* Peter Haas: PeterJHaas@t-online.de *)
(* *)
(* Only modified line 1380 ( TAVIPALCHANGE.peNew ) *)
(* *)
(******************************************************************************)
uses
Windows,
MMSystem,
Messages,
CommDlg,
ActiveX,
Dialogs;
(****************************************************************************
*
* types
*
***************************************************************************)
type
PVOID = pointer;
LONG = longint;
PLONG = ^LONG;
int = integer;
(****************************************************************************
*
* VideoForWindowsVersion() - returns version of VfW
*
***************************************************************************)
function VideoForWindowsVersion: DWORD; pascal;
(****************************************************************************
*
* call these to start stop using VfW from your app.
*
***************************************************************************)
{
function InitVFW: LONG; stdcall;
function TermVFW: LONG; stdcall; }
(****************************************************************************/
/* */
/* Macros */
/* */
/* should we define this?? */
/* */
/****************************************************************************)
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; {vidc}
ICTYPE_AUDIO = $63647561; {audc}
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; {FrmR}
ICM_KEYFRAMERATE = $5279654B; {KeyR}
(************************************************************************
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 = packed record
dwSize : DWORD ; // sizeof(ICOPEN)
fccType : DWORD ; // 'vidc'
fccHandler : DWORD ; //
dwVersion : DWORD ; // version of compman opening you
dwFlags : DWORD ; // LOWORD is type specific
dwError : DWORD ; // error return.
pV1Reserved : PVOID ; // Reserved
pV2Reserved : PVOID ; // Reserved
dnDevNode : DWORD ; // Devnode for PnP devices
end;
(************************************************************************
************************************************************************)
PICINFO = ^TICINFO;
TICINFO = packed record
dwSize : DWORD; // sizeof(ICINFO)
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 WChar ; // short name
szDescription : array[0..127] of WChar ; // DWORD name
szDriver : array[0..127] of WChar ; // 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
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -