⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 vfw.pas

📁 灰鸽子VIP1.2经典源代码
💻 PAS
📖 第 1 页 / 共 5 页
字号:
		        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

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -