VfW declarations for video capture
Rolf Kalbermatter
rolf.kalbermatter at citeng.com
Fri May 27 02:38:45 CDT 2005
Changelog
- include/vfw.h
Add declarations for AVICAP and SDK part of Video Capture Driver Interface
Rolf Kalbermatter
Index: vfw.h
===================================================================
RCS file: /home/wine/wine/include/vfw.h,v
retrieving revision 1.49
diff -u -r1.49 vfw.h
--- vfw.h 21 Mar 2005 10:32:45 -0000 1.49
+++ vfw.h 27 May 2005 07:25:37 -0000
@@ -32,10 +32,6 @@
typedef HANDLE HDRAWDIB;
-DWORD VFWAPI VideoForWindowsVersion(void);
-LONG VFWAPI InitVFW(void);
-LONG VFWAPI TermVFW(void);
-
/*****************************************************************************
* Predeclare the interfaces
*/
@@ -1619,6 +1615,367 @@
#define PD_STRETCHDIB_1_N_OK 0x0010
DWORD VFWAPI DrawDibProfileDisplay(LPBITMAPINFOHEADER lpbi);
+
+/****************************************************************************
+ * VIDEO - Video Capture Driver Interface
+ */
+
+/* video data types */
+DECLARE_HANDLE(HVIDEO); // generic handle
+typedef HVIDEO *LPHVIDEO;
+
+/* Version api */
+DWORD VFWAPI VideoForWindowsVersion(void);
+
+LONG VFWAPI InitVFW(void);
+LONG VFWAPI TermVFW(void);
+
+/*
+ * Error Return Values
+ */
+#define DV_ERR_OK (0) /* No error */
+#define DV_ERR_BASE (1) /* Error Base */
+#define DV_ERR_NONSPECIFIC (DV_ERR_BASE)
+#define DV_ERR_BADFORMAT (DV_ERR_BASE + 1) /* unsupported video format */
+#define DV_ERR_STILLPLAYING (DV_ERR_BASE + 2) /* still something playing */
+#define DV_ERR_UNPREPARED (DV_ERR_BASE + 3) /* header not prepared */
+#define DV_ERR_SYNC (DV_ERR_BASE + 4) /* device is synchronous */
+#define DV_ERR_TOOMANYCHANNELS (DV_ERR_BASE + 5) /* number of channels exceeded */
+#define DV_ERR_NOTDETECTED (DV_ERR_BASE + 6) /* HW not detected */
+#define DV_ERR_BADINSTALL (DV_ERR_BASE + 7) /* Can not get Profile */
+#define DV_ERR_CREATEPALETTE (DV_ERR_BASE + 8)
+#define DV_ERR_SIZEFIELD (DV_ERR_BASE + 9)
+#define DV_ERR_PARAM1 (DV_ERR_BASE + 10)
+#define DV_ERR_PARAM2 (DV_ERR_BASE + 11)
+#define DV_ERR_CONFIG1 (DV_ERR_BASE + 12)
+#define DV_ERR_CONFIG2 (DV_ERR_BASE + 13)
+#define DV_ERR_FLAGS (DV_ERR_BASE + 14)
+#define DV_ERR_13 (DV_ERR_BASE + 15)
+
+#define DV_ERR_NOTSUPPORTED (DV_ERR_BASE + 16) /* function not suported */
+#define DV_ERR_NOMEM (DV_ERR_BASE + 17) /* out of memory */
+#define DV_ERR_ALLOCATED (DV_ERR_BASE + 18) /* device is allocated */
+#define DV_ERR_BADDEVICEID (DV_ERR_BASE + 19)
+#define DV_ERR_INVALHANDLE (DV_ERR_BASE + 20)
+#define DV_ERR_BADERRNUM (DV_ERR_BASE + 21)
+#define DV_ERR_NO_BUFFERS (DV_ERR_BASE + 22) /* out of buffers */
+
+#define DV_ERR_MEM_CONFLICT (DV_ERR_BASE + 23) /* Mem conflict detected */
+#define DV_ERR_IO_CONFLICT (DV_ERR_BASE + 24) /* I/O conflict detected */
+#define DV_ERR_DMA_CONFLICT (DV_ERR_BASE + 25) /* DMA conflict detected */
+#define DV_ERR_INT_CONFLICT (DV_ERR_BASE + 26) /* Interrupt conflict detected */
+#define DV_ERR_PROTECT_ONLY (DV_ERR_BASE + 27) /* Can not run in standard mode */
+#define DV_ERR_LASTERROR (DV_ERR_BASE + 27)
+
+#define DV_ERR_USER_MSG (DV_ERR_BASE + 1000) /* Hardware specific errors */
+
+/*
+ * Callback Messages
+ */
+
+/* Note that the values for all installable driver callback messages are
+ identical, (ie. MM_DRVM_DATA has the same value for capture drivers,
+ installable video codecs, and the audio compression manager). */
+#ifndef MM_DRVM_OPEN
+#define MM_DRVM_OPEN 0x3D0
+#define MM_DRVM_CLOSE 0x3D1
+#define MM_DRVM_DATA 0x3D2
+#define MM_DRVM_ERROR 0x3D3
+
+#define DV_VM_OPEN MM_DRVM_OPEN /* Obsolete messages */
+#define DV_VM_CLOSE MM_DRVM_CLOSE
+#define DV_VM_DATA MM_DRVM_DATA
+#define DV_VM_ERROR MM_DRVM_ERROR
+#endif
+
+/*
+ * Structures
+ */
+
+/* video data block header */
+typedef struct videohdr_tag {
+ LPBYTE lpData; /* pointer to locked data buffer */
+ DWORD dwBufferLength; /* Length of data buffer */
+ DWORD dwBytesUsed; /* Bytes actually used */
+ DWORD dwTimeCaptured; /* Milliseconds from start of stream */
+ DWORD dwUser; /* for client's use */
+ DWORD dwFlags; /* assorted flags (see defines) */
+ DWORD dwReserved[4]; /* reserved for driver */
+} VIDEOHDR, *PVIDEOHDR, *LPVIDEOHDR;
+
+/* dwFlags field of VIDEOHDR */
+#define VHDR_DONE 0x00000001 /* Done bit */
+#define VHDR_PREPARED 0x00000002 /* Set if this header has been prepared */
+#define VHDR_INQUEUE 0x00000004 /* Reserved for driver */
+#define VHDR_KEYFRAME 0x00000008 /* Key Frame */
+
+/* Channel capabilities structure */
+typedef struct channel_caps_tag {
+ DWORD dwFlags; /* Capability flags*/
+ DWORD dwSrcRectXMod; /* Granularity of src rect in x */
+ DWORD dwSrcRectYMod; /* Granularity of src rect in y */
+ DWORD dwSrcRectWidthMod; /* Granularity of src rect width */
+ DWORD dwSrcRectHeightMod; /* Granularity of src rect height */
+ DWORD dwDstRectXMod; /* Granularity of dst rect in x */
+ DWORD dwDstRectYMod; /* Granularity of dst rect in y */
+ DWORD dwDstRectWidthMod; /* Granularity of dst rect width */
+ DWORD dwDstRectHeightMod; /* Granularity of dst rect height */
+} CHANNEL_CAPS, *PCHANNEL_CAPS, *LPCHANNEL_CAPS;
+
+/* dwFlags of CHANNEL_CAPS */
+#define VCAPS_OVERLAY 0x00000001 /* overlay channel */
+#define VCAPS_SRC_CAN_CLIP 0x00000002 /* src rect can clip */
+#define VCAPS_DST_CAN_CLIP 0x00000004 /* dst rect can clip */
+#define VCAPS_CAN_SCALE 0x00000008 /* allows src != dst */
+
+/*
+ * API Flags
+ */
+
+/* Types of channels to open with the videoOpen function */
+#define VIDEO_EXTERNALIN 0x0001
+#define VIDEO_EXTERNALOUT 0x0002
+#define VIDEO_IN 0x0004
+#define VIDEO_OUT 0x0008
+
+/* Is a driver dialog available for this channel? */
+#define VIDEO_DLG_QUERY 0x0010
+
+/* videoConfigure (both GET and SET) */
+#define VIDEO_CONFIGURE_QUERY 0x8000
+
+/* videoConfigure (SET only) */
+#define VIDEO_CONFIGURE_SET 0x1000
+
+/* videoConfigure (GET only) */
+#define VIDEO_CONFIGURE_GET 0x2000
+#define VIDEO_CONFIGURE_QUERYSIZE 0x0001
+
+#define VIDEO_CONFIGURE_CURRENT 0x0010
+#define VIDEO_CONFIGURE_NOMINAL 0x0020
+#define VIDEO_CONFIGURE_MIN 0x0040
+#define VIDEO_CONFIGURE_MAX 0x0080
+
+/*
+ * Configure Messages
+ */
+#define DVM_USER 0x4000
+
+#define DVM_CONFIGURE_START 0x1000
+#define DVM_CONFIGURE_END 0x1FFF
+
+#define DVM_PALETTE (DVM_CONFIGURE_START + 1)
+#define DVM_FORMAT (DVM_CONFIGURE_START + 2)
+#define DVM_PALETTERGB555 (DVM_CONFIGURE_START + 3)
+#define DVM_SRC_RECT (DVM_CONFIGURE_START + 4)
+#define DVM_DST_RECT (DVM_CONFIGURE_START + 5)
+
+/****************************************************************************
+ * AVICAP - Window class for AVI capture
+ */
+
+#ifdef __cplusplus
+/* SendMessage in C++*/
+#define AVICapSM(hwnd,m,w,l) ((IsWindow(hwnd)) ? ::SendMessage(hwnd,m,w,l) : 0)
+#else
+/* SendMessage in C */
+#define AVICapSM(hwnd,m,w,l) ((IsWindow(hwnd)) ? SendMessage(hwnd,m,w,l) : 0)
+#endif /* __cplusplus */
+
+/* Window Messages WM_CAP... which can be sent to an AVICAP window */
+
+/* Defines start of the message range */
+#define WM_CAP_START WM_USER
+
+/* start of unicode messages */
+#define WM_CAP_UNICODE_START WM_USER+100
+
+#define WM_CAP_GET_CAPSTREAMPTR (WM_CAP_START + 1)
+
+#define WM_CAP_SET_CALLBACK_ERRORW (WM_CAP_UNICODE_START + 2)
+#define WM_CAP_SET_CALLBACK_STATUSW (WM_CAP_UNICODE_START + 3)
+#define WM_CAP_SET_CALLBACK_ERRORA (WM_CAP_START + 2)
+#define WM_CAP_SET_CALLBACK_STATUSA (WM_CAP_START+ 3)
+
+#define WM_CAP_SET_CALLBACK_ERROR WINELIB_NAME_AW(WM_CAP_SET_CALLBACK_ERROR)
+#define WM_CAP_SET_CALLBACK_STATUS WINELIB_NAME_AW(WM_CAP_SET_CALLBACK_STATUS)
+
+#define WM_CAP_SET_CALLBACK_YIELD (WM_CAP_START + 4)
+#define WM_CAP_SET_CALLBACK_FRAME (WM_CAP_START + 5)
+#define WM_CAP_SET_CALLBACK_VIDEOSTREAM (WM_CAP_START + 6)
+#define WM_CAP_SET_CALLBACK_WAVESTREAM (WM_CAP_START + 7)
+#define WM_CAP_GET_USER_DATA (WM_CAP_START + 8)
+#define WM_CAP_SET_USER_DATA (WM_CAP_START + 9)
+
+#define WM_CAP_DRIVER_CONNECT (WM_CAP_START + 10)
+#define WM_CAP_DRIVER_DISCONNECT (WM_CAP_START + 11)
+
+#define WM_CAP_DRIVER_GET_NAMEA (WM_CAP_START + 12)
+#define WM_CAP_DRIVER_GET_VERSIONA (WM_CAP_START + 13)
+#define WM_CAP_DRIVER_GET_NAMEW (WM_CAP_UNICODE_START + 12)
+#define WM_CAP_DRIVER_GET_VERSIONW (WM_CAP_UNICODE_START + 13)
+
+#define WM_CAP_DRIVER_GET_NAME WINELIB_NAME_AW(WM_CAP_DRIVER_GET_NAME)
+#define WM_CAP_DRIVER_GET_VERSION WINELIB_NAME_AW(WM_CAP_DRIVER_GET_VERSION)
+
+#define WM_CAP_DRIVER_GET_CAPS (WM_CAP_START + 14)
+
+#define WM_CAP_FILE_SET_CAPTURE_FILEA (WM_CAP_START + 20)
+#define WM_CAP_FILE_GET_CAPTURE_FILEA (WM_CAP_START + 21)
+#define WM_CAP_FILE_ALLOCATE (WM_CAP_START + 22)
+#define WM_CAP_FILE_SAVEASA (WM_CAP_START + 23)
+#define WM_CAP_FILE_SET_INFOCHUNK (WM_CAP_START + 24)
+#define WM_CAP_FILE_SAVEDIBA (WM_CAP_START + 25)
+#define WM_CAP_FILE_SET_CAPTURE_FILEW (WM_CAP_UNICODE_START + 20)
+#define WM_CAP_FILE_GET_CAPTURE_FILEW (WM_CAP_UNICODE_START + 21)
+#define WM_CAP_FILE_SAVEASW (WM_CAP_UNICODE_START + 23)
+#define WM_CAP_FILE_SAVEDIBW (WM_CAP_UNICODE_START + 25)
+
+#define WM_CAP_FILE_SET_CAPTURE_FILE WINELIB_NAME_AW(WM_CAP_FILE_SET_CAPTURE_FILE)
+#define WM_CAP_FILE_GET_CAPTURE_FILE WINELIB_NAME_AW(WM_CAP_FILE_GET_CAPTURE_FILE)
+#define WM_CAP_FILE_SAVEAS WINELIB_NAME_AW(WM_CAP_FILE_SAVEAS)
+#define WM_CAP_FILE_SAVEDIB WINELIB_NAME_AW(WM_CAP_FILE_SAVEDIB)
+
+#define WM_CAP_EDIT_COPY (WM_CAP_START + 30)
+
+#define WM_CAP_SET_AUDIOFORMAT (WM_CAP_START + 35)
+#define WM_CAP_GET_AUDIOFORMAT (WM_CAP_START + 36)
+
+#define WM_CAP_DLG_VIDEOFORMAT (WM_CAP_START + 41)
+#define WM_CAP_DLG_VIDEOSOURCE (WM_CAP_START + 42)
+#define WM_CAP_DLG_VIDEODISPLAY (WM_CAP_START + 43)
+#define WM_CAP_GET_VIDEOFORMAT (WM_CAP_START + 44)
+#define WM_CAP_SET_VIDEOFORMAT (WM_CAP_START + 45)
+#define WM_CAP_DLG_VIDEOCOMPRESSION (WM_CAP_START + 46)
+
+#define WM_CAP_SET_PREVIEW (WM_CAP_START + 50)
+#define WM_CAP_SET_OVERLAY (WM_CAP_START + 51)
+#define WM_CAP_SET_PREVIEWRATE (WM_CAP_START + 52)
+#define WM_CAP_SET_SCALE (WM_CAP_START + 53)
+#define WM_CAP_GET_STATUS (WM_CAP_START + 54)
+#define WM_CAP_SET_SCROLL (WM_CAP_START + 55)
+
+#define WM_CAP_GRAB_FRAME (WM_CAP_START + 60)
+#define WM_CAP_GRAB_FRAME_NOSTOP (WM_CAP_START + 61)
+
+#define WM_CAP_SEQUENCE (WM_CAP_START + 62)
+#define WM_CAP_SEQUENCE_NOFILE (WM_CAP_START + 63)
+#define WM_CAP_SET_SEQUENCE_SETUP (WM_CAP_START + 64)
+#define WM_CAP_GET_SEQUENCE_SETUP (WM_CAP_START + 65)
+
+#define WM_CAP_SET_MCI_DEVICEA (WM_CAP_START + 66)
+#define WM_CAP_GET_MCI_DEVICEA (WM_CAP_START + 67)
+#define WM_CAP_SET_MCI_DEVICEW (WM_CAP_UNICODE_START + 66)
+#define WM_CAP_GET_MCI_DEVICEW (WM_CAP_UNICODE_START + 67)
+
+#define WM_CAP_SET_MCI_DEVICE WINELIB_NAME_AW(WM_CAP_SET_MCI_DEVICE)
+#define WM_CAP_GET_MCI_DEVICE WINELIB_NAME_AW(WM_CAP_GET_MCI_DEVICE)
+
+#define WM_CAP_STOP (WM_CAP_START + 68)
+#define WM_CAP_ABORT (WM_CAP_START + 69)
+
+#define WM_CAP_SINGLE_FRAME_OPEN (WM_CAP_START + 70)
+#define WM_CAP_SINGLE_FRAME_CLOSE (WM_CAP_START + 71)
+#define WM_CAP_SINGLE_FRAME (WM_CAP_START + 72)
+
+#define WM_CAP_PAL_OPENA (WM_CAP_START + 80)
+#define WM_CAP_PAL_SAVEA (WM_CAP_START + 81)
+#define WM_CAP_PAL_OPENW (WM_CAP_UNICODE_START + 80)
+#define WM_CAP_PAL_SAVEW (WM_CAP_UNICODE_START + 81)
+
+#define WM_CAP_PAL_OPEN WINELIB_NAME_AW(WM_CAP_PAL_OPEN)
+#define WM_CAP_PAL_SAVE WINELIB_NAME_AW(WM_CAP_PAL_SAVE)
+
+#define WM_CAP_PAL_PASTE (WM_CAP_START + 82)
+#define WM_CAP_PAL_AUTOCREATE (WM_CAP_START + 83)
+#define WM_CAP_PAL_MANUALCREATE (WM_CAP_START + 84)
+
+/* Following added post VFW 1.1 */
+#define WM_CAP_SET_CALLBACK_CAPCONTROL (WM_CAP_START + 85)
+
+/* Defines end of the message range */
+#define WM_CAP_UNICODE_END WM_CAP_PAL_SAVEW
+#define WM_CAP_END WM_CAP_UNICODE_END
+
+/*
+ * Structures
+ */
+typedef struct tagCapDriverCaps {
+ UINT wDeviceIndex; /* Driver index in system.ini */
+ BOOL fHasOverlay; /* Can device overlay? */
+ BOOL fHasDlgVideoSource; /* Has Video source dlg? */
+ BOOL fHasDlgVideoFormat; /* Has Format dlg? */
+ BOOL fHasDlgVideoDisplay; /* Has External out dlg? */
+ BOOL fCaptureInitialized; /* Driver ready to capture? */
+ BOOL fDriverSuppliesPalettes; /* Can driver make palettes? */
+
+/* following always NULL on Win32 */
+ HANDLE hVideoIn; /* Driver In channel */
+ HANDLE hVideoOut; /* Driver Out channel */
+ HANDLE hVideoExtIn; /* Driver Ext In channel */
+ HANDLE hVideoExtOut; /* Driver Ext Out channel */
+} CAPDRIVERCAPS, *PCAPDRIVERCAPS, *LPCAPDRIVERCAPS;
+
+typedef struct tagCapStatus {
+ UINT uiImageWidth; /* Width of the image */
+ UINT uiImageHeight; /* Height of the image */
+ BOOL fLiveWindow; /* Now Previewing video? */
+ BOOL fOverlayWindow; /* Now Overlaying video? */
+ BOOL fScale; /* Scale image to client? */
+ POINT ptScroll; /* Scroll position */
+ BOOL fUsingDefaultPalette; /* Using default driver palette? */
+ BOOL fAudioHardware; /* Audio hardware present? */
+ BOOL fCapFileExists; /* Does capture file exist? */
+ DWORD dwCurrentVideoFrame; /* # of video frames cap'td */
+ DWORD dwCurrentVideoFramesDropped;/* # of video frames dropped */
+ DWORD dwCurrentWaveSamples; /* # of wave samples cap'td */
+ DWORD dwCurrentTimeElapsedMS; /* Elapsed capture duration */
+ HPALETTE hPalCurrent; /* Current palette in use */
+ BOOL fCapturingNow; /* Capture in progress? */
+ DWORD dwReturn; /* Error value after any operation */
+ UINT wNumVideoAllocated; /* Actual number of video buffers */
+ UINT wNumAudioAllocated; /* Actual number of audio buffers */
+} CAPSTATUS, *PCAPSTATUS, *LPCAPSTATUS;
+
+ /* Default values in parenthesis */
+typedef struct tagCaptureParms {
+ DWORD dwRequestMicroSecPerFrame; /* Requested capture rate */
+ BOOL fMakeUserHitOKToCapture; /* Show "Hit OK to cap" dlg? */
+ UINT wPercentDropForError; /* Give error msg if > (10%) */
+ BOOL fYield; /* Capture via background task? */
+ DWORD dwIndexSize; /* Max index size in frames (32K) */
+ UINT wChunkGranularity; /* Junk chunk granularity (2K) */
+ BOOL fUsingDOSMemory; /* Use DOS buffers? */
+ UINT wNumVideoRequested; /* # video buffers, If 0, autocalc */
+ BOOL fCaptureAudio; /* Capture audio? */
+ UINT wNumAudioRequested; /* # audio buffers, If 0, autocalc */
+ UINT vKeyAbort; /* Virtual key causing abort */
+ BOOL fAbortLeftMouse; /* Abort on left mouse? */
+ BOOL fAbortRightMouse; /* Abort on right mouse? */
+ BOOL fLimitEnabled; /* Use wTimeLimit? */
+ UINT wTimeLimit; /* Seconds to capture */
+ BOOL fMCIControl; /* Use MCI video source? */
+ BOOL fStepMCIDevice; /* Step MCI device? */
+ DWORD dwMCIStartTime; /* Time to start in MS */
+ DWORD dwMCIStopTime; /* Time to stop in MS */
+ BOOL fStepCaptureAt2x; /* Perform spatial averaging 2x */
+ UINT wStepCaptureAverageFrames; /* Temporal average n Frames */
+ DWORD dwAudioBufferSize; /* Size of audio bufs (0 = default) */
+ BOOL fDisableWriteCache; /* Attempt to disable write cache */
+ UINT AVStreamMaster; /* Which stream controls length? */
+} CAPTUREPARMS, *PCAPTUREPARMS, *LPCAPTUREPARMS;
+
+/*
+ * Callback Definitions
+ */
+typedef LRESULT (CALLBACK* CAPYIELDCALLBACK) (HWND hWnd);
+typedef LRESULT (CALLBACK* CAPSTATUSCALLBACKW) (HWND hWnd, int nID, LPCWSTR lpsz);
+typedef LRESULT (CALLBACK* CAPERRORCALLBACKW) (HWND hWnd, int nID, LPCWSTR lpsz);
+typedef LRESULT (CALLBACK* CAPSTATUSCALLBACKA) (HWND hWnd, int nID, LPCSTR lpsz);
+typedef LRESULT (CALLBACK* CAPERRORCALLBACKA) (HWND hWnd, int nID, LPCSTR lpsz);
+typedef LRESULT (CALLBACK* CAPVIDEOCALLBACK) (HWND hWnd, LPVIDEOHDR lpVHdr);
+typedef LRESULT (CALLBACK* CAPWAVECALLBACK) (HWND hWnd, LPWAVEHDR lpWHdr);
+typedef LRESULT (CALLBACK* CAPCONTROLCALLBACK)(HWND hWnd, int nState);
HWND VFWAPI capCreateCaptureWindowA(LPCSTR,DWORD,INT,INT,INT,INT,HWND,INT);
HWND VFWAPI capCreateCaptureWindowW(LPCWSTR,DWORD,INT,INT,INT,INT,HWND,INT);
More information about the wine-patches
mailing list