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

📄 vfw.pas

📁 灰鸽子VIP1.2经典源代码
💻 PAS
📖 第 1 页 / 共 5 页
字号:

    ICM_CONFIGURE               = (ICM_RESERVED+10);    // show the configure dialog
    ICM_ABOUT                   = (ICM_RESERVED+11);    // show the about box

    ICM_GETDEFAULTQUALITY       = (ICM_RESERVED+30);    // get the default value for quality
    ICM_GETQUALITY              = (ICM_RESERVED+31);    // get the current value for quality
    ICM_SETQUALITY              = (ICM_RESERVED+32);    // set the default value for quality

    ICM_SET                     = (ICM_RESERVED+40);    // Tell the driver something
    ICM_GET                     = (ICM_RESERVED+41);    // Ask the driver something

{-- Constants for ICM_SET: ---------------------------------------------------}

    ICM_FRAMERATE               = $526D7246; // mmioFOURCC('F','r','m','R')
    ICM_KEYFRAMERATE            = $5279654B; // mmioFOURCC('K','e','y','R')

{-- ICM specific messages ----------------------------------------------------}

    ICM_COMPRESS_GET_FORMAT     = (ICM_USER+4)  ;   // get compress format or size
    ICM_COMPRESS_GET_SIZE       = (ICM_USER+5)  ;   // get output size
    ICM_COMPRESS_QUERY          = (ICM_USER+6)  ;   // query support for compress
    ICM_COMPRESS_BEGIN          = (ICM_USER+7)  ;   // begin a series of compress calls.
    ICM_COMPRESS                = (ICM_USER+8)  ;   // compress a frame
    ICM_COMPRESS_END            = (ICM_USER+9)  ;   // end of a series of compress calls.

    ICM_DECOMPRESS_GET_FORMAT   = (ICM_USER+10) ;   // get decompress format or size
    ICM_DECOMPRESS_QUERY        = (ICM_USER+11) ;   // query support for dempress
    ICM_DECOMPRESS_BEGIN        = (ICM_USER+12) ;   // start a series of decompress calls
    ICM_DECOMPRESS              = (ICM_USER+13) ;   // decompress a frame
    ICM_DECOMPRESS_END          = (ICM_USER+14) ;   // end a series of decompress calls
    ICM_DECOMPRESS_SET_PALETTE  = (ICM_USER+29) ;   // fill in the DIB color table
    ICM_DECOMPRESS_GET_PALETTE  = (ICM_USER+30) ;   // fill in the DIB color table

    ICM_DRAW_QUERY              = (ICM_USER+31) ;   // query support for dempress
    ICM_DRAW_BEGIN              = (ICM_USER+15) ;   // start a series of draw calls
    ICM_DRAW_GET_PALETTE        = (ICM_USER+16) ;   // get the palette needed for drawing
    ICM_DRAW_START              = (ICM_USER+18) ;   // start decompress clock
    ICM_DRAW_STOP               = (ICM_USER+19) ;   // stop decompress clock
    ICM_DRAW_END                = (ICM_USER+21) ;   // end a series of draw calls
    ICM_DRAW_GETTIME            = (ICM_USER+32) ;   // get value of decompress clock
    ICM_DRAW                    = (ICM_USER+33) ;   // generalized "render" message
    ICM_DRAW_WINDOW             = (ICM_USER+34) ;   // drawing window has moved or hidden
    ICM_DRAW_SETTIME            = (ICM_USER+35) ;   // set correct value for decompress clock
    ICM_DRAW_REALIZE            = (ICM_USER+36) ;   // realize palette for drawing
    ICM_DRAW_FLUSH              = (ICM_USER+37) ;   // clear out buffered frames
    ICM_DRAW_RENDERBUFFER       = (ICM_USER+38) ;   // draw undrawn things in queue

    ICM_DRAW_START_PLAY         = (ICM_USER+39) ;   // start of a play
    ICM_DRAW_STOP_PLAY          = (ICM_USER+40) ;   // end of a play

    ICM_DRAW_SUGGESTFORMAT      = (ICM_USER+50) ;   // Like ICGetDisplayFormat
    ICM_DRAW_CHANGEPALETTE      = (ICM_USER+51) ;   // for animating palette

    ICM_GETBUFFERSWANTED        = (ICM_USER+41) ;   // ask about prebuffering

    ICM_GETDEFAULTKEYFRAMERATE  = (ICM_USER+42) ;   // get the default value for key frames

    ICM_DECOMPRESSEX_BEGIN      = (ICM_USER+60) ;   // start a series of decompress calls
    ICM_DECOMPRESSEX_QUERY      = (ICM_USER+61) ;   // start a series of decompress calls
    ICM_DECOMPRESSEX            = (ICM_USER+62) ;   // decompress a frame
    ICM_DECOMPRESSEX_END        = (ICM_USER+63) ;   // end a series of decompress calls

    ICM_COMPRESS_FRAMES_INFO    = (ICM_USER+70) ;   // tell about compress to come
    ICM_SET_STATUS_PROC         = (ICM_USER+72) ;   // set status callback

{-----------------------------------------------------------------------------}

type
    PICOPEN                     = ^TICOPEN;
    TICOPEN                     = record
        dwSize                  : DWORD   ; // sizeof(TICOPEN)
        fccType                 : DWORD   ; // 'vidc'
        fccHandler              : DWORD   ; //
        dwVersion               : DWORD   ; // version of compman opening you
        dwFlags                 : DWORD   ; // LOWORD is type specific
        dwError                 : DWORD   ; // error return.
        pV1Reserved             : Pointer   ; // Reserved
        pV2Reserved             : Pointer   ; // Reserved
        dnDevNode               : DWORD   ; // Devnode for PnP devices
    end;

{-----------------------------------------------------------------------------}

    PICINFO                     = ^TICINFO ;
    TICINFO                     = record
        dwSize                  : DWORD;    // sizeof(TICINFO)
        fccType                 : DWORD;    // compressor type     'vidc' 'audc'
        fccHandler              : DWORD;    // compressor sub-type 'rle ' 'jpeg' 'pcm '
        dwFlags                 : DWORD;    // flags LOWORD is type specific
        dwVersion               : DWORD;    // version of the driver
        dwVersionICM            : DWORD;    // version of the ICM used
        //
        // under Win32, the driver always returns UNICODE strings.
        //
        szName                  : array[0..15] of WideChar  ; // short name
        szDescription           : array[0..127] of WideChar ; // DWORD name
        szDriver                : array[0..127] of WideChar ; // driver that contains compressor
    end;

{-- Flags for the <dwFlags> field of the <ICINFO> structure. -----------------}

const
    VIDCF_QUALITY               = $0001 ;  // supports quality
    VIDCF_CRUNCH                = $0002 ;  // supports crunching to a frame size
    VIDCF_TEMPORAL              = $0004 ;  // supports inter-frame compress
    VIDCF_COMPRESSFRAMES        = $0008 ;  // wants the compress all frames message
    VIDCF_DRAW                  = $0010 ;  // supports drawing
    VIDCF_FASTTEMPORALC         = $0020 ;  // does not need prev frame on compress
    VIDCF_FASTTEMPORALD         = $0080 ;  // does not need prev frame on decompress
    //VIDCF_QUALITYTIME         = $0040 ;  // supports temporal quality

    //VIDCF_FASTTEMPORAL        = (VIDCF_FASTTEMPORALC or VIDCF_FASTTEMPORALD)

{-----------------------------------------------------------------------------}

    ICCOMPRESS_KEYFRAME         = $00000001;

type
    PICCOMPRESS                 = ^TICCOMPRESS;
    TICCOMPRESS                 = record
        dwFlags                 : DWORD;                // flags

        lpbiOutput              : PBITMAPINFOHEADER ;   // output format
        lpOutput                : Pointer ;               // output data

        lpbiInput               : PBITMAPINFOHEADER ;   // format of frame to compress
        lpInput                 : Pointer ;               // frame data to compress

        lpckid                  : PDWORD ;              // ckid for data in AVI file
        lpdwFlags               : PDWORD;               // flags in the AVI index.
        lFrameNum               : DWORD ;                // frame number of seq.
        dwFrameSize             : DWORD ;               // reqested size in bytes. (if non zero)

        dwQuality               : DWORD ;               // quality

        // these are new fields

        lpbiPrev                : PBITMAPINFOHEADER ;   // format of previous frame
        lpPrev                  : Pointer ;              // previous frame
    end;

{-----------------------------------------------------------------------------}

const
    ICCOMPRESSFRAMES_PADDING    = $00000001 ;

type
    TICCompressProc             = function(lInput: LPARAM; lFrame: DWORD; lpBits: Pointer; len: DWORD): DWORD; stdcall;

    PICCOMPRESSFRAMES           = ^TICCOMPRESSFRAMES;
    TICCOMPRESSFRAMES           = record
        dwFlags                 : DWORD ;               // flags

        lpbiOutput              : PBITMAPINFOHEADER ;   // output format
        lOutput                 : LPARAM ;              // output identifier

        lpbiInput               : PBITMAPINFOHEADER ;   // format of frame to compress
        lInput                  : LPARAM ;              // input identifier

        lStartFrame             : DWORD ;                // start frame
        lFrameCount             : DWORD ;                // # of frames

        lQuality                : DWORD ;                // quality
        lDataRate               : DWORD ;                // data rate
        lKeyRate                : DWORD ;                // key frame rate

        dwRate                  : DWORD ;               // frame rate, as always
        dwScale                 : DWORD ;

        dwOverheadPerFrame      : DWORD ;
        dwReserved2             : DWORD ;

        GetData                 : TICCompressProc;
        PutData                 : TICCompressProc;
    end;

{-- Messages for Status callback ---------------------------------------------}

const
    ICSTATUS_START              = 0 ;
    ICSTATUS_STATUS             = 1 ;   // l = % done
    ICSTATUS_END                = 2 ;
    ICSTATUS_ERROR              = 3 ;   // l = error string (LPSTR)
    ICSTATUS_YIELD              = 4 ;

type    
    // return nonzero means abort operation in progress
    TICStatusProc               = function(lParam: LPARAM; message: UINT; l: DWORD): DWORD; stdcall;

    PICSETSTATUSPROC            = ^TICSETSTATUSPROC;
    TICSETSTATUSPROC            = record
        dwFlags                 : DWORD ;
        lParam                  : LPARAM ;
        Status                  : TICStatusProc;
    end;

{-----------------------------------------------------------------------------}

const
    ICDECOMPRESS_HURRYUP        = $80000000 ;   // don't draw just buffer (hurry up!)
    ICDECOMPRESS_UPDATE         = $40000000 ;   // don't draw just update screen
    ICDECOMPRESS_PREROLL        = $20000000 ;   // this frame is before real start
    ICDECOMPRESS_NULLFRAME      = $10000000 ;   // repeat last frame
    ICDECOMPRESS_NOTKEYFRAME    = $08000000 ;   // this frame is not a key frame

type
    PICDECOMPRESS               = ^TICDECOMPRESS;
    TICDECOMPRESS               = record
        dwFlags                 : DWORD ;               // flags (from AVI index...)
        lpbiInput               : PBITMAPINFOHEADER ;   // BITMAPINFO of compressed data
                                                        // biSizeImage has the chunk size
        lpInput                 : Pointer ;               // compressed data
        lpbiOutput              : PBITMAPINFOHEADER ;   // DIB to decompress to
        lpOutput                : Pointer ;
        ckid                    : DWORD ;               // ckid from AVI file
    end;

    PICDECOMPRESSEX             = ^TICDECOMPRESSEX;
    TICDECOMPRESSEX             = record

        //
        // same as ICM_DECOMPRESS
        //

        dwFlags                 : DWORD;
        lpbiSrc                 : PBITMAPINFOHEADER;    // BITMAPINFO of compressed data
        lpSrc                   : Pointer;                // compressed data
        lpbiDst                 : PBITMAPINFOHEADER;    // DIB to decompress to
        lpDst                   : Pointer;                // output data

        //
        // new for ICM_DECOMPRESSEX
        //

        xDst                    : integer ; // destination rectangle
        yDst                    : integer ;
        dxDst                   : integer ;
        dyDst                   : integer ;

        xSrc                    : integer ; // source rectangle
        ySrc                    : integer ;
        dxSrc                   : integer ;
        dySrc                   : integer ;
    end;

{-----------------------------------------------------------------------------}

const
    ICDRAW_QUERY                = $00000001 ; // test for support
    ICDRAW_FULLSCREEN           = $00000002 ; // draw to full screen
    ICDRAW_HDC                  = $00000004 ; // draw to a HDC/HWND
    ICDRAW_ANIMATE              = $00000008 ;   // expect palette animation
    ICDRAW_CONTINUE             = $00000010 ;   // draw is a continuation of previous draw
    ICDRAW_MEMORYDC             = $00000020 ;   // DC is offscreen, by the way
    ICDRAW_UPDATING             = $00000040 ;   // We're updating, as opposed to playing
    ICDRAW_RENDER               = $00000080 ; // used to render data not draw it
    ICDRAW_BUFFER               = $00000100 ; // please buffer this data offscreen, we will need to update it

type
    PICDRAWBEGIN                = ^TICDRAWBEGIN;
    TICDRAWBEGIN                = record
        dwFlags                 : DWORD ;       // flags

        hpal                    : HPALETTE ;    // palette to draw with
        hwnd                    : HWND ;        // window to draw to
        hdc                     : HDC ;         // HDC to draw to

        xDst                    : integer ;         // destination rectangle
        yDst                    : integer ;
        dxDst                   : integer ;
        dyDst                   : integer ;

        lpbi                    : PBITMAPINFOHEADER ;
                                                // format of frame to draw

        xSrc                    : integer ;         // source rectangle
        ySrc                    : integer ;
        dxSrc                   : integer ;
        dySrc                   : integer ;

        dwRate                  : DWORD ;       // frames/second = (dwRate/dwScale)
        dwScale                 : DWORD ;
    end;

{-----------------------------------------------------------------------------}

const
    ICDRAW_HURRYUP              = $80000000 ;   // don't draw just buffer (hurry up!)
    ICDRAW_UPDATE               = $40000000 ;   // don't draw just update screen
    ICDRAW_PREROLL              = $20000000 ;   // this frame is before real start
    ICDRAW_NULLFRAME            = $10000000 ;   // repeat last frame
    ICDRAW_NOTKEYFRAME          = $08000000 ;   // this frame is not a key frame

type
    PICDRAW                     = ^TICDRAW;
    TICDRAW                     = record
        dwFlags                 : DWORD ;   // flags
        lpFormat                : Pointer ;   // format of frame to decompress
        lpData                  : Pointer ;   // frame data to decompress
        cbData                  : DWORD ;
        lTime                   : DWORD  ;   // time in drawbegin units (see dwRate and dwScale)
    end;

⌨️ 快捷键说明

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