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.

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