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.

249 lines
10 KiB

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