home *** CD-ROM | disk | FTP | other *** search
/ PC Plus SuperCD (UK) 2000 May / PCP163A.iso / Runimage / Cbuilder4 / Include / MSVIDEO.H < prev    next >
Encoding:
C/C++ Source or Header  |  1999-01-26  |  11.8 KB  |  300 lines

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