Main Page | Modules | Namespace List | Class Hierarchy | Alphabetical List | Class List | Directories | File List | Namespace Members | Class Members | File Members | Related Pages

phVFW.h

Go to the documentation of this file.
00001 /* ---------------------------------------------------------------------------
00002     Phission : 
00003         Realtime Vision Processing System
00004     
00005     Copyright (C) 2003-2006 Philip D.S. Thoren (pthoren@cs.uml.edu)
00006     University of Massachusetts at Lowell,
00007     Laboratory for Artificial Intelligence and Robotics
00008     
00009     This file is part of Phission.
00010 
00011     Phission is free software; you can redistribute it and/or modify
00012     it under the terms of the GNU Lesser General Public License as published by
00013     the Free Software Foundation; either version 2 of the License, or
00014     (at your option) any later version.
00015 
00016     Phission is distributed in the hope that it will be useful,
00017     but WITHOUT ANY WARRANTY; without even the implied warranty of
00018     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00019     GNU Lesser General Public License for more details.
00020 
00021     You should have received a copy of the GNU Lesser General Public License
00022     along with Phission; if not, write to the Free Software
00023     Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
00024 
00025  ---------------------------------------------------------------------------*/
00026 #ifndef _PHVFW_H
00027 #define _PHVFW_H
00028 
00029 #include <windows.h>
00030 #include <mmsystem.h>
00031 #include <vfw.h>
00032 
00033 /* ---------------------------------------------------------------------- */
00046 #if !defined(_MSC_VER)
00047 /* ---------------------------------------------------------------------- */
00048 #ifdef __cplusplus
00049 extern "C" {
00050 #endif 
00051 
00052 /* ---------------------------------------------------------------------- */
00053 /* video data block header */
00054 typedef struct videohdr_tag {
00055     LPBYTE      lpData;                 /* pointer to locked data buffer */
00056     DWORD       dwBufferLength;         /* Length of data buffer */
00057     DWORD       dwBytesUsed;            /* Bytes actually used */
00058     DWORD       dwTimeCaptured;         /* Milliseconds from start of stream */
00059     DWORD       dwUser;                 /* for client's use */
00060     DWORD       dwFlags;                /* assorted flags (see defines) */
00061     DWORD       dwReserved[4];          /* reserved for driver */
00062 } VIDEOHDR, NEAR *PVIDEOHDR, FAR * LPVIDEOHDR;
00063 
00064 /* dwFlags field of VIDEOHDR */
00065 #define VHDR_DONE       0x00000001  /* Done bit */
00066 #define VHDR_PREPARED   0x00000002  /* Set if this header has been prepared */
00067 #define VHDR_INQUEUE    0x00000004  /* Reserved for driver */
00068 #define VHDR_KEYFRAME   0x00000008  /* Key Frame */
00069 
00070 /* ---------------------------------------------------------------------- */
00071 typedef struct tagCapDriverCaps {
00072     UINT        wDeviceIndex;               // Driver index in system.ini
00073     BOOL        fHasOverlay;                // Can device overlay?
00074     BOOL        fHasDlgVideoSource;         // Has Video source dlg?
00075     BOOL        fHasDlgVideoFormat;         // Has Format dlg?
00076     BOOL        fHasDlgVideoDisplay;        // Has External out dlg?
00077     BOOL        fCaptureInitialized;        // Driver ready to capture?
00078     BOOL        fDriverSuppliesPalettes;    // Can driver make palettes?
00079 
00080 // following always NULL on Win32.
00081     HANDLE      hVideoIn;                   // Driver In channel
00082     HANDLE      hVideoOut;                  // Driver Out channel
00083     HANDLE      hVideoExtIn;                // Driver Ext In channel
00084     HANDLE      hVideoExtOut;               // Driver Ext Out channel
00085 } CAPDRIVERCAPS, *PCAPDRIVERCAPS, FAR *LPCAPDRIVERCAPS;
00086 
00087 typedef struct tagCapStatus {
00088     UINT        uiImageWidth;               // Width of the image
00089     UINT        uiImageHeight;              // Height of the image
00090     BOOL        fLiveWindow;                // Now Previewing video?
00091     BOOL        fOverlayWindow;             // Now Overlaying video?
00092     BOOL        fScale;                     // Scale image to client?
00093     POINT       ptScroll;                   // Scroll position
00094     BOOL        fUsingDefaultPalette;       // Using default driver palette?
00095     BOOL        fAudioHardware;             // Audio hardware present?
00096     BOOL        fCapFileExists;             // Does capture file exist?
00097     DWORD       dwCurrentVideoFrame;        // # of video frames cap'td
00098     DWORD       dwCurrentVideoFramesDropped;// # of video frames dropped
00099     DWORD       dwCurrentWaveSamples;       // # of wave samples cap'td
00100     DWORD       dwCurrentTimeElapsedMS;     // Elapsed capture duration
00101     HPALETTE    hPalCurrent;                // Current palette in use
00102     BOOL        fCapturingNow;              // Capture in progress?
00103     DWORD       dwReturn;                   // Error value after any operation
00104     UINT        wNumVideoAllocated;         // Actual number of video buffers
00105     UINT        wNumAudioAllocated;         // Actual number of audio buffers
00106 } CAPSTATUS, *PCAPSTATUS, FAR *LPCAPSTATUS;
00107 
00108                                             // Default values in parenthesis
00109 typedef struct tagCaptureParms {
00110     DWORD       dwRequestMicroSecPerFrame;  // Requested capture rate
00111     BOOL        fMakeUserHitOKToCapture;    // Show "Hit OK to cap" dlg?
00112     UINT        wPercentDropForError;       // Give error msg if > (10%)
00113     BOOL        fYield;                     // Capture via background task?
00114     DWORD       dwIndexSize;                // Max index size in frames (32K)
00115     UINT        wChunkGranularity;          // Junk chunk granularity (2K)
00116     BOOL        fUsingDOSMemory;            // Use DOS buffers?
00117     UINT        wNumVideoRequested;         // # video buffers, If 0, autocalc
00118     BOOL        fCaptureAudio;              // Capture audio?
00119     UINT        wNumAudioRequested;         // # audio buffers, If 0, autocalc
00120     UINT        vKeyAbort;                  // Virtual key causing abort
00121     BOOL        fAbortLeftMouse;            // Abort on left mouse?
00122     BOOL        fAbortRightMouse;           // Abort on right mouse?
00123     BOOL        fLimitEnabled;              // Use wTimeLimit?
00124     UINT        wTimeLimit;                 // Seconds to capture
00125     BOOL        fMCIControl;                // Use MCI video source?
00126     BOOL        fStepMCIDevice;             // Step MCI device?
00127     DWORD       dwMCIStartTime;             // Time to start in MS
00128     DWORD       dwMCIStopTime;              // Time to stop in MS
00129     BOOL        fStepCaptureAt2x;           // Perform spatial averaging 2x
00130     UINT        wStepCaptureAverageFrames;  // Temporal average n Frames
00131     DWORD       dwAudioBufferSize;          // Size of audio bufs (0 = default)
00132     BOOL        fDisableWriteCache;         // Attempt to disable write cache
00133     UINT        AVStreamMaster;             // Which stream controls length?
00134 } CAPTUREPARMS, *PCAPTUREPARMS, FAR *LPCAPTUREPARMS; 
00135 
00136 // ------------------------------------------------------------------
00137 //  Window Messages  WM_CAP... which can be sent to an AVICAP window
00138 // ------------------------------------------------------------------
00139 
00140 // UNICODE
00141 //
00142 // The Win32 version of AVICAP on NT supports UNICODE applications:
00143 // for each API or message that takes a char or string parameter, there are
00144 // two versions, ApiNameA and ApiNameW. The default name ApiName is #defined
00145 // to one or other depending on whether UNICODE is defined. Apps can call
00146 // the A and W apis directly, and mix them.
00147 //
00148 // The 32-bit AVICAP on NT uses unicode exclusively internally.
00149 // ApiNameA() will be implemented as a call to ApiNameW() together with
00150 // translation of strings.
00151 
00152 // Defines start of the message range
00153 #define WM_CAP_START                    WM_USER
00154 
00155 // start of unicode messages
00156 #define WM_CAP_UNICODE_START            WM_USER+100
00157 
00158 #define WM_CAP_GET_CAPSTREAMPTR         (WM_CAP_START+  1)
00159 
00160 #define WM_CAP_SET_CALLBACK_ERRORW     (WM_CAP_UNICODE_START+  2)
00161 #define WM_CAP_SET_CALLBACK_STATUSW    (WM_CAP_UNICODE_START+  3)
00162 #define WM_CAP_SET_CALLBACK_ERRORA     (WM_CAP_START+  2)
00163 #define WM_CAP_SET_CALLBACK_STATUSA    (WM_CAP_START+  3)
00164 #ifdef UNICODE
00165 #define WM_CAP_SET_CALLBACK_ERROR       WM_CAP_SET_CALLBACK_ERRORW
00166 #define WM_CAP_SET_CALLBACK_STATUS      WM_CAP_SET_CALLBACK_STATUSW
00167 #else
00168 #define WM_CAP_SET_CALLBACK_ERROR       WM_CAP_SET_CALLBACK_ERRORA
00169 #define WM_CAP_SET_CALLBACK_STATUS      WM_CAP_SET_CALLBACK_STATUSA
00170 #endif
00171 
00172 #define WM_CAP_SET_CALLBACK_YIELD       (WM_CAP_START+  4)
00173 #define WM_CAP_SET_CALLBACK_FRAME       (WM_CAP_START+  5)
00174 #define WM_CAP_SET_CALLBACK_VIDEOSTREAM (WM_CAP_START+  6)
00175 #define WM_CAP_SET_CALLBACK_WAVESTREAM  (WM_CAP_START+  7)
00176 #define WM_CAP_GET_USER_DATA        (WM_CAP_START+  8)
00177 #define WM_CAP_SET_USER_DATA        (WM_CAP_START+  9)
00178 
00179 #define WM_CAP_DRIVER_CONNECT           (WM_CAP_START+  10)
00180 #define WM_CAP_DRIVER_DISCONNECT        (WM_CAP_START+  11)
00181 
00182 #define WM_CAP_DRIVER_GET_NAMEA        (WM_CAP_START+  12)
00183 #define WM_CAP_DRIVER_GET_VERSIONA     (WM_CAP_START+  13)
00184 #define WM_CAP_DRIVER_GET_NAMEW        (WM_CAP_UNICODE_START+  12)
00185 #define WM_CAP_DRIVER_GET_VERSIONW     (WM_CAP_UNICODE_START+  13)
00186 #ifdef UNICODE
00187 #define WM_CAP_DRIVER_GET_NAME          WM_CAP_DRIVER_GET_NAMEW
00188 #define WM_CAP_DRIVER_GET_VERSION       WM_CAP_DRIVER_GET_VERSIONW
00189 #else
00190 #define WM_CAP_DRIVER_GET_NAME          WM_CAP_DRIVER_GET_NAMEA
00191 #define WM_CAP_DRIVER_GET_VERSION       WM_CAP_DRIVER_GET_VERSIONA
00192 #endif
00193 
00194 #define WM_CAP_DRIVER_GET_CAPS          (WM_CAP_START+  14)
00195 
00196 #define WM_CAP_FILE_SET_CAPTURE_FILEA  (WM_CAP_START+  20)
00197 #define WM_CAP_FILE_GET_CAPTURE_FILEA  (WM_CAP_START+  21)
00198 #define WM_CAP_FILE_SAVEASA            (WM_CAP_START+  23)
00199 #define WM_CAP_FILE_SAVEDIBA           (WM_CAP_START+  25)
00200 #define WM_CAP_FILE_SET_CAPTURE_FILEW  (WM_CAP_UNICODE_START+  20)
00201 #define WM_CAP_FILE_GET_CAPTURE_FILEW  (WM_CAP_UNICODE_START+  21)
00202 #define WM_CAP_FILE_SAVEASW            (WM_CAP_UNICODE_START+  23)
00203 #define WM_CAP_FILE_SAVEDIBW           (WM_CAP_UNICODE_START+  25)
00204 #ifdef UNICODE
00205 #define WM_CAP_FILE_SET_CAPTURE_FILE    WM_CAP_FILE_SET_CAPTURE_FILEW
00206 #define WM_CAP_FILE_GET_CAPTURE_FILE    WM_CAP_FILE_GET_CAPTURE_FILEW
00207 #define WM_CAP_FILE_SAVEAS              WM_CAP_FILE_SAVEASW
00208 #define WM_CAP_FILE_SAVEDIB             WM_CAP_FILE_SAVEDIBW
00209 #else
00210 #define WM_CAP_FILE_SET_CAPTURE_FILE    WM_CAP_FILE_SET_CAPTURE_FILEA
00211 #define WM_CAP_FILE_GET_CAPTURE_FILE    WM_CAP_FILE_GET_CAPTURE_FILEA
00212 #define WM_CAP_FILE_SAVEAS              WM_CAP_FILE_SAVEASA
00213 #define WM_CAP_FILE_SAVEDIB             WM_CAP_FILE_SAVEDIBA
00214 #endif
00215 
00216 // out of order to save on ifdefs
00217 #define WM_CAP_FILE_ALLOCATE            (WM_CAP_START+  22)
00218 #define WM_CAP_FILE_SET_INFOCHUNK       (WM_CAP_START+  24)
00219 
00220 #define WM_CAP_EDIT_COPY                (WM_CAP_START+  30)
00221 
00222 #define WM_CAP_SET_AUDIOFORMAT          (WM_CAP_START+  35)
00223 #define WM_CAP_GET_AUDIOFORMAT          (WM_CAP_START+  36)
00224 
00225 #define WM_CAP_DLG_VIDEOFORMAT          (WM_CAP_START+  41)
00226 #define WM_CAP_DLG_VIDEOSOURCE          (WM_CAP_START+  42)
00227 #define WM_CAP_DLG_VIDEODISPLAY         (WM_CAP_START+  43)
00228 #define WM_CAP_GET_VIDEOFORMAT          (WM_CAP_START+  44)
00229 #define WM_CAP_SET_VIDEOFORMAT          (WM_CAP_START+  45)
00230 #define WM_CAP_DLG_VIDEOCOMPRESSION     (WM_CAP_START+  46)
00231 
00232 #define WM_CAP_SET_PREVIEW              (WM_CAP_START+  50)
00233 #define WM_CAP_SET_OVERLAY              (WM_CAP_START+  51)
00234 #define WM_CAP_SET_PREVIEWRATE          (WM_CAP_START+  52)
00235 #define WM_CAP_SET_SCALE                (WM_CAP_START+  53)
00236 #define WM_CAP_GET_STATUS               (WM_CAP_START+  54)
00237 #define WM_CAP_SET_SCROLL               (WM_CAP_START+  55)
00238 
00239 #define WM_CAP_GRAB_FRAME               (WM_CAP_START+  60)
00240 #define WM_CAP_GRAB_FRAME_NOSTOP        (WM_CAP_START+  61)
00241 
00242 #define WM_CAP_SEQUENCE                 (WM_CAP_START+  62)
00243 #define WM_CAP_SEQUENCE_NOFILE          (WM_CAP_START+  63)
00244 #define WM_CAP_SET_SEQUENCE_SETUP       (WM_CAP_START+  64)
00245 #define WM_CAP_GET_SEQUENCE_SETUP       (WM_CAP_START+  65)
00246 
00247 #define WM_CAP_SET_MCI_DEVICEA         (WM_CAP_START+  66)
00248 #define WM_CAP_GET_MCI_DEVICEA         (WM_CAP_START+  67)
00249 #define WM_CAP_SET_MCI_DEVICEW         (WM_CAP_UNICODE_START+  66)
00250 #define WM_CAP_GET_MCI_DEVICEW         (WM_CAP_UNICODE_START+  67)
00251 #ifdef UNICODE
00252 #define WM_CAP_SET_MCI_DEVICE           WM_CAP_SET_MCI_DEVICEW
00253 #define WM_CAP_GET_MCI_DEVICE           WM_CAP_GET_MCI_DEVICEW
00254 #else
00255 #define WM_CAP_SET_MCI_DEVICE           WM_CAP_SET_MCI_DEVICEA
00256 #define WM_CAP_GET_MCI_DEVICE           WM_CAP_GET_MCI_DEVICEA
00257 #endif
00258 
00259 #define WM_CAP_STOP                     (WM_CAP_START+  68)
00260 #define WM_CAP_ABORT                    (WM_CAP_START+  69)
00261 
00262 #define WM_CAP_SINGLE_FRAME_OPEN        (WM_CAP_START+  70)
00263 #define WM_CAP_SINGLE_FRAME_CLOSE       (WM_CAP_START+  71)
00264 #define WM_CAP_SINGLE_FRAME             (WM_CAP_START+  72)
00265 
00266 #define WM_CAP_PAL_OPENA               (WM_CAP_START+  80)
00267 #define WM_CAP_PAL_SAVEA               (WM_CAP_START+  81)
00268 #define WM_CAP_PAL_OPENW               (WM_CAP_UNICODE_START+  80)
00269 #define WM_CAP_PAL_SAVEW               (WM_CAP_UNICODE_START+  81)
00270 #ifdef UNICODE
00271 #define WM_CAP_PAL_OPEN                 WM_CAP_PAL_OPENW
00272 #define WM_CAP_PAL_SAVE                 WM_CAP_PAL_SAVEW
00273 #else
00274 #define WM_CAP_PAL_OPEN                 WM_CAP_PAL_OPENA
00275 #define WM_CAP_PAL_SAVE                 WM_CAP_PAL_SAVEA
00276 #endif
00277 
00278 #define WM_CAP_PAL_PASTE                (WM_CAP_START+  82)
00279 #define WM_CAP_PAL_AUTOCREATE           (WM_CAP_START+  83)
00280 #define WM_CAP_PAL_MANUALCREATE         (WM_CAP_START+  84)
00281 
00282 // Following added post VFW 1.1
00283 #define WM_CAP_SET_CALLBACK_CAPCONTROL  (WM_CAP_START+  85)
00284 
00285 // Defines end of the message range
00286 #define WM_CAP_UNICODE_END              WM_CAP_PAL_SAVEW
00287 #define WM_CAP_END                      WM_CAP_UNICODE_END
00288 
00289 /* ---------------------------------------------------------------------- */
00290 #define capSetCallbackOnError(hwnd, fpProc)        ((BOOL)SendMessage(hwnd, WM_CAP_SET_CALLBACK_ERROR, 0, (LPARAM)(LPVOID)(fpProc)))
00291 #define capSetCallbackOnStatus(hwnd, fpProc)       ((BOOL)SendMessage(hwnd, WM_CAP_SET_CALLBACK_STATUS, 0, (LPARAM)(LPVOID)(fpProc)))
00292 #define capSetCallbackOnYield(hwnd, fpProc)        ((BOOL)SendMessage(hwnd, WM_CAP_SET_CALLBACK_YIELD, 0, (LPARAM)(LPVOID)(fpProc)))
00293 #define capSetCallbackOnFrame(hwnd, fpProc)        ((BOOL)SendMessage(hwnd, WM_CAP_SET_CALLBACK_FRAME, 0, (LPARAM)(LPVOID)(fpProc)))
00294 #define capSetCallbackOnVideoStream(hwnd, fpProc)  ((BOOL)SendMessage(hwnd, WM_CAP_SET_CALLBACK_VIDEOSTREAM, 0, (LPARAM)(LPVOID)(fpProc)))
00295 #define capSetCallbackOnWaveStream(hwnd, fpProc)   ((BOOL)SendMessage(hwnd, WM_CAP_SET_CALLBACK_WAVESTREAM, 0, (LPARAM)(LPVOID)(fpProc)))
00296 #define capSetCallbackOnCapControl(hwnd, fpProc)   ((BOOL)SendMessage(hwnd, WM_CAP_SET_CALLBACK_CAPCONTROL, 0, (LPARAM)(LPVOID)(fpProc)))
00297 
00298 #define capSetUserData(hwnd, lUser)        ((BOOL)SendMessage(hwnd, WM_CAP_SET_USER_DATA, 0, (LPARAM)lUser))
00299 #define capGetUserData(hwnd)               (SendMessage(hwnd, WM_CAP_GET_USER_DATA, 0, 0))
00300 
00301 #define capDriverConnect(hwnd, i)                  ((BOOL)SendMessage(hwnd, WM_CAP_DRIVER_CONNECT, (WPARAM)(i), 0L))
00302 #define capDriverDisconnect(hwnd)                  ((BOOL)SendMessage(hwnd, WM_CAP_DRIVER_DISCONNECT, (WPARAM)0, 0L))
00303 #define capDriverGetName(hwnd, szName, wSize)      ((BOOL)SendMessage(hwnd, WM_CAP_DRIVER_GET_NAME, (WPARAM)(wSize), (LPARAM)(LPVOID)(LPTSTR)(szName)))
00304 #define capDriverGetVersion(hwnd, szVer, wSize)    ((BOOL)SendMessage(hwnd, WM_CAP_DRIVER_GET_VERSION, (WPARAM)(wSize), (LPARAM)(LPVOID)(LPTSTR)(szVer)))
00305 #define capDriverGetCaps(hwnd, s, wSize)           ((BOOL)SendMessage(hwnd, WM_CAP_DRIVER_GET_CAPS, (WPARAM)(wSize), (LPARAM)(LPVOID)(LPCAPDRIVERCAPS)(s)))
00306 
00307 #define capFileSetCaptureFile(hwnd, szName)        ((BOOL)SendMessage(hwnd, WM_CAP_FILE_SET_CAPTURE_FILE, 0, (LPARAM)(LPVOID)(LPTSTR)(szName)))
00308 #define capFileGetCaptureFile(hwnd, szName, wSize) ((BOOL)SendMessage(hwnd, WM_CAP_FILE_GET_CAPTURE_FILE, (WPARAM)(wSize), (LPARAM)(LPVOID)(LPTSTR)(szName)))
00309 #define capFileAlloc(hwnd, dwSize)                 ((BOOL)SendMessage(hwnd, WM_CAP_FILE_ALLOCATE, 0, (LPARAM)(DWORD)(dwSize)))
00310 #define capFileSaveAs(hwnd, szName)                ((BOOL)SendMessage(hwnd, WM_CAP_FILE_SAVEAS, 0, (LPARAM)(LPVOID)(LPTSTR)(szName)))
00311 #define capFileSetInfoChunk(hwnd, lpInfoChunk)     ((BOOL)SendMessage(hwnd, WM_CAP_FILE_SET_INFOCHUNK, (WPARAM)0, (LPARAM)(LPCAPINFOCHUNK)(lpInfoChunk)))
00312 #define capFileSaveDIB(hwnd, szName)               ((BOOL)SendMessage(hwnd, WM_CAP_FILE_SAVEDIB, 0, (LPARAM)(LPVOID)(LPTSTR)(szName)))
00313 
00314 #define capEditCopy(hwnd)                          ((BOOL)SendMessage(hwnd, WM_CAP_EDIT_COPY, 0, 0L))
00315 
00316 #define capSetAudioFormat(hwnd, s, wSize)          ((BOOL)SendMessage(hwnd, WM_CAP_SET_AUDIOFORMAT, (WPARAM)(wSize), (LPARAM)(LPVOID)(LPWAVEFORMATEX)(s)))
00317 #define capGetAudioFormat(hwnd, s, wSize)          ((DWORD)SendMessage(hwnd, WM_CAP_GET_AUDIOFORMAT, (WPARAM)(wSize), (LPARAM)(LPVOID)(LPWAVEFORMATEX)(s)))
00318 #define capGetAudioFormatSize(hwnd)                ((DWORD)SendMessage(hwnd, WM_CAP_GET_AUDIOFORMAT, (WPARAM)0, (LPARAM)0L))
00319 
00320 #define capDlgVideoFormat(hwnd)                    ((BOOL)SendMessage(hwnd, WM_CAP_DLG_VIDEOFORMAT, 0, 0L))
00321 #define capDlgVideoSource(hwnd)                    ((BOOL)SendMessage(hwnd, WM_CAP_DLG_VIDEOSOURCE, 0, 0L))
00322 #define capDlgVideoDisplay(hwnd)                   ((BOOL)SendMessage(hwnd, WM_CAP_DLG_VIDEODISPLAY, 0, 0L))
00323 #define capDlgVideoCompression(hwnd)               ((BOOL)SendMessage(hwnd, WM_CAP_DLG_VIDEOCOMPRESSION, 0, 0L))
00324 
00325 #define capGetVideoFormat(hwnd, s, wSize)          ((DWORD)SendMessage(hwnd, WM_CAP_GET_VIDEOFORMAT, (WPARAM)(wSize), (LPARAM)(LPVOID)(s)))
00326 #define capGetVideoFormatSize(hwnd)            ((DWORD)SendMessage(hwnd, WM_CAP_GET_VIDEOFORMAT, 0, 0L))
00327 #define capSetVideoFormat(hwnd, s, wSize)          ((BOOL)SendMessage(hwnd, WM_CAP_SET_VIDEOFORMAT, (WPARAM)(wSize), (LPARAM)(LPVOID)(s)))
00328 
00329 #define capPreview(hwnd, f)                        ((BOOL)SendMessage(hwnd, WM_CAP_SET_PREVIEW, (WPARAM)(BOOL)(f), 0L))
00330 #define capPreviewRate(hwnd, wMS)                  ((BOOL)SendMessage(hwnd, WM_CAP_SET_PREVIEWRATE, (WPARAM)(wMS), 0))
00331 #define capOverlay(hwnd, f)                        ((BOOL)SendMessage(hwnd, WM_CAP_SET_OVERLAY, (WPARAM)(BOOL)(f), 0L))
00332 #define capPreviewScale(hwnd, f)                   ((BOOL)SendMessage(hwnd, WM_CAP_SET_SCALE, (WPARAM)(BOOL)f, 0L))
00333 #define capGetStatus(hwnd, s, wSize)               ((BOOL)SendMessage(hwnd, WM_CAP_GET_STATUS, (WPARAM)(wSize), (LPARAM)(LPVOID)(LPCAPSTATUS)(s)))
00334 #define capSetScrollPos(hwnd, lpP)                 ((BOOL)SendMessage(hwnd, WM_CAP_SET_SCROLL, (WPARAM)0, (LPARAM)(LPPOINT)(lpP)))
00335 
00336 #define capGrabFrame(hwnd)                         ((BOOL)SendMessage(hwnd, WM_CAP_GRAB_FRAME, (WPARAM)0, (LPARAM)0L))
00337 #define capGrabFrameNoStop(hwnd)                   ((BOOL)SendMessage(hwnd, WM_CAP_GRAB_FRAME_NOSTOP, (WPARAM)0, (LPARAM)0L))
00338 
00339 #define capCaptureSequence(hwnd)                   ((BOOL)SendMessage(hwnd, WM_CAP_SEQUENCE, (WPARAM)0, (LPARAM)0L))
00340 #define capCaptureSequenceNoFile(hwnd)             ((BOOL)SendMessage(hwnd, WM_CAP_SEQUENCE_NOFILE, (WPARAM)0, (LPARAM)0L))
00341 #define capCaptureStop(hwnd)                       ((BOOL)SendMessage(hwnd, WM_CAP_STOP, (WPARAM)0, (LPARAM)0L))
00342 #define capCaptureAbort(hwnd)                      ((BOOL)SendMessage(hwnd, WM_CAP_ABORT, (WPARAM)0, (LPARAM)0L))
00343 
00344 #define capCaptureSingleFrameOpen(hwnd)            ((BOOL)SendMessage(hwnd, WM_CAP_SINGLE_FRAME_OPEN, (WPARAM)0, (LPARAM)0L))
00345 #define capCaptureSingleFrameClose(hwnd)           ((BOOL)SendMessage(hwnd, WM_CAP_SINGLE_FRAME_CLOSE, (WPARAM)0, (LPARAM)0L))
00346 #define capCaptureSingleFrame(hwnd)                ((BOOL)SendMessage(hwnd, WM_CAP_SINGLE_FRAME, (WPARAM)0, (LPARAM)0L))
00347 
00348 #define capCaptureGetSetup(hwnd, s, wSize)         ((BOOL)SendMessage(hwnd, WM_CAP_GET_SEQUENCE_SETUP, (WPARAM)(wSize), (LPARAM)(LPVOID)(LPCAPTUREPARMS)(s)))
00349 #define capCaptureSetSetup(hwnd, s, wSize)         ((BOOL)SendMessage(hwnd, WM_CAP_SET_SEQUENCE_SETUP, (WPARAM)(wSize), (LPARAM)(LPVOID)(LPCAPTUREPARMS)(s)))
00350 
00351 #define capSetMCIDeviceName(hwnd, szName)          ((BOOL)SendMessage(hwnd, WM_CAP_SET_MCI_DEVICE, 0, (LPARAM)(LPVOID)(LPTSTR)(szName)))
00352 #define capGetMCIDeviceName(hwnd, szName, wSize)   ((BOOL)SendMessage(hwnd, WM_CAP_GET_MCI_DEVICE, (WPARAM)(wSize), (LPARAM)(LPVOID)(LPTSTR)(szName)))
00353 
00354 #define capPaletteOpen(hwnd, szName)               ((BOOL)SendMessage(hwnd, WM_CAP_PAL_OPEN, 0, (LPARAM)(LPVOID)(LPTSTR)(szName)))
00355 #define capPaletteSave(hwnd, szName)               ((BOOL)SendMessage(hwnd, WM_CAP_PAL_SAVE, 0, (LPARAM)(LPVOID)(LPTSTR)(szName)))
00356 #define capPalettePaste(hwnd)                      ((BOOL)SendMessage(hwnd, WM_CAP_PAL_PASTE, (WPARAM) 0, (LPARAM)0L))
00357 #define capPaletteAuto(hwnd, iFrames, iColors)     ((BOOL)SendMessage(hwnd, WM_CAP_PAL_AUTOCREATE, (WPARAM)(iFrames), (LPARAM)(DWORD)(iColors)))
00358 #define capPaletteManual(hwnd, fGrab, iColors)     ((BOOL)SendMessage(hwnd, WM_CAP_PAL_MANUALCREATE, (WPARAM)(fGrab), (LPARAM)(DWORD)(iColors)))
00359 
00360 // ------------------------------------------------------------------
00361 //  Callback Definitions
00362 // ------------------------------------------------------------------
00363 
00364 typedef LRESULT (CALLBACK* CAPYIELDCALLBACK)  (HWND hWnd);
00365 typedef LRESULT (CALLBACK* CAPSTATUSCALLBACKW) (HWND hWnd, int nID, LPCWSTR lpsz);
00366 typedef LRESULT (CALLBACK* CAPERRORCALLBACKW)  (HWND hWnd, int nID, LPCWSTR lpsz);
00367 typedef LRESULT (CALLBACK* CAPSTATUSCALLBACKA) (HWND hWnd, int nID, LPCSTR lpsz);
00368 typedef LRESULT (CALLBACK* CAPERRORCALLBACKA)  (HWND hWnd, int nID, LPCSTR lpsz);
00369 #ifdef UNICODE
00370 #define CAPSTATUSCALLBACK  CAPSTATUSCALLBACKW
00371 #define CAPERRORCALLBACK   CAPERRORCALLBACKW
00372 #else
00373 #define CAPSTATUSCALLBACK  CAPSTATUSCALLBACKA
00374 #define CAPERRORCALLBACK   CAPERRORCALLBACKA
00375 #endif
00376 typedef LRESULT (CALLBACK* CAPVIDEOCALLBACK)  (HWND hWnd, LPVIDEOHDR lpVHdr);
00377 typedef LRESULT (CALLBACK* CAPWAVECALLBACK)   (HWND hWnd, LPWAVEHDR lpWHdr);
00378 typedef LRESULT (CALLBACK* CAPCONTROLCALLBACK)(HWND hWnd, int nState);
00379 
00380 // ------------------------------------------------------------------
00381 //  CapControlCallback states
00382 // ------------------------------------------------------------------
00383 #define CONTROLCALLBACK_PREROLL         1 /* Waiting to start capture */
00384 #define CONTROLCALLBACK_CAPTURING       2 /* Now capturing */
00385 
00386 /* ---------------------------------------------------------------------- */
00387 HWND VFWAPI capCreateCaptureWindowA (LPCSTR,DWORD,int,int,int,int,HWND,int);
00388 BOOL VFWAPI capGetDriverDescriptionA (UINT,LPSTR,int,LPSTR,int);
00389 HWND VFWAPI capCreateCaptureWindowW (LPCWSTR,DWORD,int,int,int,int,HWND,int);
00390 BOOL VFWAPI capGetDriverDescriptionW (UINT,LPWSTR,int,LPWSTR,int);
00391 
00392 #ifdef UNICODE
00393 #define capCreateCaptureWindow  capCreateCaptureWindowW
00394 #define capGetDriverDescription capGetDriverDescriptionW
00395 #else
00396 #define capCreateCaptureWindow  capCreateCaptureWindowA
00397 #define capGetDriverDescription capGetDriverDescriptionA
00398 #endif
00399 
00400 #ifdef __cplusplus
00401 }
00402 #endif 
00403 #endif /* if !defined(_MSC_VER) */
00404  /* end \addtogroup VideoForWindowAPI */ /* end \addtogroup Capture */
00407 
00408 #endif /* _PHVFW_H */




Copyright (C) 2002 - 2007 Philip D.S. Thoren ( pthoren@users.sourceforge.net )
University Of Massachusetts at Lowell
Robotics Lab
SourceForge.net Logo

Generated on Sat Jun 16 02:44:03 2007 for phission by  doxygen 1.4.4