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.

308 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-1994, 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_IDS_PROFILING (DV_ERR_BASE + 900)
  75. //#define DV_IDS_LISTBOX (DV_ERR_BASE + 901)
  76. #define DV_ERR_USER_MSG (DV_ERR_BASE + 1000) /* Hardware specific errors */
  77. /****************************************************************************
  78. Callback Messages
  79. Note that the values for all installable driver callback messages are
  80. identical, (ie. MM_DRVM_DATA has the same value for capture drivers,
  81. installable video codecs, and the audio compression manager).
  82. ****************************************************************************/
  83. #ifndef _RCINVOKED
  84. #ifndef MM_DRVM_OPEN
  85. #define MM_DRVM_OPEN 0x3D0
  86. #define MM_DRVM_CLOSE 0x3D1
  87. #define MM_DRVM_DATA 0x3D2
  88. #define MM_DRVM_ERROR 0x3D3
  89. #endif
  90. #define DV_VM_OPEN MM_DRVM_OPEN // Obsolete messages
  91. #define DV_VM_CLOSE MM_DRVM_CLOSE
  92. #define DV_VM_DATA MM_DRVM_DATA
  93. #define DV_VM_ERROR MM_DRVM_ERROR
  94. /****************************************************************************
  95. Structures
  96. ****************************************************************************/
  97. /* video data block header */
  98. typedef struct videohdr_tag {
  99. LPBYTE lpData; /* pointer to locked data buffer */
  100. DWORD dwBufferLength; /* Length of data buffer */
  101. DWORD dwBytesUsed; /* Bytes actually used */
  102. DWORD dwTimeCaptured; /* Milliseconds from start of stream */
  103. DWORD dwUser; /* for client's use */
  104. DWORD dwFlags; /* assorted flags (see defines) */
  105. DWORD dwReserved[4]; /* reserved for driver */
  106. } VIDEOHDR, NEAR *PVIDEOHDR, FAR * LPVIDEOHDR;
  107. /* dwFlags field of VIDEOHDR */
  108. #define VHDR_DONE 0x00000001 /* Done bit */
  109. #define VHDR_PREPARED 0x00000002 /* Set if this header has been prepared */
  110. #define VHDR_INQUEUE 0x00000004 /* Reserved for driver */
  111. #define VHDR_KEYFRAME 0x00000008 /* Key Frame */
  112. #define VHDR_VALID 0x0000000F /* valid flags */ /* ;Internal */
  113. /* Channel capabilities structure */
  114. typedef struct channel_caps_tag {
  115. DWORD dwFlags; /* Capability flags*/
  116. DWORD dwSrcRectXMod; /* Granularity of src rect in x */
  117. DWORD dwSrcRectYMod; /* Granularity of src rect in y */
  118. DWORD dwSrcRectWidthMod; /* Granularity of src rect width */
  119. DWORD dwSrcRectHeightMod; /* Granularity of src rect height */
  120. DWORD dwDstRectXMod; /* Granularity of dst rect in x */
  121. DWORD dwDstRectYMod; /* Granularity of dst rect in y */
  122. DWORD dwDstRectWidthMod; /* Granularity of dst rect width */
  123. DWORD dwDstRectHeightMod; /* Granularity of dst rect height */
  124. } CHANNEL_CAPS, NEAR *PCHANNEL_CAPS, FAR * LPCHANNEL_CAPS;
  125. /* dwFlags of CHANNEL_CAPS */
  126. #define VCAPS_OVERLAY 0x00000001 /* overlay channel */
  127. #define VCAPS_SRC_CAN_CLIP 0x00000002 /* src rect can clip */
  128. #define VCAPS_DST_CAN_CLIP 0x00000004 /* dst rect can clip */
  129. #define VCAPS_CAN_SCALE 0x00000008 /* allows src != dst */
  130. // end_vfw32
  131. /****************************************************************************
  132. videoXXXX API's are only available on Win 3.x! they are Not in Win32
  133. ****************************************************************************/
  134. #if !defined _WIN32
  135. /****************************************************************************
  136. video APIs
  137. ****************************************************************************/
  138. DWORD WINAPI videoGetNumDevs(void);
  139. DWORD WINAPI videoOpen (LPHVIDEO lphVideo,
  140. DWORD dwDevice, DWORD dwFlags);
  141. DWORD WINAPI videoClose (HVIDEO hVideo);
  142. DWORD WINAPI videoDialog(HVIDEO hVideo, HWND hWndParent, DWORD dwFlags);
  143. DWORD WINAPI videoGetChannelCaps(HVIDEO hVideo, LPCHANNEL_CAPS lpChannelCaps,
  144. DWORD dwSize);
  145. DWORD WINAPI videoUpdate (HVIDEO hVideo, HWND hWnd, HDC hDC);
  146. DWORD WINAPI videoConfigure (HVIDEO hVideo, UINT msg, DWORD dwFlags,
  147. LPDWORD lpdwReturn, LPVOID lpData1, DWORD dwSize1,
  148. LPVOID lpData2, DWORD dwSize2);
  149. #ifdef UNICODE
  150. DWORD WINAPI videoConfigureStorageA(HVIDEO hVideo,
  151. LPSTR lpstrIdent, DWORD dwFlags);
  152. DWORD WINAPI videoConfigureStorageW(HVIDEO hVideo,
  153. LPWSTR lpstrIdent, DWORD dwFlags);
  154. #define videoConfigureStorage videoConfigureStorageW
  155. #else
  156. #define videoConfigureStorage videoConfigureStorageA
  157. #else
  158. DWORD WINAPI videoConfigureStorage(HVIDEO hVideo,
  159. LPSTR lpstrIdent, DWORD dwFlags);
  160. #define videoConfigureStorageA videoConfigureStorage
  161. #endif // !UNICODE
  162. DWORD WINAPI videoFrame(HVIDEO hVideo, LPVIDEOHDR lpVHdr);
  163. DWORD WINAPI videoMessage(HVIDEO hVideo, UINT msg, LPARAM dwP1, LPARAM 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 UNICODE
  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. #define videoGetErrorText videoGetErrorTextW
  175. #else
  176. #define videoGetErrorText videoGetErrorTextA
  177. #else
  178. DWORD WINAPI videoGetErrorText(HVIDEO hVideo, UINT wError,
  179. LPSTR lpText, UINT wSize);
  180. #define videoGetErrorTextA videoGetErrorText
  181. #endif // !UNICODE
  182. DWORD WINAPI videoStreamGetPosition(HVIDEO hVideo, MMTIME FAR* lpInfo,
  183. DWORD dwSize);
  184. DWORD WINAPI videoStreamInit(HVIDEO hVideo,
  185. DWORD dwMicroSecPerFrame, DWORD_PTR dwCallback,
  186. DWORD_PTR dwCallbackInst, DWORD dwFlags);
  187. DWORD WINAPI videoStreamFini(HVIDEO hVideo);
  188. DWORD WINAPI videoStreamPrepareHeader(HVIDEO hVideo,
  189. LPVIDEOHDR lpVHdr, DWORD dwSize);
  190. DWORD WINAPI videoStreamReset(HVIDEO hVideo);
  191. DWORD WINAPI videoStreamStart(HVIDEO hVideo);
  192. DWORD WINAPI videoStreamStop(HVIDEO hVideo);
  193. DWORD WINAPI videoStreamUnprepareHeader(HVIDEO hVideo,
  194. LPVIDEOHDR lpVHdr, DWORD dwSize);
  195. // Added post VFW1.1a
  196. DWORD WINAPI videoStreamAllocHdrAndBuffer(HVIDEO hVideo,
  197. LPVIDEOHDR FAR * plpVHdr, DWORD dwSize);
  198. DWORD WINAPI videoStreamFreeHdrAndBuffer(HVIDEO hVideo,
  199. LPVIDEOHDR lpVHdr);
  200. #endif // ! _WIN32
  201. // begin_vfw32
  202. /****************************************************************************
  203. API Flags
  204. ****************************************************************************/
  205. // Types of channels to open with the videoOpen function
  206. #define VIDEO_EXTERNALIN 0x0001
  207. #define VIDEO_EXTERNALOUT 0x0002
  208. #define VIDEO_IN 0x0004
  209. #define VIDEO_OUT 0x0008
  210. // Is a driver dialog available for this channel?
  211. #define VIDEO_DLG_QUERY 0x0010
  212. // videoConfigure (both GET and SET)
  213. #define VIDEO_CONFIGURE_QUERY 0x8000
  214. // videoConfigure (SET only)
  215. #define VIDEO_CONFIGURE_SET 0x1000
  216. // videoConfigure (GET only)
  217. #define VIDEO_CONFIGURE_GET 0x2000
  218. #define VIDEO_CONFIGURE_QUERYSIZE 0x0001
  219. #define VIDEO_CONFIGURE_CURRENT 0x0010
  220. #define VIDEO_CONFIGURE_NOMINAL 0x0020
  221. #define VIDEO_CONFIGURE_MIN 0x0040
  222. #define VIDEO_CONFIGURE_MAX 0x0080
  223. /****************************************************************************
  224. CONFIGURE MESSAGES
  225. ****************************************************************************/
  226. #define DVM_USER 0X4000
  227. #define DVM_CONFIGURE_START 0x1000
  228. #define DVM_CONFIGURE_END 0x1FFF
  229. #define DVM_PALETTE (DVM_CONFIGURE_START + 1)
  230. #define DVM_FORMAT (DVM_CONFIGURE_START + 2)
  231. #define DVM_PALETTERGB555 (DVM_CONFIGURE_START + 3)
  232. #define DVM_SRC_RECT (DVM_CONFIGURE_START + 4)
  233. #define DVM_DST_RECT (DVM_CONFIGURE_START + 5)
  234. #endif /* ifndef _RCINVOKED */
  235. // end_vfw32
  236. #ifdef __cplusplus
  237. } /* End of extern "C" { */
  238. #endif /* __cplusplus */
  239. #endif /* _INC_MSVIDEO */