📄 avifile.h
字号:
/****************************************************************************
*
* AVIFILE.H
*
* routines for reading Standard AVI files
*
* Copyright (c) 1992 - 1995 Microsoft Corporation. All Rights Reserved.
*
* You have a royalty-free right to use, modify, reproduce and
* distribute the Sample Files (and/or any modified version) in
* any way you find useful, provided that you agree that
* Microsoft has no warranty obligations or liability for any
* Sample Application Files which are modified.
*
***************************************************************************/
#if !defined( _AVIFILE_H_ )
#define _AVIFILE_H_
#ifdef __cplusplus
extern "C" { /* Assume C declarations for C++ */
#endif /* __cplusplus */
// begin_vfw32
/*
* 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).
*
*/
#ifndef mmioFOURCC
#define mmioFOURCC( ch0, ch1, ch2, ch3 ) \
( (DWORD)(BYTE)(ch0) | ( (DWORD)(BYTE)(ch1) << 8 ) | \
( (DWORD)(BYTE)(ch2) << 16 ) | ( (DWORD)(BYTE)(ch3) << 24 ) )
#endif
#ifndef streamtypeVIDEO
#define streamtypeVIDEO mmioFOURCC('v', 'i', 'd', 's')
#define streamtypeAUDIO mmioFOURCC('a', 'u', 'd', 's')
#define streamtypeMIDI mmioFOURCC('m', 'i', 'd', 's')
#define streamtypeTEXT mmioFOURCC('t', 'x', 't', 's')
#endif
#ifndef AVIIF_KEYFRAME
#define AVIIF_KEYFRAME 0x00000010L // this frame is a key frame.
#endif
// For GetFrame::SetFormat - use the best format for the display
#define 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!
*/
// end_vfw32
#ifdef _WIN32
// begin_vfw32
typedef struct _AVISTREAMINFOW {
DWORD fccType;
DWORD fccHandler;
DWORD dwFlags; /* Contains AVITF_* flags */
DWORD dwCaps;
WORD wPriority;
WORD wLanguage;
DWORD dwScale;
DWORD dwRate; /* dwRate / dwScale == samples/second */
DWORD dwStart;
DWORD dwLength; /* In units above... */
DWORD dwInitialFrames;
DWORD dwSuggestedBufferSize;
DWORD dwQuality;
DWORD dwSampleSize;
RECT rcFrame;
DWORD dwEditCount;
DWORD dwFormatChangeCount;
WCHAR szName[64];
} AVISTREAMINFOW, FAR * LPAVISTREAMINFOW;
typedef struct _AVISTREAMINFOA {
DWORD fccType;
DWORD fccHandler;
DWORD dwFlags; /* Contains AVITF_* flags */
DWORD dwCaps;
WORD wPriority;
WORD wLanguage;
DWORD dwScale;
DWORD dwRate; /* dwRate / dwScale == samples/second */
DWORD dwStart;
DWORD dwLength; /* In units above... */
DWORD dwInitialFrames;
DWORD dwSuggestedBufferSize;
DWORD dwQuality;
DWORD dwSampleSize;
RECT rcFrame;
DWORD dwEditCount;
DWORD dwFormatChangeCount;
char szName[64];
} AVISTREAMINFOA, FAR * LPAVISTREAMINFOA;
#ifdef UNICODE
#define AVISTREAMINFO AVISTREAMINFOW
#define LPAVISTREAMINFO LPAVISTREAMINFOW
#else
#define AVISTREAMINFO AVISTREAMINFOA
#define LPAVISTREAMINFO LPAVISTREAMINFOA
#endif
// end_vfw32
#else //win16 variant
#define AVISTREAMINFOW AVISTREAMINFO
typedef struct _AVISTREAMINFO {
DWORD fccType;
DWORD fccHandler;
DWORD dwFlags; /* Contains AVITF_* flags */
DWORD dwCaps;
WORD wPriority;
WORD wLanguage;
DWORD dwScale;
DWORD dwRate; /* dwRate / dwScale == samples/second */
DWORD dwStart;
DWORD dwLength; /* In units above... */
DWORD dwInitialFrames;
DWORD dwSuggestedBufferSize;
DWORD dwQuality;
DWORD dwSampleSize;
RECT rcFrame;
DWORD dwEditCount;
DWORD dwFormatChangeCount;
char szName[64];
} AVISTREAMINFO, FAR * LPAVISTREAMINFO;
#endif
// begin_vfw32
#define AVISTREAMINFO_DISABLED 0x00000001
#define AVISTREAMINFO_FORMATCHANGES 0x00010000
/*
* --- AVIFILEINFO ----------------------------------------------------
*
*/
// end_vfw32
#ifdef _WIN32
// begin_vfw32
typedef struct _AVIFILEINFOW {
DWORD dwMaxBytesPerSec; // max. transfer rate
DWORD dwFlags; // the ever-present flags
DWORD dwCaps;
DWORD dwStreams;
DWORD dwSuggestedBufferSize;
DWORD dwWidth;
DWORD dwHeight;
DWORD dwScale;
DWORD dwRate; /* dwRate / dwScale == samples/second */
DWORD dwLength;
DWORD dwEditCount;
WCHAR szFileType[64]; // descriptive string for file type?
} AVIFILEINFOW, FAR * LPAVIFILEINFOW;
typedef struct _AVIFILEINFOA {
DWORD dwMaxBytesPerSec; // max. transfer rate
DWORD dwFlags; // the ever-present flags
DWORD dwCaps;
DWORD dwStreams;
DWORD dwSuggestedBufferSize;
DWORD dwWidth;
DWORD dwHeight;
DWORD dwScale;
DWORD dwRate; /* dwRate / dwScale == samples/second */
DWORD dwLength;
DWORD dwEditCount;
char szFileType[64]; // descriptive string for file type?
} AVIFILEINFOA, FAR * LPAVIFILEINFOA;
#ifdef UNICODE
#define AVIFILEINFO AVIFILEINFOW
#define LPAVIFILEINFO LPAVIFILEINFOW
#else
#define AVIFILEINFO AVIFILEINFOA
#define LPAVIFILEINFO LPAVIFILEINFOA
#endif
// end_vfw32
#else // win16 variant
#define AVIFILEINFOW AVIFILEINFO
typedef struct _AVIFILEINFO {
DWORD dwMaxBytesPerSec; // max. transfer rate
DWORD dwFlags; // the ever-present flags
DWORD dwCaps;
DWORD dwStreams;
DWORD dwSuggestedBufferSize;
DWORD dwWidth;
DWORD dwHeight;
DWORD dwScale;
DWORD dwRate; /* dwRate / dwScale == samples/second */
DWORD dwLength;
DWORD dwEditCount;
char szFileType[64]; // descriptive string for file type?
} AVIFILEINFO, FAR * LPAVIFILEINFO;
#endif
// begin_vfw32
// Flags for dwFlags
#define AVIFILEINFO_HASINDEX 0x00000010
#define AVIFILEINFO_MUSTUSEINDEX 0x00000020
#define AVIFILEINFO_ISINTERLEAVED 0x00000100
#define AVIFILEINFO_WASCAPTUREFILE 0x00010000
#define AVIFILEINFO_COPYRIGHTED 0x00020000
// Flags for dwCaps
#define AVIFILECAPS_CANREAD 0x00000001
#define AVIFILECAPS_CANWRITE 0x00000002
#define AVIFILECAPS_ALLKEYFRAMES 0x00000010
#define AVIFILECAPS_NOCOMPRESSION 0x00000020
typedef BOOL (FAR PASCAL * AVISAVECALLBACK)(int);
/************************************************************************/
/* Declaration for the AVICOMPRESSOPTIONS structure. Make sure it */
/* matches the AutoDoc in avisave.c !!! */
/************************************************************************/
typedef struct {
DWORD fccType; /* stream type, for consistency */
DWORD fccHandler; /* compressor */
DWORD dwKeyFrameEvery; /* keyframe rate */
DWORD dwQuality; /* compress quality 0-10,000 */
DWORD dwBytesPerSecond; /* bytes per second */
DWORD dwFlags; /* flags... see below */
LPVOID lpFormat; /* save format */
DWORD cbFormat;
LPVOID lpParms; /* compressor options */
DWORD cbParms;
DWORD dwInterleaveEvery; /* for non-video streams only */
} AVICOMPRESSOPTIONS, FAR *LPAVICOMPRESSOPTIONS;
//
// 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.
//
#define AVICOMPRESSF_INTERLEAVE 0x00000001 // interleave
#define AVICOMPRESSF_DATARATE 0x00000002 // use a data rate
#define AVICOMPRESSF_KEYFRAMES 0x00000004 // use keyframes
#define AVICOMPRESSF_VALID 0x00000008 // has valid data?
// end_vfw32
#ifdef __cplusplus
} /* End of extern "C" { */
#endif /* __cplusplus */
#include "aviiface.h"
#ifdef __cplusplus
extern "C" { /* Assume C declarations for C++ */
#endif /* __cplusplus */
// begin2_vfw32
//
// functions
//
STDAPI_(void) AVIFileInit(void); // Call this first!
STDAPI_(void) AVIFileExit(void);
STDAPI_(ULONG) AVIFileAddRef (PAVIFILE pfile);
STDAPI_(ULONG) AVIFileRelease (PAVIFILE pfile);
#ifdef _WIN32
STDAPI AVIFileOpenA (PAVIFILE FAR * ppfile, LPCSTR szFile,
UINT uMode, LPCLSID lpHandler);
STDAPI AVIFileOpenW (PAVIFILE FAR * ppfile, LPCWSTR szFile,
UINT uMode, LPCLSID lpHandler);
#ifdef UNICODE
#define AVIFileOpen AVIFileOpenW
#else
#define AVIFileOpen AVIFileOpenA
#endif
#else // win16
STDAPI AVIFileOpen (PAVIFILE FAR * ppfile, LPCSTR szFile,
UINT uMode, LPCLSID lpHandler);
#endif
#ifdef _WIN32
STDAPI AVIFileInfoW (PAVIFILE pfile, LPAVIFILEINFOW pfi, LONG lSize);
STDAPI AVIFileInfoA (PAVIFILE pfile, LPAVIFILEINFOA pfi, LONG lSize);
#ifdef UNICODE
#define AVIFileInfo AVIFileInfoW
#else
#define AVIFileInfo AVIFileInfoA
#endif
#else //win16 version
STDAPI AVIFileInfo (PAVIFILE pfile, LPAVIFILEINFO pfi, LONG lSize);
#endif
STDAPI AVIFileGetStream (PAVIFILE pfile, PAVISTREAM FAR * ppavi, DWORD fccType, LONG lParam);
#ifdef _WIN32
STDAPI AVIFileCreateStreamW (PAVIFILE pfile, PAVISTREAM FAR *ppavi, AVISTREAMINFOW FAR * psi);
STDAPI AVIFileCreateStreamA (PAVIFILE pfile, PAVISTREAM FAR *ppavi, AVISTREAMINFOA FAR * psi);
#ifdef UNICODE
#define AVIFileCreateStream AVIFileCreateStreamW
#else
#define AVIFileCreateStream AVIFileCreateStreamA
#endif
#else //win16 version
STDAPI AVIFileCreateStream(PAVIFILE pfile, PAVISTREAM FAR *ppavi, AVISTREAMINFO FAR * psi);
#endif
STDAPI AVIFileWriteData (PAVIFILE pfile,
DWORD ckid,
LPVOID lpData,
LONG cbData);
STDAPI AVIFileReadData (PAVIFILE pfile,
DWORD ckid,
LPVOID lpData,
LONG FAR *lpcbData);
STDAPI AVIFileEndRecord (PAVIFILE pfile);
STDAPI_(ULONG) AVIStreamAddRef (PAVISTREAM pavi);
STDAPI_(ULONG) AVIStreamRelease (PAVISTREAM pavi);
// end2_vfw32
#ifdef _WIN32
// begin2_vfw32
STDAPI AVIStreamInfoW (PAVISTREAM pavi, LPAVISTREAMINFOW psi, LONG lSize);
STDAPI AVIStreamInfoA (PAVISTREAM pavi, LPAVISTREAMINFOA psi, LONG lSize);
#ifdef UNICODE
#define AVIStreamInfo AVIStreamInfoW
#else
#define AVIStreamInfo AVIStreamInfoA
#endif
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -