vfw.pas
上传用户:hylc_2004
上传日期:2014-01-23
资源大小:46800k
文件大小:187k
- unit VFW;
- 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
- 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 = packed record
- dwFlags : DWORD; // flags
- lpbiOutput : PBITMAPINFOHEADER ; // output format
- lpOutput : PVOID ; // output data
- lpbiInput : PBITMAPINFOHEADER ; // format of frame to compress
- lpInput : PVOID ; // frame data to compress
- lpckid : PDWORD ; // ckid for data in AVI file
- lpdwFlags : PDWORD; // flags in the AVI index.
- lFrameNum : LONG ; // 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 : PVOID ; // previous frame
- end;
- (************************************************************************
- ************************************************************************)
- const
- ICCOMPRESSFRAMES_PADDING = $00000001 ;
- type
- TICCompressProc = function(lInputOutput: LPARAM; lFrame: DWORD; lpBits: PVOID; len: LONG): LONG; stdcall;
- PICCOMPRESSFRAMES = ^TICCOMPRESSFRAMES;
- TICCOMPRESSFRAMES = packed record
- dwFlags : DWORD ; // flags
- lpbiOutput : PBITMAPINFOHEADER ; // output format
- lOutput : LPARAM ; // output identifier
- lpbiInput : PBITMAPINFOHEADER ; // format of frame to compress
- lInput : LPARAM ; // input identifier
- lStartFrame : LONG ; // start frame
- lFrameCount : LONG ; // # of frames
- lQuality : LONG ; // quality
- lDataRate : LONG ; // data rate
- lKeyRate : LONG ; // 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: LONG): LONG; stdcall;
- PICSETSTATUSPROC = ^TICSETSTATUSPROC;
- TICSETSTATUSPROC = packed 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 = packed record
- dwFlags : DWORD ; // flags (from AVI index...)
- lpbiInput : PBITMAPINFOHEADER ; // BITMAPINFO of compressed data
- // biSizeImage has the chunk size
- lpInput : PVOID ; // compressed data
- lpbiOutput : PBITMAPINFOHEADER ; // DIB to decompress to
- lpOutput : PVOID ;
- ckid : DWORD ; // ckid from AVI file
- end;
- PICDECOMPRESSEX = ^TICDECOMPRESSEX;
- TICDECOMPRESSEX = packed record
- //
- // same as ICM_DECOMPRESS
- //
- dwFlags : DWORD;
- lpbiSrc : PBITMAPINFOHEADER; // BITMAPINFO of compressed data
- lpSrc : PVOID; // compressed data
- lpbiDst : PBITMAPINFOHEADER; // DIB to decompress to
- lpDst : PVOID; // output data
- //
- // new for ICM_DECOMPRESSEX
- //
- xDst : int; // destination rectangle
- yDst : int;
- dxDst : int;
- dyDst : int;
- xSrc : int; // source rectangle
- ySrc : int;
- dxSrc : int;
- dySrc : int;
- 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 = packed record
- dwFlags : DWORD ; // flags
- hpal : HPALETTE ; // palette to draw with
- hwnd : HWND ; // window to draw to
- hdc : HDC ; // HDC to draw to
- xDst : int ; // destination rectangle
- yDst : int ;
- dxDst : int ;
- dyDst : int ;
- lpbi : PBITMAPINFOHEADER ;
- // format of frame to draw
- xSrc : int ; // source rectangle
- ySrc : int ;
- dxSrc : int ;
- dySrc : int ;
- 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 = packed record
- dwFlags : DWORD ; // flags
- lpFormat : PVOID ; // format of frame to decompress
- lpData : PVOID ; // frame data to decompress
- cbData : DWORD ;
- lTime : LONG ; // time in drawbegin units (see dwRate and dwScale)
- end;
- PICDRAWSUGGEST = ^TICDRAWSUGGEST;
- TICDRAWSUGGEST = packed record
- lpbiIn : PBITMAPINFOHEADER ; // format to be drawn
- lpbiSuggest : PBITMAPINFOHEADER ; // location for suggested format (or NULL to get size)
- dxSrc : int ; // source extent or 0
- dySrc : int ;
- dxDst : int ; // dest extent or 0
- dyDst : int ;
- hicDecompressor : HIC ; // decompressor you can talk to
- end;
- (************************************************************************
- ************************************************************************)
- PICPALETTE = ^TICPALETTE;
- TICPALETTE = packed record
- dwFlags : DWORD ; // flags (from AVI index...)
- iStart : int ; // first palette to change
- iLen : int ; // 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: DWORD) : 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: PVOID; cb: DWORD): DWORD;
- function ICSetState(hic: HIC; pv: PVOID; 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 : PVOID; // output data
- lpbiInput : PBITMAPINFOHEADER; // format of frame to compress
- lpBits : PVOID; // 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 : PVOID // previous frame
- ): DWORD; cdecl;
- (*
- * ICCompressBegin()
- *
- * start compression from a source format (lpbiInput) to a dest
- * format (lpbiOuput) is supported.
- *
- *)
- function ICCompressBegin(hic: HIC; lpbiInput: PBITMAPINFOHEADER; lpbiOutput: PBITMAPINFOHEADER): DWORD;
- (*
- * ICCompressQuery()
- *
- * determines if compression from a source format (lpbiInput) to a dest
- * format (lpbiOuput) is supported.
- *
- *)
- function ICCompressQuery(hic: HIC; lpbiInput, lpbiOutput: PBITMAPINFOHEADER): DWORD;
- (*
- * ICCompressGetFormat()
- *
- * get the output format, (format of compressed data)
- * if lpbiOutput is NULL return the size in bytes needed for format.
- *
- *)
- function ICCompressGetFormat(hic: HIC; lpbiInput, lpbiOutput: PBITMAPINFOHEADER): DWORD;
- function ICCompressGetFormatSize(hic: HIC; lpbi: PBITMAPINFOHEADER): DWORD;
- (*
- * ICCompressSize()
- *
- * return the maximal size of a compressed frame
- *
- *)
- function ICCompressGetSize(hic: HIC; lpbiInput, lpbiOutput: PBITMAPINFOHEADER): DWORD;
- function ICCompressEnd(hic: HIC): DWORD;
- (************************************************************************
- decompression functions
- ************************************************************************)
- (*
- * ICDecompress()
- *
- * decompress a single frame
- *
- *)
- function ICDecompress(
- hic : HIC;
- dwFlags : DWORD; // flags (from AVI index...)
- lpbiFormat : PBITMAPINFOHEADER; // BITMAPINFO of compressed data
- // biSizeImage has the chunk size
- lpData : PVOID; // data
- lpbi : PBITMAPINFOHEADER; // DIB to decompress to
- lpBits : PVOID
- ): DWORD; cdecl;
- (*
- * ICDecompressBegin()
- *
- * start compression from a source format (lpbiInput) to a dest
- * format (lpbiOutput) is supported.
- *
- *)
- function ICDecompressBegin(hic: HIC; lpbiInput, lpbiOutput: PBITMAPINFOHEADER): DWORD;
- (*
- * ICDecompressQuery()
- *
- * determines if compression from a source format (lpbiInput) to a dest
- * format (lpbiOutput) is supported.
- *
- *)
- function ICDecompressQuery(hic: HIC; lpbiInput, lpbiOutput: PBITMAPINFOHEADER): DWORD;
- (*
- * ICDecompressGetFormat()
- *
- * get the output format, (format of un-compressed data)
- * if lpbiOutput is NULL return the size in bytes needed for format.
- *
- *)
- function ICDecompressGetFormat(hic: HIC; lpbiInput, lpbiOutput: PBITMAPINFOHEADER): DWORD;
- function ICDecompressGetFormatSize(hic: HIC; lpbi: PBITMAPINFOHEADER): DWORD;
- (*
- * ICDecompressGetPalette()
- *
- * get the output palette
- *
- *)
- function ICDecompressGetPalette(hic: HIC; lpbiInput, lpbiOutput: PBITMAPINFOHEADER): DWORD;
- function ICDecompressSetPalette(hic: HIC; lpbiPalette: PBITMAPINFOHEADER): DWORD;
- function ICDecompressEnd(hic: HIC): DWORD;
- (************************************************************************
- decompression (ex) functions
- ************************************************************************)
- //
- // on Win16 these functions are macros that call ICMessage. ICMessage will
- // not work on NT. rather than add new entrypoints we have given
- // them as static inline functions
- //
- (*
- * ICDecompressEx()
- *
- * decompress a single frame
- *
- *)
- function ICDecompressEx(
- hic : HIC;
- dwFlags : DWORD;
- lpbiSrc : PBITMAPINFOHEADER;
- lpSrc : PVOID;
- xSrc : int;
- ySrc : int;
- dxSrc : int;
- dySrc : int;
- lpbiDst : PBITMAPINFOHEADER;
- lpDst : PVOID;
- xDst : int;
- yDst : int;
- dxDst : int;
- dyDst : int
- ): DWORD; stdcall;
- (*
- * ICDecompressExBegin()
- *
- * start compression from a source format (lpbiInput) to a dest
- * format (lpbiOutput) is supported.
- *
- *)
- function ICDecompressExBegin(
- hic : HIC;
- dwFlags : DWORD;
- lpbiSrc : PBITMAPINFOHEADER;
- lpSrc : PVOID;
- xSrc : int;
- ySrc : int;
- dxSrc : int;
- dySrc : int;
- lpbiDst : PBITMAPINFOHEADER;
- lpDst : PVOID;
- xDst : int;
- yDst : int;
- dxDst : int;
- dyDst : int
- ): DWORD; stdcall;
- (*
- * ICDecompressExQuery()
- *
- *)
- function ICDecompressExQuery(
- hic : HIC;
- dwFlags : DWORD;
- lpbiSrc : PBITMAPINFOHEADER;
- lpSrc : PVOID;
- xSrc : int;
- ySrc : int;
- dxSrc : int;
- dySrc : int;
- lpbiDst : PBITMAPINFOHEADER;
- lpDst : PVOID;
- xDst : int;
- yDst : int;
- dxDst : int;
- dyDst : int
- ): DWORD; stdcall;
- function ICDecompressExEnd(hic: HIC): DWORD;
- (************************************************************************
- drawing functions
- ************************************************************************)
- (*
- * ICDrawBegin()
- *
- * start decompressing data with format (lpbiInput) directly to the screen
- *
- * return zero if the decompressor supports drawing.
- *
- *)
- function ICDrawBegin(
- hic : HIC;
- dwFlags : DWORD; // flags
- hpal : HPALETTE; // palette to draw with
- hwnd : HWND; // window to draw to
- hdc : HDC; // HDC to draw to
- xDst : int; // destination rectangle
- yDst : int;
- dxDst : int;
- dyDst : int;
- lpbi : PBITMAPINFOHEADER; // format of frame to draw
- xSrc : int; // source rectangle
- ySrc : int;
- dxSrc : int;
- dySrc : int;
- dwRate : DWORD; // frames/second = (dwRate/dwScale)
- dwScale : DWORD
- ): DWORD; cdecl;
- (*
- * ICDraw()
- *
- * decompress data directly to the screen
- *
- *)
- function ICDraw(
- hic : HIC;
- dwFlags : DWORD; // flags
- lpFormat : PVOID; // format of frame to decompress
- lpData : PVOID; // frame data to decompress
- cbData : DWORD; // size of data
- lTime : DWORD // time to draw this frame
- ): DWORD; cdecl;
- // ICMessage is not supported on Win32, so provide a static inline function
- // to do the same job
- function ICDrawSuggestFormat(
- hic : HIC;
- lpbiIn : PBITMAPINFOHEADER;
- lpbiOut : PBITMAPINFOHEADER;
- dxSrc : int;
- dySrc : int;
- dxDst : int;
- dyDst : int;
- hicDecomp : HIC
- ): DWORD; stdcall;
- (*
- * ICDrawQuery()
- *
- * determines if the compressor is willing to render the specified format.
- *
- *)
- function ICDrawQuery(hic: HIC; lpbiInput: PBITMAPINFOHEADER): DWORD;
- function ICDrawChangePalette(hic: HIC; lpbiInput: PBITMAPINFOHEADER): DWORD;
- function ICGetBuffersWanted(hic: HIC; lpdwBuffers: PDWORD): DWORD;
- function ICDrawEnd(hic: HIC): DWORD;
- function ICDrawStart(hic: HIC): DWORD;
- function ICDrawStartPlay(hic: HIC; lFrom, lTo: DWORD): DWORD;
- function ICDrawStop(hic: HIC): DWORD;
- function ICDrawStopPlay(hic: HIC): DWORD;
- function ICDrawGetTime(hic: HIC; lplTime: PDWORD): DWORD;
- function ICDrawSetTime(hic: HIC; lTime: DWORD): DWORD;
- function ICDrawRealize(hic: HIC; hdc: HDC; fBackground: BOOL): DWORD;
- function ICDrawFlush(hic: HIC): DWORD;
- function ICDrawRenderBuffer(hic: HIC): DWORD;
- (************************************************************************
- Status callback functions
- ************************************************************************/
- /*
- * ICSetStatusProc()
- *
- * Set the status callback function
- *
- *)
- // ICMessage is not supported on NT
- function ICSetStatusProc(
- hic : HIC;
- dwFlags : DWORD;
- lParam : DWORD;
- fpfnStatus : TICStatusProc
- ): DWORD; stdcall;
- (************************************************************************
- helper routines for DrawDib and MCIAVI...
- ************************************************************************)
- function ICLocate(fccType, fccHandler: DWORD; lpbiIn, lpbiOut: PBITMAPINFOHEADER; wFlags: WORD): HIC; stdcall;
- function ICGetDisplayFormat(hic: HIC; lpbiIn, lpbiOut: PBITMAPINFOHEADER; BitDepth: int; dx, dy: int): HIC; stdcall;
- function ICDecompressOpen(fccType, fccHandler: DWORD; lpbiIn, lpbiOut: PBITMAPINFOHEADER): HIC;
- function ICDrawOpen(fccType, fccHandler: DWORD; lpbiIn: PBITMAPINFOHEADER): HIC;
- (************************************************************************
- Higher level functions
- ************************************************************************)
- function ICImageCompress(
- hic : HIC; // compressor to use
- uiFlags : UINT; // flags (none yet)
- lpbiIn : PBITMAPINFO; // format to compress from
- lpBits : PVOID; // data to compress
- lpbiOut : PBITMAPINFO; // compress to this (NULL ==> default)
- lQuality : LONG; // quality to use
- plSize : PDWORD // compress to this size (0=whatever)
- ): THANDLE; stdcall;
- function ICImageDecompress(
- hic : HIC; // compressor to use
- uiFlags : UINT; // flags (none yet)
- lpbiIn : PBITMAPINFO; // format to decompress from
- lpBits : PVOID; // data to decompress
- lpbiOut : PBITMAPINFO // decompress to this (NULL ==> default)
- ): THANDLE; stdcall;
- {-- TCompVars ----------------------------------------------------------------}
- //
- // Structure used by ICSeqCompressFrame and ICCompressorChoose routines
- // Make sure this matches the autodoc in icm.c!
- //
- type
- PCOMPVARS = ^TCOMPVARS;
- TCOMPVARS = packed record
- cbSize : DWORD; // set to sizeof(COMPVARS) before
- // calling ICCompressorChoose
- dwFlags : DWORD; // see below...
- hic : HIC; // HIC of chosen compressor
- fccType : DWORD; // basically ICTYPE_VIDEO
- fccHandler : DWORD; // handler of chosen compressor or
- // "" or "DIB "
- lpbiIn : PBITMAPINFO; // input format
- lpbiOut : PBITMAPINFO; // output format - will compress to this
- lpBitsOut : PVOID;
- lpBitsPrev : PVOID;
- lFrame : LONG;
- lKey : LONG; // key frames how often?
- lDataRate : LONG; // desired data rate KB/Sec
- lQ : LONG; // desired quality
- lKeyCount : LONG;
- lpState : PVOID; // state of compressor
- cbState : LONG; // size of the state
- end;
- // FLAGS for dwFlags element of COMPVARS structure:
- // set this flag if you initialize COMPVARS before calling ICCompressorChoose
- const
- ICMF_COMPVARS_VALID = $00000001; // COMPVARS contains valid data
- //
- // allows user to choose compressor, quality etc...
- //
- function ICCompressorChoose(
- hwnd : HWND; // parent window for dialog
- uiFlags : UINT; // flags
- pvIn : PVOID; // input format (optional)
- lpData : PVOID; // input data (optional)
- pc : PCOMPVARS; // data about the compressor/dlg
- lpszTitle : LPSTR // dialog title (optional)
- ): BOOL; stdcall;
- // defines for uiFlags
- const
- ICMF_CHOOSE_KEYFRAME = $0001; // show KeyFrame Every box
- ICMF_CHOOSE_DATARATE = $0002; // show DataRate box
- ICMF_CHOOSE_PREVIEW = $0004; // allow expanded preview dialog
- ICMF_CHOOSE_ALLCOMPRESSORS = $0008; // don't only show those that
- // can handle the input format
- // or input data
- function ICSeqCompressFrameStart(pc: PCOMPVARS; lpbiIn: PBITMAPINFO): BOOL; stdcall;
- procedure ICSeqCompressFrameEnd(pc: PCOMPVARS); stdcall;
- function ICSeqCompressFrame(
- pc : PCOMPVARS; // set by ICCompressorChoose
- uiFlags : UINT; // flags
- lpBits : PVOID; // input DIB bits
- pfKey : PBOOL; // did it end up being a key frame?
- plSize : PDWORD // size to compress to/of returned image
- ): PVOID; stdcall;
- procedure ICCompressorFree(pc: PCOMPVARS); stdcall;
- (**************************************************************************
- *
- * 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): PVOID; 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: int; 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 : int;
- dyDst : int;
- lpbi : PBITMAPINFOHEADER;
- dxSrc : int;
- dySrc : int;
- wFlags : UINT
- ): BOOL; stdcall;
- {-- DrawDibDraw() - actually draw a DIB to the screen ------------------------}
- function DrawDibDraw(
- hdd : HDRAWDIB;
- hdc : HDC;
- xDst : int;
- yDst : int;
- dxDst : int;
- dyDst : int;
- lpbi : PBITMAPINFOHEADER;
- lpBits : PVOID;
- xSrc : int;
- ySrc : int;
- dxSrc : int;
- dySrc : int;
- wFlags : UINT
- ): BOOL; stdcall;
- {-- DrawDibUpdate() - redraw last image (may only be valid with DDF_BUFFER) --}
- function DrawDibUpdate(hdd: HDRAWDIB; hdc: HDC; x, y: int): BOOL;
- {-- DrawDibEnd() -------------------------------------------------------------}
- function DrawDibEnd(hdd: HDRAWDIB): BOOL; stdcall;
- {-- DrawDibTime() - for debugging purposes only ------------------------------}
- type
- PDRAWDIBTIME = ^TDRAWDIBTIME;
- TDRAWDIBTIME = packed record
- timeCount : LONG;
- timeDraw : LONG;
- timeDecompress : LONG;
- timeDither : LONG;
- timeStretch : LONG;
- timeBlt : LONG;
- timeSetDIBits : LONG;
- end;
- function DrawDibTime(hdd: HDRAWDIB; lpddtime: PDRAWDIBTIME): BOOL; stdcall;
- procedure StretchDIB(
- biDst : PBITMAPINFOHEADER;
- lpvDst : PVOID;
- DstX : Integer;
- DstY : Integer;
- DstXE : Integer;
- DstYE : Integer;
- biSrc : PBITMAPINFOHEADER;
- lpvSrc : PVOID;
- SrcX : Integer;
- SrcY : Integer;
- SrcXE : Integer;
- SrcYE : Integer
- ); 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;
- (****************************************************************************
- *
- * AVIFMT - AVI file format definitions
- *
- ****************************************************************************)
- //
- // The following is a short description of the AVI file format. Please
- // see the accompanying documentation for a full explanation.
- //
- // An AVI file is the following RIFF form:
- //
- // RIFF('AVI'
- // LIST('hdrl'
- // avih(<MainAVIHeader>)
- // LIST ('strl'
- // strh(<Stream header>)
- // strf(<Stream format>)
- // ... additional header data
- // LIST('movi'
- // { LIST('rec'
- // SubChunk...
- // )
- // | SubChunk } ....
- // )
- // [ <AVIIndex> ]
- // )
- //
- // The main file header specifies how many streams are present. For
- // each one, there must be a stream header chunk and a stream format
- // chunk, enlosed in a 'strl' LIST chunk. The 'strf' chunk contains
- // type-specific format information; for a video stream, this should
- // be a BITMAPINFO structure, including palette. For an audio stream,
- // this should be a WAVEFORMAT (or PCMWAVEFORMAT) structure.
- //
- // The actual data is contained in subchunks within the 'movi' LIST
- // chunk. The first two characters of each data chunk are the
- // stream number with which that data is associated.
- //
- // Some defined chunk types:
- // Video Streams:
- // ##db: RGB DIB bits
- // ##dc: RLE8 compressed DIB bits
- // ##pc: Palette Change
- //
- // Audio Streams:
- // ##wb: waveform audio bytes
- //
- // The grouping into LIST 'rec' chunks implies only that the contents of
- // the chunk should be read into memory at the same time. This
- // grouping is used for files specifically intended to be played from
- // CD-ROM.
- //
- // The index chunk at the end of the file should contain one entry for
- // each data chunk in the file.
- //
- // Limitations for the current software:
- // Only one video stream and one audio stream are allowed.
- // The streams must start at the beginning of the file.
- //
- //
- // To register codec types please obtain a copy of the Multimedia
- // Developer Registration Kit from:
- //
- // Microsoft Corporation
- // Multimedia Systems Group
- // Product Marketing
- // One Microsoft Way
- // Redmond, WA 98052-6399
- //
- {-- form types, list types and chunk types -----------------------------------}
- const
- formtypeAVI = $20495641; // mmioFOURCC('A', 'V', 'I', ' ')
- listtypeAVIHEADER = $6C726468; // mmioFOURCC('h', 'd', 'r', 'l')
- ckidAVIMAINHDR = $68697661; // mmioFOURCC('a', 'v', 'i', 'h')
- listtypeSTREAMHEADER = $6C727473; // mmioFOURCC('s', 't', 'r', 'l')
- ckidSTREAMHEADER = $68727473; // mmioFOURCC('s', 't', 'r', 'h')
- ckidSTREAMFORMAT = $66727473; // mmioFOURCC('s', 't', 'r', 'f')
- ckidSTREAMHANDLERDATA = $64727473; // mmioFOURCC('s', 't', 'r', 'd')
- ckidSTREAMNAME = $6E727473; // mmioFOURCC('s', 't', 'r', 'n')
- listtypeAVIMOVIE = $69766F6D; // mmioFOURCC('m', 'o', 'v', 'i')
- listtypeAVIRECORD = $20636572; // mmioFOURCC('r', 'e', 'c', ' ')
- ckidAVINEWINDEX = $31786469; // mmioFOURCC('i', 'd', 'x', '1')
- {-- Stream types for the <fccType> field of the stream header ----------------}
- streamtypeVIDEO = $73646976; // mmioFOURCC('v', 'i', 'd', 's')
- streamtypeAUDIO = $73647561; // mmioFOURCC('a', 'u', 'd', 's')
- streamtypeMIDI = $7364696D; // mmioFOURCC('m', 'i', 'd', 's')
- streamtypeTEXT = $73747874; // mmioFOURCC('t', 'x', 't', 's')
- {-- Basic chunk types --------------------------------------------------------}
- cktypeDIBbits = $6264; // aviTWOCC('d', 'b')
- cktypeDIBcompressed = $6364; // aviTWOCC('d', 'c')
- cktypePALchange = $6370; // aviTWOCC('p', 'c')
- cktypeWAVEbytes = $6277; // aviTWOCC('w', 'b')
- {-- Chunk id to use for extra chunks for padding -----------------------------}
- ckidAVIPADDING = $4B4E554A; // mmioFOURCC('J', 'U', 'N', 'K')
- (*
- ** Useful macros
- **
- ** Warning: These are nasty macro, and MS C 6.0 compiles some of them
- ** incorrectly if optimizations are on. Ack.
- *)
- {-- Macro to get stream number out of a FOURCC ckid --------------------------}
- function FromHex(n: BYTE): BYTE;
- function StreamFromFOURCC(fcc: DWORD): BYTE;
- {-- Macro to get TWOCC chunk type out of a FOURCC ckid -----------------------}
- function TWOCCFromFOURCC(fcc: DWORD): WORD;
- {-- Macro to make a ckid for a chunk out of a TWOCC and a stream num (0-255) -}
- function ToHex(n: BYTE): BYTE;
- function MAKEAVICKID(tcc: WORD; stream: BYTE): DWORD;
- {-- Main AVI file header -----------------------------------------------------}
- {-- flags for use in <dwFlags> in AVIFileHdr ---------------------------------}
- const
- AVIF_HASINDEX = $00000010; // Index at end of file?
- AVIF_MUSTUSEINDEX = $00000020;
- AVIF_ISINTERLEAVED = $00000100;
- AVIF_TRUSTCKTYPE = $00000800; // Use CKType to find key frames?
- AVIF_WASCAPTUREFILE = $00010000;
- AVIF_COPYRIGHTED = $00020000;
- {-- The AVI File Header LIST chunk should be padded to this size -------------}
- const
- AVI_HEADERSIZE = 2048; // size of AVI header list
- type
- PMainAVIHeader = ^TMainAVIHeader;
- TMainAVIHeader = packed record
- dwMicroSecPerFrame : DWORD; // frame display rate (or 0L)
- dwMaxBytesPerSec : DWORD; // max. transfer rate
- dwPaddingGranularity : DWORD; // pad to multiples of this
- // size; normally 2K.
- dwFlags : DWORD; // the ever-present flags
- dwTotalFrames : DWORD; // # frames in file
- dwInitialFrames : DWORD;
- dwStreams : DWORD;
- dwSuggestedBufferSize : DWORD;
- dwWidth : DWORD;
- dwHeight : DWORD;
- dwReserved : array[0..3] of DWORD;
- end;
- {-- Stream header ------------------------------------------------------------}
- const
- AVISF_DISABLED = $00000001;
- AVISF_VIDEO_PALCHANGES = $00010000;
- type
- PAVIStreamHeader = ^TAVIStreamHeader;
- TAVIStreamHeader = packed record
- fccType : FOURCC;
- fccHandler : FOURCC;
- dwFlags : DWORD; // Contains AVITF_* flags
- wPriority : WORD;
- wLanguage : WORD;
- dwInitialFrames : DWORD;
- dwScale : DWORD;
- dwRate : DWORD; // dwRate / dwScale == samples/second
- dwStart : DWORD;
- dwLength : DWORD; // In units above...
- dwSuggestedBufferSize : DWORD;
- dwQuality : DWORD;
- dwSampleSize : DWORD;
- rcFrame : TRECT;
- end;
- {-- Flags for index ----------------------------------------------------------}
- const
- AVIIF_NOTIME = $00000100; // this frame doesn't take any time
- AVIIF_COMPUSE = $0FFF0000; // these bits are for compressor use
- type
- PAVIINDEXENTRY = ^TAVIINDEXENTRY;
- TAVIINDEXENTRY = packed record
- ckid : DWORD;
- dwFlags : DWORD;
- dwChunkOffset : DWORD; // Position of chunk
- dwChunkLength : DWORD; // Length of chunk
- end;
- {-- Palette change chunk (used in video streams) -----------------------------}
- PAVIPALCHANGE = ^TAVIPALCHANGE;
- TAVIPALCHANGE = packed record
- bFirstEntry : BYTE; // first entry to change
- bNumEntries : BYTE; // # entries to change (0 if 256)
- wFlags : WORD; // Mostly to preserve alignment...
- peNew : array[0..0] of TPALETTEENTRY; // New color specifications
- end;
- (****************************************************************************
- *
- * AVIFile - routines for reading/writing standard AVI files
- *
- ***************************************************************************)
- //
- // Ansi - Unicode thunking.
- //
- // Unicode or Ansi-only apps can call the avifile APIs.
- // any Win32 app who wants to use
- // any of the AVI COM interfaces must be UNICODE - the AVISTREAMINFO and
- // AVIFILEINFO structures used in the Info methods of these interfaces are
- // the unicode variants, and no thunking to or from ansi takes place
- // except in the AVIFILE api entrypoints.
- //
- // For Ansi/Unicode thunking: for each entrypoint or structure that
- // uses chars or strings, two versions are declared in the Win32 version,
- // ApiNameW and ApiNameA. The default name ApiName is #defined to one or
- // other of these depending on whether UNICODE is defined (during
- // compilation of the app that is including this header). The source will
- // contain ApiName and ApiNameA (with ApiName being the Win16 implementation,
- // and also #defined to ApiNameW, and ApiNameA being the thunk entrypoint).
- //
- // For GetFrame::SetFormat - use the best format for the display
- const
- AVIGETFRAMEF_BESTDISPLAYFMT = 1;
- //
- // Structures used by AVIStreamInfo & AVIFileInfo.
- //
- // These are related to, but not identical to, the header chunks
- // in an AVI file.
- //
- {-- AVISTREAMINFO ------------------------------------------------------------}
- // for Unicode/Ansi thunking we need to declare three versions of this!
- type
- PAVIStreamInfoW = ^TAVIStreamInfoW;
- TAVIStreamInfoW = packed record
- fccType : DWORD;
- fccHandler : DWORD;
- dwFlags : DWORD; // Contains AVITF_* flags
- dwCaps : DWORD;
- wPriority : WORD;
- wLanguage : WORD;
- dwScale : DWORD;
- dwRate : DWORD; // dwRate / dwScale == samples/second
- dwStart : DWORD;
- dwLength : DWORD; // In units above...
- dwInitialFrames : DWORD;
- dwSuggestedBufferSize : DWORD;
- dwQuality : DWORD;
- dwSampleSize : DWORD;
- rcFrame : TRECT;
- dwEditCount : DWORD;
- dwFormatChangeCount : DWORD;
- szName : array[0..63] of WideChar;
- end;
- PAVIStreamInfoA = ^TAVIStreamInfoA;
- TAVIStreamInfoA = packed record
- fccType : DWORD;
- fccHandler : DWORD;
- dwFlags : DWORD; // Contains AVITF_* flags
- dwCaps : DWORD;
- wPriority : WORD;
- wLanguage : WORD;
- dwScale : DWORD;
- dwRate : DWORD; // dwRate / dwScale == samples/second
- dwStart : DWORD;
- dwLength : DWORD; // In units above...
- dwInitialFrames : DWORD;
- dwSuggestedBufferSize : DWORD;
- dwQuality : DWORD;
- dwSampleSize : DWORD;
- rcFrame : TRECT;
- dwEditCount : DWORD;
- dwFormatChangeCount : DWORD;
- szName : array[0..63] of AnsiChar;
- end;
- PAVIStreamInfo = ^TAVIStreamInfo;
- {$IFDEF UNICODE}
- TAVIStreamInfo = TAVIStreamInfoW;
- {$ELSE}
- TAVIStreamInfo = TAVIStreamInfoA;
- {$ENDIF}
- const
- AVISTREAMINFO_DISABLED = $00000001;
- AVISTREAMINFO_FORMATCHANGES = $00010000;
- {-- AVIFILEINFO --------------------------------------------------------------}
- type
- PAVIFileInfoW = ^TAVIFileInfoW;
- TAVIFileInfoW = packed record
- dwMaxBytesPerSec : DWORD; // max. transfer rate
- dwFlags : DWORD; // the ever-present flags
- dwCaps : DWORD;
- dwStreams : DWORD;
- dwSuggestedBufferSize : DWORD;
- dwWidth : DWORD;
- dwHeight : DWORD;
- dwScale : DWORD;
- dwRate : DWORD; // dwRate / dwScale == samples/second
- dwLength : DWORD;
- dwEditCount : DWORD;
- szFileType : array[0..63] of WideChar;
- // descriptive string for file type?
- end;
- PAVIFileInfoA = ^TAVIFileInfoA;
- TAVIFileInfoA = packed record
- dwMaxBytesPerSec : DWORD; // max. transfer rate
- dwFlags : DWORD; // the ever-present flags
- dwCaps : DWORD;
- dwStreams : DWORD;
- dwSuggestedBufferSize : DWORD;
- dwWidth : DWORD;
- dwHeight : DWORD;
- dwScale : DWORD;
- dwRate : DWORD; // dwRate / dwScale == samples/second
- dwLength : DWORD;
- dwEditCount : DWORD;
- szFileType : array[0..63] of AnsiChar;
- // descriptive string for file type?
- end;
- PAVIFileInfo = ^TAVIFileInfo;
- {$IFDEF UNICODE}
- TAVIFileInfo = TAVIFileInfoW;
- {$ELSE}
- TAVIFileInfo = TAVIFileInfoA;
- {$ENDIF}
- {-- Flags for dwFlags --------------------------------------------------------}
- const
- AVIFILEINFO_HASINDEX = $00000010;
- AVIFILEINFO_MUSTUSEINDEX = $00000020;
- AVIFILEINFO_ISINTERLEAVED = $00000100;
- AVIFILEINFO_WASCAPTUREFILE = $00010000;
- AVIFILEINFO_COPYRIGHTED = $00020000;
- {-- Flags for dwCaps ---------------------------------------------------------}
- AVIFILECAPS_CANREAD = $00000001;
- AVIFILECAPS_CANWRITE = $00000002;
- AVIFILECAPS_ALLKEYFRAMES = $00000010;
- AVIFILECAPS_NOCOMPRESSION = $00000020;
- type
- TAVISAVECALLBACK = function(i: int): BOOL; pascal;
- {-- AVICOMPRESSOPTIONS -------------------------------------------------------}
- // Make sure it matches the AutoDoc in avisave.c !!!
- type
- PAVICOMPRESSOPTIONS = ^TAVICOMPRESSOPTIONS;
- TAVICOMPRESSOPTIONS = packed record
- fccType : DWORD; // stream type, for consistency
- fccHandler : DWORD; // compressor
- dwKeyFrameEvery : DWORD; // keyframe rate
- dwQuality : DWORD; // compress quality 0-10,000
- dwBytesPerSecond : DWORD; // bytes per second
- dwFlags : DWORD; // flags... see below
- lpFormat : PVOID; // save format
- cbFormat : DWORD;
- lpParms : PVOID; // compressor options
- cbParms : DWORD;
- dwInterleaveEvery : DWORD; // for non-video streams only
- end;
- //
- // Defines for the dwFlags field of the AVICOMPRESSOPTIONS struct
- // Each of these flags determines if the appropriate field in the structure
- // (dwInterleaveEvery, dwBytesPerSecond, and dwKeyFrameEvery) is payed
- // attention to. See the autodoc in avisave.c for details.
- //
- const
- AVICOMPRESSF_INTERLEAVE = $00000001; // interleave
- AVICOMPRESSF_DATARATE = $00000002; // use a data rate
- AVICOMPRESSF_KEYFRAMES = $00000004; // use keyframes
- AVICOMPRESSF_VALID = $00000008; // has valid data?
- (* - - - - - - - - */
- /****** AVI Stream Interface *******************************************)
- type
- IAVIStream = interface(IUnknown)
- function Create(lParam1, lParam2: LPARAM): HResult; stdcall;
- function Info(var psi: TAVIStreamInfoW; lSize: LONG): HResult; stdcall;
- function FindSample(lPos: LONG; lFlags: LONG): LONG; stdcall;
- function ReadFormat(lPos: LONG; lpFormat: PVOID; var lpcbFormat: LONG): HResult; stdcall;
- function SetFormat(lPos: LONG; lpFormat: PVOID; cbFormat: LONG): HResult; stdcall;
- function Read(lStart: LONG; lSamples: LONG; lpBuffer: PVOID; cbBuffer: LONG; var plBytes, plSamples: LONG): HResult; stdcall;
- function Write(lStart: LONG; lSamples: LONG; lpBuffer: PVOID; cbBuffer: LONG; dwFlags: DWORD; var plSampWritten, plBytesWritten: LONG): HResult; stdcall;
- function Delete(lStart: LONG; lSamples: LONG): HResult; stdcall;
- function ReadData(fcc: DWORD; lp: PVOID; var lpcb: LONG): HResult; stdcall;
- function WriteData(fcc: DWORD; lp: PVOID; cb: LONG): HResult; stdcall;
- function SetInfo(var lpInfo: TAVIStreamInfoW; cbInfo: LONG): HResult; stdcall;
- end;
- IAVIStreaming = interface(IUnknown)
- function _Begin(lStart, lEnd : LONG; lRate : LONG): HResult; stdcall;
- function _End: HResult; stdcall;
- end;
- IAVIEditStream = interface(IUnknown)
- function Cut(var plStart, plLength: LONG; var ppResult: IAVIStream): HResult; stdcall;
- function Copy(var plStart, plLength: LONG; var ppResult: IAVIStream): HResult; stdcall;
- function Paste(var plPos: LONG; var plLength: LONG; pstream: IAVIStream; lStart, lEnd: LONG): HResult; stdcall;
- function Clone(var ppResult: IAVIStream): HResult; stdcall;
- function SetInfo(var lpInfo: TAVIStreamInfoW; cbInfo: LONG): HResult; stdcall;
- end;
- {-- AVIFile ------------------------------------------------------------------}
- IAVIFile = interface(IUnknown)
- function Info(var pfi: TAVIFileInfoW; iSize: LONG): HResult; stdcall;
- function GetStream(var ppStream: IAVISTREAM; fccType: DWORD; lParam: LONG): HResult; stdcall;
- function CreateStream(var ppStream: IAVISTREAM; var psi: TAVIStreamInfoW): HResult; stdcall;
- function WriteData(ckid: DWORD; lpData: PVOID; cbData: LONG): HResult; stdcall;
- function ReadData(ckid: DWORD; lpData: PVOID; lpcbData: PLONG): HResult; stdcall;
- function EndRecord: HResult; stdcall;
- function DeleteStream(fccType: DWORD; lParam: LONG): HResult; stdcall;
- end;
- {-- GetFrame -----------------------------------------------------------------}
- // The functions 'BeginExtraction' and 'EndExtraction' have actually
- // the names 'Begin' and 'End', but we cannot use that identifiers for
- // obvious reasons.
- IGetFrame = interface(IUnknown)
- function GetFrame(lPos: LONG): PBitmapInfoHeader; stdcall;
- function BeginExtraction(lStart, lEnd, lRate: LONG): HResult; stdcall;
- function EndExtraction: HResult; stdcall;
- function SetFormat(var lpbi: TBitmapInfoHeader; lpBits: Pointer; x, y, dx, dy: Integer): HResult; stdcall;
- end;
- {-- GUIDs --------------------------------------------------------------------}
- const
- IID_IAVIFile : TGUID = (D1: $00020020; D2: $0; D3: $0; D4:($C0,$0,$0,$0,$0,$0,$0,$46));
- IID_IAVIStream : TGUID = (D1: $00020021; D2: $0; D3: $0; D4:($C0,$0,$0,$0,$0,$0,$0,$46));
- IID_IAVIStreaming : TGUID = (D1: $00020022; D2: $0; D3: $0; D4:($C0,$0,$0,$0,$0,$0,$0,$46));
- IID_IGetFrame : TGUID = (D1: $00020023; D2: $0; D3: $0; D4:($C0,$0,$0,$0,$0,$0,$0,$46));
- IID_IAVIEditStream: TGUID = (D1: $00020024; D2: $0; D3: $0; D4:($C0,$0,$0,$0,$0,$0,$0,$46));
- CLSID_AVISimpleUnMarshal : TGUID = (D1: $00020009; D2: $0; D3: $0; D4:($C0,$0,$0,$0,$0,$0,$0,$46));
- CLSID_AVIFile : TGUID = (D1: $00020000; D2: $0; D3: $0; D4:($C0,$0,$0,$0,$0,$0,$0,$46));
- AVIFILEHANDLER_CANREAD = $0001;
- AVIFILEHANDLER_CANWRITE = $0002;
- AVIFILEHANDLER_CANACCEPTNONRGB = $0004;
- {-- Functions ----------------------------------------------------------------}
- procedure AVIFileInit; stdcall; // Call this first!
- procedure AVIFileExit; stdcall;
- function AVIFileAddRef(pfile: IAVIFile): ULONG; stdcall;
- function AVIFileRelease(pfile: IAVIFile): ULONG; stdcall;
- function AVIFileOpenA(var ppfile: IAVIFile; szFile: LPCSTR; uMode: UINT; lpHandler: PCLSID): HResult; stdcall;
- function AVIFileOpenW(var ppfile: IAVIFile; szFile: LPCWSTR; uMode: UINT; lpHandler: PCLSID): HResult; stdcall;
- {$IFDEF UNICODE}
- function AVIFileOpen(var ppfile: IAVIFile; szFile: LPCWSTR; uMode: UINT; lpHandler: PCLSID): HResult; stdcall;
- {$ELSE}
- function AVIFileOpen(var ppfile: IAVIFile; szFile: LPCSTR; uMode: UINT; lpHandler: PCLSID): HResult; stdcall;
- {$ENDIF}
- function AVIFileInfoW(pfile: IAVIFile; var pfi: TAVIFILEINFOW; lSize: LONG): HResult; stdcall;
- function AVIFileInfoA(pfile: IAVIFile; var pfi: TAVIFILEINFOA; lSize: LONG): HResult; stdcall;
- function AVIFileInfo(pfile: IAVIFile; var pfi: TAVIFILEINFO; lSize: LONG): HResult; stdcall;
- function AVIFileGetStream(pfile: IAVIFile; var ppavi: IAVISTREAM; fccType: DWORD; lParam: LONG): HResult; stdcall;
- function AVIFileCreateStreamW(pfile: IAVIFile; var ppavi: IAVISTREAM; var psi: TAVISTREAMINFOW): HResult; stdcall;
- function AVIFileCreateStreamA(pfile: IAVIFile; var ppavi: IAVISTREAM; var psi: TAVISTREAMINFOA): HResult; stdcall;
- function AVIFileCreateStream(pfile: IAVIFile; var ppavi: IAVISTREAM; var psi: TAVISTREAMINFO): HResult; stdcall;
- function AVIFileWriteData(pfile: IAVIFile; ckid: DWORD; lpData: PVOID; cbData: LONG): HResult; stdcall;
- function AVIFileReadData(pfile: IAVIFile; ckid: DWORD; lpData: PVOID; var lpcbData: LONG): HResult; stdcall;
- function AVIFileEndRecord(pfile: IAVIFile): HResult; stdcall;
- function AVIStreamAddRef(pavi: IAVIStream): ULONG; stdcall;
- function AVIStreamRelease(pavi: IAVIStream): ULONG; stdcall;
- function AVIStreamInfoW (pavi: IAVIStream; var psi: TAVISTREAMINFOW; lSize: LONG): HResult; stdcall;
- function AVIStreamInfoA (pavi: IAVIStream; var psi: TAVISTREAMINFOA; lSize: LONG): HResult; stdcall;
- function AVIStreamInfo(pavi: IAVIStream; var psi: TAVISTREAMINFO; lSize: LONG): HResult; stdcall;
- function AVIStreamFindSample(pavi: IAVIStream; lPos: LONG; lFlags: LONG): LONG; stdcall;
- function AVIStreamReadFormat(pavi: IAVIStream; lPos: LONG; lpFormat: PVOID; lpcbFormat: PLONG): HResult; stdcall;
- function AVIStreamSetFormat(pavi: IAVIStream; lPos: LONG; lpFormat: PVOID; cbFormat: LONG): HResult; stdcall;
- function AVIStreamReadData(pavi: IAVIStream; fcc: DWORD; lp: PVOID; lpcb: PLONG): HResult; stdcall;
- function AVIStreamWriteData(pavi: IAVIStream; fcc: DWORD; lp: PVOID; cb: LONG): HResult; stdcall;
- function AVIStreamRead(
- pavi : IAVISTREAM;
- lStart : LONG;
- lSamples : LONG;
- lpBuffer : PVOID;
- cbBuffer : LONG;
- plBytes : PLONG;
- plSamples : PLONG
- ): HResult; stdcall;
- const
- AVISTREAMREAD_CONVENIENT = -1;
- function AVIStreamWrite(
- pavi : IAVISTREAM;
- lStart : LONG;
- lSamples : LONG;
- lpBuffer : PVOID;
- cbBuffer : LONG;
- dwFlags : DWORD;
- plSampWritten : PLONG;
- plBytesWritten : PLONG
- ): HResult; stdcall;
- // Right now, these just use AVIStreamInfo() to get information, then
- // return some of it. Can they be more efficient?
- function AVIStreamStart(pavi: IAVIStream): LONG; stdcall;
- function AVIStreamLength(pavi: IAVIStream): LONG; stdcall;
- function AVIStreamTimeToSample(pavi: IAVIStream; lTime: LONG): LONG; stdcall;
- function AVIStreamSampleToTime(pavi: IAVIStream; lSample: LONG): LONG; stdcall;
- function AVIStreamBeginStreaming(pavi: IAVIStream; lStart, lEnd: LONG; lRate: LONG): HResult; stdcall;
- function AVIStreamEndStreaming(pavi: IAVIStream): HResult; stdcall;
- {-- Helper functions for using IGetFrame -------------------------------------}
- function AVIStreamGetFrameOpen(pavi: IAVIStream; lpbiWanted: PBitmapInfoHeader): IGetFrame; stdcall;
- function AVIStreamGetFrame(pg: IGetFrame; lPos: LONG): PBitmapInfoHeader; stdcall;
- function AVIStreamGetFrameClose(pg: IGetFrame): HResult; stdcall;
- // !!! We need some way to place an advise on a stream....
- // STDAPI AVIStreamHasChanged (PAVISTREAM pavi);
- {-- Shortcut function --------------------------------------------------------}
- function AVIStreamOpenFromFileA(var ppavi: IAVISTREAM; szFile: LPCSTR; fccType: DWORD;
- lParam: LONG; mode: UINT; pclsidHandler: PCLSID): HResult; stdcall;
- function AVIStreamOpenFromFileW(var ppavi: IAVISTREAM; szFile: LPCWSTR; fccType: DWORD;
- lParam: LONG; mode: UINT; pclsidHandler: PCLSID): HResult; stdcall;
- {$IFDEF UNICODE}
- function AVIStreamOpenFromFile(var ppavi: IAVISTREAM; szFile: LPCWSTR; fccType: DWORD;
- lParam: LONG; mode: UINT; pclsidHandler: PCLSID): HResult; stdcall;
- {$ELSE}
- function AVIStreamOpenFromFile(var ppavi: IAVISTREAM; szFile: LPCSTR; fccType: DWORD;
- lParam: LONG; mode: UINT; pclsidHandler: PCLSID): HResult; stdcall;
- {$ENDIF}
- {-- Use to create disembodied streams ----------------------------------------}
- function AVIStreamCreate(var ppavi: IAVISTREAM; lParam1, lParam2: LONG; pclsidHandler: PCLSID): HResult; stdcall;
- // PHANDLER AVIAPI AVIGetHandler (PAVISTREAM pavi, PAVISTREAMHANDLER psh);
- // PAVISTREAM AVIAPI AVIGetStream (PHANDLER p);
- {-- Flags for AVIStreamFindSample --------------------------------------------}
- const
- FIND_DIR = $0000000F; // direction
- FIND_NEXT = $00000001; // go forward
- FIND_PREV = $00000004; // go backward
- FIND_FROM_START = $00000008; // start at the logical beginning
- FIND_TYPE = $000000F0; // type mask
- FIND_KEY = $00000010; // find key frame.
- FIND_ANY = $00000020; // find any (non-empty) sample
- FIND_FORMAT = $00000040; // find format change
- FIND_RET = $0000F000; // return mask
- FIND_POS = $00000000; // return logical position
- FIND_LENGTH = $00001000; // return logical size
- FIND_OFFSET = $00002000; // return physical position
- FIND_SIZE = $00003000; // return physical size
- FIND_INDEX = $00004000; // return physical index position
- {-- Stuff to support backward compat. ----------------------------------------}
- function AVIStreamFindKeyFrame(var pavi: IAVISTREAM; lPos: LONG; lFlags: LONG): DWORD; stdcall; // AVIStreamFindSample
- // Non-portable: this is alias for method name
- // FindKeyFrame FindSample
- function AVIStreamClose(pavi: IAVISTREAM): ULONG; stdcall; // AVIStreamRelease
- function AVIFileClose(pfile: IAVIFILE): ULONG; stdcall; // AVIFileRelease
- procedure AVIStreamInit; stdcall; // AVIFileInit
- procedure AVIStreamExit; stdcall; // AVIFileExit
- const
- SEARCH_NEAREST = FIND_PREV;
- SEARCH_BACKWARD = FIND_PREV;
- SEARCH_FORWARD = FIND_NEXT;
- SEARCH_KEY = FIND_KEY;
- SEARCH_ANY = FIND_ANY;
- {-- Helper macros ------------------------------------------------------------}
- function AVIStreamSampleToSample(pavi1, pavi2: IAVISTREAM; l: LONG): LONG;
- function AVIStreamNextSample(pavi: IAVISTREAM; l: LONG): LONG;
- function AVIStreamPrevSample(pavi: IAVISTREAM; l: LONG): LONG;
- function AVIStreamNearestSample(pavi: IAVISTREAM; l: LONG): LONG;
- function AVIStreamNextKeyFrame(pavi: IAVISTREAM; l: LONG): LONG;
- function AVIStreamPrevKeyFrame(pavi: IAVISTREAM; l: LONG): LONG;
- function AVIStreamNearestKeyFrame(pavi: IAVISTREAM; l: LONG): LONG;
- function AVIStreamIsKeyFrame(pavi: IAVISTREAM; l: LONG): BOOL;
- function AVIStreamPrevSampleTime(pavi: IAVISTREAM; t: LONG): LONG;
- function AVIStreamNextSampleTime(pavi: IAVISTREAM; t: LONG): LONG;
- function AVIStreamNearestSampleTime(pavi: IAVISTREAM; t: LONG): LONG;
- function AVIStreamNextKeyFrameTime(pavi: IAVISTREAM; t: LONG): LONG;
- function AVIStreamPrevKeyFrameTime(pavi: IAVISTREAM; t: LONG): LONG;
- function AVIStreamNearestKeyFrameTime(pavi: IAVISTREAM; t: LONG): LONG;
- function AVIStreamStartTime(pavi: IAVISTREAM): LONG;
- function AVIStreamLengthTime(pavi: IAVISTREAM): LONG;
- function AVIStreamEnd(pavi: IAVISTREAM): LONG;
- function AVIStreamEndTime(pavi: IAVISTREAM): LONG;
- function AVIStreamSampleSize(pavi: IAVISTREAM; lPos: LONG; plSize: PLONG): LONG;
- function AVIStreamFormatSize(pavi: IAVISTREAM; lPos: LONG; plSize: PLONG): HResult;
- function AVIStreamDataSize(pavi: IAVISTREAM; fcc: DWORD; plSize: PLONG): HResult;
- {== AVISave routines and structures ==========================================}
- const
- comptypeDIB = $20424944; // mmioFOURCC('D', 'I', 'B', ' ')
- function AVIMakeCompressedStream(
- var ppsCompressed : IAVISTREAM;
- ppsSource : IAVISTREAM;
- lpOptions : PAVICOMPRESSOPTIONS;
- pclsidHandler : PCLSID
- ): HResult; stdcall;
- // Non-portable: uses variable number of params
- // EXTERN_C HRESULT CDECL AVISaveA (LPCSTR szFile,
- // CLSID FAR *pclsidHandler,
- // AVISAVECALLBACK lpfnCallback,
- // int nStreams,
- // PAVISTREAM pfile,
- // LPAVICOMPRESSOPTIONS lpOptions,
- // ...);
- function AVISaveVA(
- szFile : LPCSTR;
- pclsidHandler : PCLSID;
- lpfnCallback : TAVISAVECALLBACK;
- nStreams : int;
- var ppavi : IAVISTREAM;
- var plpOptions : PAVICOMPRESSOPTIONS
- ): HResult; stdcall;
- // Non-portable: uses variable number of params
- // EXTERN_C HRESULT CDECL AVISaveW (LPCWSTR szFile,
- // CLSID FAR *pclsidHandler,
- // AVISAVECALLBACK lpfnCallback,
- // int nStreams,
- // PAVISTREAM pfile,
- // LPAVICOMPRESSOPTIONS lpOptions,
- // ...);
- function AVISaveVW(
- szFile : LPCWSTR;
- pclsidHandler : PCLSID;
- lpfnCallback : TAVISAVECALLBACK;
- nStreams : int;
- var ppavi : IAVISTREAM;
- var plpOptions : PAVICOMPRESSOPTIONS
- ): HResult; stdcall;
- // #define AVISave AVISaveA
- function AVISaveV(
- szFile : LPCSTR;
- pclsidHandler : PCLSID;
- lpfnCallback : TAVISAVECALLBACK;
- nStreams : int;
- var ppavi : IAVISTREAM;
- var plpOptions : PAVICOMPRESSOPTIONS
- ): HResult; stdcall; // AVISaveVA
- function AVISaveOptions(
- hwnd : HWND;
- uiFlags : UINT;
- nStreams : int;
- var ppavi : IAVISTREAM;
- var plpOptions : PAVICOMPRESSOPTIONS
- ): BOOL; stdcall;
- function AVISaveOptionsFree(nStreams: int; var plpOptions: PAVICOMPRESSOPTIONS): HResult; stdcall;
- {-- FLAGS FOR uiFlags --------------------------------------------------------}
- // Same as the flags for ICCompressorChoose (see compman.h)
- // These determine what the compression options dialog for video streams
- // will look like.
- function AVIBuildFilterW(lpszFilter: LPWSTR; cbFilter: LONG; fSaving: BOOL): HResult; stdcall;
- function AVIBuildFilterA(lpszFilter: LPSTR; cbFilter: LONG; fSaving: BOOL): HResult; stdcall;
- function AVIBuildFilter(lpszFilter: LPSTR; cbFilter: LONG; fSaving: BOOL): HResult; stdcall; // AVIBuildFilterA
- function AVIMakeFileFromStreams(var ppfile: IAVIFILE; nStreams: int; var papStreams: IAVISTREAM): HResult; stdcall;
- function AVIMakeStreamFromClipboard(cfFormat: UINT; hGlobal: THANDLE; var ppstream: IAVISTREAM): HResult; stdcall;
- {-- Clipboard routines -------------------------------------------------------}
- function AVIPutFileOnClipboard(pf: IAVIFILE): HResult; stdcall;
- function AVIGetFromClipboard(var lppf: IAVIFILE): HResult; stdcall;
- function AVIClearClipboard: HResult; stdcall;
- {-- Editing routines ---------------------------------------------------------}
- function CreateEditableStream(var ppsEditable: IAVISTREAM; psSource: IAVISTREAM): HResult; stdcall;
- function EditStreamCut(pavi: IAVISTREAM; var plStart, plLength: LONG; var ppResult: IAVISTREAM): HResult; stdcall;
- function EditStreamCopy(pavi: IAVISTREAM; var plStart, plLength: LONG; var ppResult: IAVISTREAM): HResult; stdcall;
- function EditStreamPaste(pavi: IAVISTREAM; var plPos, plLength: LONG; pstream: IAVISTREAM; lStart, lEnd: LONG): HResult; stdcall;
- function EditStreamClone(pavi: IAVISTREAM; var ppResult: IAVISTREAM): HResult; stdcall;
- function EditStreamSetNameA(pavi: IAVISTREAM; lpszName: LPCSTR): HResult; stdcall;
- function EditStreamSetNameW(pavi: IAVISTREAM; lpszName: LPCWSTR): HResult; stdcall;
- function EditStreamSetInfoW(pavi: IAVISTREAM; lpInfo: PAVISTREAMINFOW; cbInfo: LONG): HResult; stdcall;
- function EditStreamSetInfoA(pavi: IAVISTREAM; lpInfo: PAVISTREAMINFOA; cbInfo: LONG): HResult; stdcall;
- function EditStreamSetInfo(pavi: IAVISTREAM; lpInfo: PAVISTREAMINFOA; cbInfo: LONG): HResult; stdcall; // EditStreamSetInfoA
- function EditStreamSetName(pavi: IAVISTREAM; lpszName: LPCSTR): HResult; stdcall; // EditStreamSetNameA
- {-- Error handling -----------------------------------------------------------}
- const
- AVIERR_OK = 0;
- // !!! Questions to be answered:
- // How can you get a string form of these errors?
- // Which of these errors should be replaced by errors in SCODE.H?
- const
- AVIERR_UNSUPPORTED = $80044065; // MAKE_AVIERR(101)
- AVIERR_BADFORMAT = $80044066; // MAKE_AVIERR(102)
- AVIERR_MEMORY = $80044067; // MAKE_AVIERR(103)
- AVIERR_INTERNAL = $80044068; // MAKE_AVIERR(104)
- AVIERR_BADFLAGS = $80044069; // MAKE_AVIERR(105)
- AVIERR_BADPARAM = $8004406A; // MAKE_AVIERR(106)
- AVIERR_BADSIZE = $8004406B; // MAKE_AVIERR(107)
- AVIERR_BADHANDLE = $8004406C; // MAKE_AVIERR(108)
- AVIERR_FILEREAD = $8004406D; // MAKE_AVIERR(109)
- AVIERR_FILEWRITE = $8004406E; // MAKE_AVIERR(110)
- AVIERR_FILEOPEN = $8004406F; // MAKE_AVIERR(111)
- AVIERR_COMPRESSOR = $80044070; // MAKE_AVIERR(112)
- AVIERR_NOCOMPRESSOR = $80044071; // MAKE_AVIERR(113)
- AVIERR_READONLY = $80044072; // MAKE_AVIERR(114)
- AVIERR_NODATA = $80044073; // MAKE_AVIERR(115)
- AVIERR_BUFFERTOOSMALL = $80044074; // MAKE_AVIERR(116)
- AVIERR_CANTCOMPRESS = $80044075; // MAKE_AVIERR(117)
- AVIERR_USERABORT = $800440C6; // MAKE_AVIERR(198)
- AVIERR_ERROR = $800440C7; // MAKE_AVIERR(199)
- {== MCIWnd - Window class for MCI objects ====================================}
- //
- // MCIWnd
- //
- // MCIWnd window class header file.
- //
- // the MCIWnd window class is a window class for controling MCI devices
- // MCI devices include, wave files, midi files, AVI Video, cd audio,
- // vcr, video disc, and others..
- //
- // to learn more about MCI and mci command sets see the
- // "Microsoft Multimedia Programmers's guide" in the Win31 SDK
- //
- // the easiest use of the MCIWnd class is like so:
- //
- // hwnd = MCIWndCreate(hwndParent, hInstance, 0, "chimes.wav");
- // ...
- // MCIWndPlay(hwnd);
- // MCIWndStop(hwnd);
- // MCIWndPause(hwnd);
- // ....
- // MCIWndDestroy(hwnd);
- //
- // this will create a window with a play/pause, stop and a playbar
- // and start the wave file playing.
- //
- // mciwnd.h defines macros for all the most common MCI commands, but
- // any string command can be used if needed.
- //
- // Note: unlike the mciSendString() API, no alias or file name needs
- // to be specifed, since the device to use is implied by the window handle.
- //
- // MCIWndSendString(hwnd, "setaudio stream to 2");
- //
- // (C) Copyright Microsoft Corp. 1991-1995. All rights reserved.
- //
- // WIN32:
- //
- // MCIWnd supports both ansi and unicode interfaces. For any message that
- // takes or returns a text string, two versions of the message are defined,
- // appended with A or W for Ansi or Wide Char. The message or api itself
- // is defined to be one or other of these depending on whether you have
- // UNICODE defined in your application.
- // Thus for the api MCIWndCreate, there are in fact two apis,
- // MCIWndCreateA and MCIWndCreateW. If you call MCIWndCreate, this will be
- // re-routed to MCIWndCreateA unless UNICODE is defined when building your
- // application. In any one application, you can mix calls to the
- // Ansi and Unicode entrypoints.
- //
- // If you use SendMessage instead of the macros below such as MCIWndOpen(),
- // you will see that the messages have changed for WIN32, to support Ansi
- // and Unicode entrypoints. In particular, MCI_OPEN has been replaced by
- // MCWNDM_OPENA, or MCIWNDM_OPENW (MCIWNDM_OPEN is defined to be one or
- // other of these).
- //
- // Also, note that the WIN32 implementation of MCIWnd uses UNICODE
- // so all apis and messages supporting ANSI strings do so by mapping them
- // UNICODE strings and then calling the corresponding UNICODE entrypoint.
- //
- function MCIWndSM(hWnd: HWND; Msg: UINT; wParam: WPARAM; lParam: LPARAM): DWORD;
- const
- MCIWND_WINDOW_CLASS = 'MCIWndClass' ;
- function MCIWndCreateA(hwndParent: HWND; hInstance: HINST; dwStyle: DWORd; szFile: LPCSTR): HWND; cdecl;
- function MCIWndCreateW(hwndParent: HWND; hInstance: HINST; dwStyle: DWORd; szFile: LPCWSTR): HWND; cdecl;
- function MCIWndCreate(hwndParent: HWND; hInstance: HINST; dwStyle: DWORd; szFile: LPCSTR): HWND; cdecl; // MCIWndCreateA
- function MCIWndRegisterClass: BOOL; cdecl;
- {-- Flags for the MCIWndOpen command -----------------------------------------}
- const
- MCIWNDOPENF_NEW = $0001; // open a new file
- {-- Window styles ------------------------------------------------------------}
- MCIWNDF_NOAUTOSIZEWINDOW = $0001; // when movie size changes
- MCIWNDF_NOPLAYBAR = $0002; // no toolbar
- MCIWNDF_NOAUTOSIZEMOVIE = $0004; // when window size changes
- MCIWNDF_NOMENU = $0008; // no popup menu from RBUTTONDOWN
- MCIWNDF_SHOWNAME = $0010; // show name in caption
- MCIWNDF_SHOWPOS = $0020; // show position in caption
- MCIWNDF_SHOWMODE = $0040; // show mode in caption
- MCIWNDF_SHOWALL = $0070; // show all
- MCIWNDF_NOTIFYMODE = $0100; // tell parent of mode change
- MCIWNDF_NOTIFYPOS = $0200; // tell parent of pos change
- MCIWNDF_NOTIFYSIZE = $0400; // tell parent of size change
- MCIWNDF_NOTIFYERROR = $1000; // tell parent of an error
- MCIWNDF_NOTIFYALL = $1F00; // tell all
- MCIWNDF_NOTIFYANSI = $0080;
- // The MEDIA notification includes a text string.
- // To receive notifications in ANSI instead of unicode set the
- // MCIWNDF_NOTIFYANSI style bit. The macro below includes this bit
- // by default unless you define UNICODE in your application.
- MCIWNDF_NOTIFYMEDIAA = $0880; // tell parent of media change
- MCIWNDF_NOTIFYMEDIAW = $0800; // tell parent of media change
- MCIWNDF_NOTIFYMEDIA = MCIWNDF_NOTIFYMEDIAA;
- MCIWNDF_RECORD = $2000; // Give a record button
- MCIWNDF_NOERRORDLG = $4000; // Show Error Dlgs for MCI cmds?
- MCIWNDF_NOOPEN = $8000; // Don't allow user to open things
- {-- Can macros ---------------------------------------------------------------}
- function MCIWndCanPlay(hwnd: HWND): BOOL;
- function MCIWndCanRecord(hwnd: HWND): BOOL;
- function MCIWndCanSave(hwnd: HWND): BOOL;
- function MCIWndCanWindow(hwnd: HWND): BOOL;
- function MCIWndCanEject(hwnd: HWND): BOOL;
- function MCIWndCanConfig(hwnd: HWND): BOOL;
- function MCIWndPaletteKick(hwnd: HWND): BOOL;
- function MCIWndSave(hwnd: HWND; szFile: LPCSTR): DWORD;
- function MCIWndSaveDialog(hwnd: HWND): DWORD;
- // If you dont give a device it will use the current device....
- function MCIWndNew(hwnd: HWND; lp: PVOID): DWORD;
- function MCIWndRecord(hwnd: HWND): DWORD;
- function MCIWndOpen(hwnd: HWND; sz: LPCSTR; f: BOOL): DWORD;
- function MCIWndOpenDialog(hwnd: HWND): DWORD;
- function MCIWndClose(hwnd: HWND): DWORD;
- function MCIWndPlay(hwnd: HWND): DWORD;
- function MCIWndStop(hwnd: HWND): DWORD;
- function MCIWndPause(hwnd: HWND): DWORD;
- function MCIWndResume(hwnd: HWND): DWORD;
- function MCIWndSeek(hwnd: HWND; lPos: DWORD): DWORD;
- function MCIWndEject(hwnd: HWND): DWORD;
- function MCIWndHome(hwnd: HWND): DWORD;
- function MCIWndEnd(hwnd: HWND): DWORD;
- function MCIWndGetSource(hwnd: HWND; prc: PRECT): DWORD;
- function MCIWndPutSource(hwnd: HWND; prc: PRECT): DWORD;
- function MCIWndGetDest(hwnd: HWND; prc: PRECT): DWORD;
- function MCIWndPutDest(hwnd: HWND; prc: PRECT): DWORD;
- function MCIWndPlayReverse(hwnd: HWND): DWORD;
- function MCIWndPlayFrom(hwnd: HWND; lPos: DWORD): DWORD;
- function MCIWndPlayTo(hwnd: HWND; lPos: DWORD): DWORD;
- function MCIWndPlayFromTo(hwnd: HWND; lStart, lEnd: DWORD): DWORD;
- function MCIWndGetDeviceID(hwnd: HWND): UINT;
- function MCIWndGetAlias(hwnd: HWND): UINT;
- function MCIWndGetMode(hwnd: HWND; lp: LPSTR; len: UINT): DWORD;
- function MCIWndGetPosition(hwnd: HWND): DWORD;
- function MCIWndGetPositionString(hwnd: HWND; lp: LPSTR; len: UINT): DWORD;
- function MCIWndGetStart(hwnd: HWND): DWORD;
- function MCIWndGetLength(hwnd: HWND): DWORD;
- function MCIWndGetEnd(hwnd: HWND): DWORD;
- function MCIWndStep(hwnd: HWND; n: DWORD): DWORD;
- procedure MCIWndDestroy(hwnd: HWND);
- procedure MCIWndSetZoom(hwnd: HWND; iZoom: UINT);
- function MCIWndGetZoom(hwnd: HWND): UINT;
- function MCIWndSetVolume(hwnd: HWND; iVol: UINT): DWORD;
- function MCIWndGetVolume(hwnd: HWND): DWORD;
- function MCIWndSetSpeed(hwnd: HWND; iSpeed: UINT): DWORD;
- function MCIWndGetSpeed(hwnd: HWND): DWORD;
- function MCIWndSetTimeFormat(hwnd: HWND; lp: LPCSTR): DWORD;
- function MCIWndGetTimeFormat(hwnd: HWND; lp: LPSTR; len: UINT): DWORD;
- procedure MCIWndValidateMedia(hwnd: HWND);
- procedure MCIWndSetRepeat(hwnd: HWND; f: BOOL);
- function MCIWndGetRepeat(hwnd: HWND): BOOL;
- function MCIWndUseFrames(hwnd: HWND): DWORD;
- function MCIWndUseTime(hwnd: HWND): DWORD;
- procedure MCIWndSetActiveTimer(hwnd: HWND; active: UINT);
- procedure MCIWndSetInactiveTimer(hwnd: HWND; inactive: UINT);
- procedure MCIWndSetTimers(hwnd: HWND; active, inactive: UINT);
- function MCIWndGetActiveTimer(hwnd: HWND): UINT;
- function MCIWndGetInactiveTimer(hwnd: HWND): UINT;
- function MCIWndRealize(hwnd: HWND; fBkgnd: BOOL): DWORD;
- function MCIWndSendString(hwnd: HWND; sz: LPCSTR): DWORD;
- function MCIWndReturnString(hwnd: HWND; lp: LPSTR; len: UINT): DWORD;
- function MCIWndGetError(hwnd: HWND; lp: LPSTR; len: UINT): DWORD;
- // #define MCIWndActivate(hwnd, f) (void)MCIWndSM(hwnd, WM_ACTIVATE, (WPARAM)(BOOL)(f), 0)
- function MCIWndGetPalette(hwnd: HWND): HPALETTE;
- function MCIWndSetPalette(hwnd: HWND; hpal: HPALETTE): DWORD;
- function MCIWndGetFileName(hwnd: HWND; lp: LPSTR; len: UINT): DWORD;
- function MCIWndGetDevice(hwnd: HWND; lp: LPSTR; len: UINT): DWORD;
- function MCIWndGetStyles(hwnd: HWND): UINT;
- function MCIWndChangeStyles(hwnd: HWND; mask: UINT; value: DWORD): DWORD;
- type
- PUnknown = ^IUnknown;
- function MCIWndOpenInterface(hwnd: HWND; pUnk: PUnknown): DWORD;
- function MCIWndSetOwner(hwnd: HWND; hwndP: HWND): DWORD;
- {-- Messages an app will send to MCIWND --------------------------------------}
- // all the text-related messages are defined out of order above (they need
- // to be defined before the MCIWndOpen() macros
- const
- MCIWNDM_GETDEVICEID = WM_USER + 100;
- MCIWNDM_GETSTART = WM_USER + 103;
- MCIWNDM_GETLENGTH = WM_USER + 104;
- MCIWNDM_GETEND = WM_USER + 105;
- MCIWNDM_EJECT = WM_USER + 107;
- MCIWNDM_SETZOOM = WM_USER + 108;
- MCIWNDM_GETZOOM = WM_USER + 109;
- MCIWNDM_SETVOLUME = WM_USER + 110;
- MCIWNDM_GETVOLUME = WM_USER + 111;
- MCIWNDM_SETSPEED = WM_USER + 112;
- MCIWNDM_GETSPEED = WM_USER + 113;
- MCIWNDM_SETREPEAT = WM_USER + 114;
- MCIWNDM_GETREPEAT = WM_USER + 115;
- MCIWNDM_REALIZE = WM_USER + 118;
- MCIWNDM_VALIDATEMEDIA = WM_USER + 121;
- MCIWNDM_PLAYFROM = WM_USER + 122;
- MCIWNDM_PLAYTO = WM_USER + 123;
- MCIWNDM_GETPALETTE = WM_USER + 126;
- MCIWNDM_SETPALETTE = WM_USER + 127;
- MCIWNDM_SETTIMERS = WM_USER + 129;
- MCIWNDM_SETACTIVETIMER = WM_USER + 130;
- MCIWNDM_SETINACTIVETIMER = WM_USER + 131;
- MCIWNDM_GETACTIVETIMER = WM_USER + 132;
- MCIWNDM_GETINACTIVETIMER = WM_USER + 133;
- MCIWNDM_CHANGESTYLES = WM_USER + 135;
- MCIWNDM_GETSTYLES = WM_USER + 136;
- MCIWNDM_GETALIAS = WM_USER + 137;
- MCIWNDM_PLAYREVERSE = WM_USER + 139;
- MCIWNDM_GET_SOURCE = WM_USER + 140;
- MCIWNDM_PUT_SOURCE = WM_USER + 141;
- MCIWNDM_GET_DEST = WM_USER + 142;
- MCIWNDM_PUT_DEST = WM_USER + 143;
- MCIWNDM_CAN_PLAY = WM_USER + 144;
- MCIWNDM_CAN_WINDOW = WM_USER + 145;
- MCIWNDM_CAN_RECORD = WM_USER + 146;
- MCIWNDM_CAN_SAVE = WM_USER + 147;
- MCIWNDM_CAN_EJECT = WM_USER + 148;
- MCIWNDM_CAN_CONFIG = WM_USER + 149;
- MCIWNDM_PALETTEKICK = WM_USER + 150;
- MCIWNDM_OPENINTERFACE = WM_USER + 151;
- MCIWNDM_SETOWNER = WM_USER + 152;
- {-- Define both A and W messages ---------------------------------------------}
- MCIWNDM_SENDSTRINGA = WM_USER + 101;
- MCIWNDM_GETPOSITIONA = WM_USER + 102;
- MCIWNDM_GETMODEA = WM_USER + 106;
- MCIWNDM_SETTIMEFORMATA = WM_USER + 119;
- MCIWNDM_GETTIMEFORMATA = WM_USER + 120;
- MCIWNDM_GETFILENAMEA = WM_USER + 124;
- MCIWNDM_GETDEVICEA = WM_USER + 125;
- MCIWNDM_GETERRORA = WM_USER + 128;
- MCIWNDM_NEWA = WM_USER + 134;
- MCIWNDM_RETURNSTRINGA = WM_USER + 138;
- MCIWNDM_OPENA = WM_USER + 153;
- MCIWNDM_SENDSTRINGW = WM_USER + 201;
- MCIWNDM_GETPOSITIONW = WM_USER + 202;
- MCIWNDM_GETMODEW = WM_USER + 206;
- MCIWNDM_SETTIMEFORMATW = WM_USER + 219;
- MCIWNDM_GETTIMEFORMATW = WM_USER + 220;
- MCIWNDM_GETFILENAMEW = WM_USER + 224;
- MCIWNDM_GETDEVICEW = WM_USER + 225;
- MCIWNDM_GETERRORW = WM_USER + 228;
- MCIWNDM_NEWW = WM_USER + 234;
- MCIWNDM_RETURNSTRINGW = WM_USER + 238;
- MCIWNDM_OPENW = WM_USER + 252;
- {-- Map defaults to A --------------------------------------------------------}
- MCIWNDM_SENDSTRING = MCIWNDM_SENDSTRINGA;
- MCIWNDM_GETPOSITION = MCIWNDM_GETPOSITIONA;
- MCIWNDM_GETMODE = MCIWNDM_GETMODEA;
- MCIWNDM_SETTIMEFORMAT = MCIWNDM_SETTIMEFORMATA;
- MCIWNDM_GETTIMEFORMAT = MCIWNDM_GETTIMEFORMATA;
- MCIWNDM_GETFILENAME = MCIWNDM_GETFILENAMEA;
- MCIWNDM_GETDEVICE = MCIWNDM_GETDEVICEA;
- MCIWNDM_GETERROR = MCIWNDM_GETERRORA;
- MCIWNDM_NEW = MCIWNDM_NEWA;
- MCIWNDM_RETURNSTRING = MCIWNDM_RETURNSTRINGA;
- MCIWNDM_OPEN = MCIWNDM_OPENA;
- // note that the source text for MCIWND will thus contain
- // support for eg MCIWNDM_SENDSTRING (both the 16-bit entrypoint and
- // in win32 mapped to MCIWNDM_SENDSTRINGW), and MCIWNDM_SENDSTRINGA (the
- // win32 ansi thunk).
- {-- Messages MCIWND will send to an app --------------------------------------}
- const
- MCIWNDM_NOTIFYMODE = WM_USER + 200; // wp = hwnd, lp = mode
- MCIWNDM_NOTIFYPOS = WM_USER + 201; // wp = hwnd, lp = pos
- MCIWNDM_NOTIFYSIZE = WM_USER + 202; // wp = hwnd
- MCIWNDM_NOTIFYMEDIA = WM_USER + 203; // wp = hwnd, lp = fn
- MCIWNDM_NOTIFYERROR = WM_USER + 205; // wp = hwnd, lp = error
- {-- Special seek values for START and END ------------------------------------}
- MCIWND_START = dword(-1) ;
- MCIWND_END = dword(-2) ;
- {== VIDEO - Video capture driver interface ===================================}
- type
- HVIDEO = THandle;
- PHVIDEO = ^HVIDEO;
- {-- Error return values ------------------------------------------------------}
- const
- DV_ERR_OK = 0; // No error
- DV_ERR_BASE = 1; // Error Base
- DV_ERR_NONSPECIFIC = DV_ERR_BASE;
- DV_ERR_BADFORMAT = DV_ERR_BASE + 1; // unsupported video format
- DV_ERR_STILLPLAYING = DV_ERR_BASE + 2; // still something playing
- DV_ERR_UNPREPARED = DV_ERR_BASE + 3; // header not prepared
- DV_ERR_SYNC = DV_ERR_BASE + 4; // device is synchronous
- DV_ERR_TOOMANYCHANNELS = DV_ERR_BASE + 5; // number of channels exceeded
- DV_ERR_NOTDETECTED = DV_ERR_BASE + 6; // HW not detected
- DV_ERR_BADINSTALL = DV_ERR_BASE + 7; // Can not get Profile
- DV_ERR_CREATEPALETTE = DV_ERR_BASE + 8;
- DV_ERR_SIZEFIELD = DV_ERR_BASE + 9;
- DV_ERR_PARAM1 = DV_ERR_BASE + 10;
- DV_ERR_PARAM2 = DV_ERR_BASE + 11;
- DV_ERR_CONFIG1 = DV_ERR_BASE + 12;
- DV_ERR_CONFIG2 = DV_ERR_BASE + 13;
- DV_ERR_FLAGS = DV_ERR_BASE + 14;
- DV_ERR_13 = DV_ERR_BASE + 15;
- DV_ERR_NOTSUPPORTED = DV_ERR_BASE + 16; // function not suported
- DV_ERR_NOMEM = DV_ERR_BASE + 17; // out of memory
- DV_ERR_ALLOCATED = DV_ERR_BASE + 18; // device is allocated
- DV_ERR_BADDEVICEID = DV_ERR_BASE + 19;
- DV_ERR_INVALHANDLE = DV_ERR_BASE + 20;
- DV_ERR_BADERRNUM = DV_ERR_BASE + 21;
- DV_ERR_NO_BUFFERS = DV_ERR_BASE + 22; // out of buffers
- DV_ERR_MEM_CONFLICT = DV_ERR_BASE + 23; // Mem conflict detected
- DV_ERR_IO_CONFLICT = DV_ERR_BASE + 24; // I/O conflict detected
- DV_ERR_DMA_CONFLICT = DV_ERR_BASE + 25; // DMA conflict detected
- DV_ERR_INT_CONFLICT = DV_ERR_BASE + 26; // Interrupt conflict detected