Source code of Windows XP (NT5)
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

310 lines
12 KiB

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