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