home *** CD-ROM | disk | FTP | other *** search
/ Chip 1997 April / Chip_1997-04_cd.bin / prezent / cb / data.z / MSVIDEO.H < prev    next >
C/C++ Source or Header  |  1997-01-16  |  12KB  |  288 lines

  1. /****************************************************************************/
  2. /*                                                                          */
  3. /*  THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY   */
  4. /*  KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE     */
  5. /*  IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR   */
  6. /*  PURPOSE.                                                                */
  7. /*        MSVIDEO.H - Include file for Video APIs                           */
  8. /*                                                                          */
  9. /*        Note: You must include WINDOWS.H before including this file.      */
  10. /*                                                                          */
  11. /****************************************************************************/
  12.  
  13. /* $Copyright: 1994$
  14.  
  15. #ifndef _INC_MSVIDEO
  16. #define _INC_MSVIDEO    50      /* version number */
  17. #define __MSVIDEO_H
  18.  
  19. #ifdef __cplusplus
  20. extern "C" {            /* Assume C declarations for C++ */
  21. #endif  /* __cplusplus */
  22.  
  23. #ifndef _RCINVOKED
  24.  
  25. /* video data types */
  26. DECLARE_HANDLE(HVIDEO);                 // generic handle
  27. typedef HVIDEO FAR * LPHVIDEO;
  28. #endif                                  // ifndef RCINVOKED
  29.  
  30. /****************************************************************************
  31.  
  32.             version api
  33.  
  34. ****************************************************************************/
  35.  
  36. DWORD FAR PASCAL VideoForWindowsVersion(void);
  37.  
  38. /****************************************************************************
  39.  
  40.                 Error Return Values
  41.  
  42. ****************************************************************************/
  43. #define DV_ERR_OK               (0)                  /* No error */
  44. #define DV_ERR_BASE             (1)                  /* Error Base */
  45. #define DV_ERR_NONSPECIFIC      (DV_ERR_BASE)
  46. #define DV_ERR_BADFORMAT        (DV_ERR_BASE + 1)
  47.                 /* unsupported video format */
  48. #define DV_ERR_STILLPLAYING     (DV_ERR_BASE + 2)
  49.                 /* still something playing */
  50. #define DV_ERR_UNPREPARED       (DV_ERR_BASE + 3)
  51.                 /* header not prepared */
  52. #define DV_ERR_SYNC             (DV_ERR_BASE + 4)
  53.                 /* device is synchronous */
  54. #define DV_ERR_TOOMANYCHANNELS  (DV_ERR_BASE + 5)
  55.                 /* number of channels exceeded */
  56. #define DV_ERR_NOTDETECTED      (DV_ERR_BASE + 6)    /* HW not detected */
  57. #define DV_ERR_BADINSTALL       (DV_ERR_BASE + 7)    /* Can not get Profile */
  58. #define DV_ERR_CREATEPALETTE    (DV_ERR_BASE + 8)
  59. #define DV_ERR_SIZEFIELD        (DV_ERR_BASE + 9)
  60. #define DV_ERR_PARAM1           (DV_ERR_BASE + 10)
  61. #define DV_ERR_PARAM2           (DV_ERR_BASE + 11)
  62. #define DV_ERR_CONFIG1          (DV_ERR_BASE + 12)
  63. #define DV_ERR_CONFIG2          (DV_ERR_BASE + 13)
  64. #define DV_ERR_FLAGS            (DV_ERR_BASE + 14)
  65. #define DV_ERR_13               (DV_ERR_BASE + 15)
  66.  
  67. #define DV_ERR_NOTSUPPORTED     (DV_ERR_BASE + 16)   /* function not suported */
  68. #define DV_ERR_NOMEM            (DV_ERR_BASE + 17)   /* out of memory */
  69. #define DV_ERR_ALLOCATED        (DV_ERR_BASE + 18)   /* device is allocated */
  70. #define DV_ERR_BADDEVICEID      (DV_ERR_BASE + 19)
  71. #define DV_ERR_INVALHANDLE      (DV_ERR_BASE + 20)
  72. #define DV_ERR_BADERRNUM        (DV_ERR_BASE + 21)
  73. #define DV_ERR_NO_BUFFERS       (DV_ERR_BASE + 22)   /* out of buffers */
  74.  
  75. #define DV_ERR_MEM_CONFLICT     (DV_ERR_BASE + 23)   /* Mem conflict detected */
  76. #define DV_ERR_IO_CONFLICT      (DV_ERR_BASE + 24)   /* I/O conflict detected */
  77. #define DV_ERR_DMA_CONFLICT     (DV_ERR_BASE + 25)   /* DMA conflict detected */
  78. #define DV_ERR_INT_CONFLICT     (DV_ERR_BASE + 26)   /* Interrupt conflict detected */
  79. #define DV_ERR_PROTECT_ONLY     (DV_ERR_BASE + 27)   /* Can not run in standard mode */
  80. #define DV_ERR_LASTERROR        (DV_ERR_BASE + 27)
  81.  
  82. //#define DV_IDS_PROFILING        (DV_ERR_BASE + 900)
  83. //#define DV_IDS_LISTBOX          (DV_ERR_BASE + 901)
  84.  
  85. #define DV_ERR_USER_MSG         (DV_ERR_BASE + 1000) /* Hardware specific errors */
  86.  
  87. /****************************************************************************
  88.  
  89.              Callback Messages
  90.  
  91. Note that the values for all installable driver callback messages are
  92. identical, (ie. MM_DRVM_DATA has the same value for capture drivers,
  93. installable video codecs, and the audio compression manager).
  94. ****************************************************************************/
  95. #ifndef _RCINVOKED
  96.  
  97. #ifndef MM_DRVM_OPEN
  98. #define MM_DRVM_OPEN       0x3D0
  99. #define MM_DRVM_CLOSE      0x3D1
  100. #define MM_DRVM_DATA       0x3D2
  101. #define MM_DRVM_ERROR      0x3D3
  102. #endif
  103.  
  104. #define DV_VM_OPEN         MM_DRVM_OPEN         // Obsolete messages
  105. #define DV_VM_CLOSE        MM_DRVM_CLOSE
  106. #define DV_VM_DATA         MM_DRVM_DATA
  107. #define DV_VM_ERROR        MM_DRVM_ERROR
  108.  
  109. /****************************************************************************
  110.  
  111.              Structures
  112.  
  113. ****************************************************************************/
  114. /* video data block header */
  115. #if !defined(__VFW_H)
  116. typedef struct videohdr_tag {
  117.     LPBYTE      lpData;                 /* pointer to locked data buffer */
  118.     DWORD       dwBufferLength;         /* Length of data buffer */
  119.     DWORD       dwBytesUsed;            /* Bytes actually used */
  120.     DWORD       dwTimeCaptured;         /* Milliseconds from start of stream */
  121.     DWORD       dwUser;                 /* for client's use */
  122.     DWORD       dwFlags;                /* assorted flags (see defines) */
  123.     DWORD       dwReserved[4];          /* reserved for driver */
  124. } VIDEOHDR, NEAR *PVIDEOHDR, FAR * LPVIDEOHDR;
  125. #endif
  126.  
  127. /* dwFlags field of VIDEOHDR */
  128. #define VHDR_DONE       0x00000001  /* Done bit */
  129. #define VHDR_PREPARED   0x00000002  /* Set if this header has been prepared */
  130. #define VHDR_INQUEUE    0x00000004  /* Reserved for driver */
  131. #define VHDR_KEYFRAME   0x00000008  /* Key Frame */
  132.  
  133. /* Channel capabilities structure */
  134. #if !defined(__VFW_H)
  135. typedef struct channel_caps_tag {
  136.     DWORD       dwFlags;                /* Capability flags*/
  137.     DWORD       dwSrcRectXMod;          /* Granularity of src rect in x */
  138.     DWORD       dwSrcRectYMod;          /* Granularity of src rect in y */
  139.     DWORD       dwSrcRectWidthMod;      /* Granularity of src rect width */
  140.     DWORD       dwSrcRectHeightMod;     /* Granularity of src rect height */
  141.     DWORD       dwDstRectXMod;          /* Granularity of dst rect in x */
  142.     DWORD       dwDstRectYMod;          /* Granularity of dst rect in y */
  143.     DWORD       dwDstRectWidthMod;      /* Granularity of dst rect width */
  144.     DWORD       dwDstRectHeightMod;     /* Granularity of dst rect height */
  145. } CHANNEL_CAPS, NEAR *PCHANNEL_CAPS, FAR * LPCHANNEL_CAPS;
  146. #endif
  147.  
  148. /* dwFlags of CHANNEL_CAPS */
  149. #define VCAPS_OVERLAY       0x00000001      /* overlay channel */
  150. #define VCAPS_SRC_CAN_CLIP  0x00000002      /* src rect can clip */
  151. #define VCAPS_DST_CAN_CLIP  0x00000004      /* dst rect can clip */
  152. #define VCAPS_CAN_SCALE     0x00000008      /* allows src != dst */
  153.  
  154. /****************************************************************************
  155.  
  156.    videoXXXX API's are only available on Win 3.x!  they are Not in Win32
  157.  
  158. ****************************************************************************/
  159.  
  160. #if !defined WIN32
  161.  
  162. /****************************************************************************
  163.  
  164.             video APIs
  165.  
  166. ****************************************************************************/
  167.  
  168.  
  169. DWORD WINAPI videoGetNumDevs(void);
  170.  
  171. DWORD WINAPI videoOpen  (LPHVIDEO lphVideo,
  172.           DWORD dwDevice, DWORD dwFlags);
  173. DWORD WINAPI videoClose (HVIDEO hVideo);
  174. DWORD WINAPI videoDialog(HVIDEO hVideo, HWND hWndParent, DWORD dwFlags);
  175. DWORD WINAPI videoGetChannelCaps(HVIDEO hVideo, LPCHANNEL_CAPS lpChannelCaps,
  176.         DWORD dwSize);
  177. DWORD WINAPI videoUpdate (HVIDEO hVideo, HWND hWnd, HDC hDC);
  178. DWORD WINAPI videoConfigure (HVIDEO hVideo, UINT msg, DWORD dwFlags,
  179.         LPDWORD lpdwReturn, LPVOID lpData1, DWORD dwSize1,
  180.         LPVOID lpData2, DWORD dwSize2);
  181.  
  182. DWORD WINAPI videoConfigureStorageA(HVIDEO hVideo,
  183.               LPSTR lpstrIdent, DWORD dwFlags);
  184.  
  185. DWORD WINAPI videoConfigureStorageW(HVIDEO hVideo,
  186.             LPWSTR lpstrIdent, DWORD dwFlags);
  187. #ifdef UNICODE
  188. #define videoConfigureStorage  videoConfigureStorageW
  189. #else
  190. #define videoConfigureStorage  videoConfigureStorageA
  191. #endif // !UNICODE
  192. DWORD WINAPI videoFrame(HVIDEO hVideo, LPVIDEOHDR lpVHdr);
  193. DWORD WINAPI videoMessage(HVIDEO hVideo, UINT msg, DWORD dwP1, DWORD dwP2);
  194.  
  195. /* streaming APIs */
  196. DWORD WINAPI videoStreamAddBuffer(HVIDEO hVideo,
  197.           LPVIDEOHDR lpVHdr, DWORD dwSize);
  198. DWORD WINAPI videoStreamGetError(HVIDEO hVideo, LPDWORD lpdwErrorFirst,
  199.     LPDWORD lpdwErrorLast);
  200.  
  201. DWORD WINAPI videoGetErrorTextA(HVIDEO hVideo, UINT wError,
  202.           LPSTR lpText, UINT wSize);
  203.  
  204. DWORD WINAPI videoGetErrorTextW(HVIDEO hVideo, UINT wError,
  205.         LPWSTR lpText, UINT wSize);
  206. #ifdef UNICODE
  207. #define videoGetErrorText  videoGetErrorTextW
  208. #else
  209. #define videoGetErrorText  videoGetErrorTextA
  210. #endif // !UNICODE
  211. DWORD WINAPI videoStreamGetPosition(HVIDEO hVideo, MMTIME FAR* lpInfo,
  212.           DWORD dwSize);
  213. DWORD WINAPI videoStreamInit(HVIDEO hVideo,
  214.           DWORD dwMicroSecPerFrame, DWORD dwCallback,
  215.           DWORD dwCallbackInst, DWORD dwFlags);
  216. DWORD WINAPI videoStreamFini(HVIDEO hVideo);
  217. DWORD WINAPI videoStreamPrepareHeader(HVIDEO hVideo,
  218.           LPVIDEOHDR lpVHdr, DWORD dwSize);
  219. DWORD WINAPI videoStreamReset(HVIDEO hVideo);
  220. DWORD WINAPI videoStreamStart(HVIDEO hVideo);
  221. DWORD WINAPI videoStreamStop(HVIDEO hVideo);
  222. DWORD WINAPI videoStreamUnprepareHeader(HVIDEO hVideo,
  223.           LPVIDEOHDR lpVHdr, DWORD dwSize);
  224.  
  225. // Added post VFW1.1a
  226. DWORD WINAPI videoStreamAllocHdrAndBuffer(HVIDEO hVideo,
  227.           LPVIDEOHDR FAR * plpVHdr, DWORD dwSize);
  228. DWORD WINAPI videoStreamFreeHdrAndBuffer(HVIDEO hVideo,
  229.           LPVIDEOHDR lpVHdr);
  230.  
  231.  
  232. #endif // ! win32
  233.  
  234.  
  235. /****************************************************************************
  236.  
  237.             API Flags
  238.  
  239. ****************************************************************************/
  240.  
  241. // Types of channels to open with the videoOpen function
  242. #define VIDEO_EXTERNALIN                0x0001
  243. #define VIDEO_EXTERNALOUT               0x0002
  244. #define VIDEO_IN                        0x0004
  245. #define VIDEO_OUT                       0x0008
  246.  
  247. // Is a driver dialog available for this channel?
  248. #define VIDEO_DLG_QUERY                 0x0010
  249.  
  250. // videoConfigure (both GET and SET)
  251. #define VIDEO_CONFIGURE_QUERY           0x8000
  252.  
  253. // videoConfigure (SET only)
  254. #define VIDEO_CONFIGURE_SET             0x1000
  255.  
  256. // videoConfigure (GET only)
  257. #define VIDEO_CONFIGURE_GET             0x2000
  258. #define VIDEO_CONFIGURE_QUERYSIZE       0x0001
  259.  
  260. #define VIDEO_CONFIGURE_CURRENT         0x0010
  261. #define VIDEO_CONFIGURE_NOMINAL         0x0020
  262. #define VIDEO_CONFIGURE_MIN             0x0040
  263. #define VIDEO_CONFIGURE_MAX             0x0080
  264.  
  265. /****************************************************************************
  266.  
  267.             CONFIGURE MESSAGES
  268.  
  269. ****************************************************************************/
  270. #define DVM_USER                        0X4000
  271.  
  272. #define DVM_CONFIGURE_START             0x1000
  273. #define DVM_CONFIGURE_END               0x1FFF
  274.  
  275. #define DVM_PALETTE                     (DVM_CONFIGURE_START + 1)
  276. #define DVM_FORMAT                      (DVM_CONFIGURE_START + 2)
  277. #define DVM_PALETTERGB555               (DVM_CONFIGURE_START + 3)
  278. #define DVM_SRC_RECT                    (DVM_CONFIGURE_START + 4)
  279. #define DVM_DST_RECT                    (DVM_CONFIGURE_START + 5)
  280.  
  281. #endif  /* ifndef _RCINVOKED */
  282.  
  283. #ifdef __cplusplus
  284. }                       /* End of extern "C" { */
  285. #endif  /* __cplusplus */
  286.  
  287. #endif  /* _INC_MSVIDEO */
  288.