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