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.

690 lines
28 KiB

  1. /*****************************************************************************/
  2. /* Let's bring the videoStream functions back from the dead, and rename them */
  3. /* in a way consistent with the waveIn and waveOut APIs. */
  4. /* This will allow us to create a VideoPacket class VERY similar to the */
  5. /* AudioPacket class. And we will be talking directly to the capture driver */
  6. /* which is much more straightforward than the stuff that is available today.*/
  7. /*****************************************************************************/
  8. #ifndef _INC_VIDEOINOUT
  9. #define _INC_VIDEOINOUT
  10. #pragma pack(1) /* Assume byte packing throughout */
  11. #ifdef __cplusplus
  12. extern "C" { /* Assume C declarations for C++ */
  13. #endif /* __cplusplus */
  14. /****************************************************************************
  15. videoIn and videoOut Constants
  16. ****************************************************************************/
  17. /*****************************************************************************
  18. * @doc EXTERNAL CONSTANTS
  19. *
  20. * @const 10 | MAXVIDEODRIVERS | Maximum number of video input capture drivers.
  21. *
  22. * @const WAVE_MAPPER | VIDEO_MAPPER | Arbitrary video driver.
  23. *
  24. * @const WAVE_FORMAT_PCM | VIDEO_FORMAT_DEFAULT | Default video format.
  25. *
  26. * @const 16 | NUM_4BIT_ENTRIES | Number of entries in a 4bit palette.
  27. *
  28. * @const 256 | NUM_8BIT_ENTRIES | Number of entries in an 8bit palette.
  29. *
  30. ****************************************************************************/
  31. #define MAXVIDEODRIVERS 10
  32. #define VIDEO_MAPPER WAVE_MAPPER
  33. #define VIDEO_FORMAT_DEFAULT WAVE_FORMAT_PCM
  34. #define NUM_4BIT_ENTRIES 16
  35. #define NUM_8BIT_ENTRIES 256
  36. /****************************************************************************
  37. videoIn and videoOut Macros
  38. ****************************************************************************/
  39. // WIDTHBYTES takes number of bits in a scan line and rounds up to nearest word.
  40. #define WIDTHBYTES(bits) (((bits) + 31) / 32 * 4)
  41. /****************************************************************************
  42. videoIn and videoOut Data Types
  43. ****************************************************************************/
  44. DECLARE_HANDLE(HVIDEOIN); // generic handle
  45. typedef HVIDEOIN *PHVIDEOIN;
  46. DECLARE_HANDLE(HVIDEOOUT); // generic handle
  47. typedef HVIDEOOUT *PHVIDEOOUT;
  48. /****************************************************************************
  49. Callback Capture Messages
  50. ****************************************************************************/
  51. /*****************************************************************************
  52. * @doc EXTERNAL CAPMSG
  53. *
  54. * @msg VIM_OPEN | This message is sent to a video capture input callback function when
  55. * a video capture input device is opened.
  56. *
  57. * @parm DWORD | dwParam1 | Currently unused.
  58. *
  59. * @parm DWORD | dwParam2 | Currently unused.
  60. *
  61. * @rdesc None
  62. *
  63. * @xref <m MM_VIM_OPEN>
  64. ****************************************************************************/
  65. /*****************************************************************************
  66. * @doc EXTERNAL CAPMSG
  67. *
  68. * @msg MM_VIM_OPEN | This message is sent to a window when a video capture input
  69. * device is opened.
  70. *
  71. * @parm WORD | wParam | Specifies a handle to the video capture input device
  72. * that was opened.
  73. *
  74. * @parm LONG | lParam | Currently unused.
  75. *
  76. * @rdesc None
  77. *
  78. * @xref <m VIM_OPEN>
  79. ****************************************************************************/
  80. /*****************************************************************************
  81. * @doc EXTERNAL CAPMSG
  82. *
  83. * @msg VIM_CLOSE | This message is sent to a video capture input callback function when
  84. * a video capture input device is closed. The device handle is no longer
  85. * valid once this message has been sent.
  86. *
  87. * @parm DWORD | dwParam1 | Currently unused.
  88. *
  89. * @parm DWORD | dwParam2 | Currently unused.
  90. *
  91. * @rdesc None
  92. *
  93. * @xref <m MM_VIM_CLOSE>
  94. ****************************************************************************/
  95. /*****************************************************************************
  96. * @doc EXTERNAL CAPMSG
  97. *
  98. * @msg MM_VIM_CLOSE | This message is sent to a window when a video capture input
  99. * device is closed. The device handle is no longer valid once this message
  100. * has been sent.
  101. *
  102. * @parm WORD | wParam | Specifies a handle to the video capture input device
  103. * that was closed.
  104. *
  105. * @parm LONG | lParam | Currently unused.
  106. *
  107. * @rdesc None
  108. *
  109. * @xref <m VIM_CLOSE>
  110. ****************************************************************************/
  111. /*****************************************************************************
  112. * @doc EXTERNAL CAPMSG
  113. *
  114. * @msg VIM_DATA | This message is sent to a video capture input callback function when
  115. * video data is present in the input buffer and the buffer is being
  116. * returned to the application. The message can be sent either when the
  117. * buffer is full, or after the <f videoInReset> function is called.
  118. *
  119. * @parm DWORD | dwParam1 | Specifies a far pointer to a <t VIDEOINOUTHDR> structure
  120. * identifying the buffer containing the video data.
  121. *
  122. * @parm DWORD | dwParam2 | Currently unused.
  123. *
  124. * @rdesc None
  125. *
  126. * @comm The returned buffer may not be full. Use the
  127. * <e VIDEOINOUTHDR.dwBytesUsed>
  128. * field of the <t VIDEOINOUTHDR> structure specified by <p dwParam1> to
  129. * determine the number of valid bytes into the returned buffer.
  130. *
  131. * @xref <m MM_VIM_DATA>
  132. ****************************************************************************/
  133. /*****************************************************************************
  134. * @doc EXTERNAL CAPMSG
  135. *
  136. * @msg MM_VIM_DATA | This message is sent to a window when video data is
  137. * present in the input buffer and the buffer is being returned to the
  138. * application. The message can be sent either when the buffer is full, or
  139. * after the <f videoInReset> function is called.
  140. *
  141. * @parm WORD | wParam | Specifies a handle to the video capture input device
  142. * that received the video data.
  143. *
  144. * @parm LONG | lParam | Specifies a far pointer to a <t VIDEOINOUTHDR> structure
  145. * identifying the buffer containing the video data.
  146. *
  147. * @rdesc None
  148. *
  149. * @comm The returned buffer may not be full. Use the
  150. * <e VIDEOINOUTHDR.dwBytesUsed>
  151. * field of the <t VIDEOINOUTHDR> structure specified by <p lParam> to
  152. * determine the number of valid bytes into the returned buffer.
  153. *
  154. * @xref <m VIM_DATA>
  155. ****************************************************************************/
  156. #define MM_VIM_OPEN MM_WIM_OPEN
  157. #define MM_VIM_CLOSE MM_WIM_CLOSE
  158. #define MM_VIM_DATA MM_WIM_DATA
  159. #define VIM_OPEN MM_VIM_OPEN
  160. #define VIM_CLOSE MM_VIM_CLOSE
  161. #define VIM_DATA MM_VIM_DATA
  162. /****************************************************************************
  163. Callback Playback Messages
  164. ****************************************************************************/
  165. /*****************************************************************************
  166. * @doc EXTERNAL PLAYMSG
  167. *
  168. * @msg VOM_OPEN | This message is sent to a video output callback function when
  169. * a video output device is opened.
  170. *
  171. * @parm DWORD | dwParam1 | Currently unused.
  172. *
  173. * @parm DWORD | dwParam2 | Currently unused.
  174. *
  175. * @rdesc None
  176. *
  177. * @xref <m MM_VOM_OPEN>
  178. ****************************************************************************/
  179. /*****************************************************************************
  180. * @doc EXTERNAL PLAYMSG
  181. *
  182. * @msg MM_VOM_OPEN | This message is sent to a window when a video output
  183. * device is opened.
  184. *
  185. * @parm WORD | wParam | Specifies a handle to the video output device
  186. * that was opened.
  187. *
  188. * @parm LONG | lParam | Currently unused.
  189. *
  190. * @rdesc None
  191. *
  192. * @xref <m VOM_OPEN>
  193. ****************************************************************************/
  194. /*****************************************************************************
  195. * @doc EXTERNAL PLAYMSG
  196. *
  197. * @msg VOM_CLOSE | This message is sent to a video output callback function when
  198. * a video output device is closed. The device handle is no longer
  199. * valid once this message has been sent.
  200. *
  201. * @parm DWORD | dwParam1 | Currently unused.
  202. *
  203. * @parm DWORD | dwParam2 | Currently unused.
  204. *
  205. * @rdesc None
  206. *
  207. * @xref <m MM_VOM_CLOSE>
  208. ****************************************************************************/
  209. /*****************************************************************************
  210. * @doc EXTERNAL PLAYMSG
  211. *
  212. * @msg MM_VOM_CLOSE | This message is sent to a window when a video output
  213. * device is closed. The device handle is no longer valid once this message
  214. * has been sent.
  215. *
  216. * @parm WORD | wParam | Specifies a handle to the video output device
  217. * that was closed.
  218. *
  219. * @parm LONG | lParam | Currently unused.
  220. *
  221. * @rdesc None
  222. *
  223. * @xref <m VOM_CLOSE>
  224. ****************************************************************************/
  225. /*****************************************************************************
  226. * @doc EXTERNAL PLAYMSG
  227. *
  228. * @msg VOM_DONE | This message is sent to a video output callback function when
  229. * the specified output buffer is being returned to
  230. * the application. Buffers are returned to the application when
  231. * they have been played back, or as the result of a call to <f videoOutReset>.
  232. *
  233. * @parm DWORD | dwParam1 | Specifies a far pointer to a <t VIDEOINOUTHDR> structure
  234. * identifying the buffer.
  235. *
  236. * @parm DWORD | dwParam2 | Currently unused.
  237. *
  238. * @rdesc None
  239. *
  240. * @xref <m MM_VOM_DONE>
  241. ****************************************************************************/
  242. /*****************************************************************************
  243. * @doc EXTERNAL PLAYMSG
  244. *
  245. * @msg MM_VOM_DONE | This message is sent to a window when
  246. * the specified output buffer is being returned to
  247. * the application. Buffers are returned to the application when
  248. * they have been played, or as the result of a call to <f videoOutReset>.
  249. *
  250. * @parm WORD | wParam | Specifies a handle to the video output device
  251. * that played the buffer.
  252. *
  253. * @parm LONG | lParam | Specifies a far pointer to a <t VIDEOINOUTHDR> structure
  254. * identifying the buffer.
  255. *
  256. * @rdesc None
  257. *
  258. * @xref <m VOM_DONE>
  259. ****************************************************************************/
  260. #define MM_VOM_OPEN MM_WOM_OPEN
  261. #define MM_VOM_CLOSE MM_WOM_CLOSE
  262. #define MM_VOM_DONE MM_WOM_DONE
  263. #define VOM_OPEN MM_VOM_OPEN
  264. #define VOM_CLOSE MM_VOM_CLOSE
  265. #define VOM_DONE MM_VOM_DONE
  266. /****************************************************************************
  267. videoIn and videoOut Structures
  268. ****************************************************************************/
  269. /*****************************************************************************
  270. * @doc EXTERNAL CAPSTRUCTENUM
  271. *
  272. * @struct VIDEOFORMATEX | The <t VIDEOFORMATEX> structure defines the format used to
  273. * capture video data and settings for the capture device.
  274. *
  275. * @field DWORD | dwFormatTag | Specifies the video format type (FOURCC code).
  276. *
  277. * @field DWORD | nSamplesPerSec | Specifies the sample rate, in frames per second.
  278. *
  279. * @field DWORD | nAvgBytesPerSec | Specifies the average data-transfer rate, in bytes per second.
  280. *
  281. * @field DWORD | nMinBytesPerSec | Specifies the minimum data-transfer rate, in bytes per second.
  282. *
  283. * @field DWORD | nMaxBytesPerSec | Specifies the maximum data-transfer rate, in bytes per second.
  284. *
  285. * @field DWORD | nBlockAlign | Specifies the block alignment, in bytes.
  286. *
  287. * @field DWORD | wBitsPerSample | Specifies the bits per sample for the wFormatTag format type.
  288. *
  289. * @field DWORD | dwRequestMicroSecPerFrame | Specifies the requested frame rate, in microseconds.
  290. *
  291. * @field DWORD | dwPercentDropForError | Specifies the maximum allowable percentage of dropped frames during capture.
  292. *
  293. * @field DWORD | dwNumVideoRequested | This specifies the maximum number of video buffers to allocate.
  294. *
  295. * @field DWORD | dwSupportTSTradeOff | Specifies the usage of temporal/spatial trade off.
  296. *
  297. * @field BOOL | bLive | Specifies if the preview is to be allowed.
  298. *
  299. * @field HWND | hWndParent | Specifies handle of the parent window.
  300. *
  301. * @field DWORD | dwFormatSize | Specifies the size of the actual video format.
  302. *
  303. * @field DWORD | bih.biSize | Specifies the number of bytes required by the spatial information.
  304. *
  305. * @field LONG | bih.biWidth | Specifies the width of the bitmap, in pixels.
  306. *
  307. * @field LONG | bih.biHeight | Specifies the height of the bitmap, in pixels.
  308. *
  309. * @field WORD | bih.biPlanes | Specifies the number of planes for the target device.
  310. *
  311. * @field WORD | bih.biBitCount | Specifies the number of bits per pixel.
  312. *
  313. * @field DWORD | bih.biCompression | Specifies the type of compression.
  314. *
  315. * @field DWORD | bih.biSizeImage | Specifies the size, in bytes, of the image.
  316. *
  317. * @field LONG | bih.biXPelsPerMeter | Specifies the horizontal resolution, in pixels per meter, of the target device for the bitmap.
  318. *
  319. * @field LONG | bih.biYPelsPerMeter | Specifies the vertical resolution, in pixels per meter, of the target device for the bitmap.
  320. *
  321. * @field DWORD | bih.biClrUsed | Specifies the number of color indices in the color table that are actually used by the bitmap.
  322. *
  323. * @field DWORD | bih.biClrImportant | Specifies the number of color indices that are considered important for displaying the bitmap.
  324. *
  325. * @field DWORD | bmiColors[256] | Specifies an array of 256 RGBQUADs.
  326. *
  327. * @type PVIDEOFORMATEX | Pointer to a <t VIDEOFORMATEX> structure.
  328. *
  329. ****************************************************************************/
  330. #define BMIH_SLOP 256+32
  331. #define BMIH_SLOP_BYTES (256+32)*4
  332. typedef struct videoformatex_tag {
  333. // Wave format compatibility fields
  334. DWORD dwFormatTag;
  335. DWORD nSamplesPerSec;
  336. DWORD nAvgBytesPerSec;
  337. DWORD nMinBytesPerSec;
  338. DWORD nMaxBytesPerSec;
  339. DWORD nBlockAlign;
  340. DWORD wBitsPerSample;
  341. // Temporal fields
  342. DWORD dwRequestMicroSecPerFrame;
  343. DWORD dwPercentDropForError;
  344. DWORD dwNumVideoRequested;
  345. DWORD dwSupportTSTradeOff;
  346. BOOL bLive;
  347. // Spatial fields
  348. DWORD dwFormatSize;
  349. BITMAPINFOHEADER bih;
  350. DWORD bihSLOP[BMIH_SLOP]; // bmiColors = &bih + bih.biSize
  351. // RGBQUAD bmiColors[256];
  352. } VIDEOFORMATEX, *PVIDEOFORMATEX;
  353. /*****************************************************************************
  354. * @doc EXTERNAL CAPSTRUCTENUM
  355. *
  356. * @struct VIDEOINCAPS | The <t VIDEOINCAPS> structure describes the
  357. * capabilities of a video capture input device.
  358. *
  359. * @field TCHAR | szDeviceName[80] | Specifies the device name.
  360. *
  361. * @field TCHAR | szDeviceVersion[80] | Specifies the device version.
  362. *
  363. * @field DWORD | dwImageSize | Specifies which standard image sizes are supported.
  364. * The supported sizes are specified with a logical OR of the following
  365. * flags:
  366. * @flag VIDEO_FORMAT_IMAGE_SIZE_40_30 | 40x30 pixels
  367. * @flag VIDEO_FORMAT_IMAGE_SIZE_80_60 | 80x30 pixels
  368. * @flag VIDEO_FORMAT_IMAGE_SIZE_120_90 | 120x90 pixels
  369. * @flag VIDEO_FORMAT_IMAGE_SIZE_160_120 | 160x120 pixels
  370. * @flag VIDEO_FORMAT_IMAGE_SIZE_200_150 | 200x150 pixels
  371. * @flag VIDEO_FORMAT_IMAGE_SIZE_240_180 | 240x180 pixels
  372. * @flag VIDEO_FORMAT_IMAGE_SIZE_280_210 | 280x210 pixels
  373. * @flag VIDEO_FORMAT_IMAGE_SIZE_320_240 | 320x240 pixels
  374. *
  375. * @field DWORD | dwNumColors | Specifies what number of colors are supported.
  376. * The supported number of colors are specified with a logical OR of the following
  377. * flags:
  378. * @flag VIDEO_FORMAT_NUM_COLORS_16 | 16 colors
  379. * @flag VIDEO_FORMAT_NUM_COLORS_256 | 256 colors
  380. * @flag VIDEO_FORMAT_NUM_COLORS_65536 | 65536 colors
  381. * @flag VIDEO_FORMAT_NUM_COLORS_16777216 | 16777216 colors
  382. *
  383. * @field DWORD | dwStreamingMode | Specifies the preferred streaming mode.
  384. * The supported mode is either one of the following
  385. * flags:
  386. * @flag STREAMING_PREFER_STREAMING | Real streaming
  387. * @flag STREAMING_PREFER_FRAME_GRAB | Single frame grabbing
  388. *
  389. * @field DWORD | dwDialogs | Specifies the dialogs that we shoud enable\disable.
  390. * The supported dialogs are specified with a logical OR of the following
  391. * flags:
  392. * @flag FORMAT_DLG_ON | Enable video format dialog
  393. * @flag FORMAT_DLG_OFF | Disable video format dialog
  394. * @flag SOURCE_DLG_ON | Enable source dialog
  395. * @flag SOURCE_DLG_OFF | Disable source dialog
  396. *
  397. * @field RGBQUAD | bmi4bitColors[16] | Specifies a 16 color palette.
  398. *
  399. * @field RGBQUAD | bmi8bitColors[256] | Specifies a 256 color palette.
  400. *
  401. * @type PVIDEOINCAPS | Pointer to a <t VIDEOINCAPS> structure.
  402. *
  403. * @devnote We could allocate the memory space required by the palettes dynamically.
  404. * But since the VIDEOINCAPS structure are only created on the stack of a couple of
  405. * VCM functions, why bother.
  406. *
  407. * @xref <f videoInGetDevCaps>
  408. ****************************************************************************/
  409. typedef struct videoincaps_tag {
  410. TCHAR szDeviceName[80];
  411. TCHAR szDeviceVersion[80];
  412. DWORD dwImageSize;
  413. DWORD dwNumColors;
  414. DWORD dwStreamingMode;
  415. DWORD dwDialogs;
  416. DWORD dwFlags;
  417. RGBQUAD bmi4bitColors[NUM_4BIT_ENTRIES];
  418. RGBQUAD bmi8bitColors[NUM_8BIT_ENTRIES];
  419. } VIDEOINCAPS, *PVIDEOINCAPS;
  420. #define VICF_4BIT_TABLE 1 // set in dwFlags, if bmi4bitColors is valid
  421. #define VICF_8BIT_TABLE 2 // set in dwFlags, if bmi8bitColors is valid
  422. /*****************************************************************************
  423. * @doc EXTERNAL PLAYSTRUCTENUM
  424. *
  425. * @struct VIDEOOUTCAPS | The <t VIDEOOUTCAPS> structure describes the
  426. * capabilities of a video output device.
  427. *
  428. * @field DWORD | dwFormats | Specifies which standard formats are supported.
  429. * The supported formats are specified with a logical OR of the following
  430. * flags:
  431. * @flag VIDEO_FORMAT_04 | 4-bit palettized
  432. * @flag VIDEO_FORMAT_08 | 8-bit palettized
  433. * @flag VIDEO_FORMAT_16 | 16-bit
  434. * @flag VIDEO_FORMAT_24 | 24-bit
  435. * @flag VIDEO_FORMAT_SP | Driver supplies palettes
  436. *
  437. * @type PVIDEOOUTCAPS | Pointer to a <t VIDEOOUTCAPS> structure.
  438. *
  439. * @xref <f videoOutGetDevCaps>
  440. ****************************************************************************/
  441. typedef struct videooutcaps_tag {
  442. DWORD dwFormats;
  443. } VIDEOOUTCAPS, *PVIDEOOUTCAPS;
  444. // dwFlags field of VIDEOINOUTHDR
  445. /*****************************************************************************
  446. * @doc EXTERNAL CONSTANTS
  447. *
  448. * @const 0x00000001 | VHDR_DONE | Data is done.
  449. *
  450. * @const 0x00000002 | VHDR_PREPARED | Data is prepared.
  451. *
  452. * @const 0x00000004 | VHDR_INQUEUE | Data is in queue.
  453. *
  454. ****************************************************************************/
  455. #define VHDR_DONE 0x00000001 /* Done bit */
  456. #define VHDR_PREPARED 0x00000002 /* Set if this header has been prepared */
  457. #define VHDR_INQUEUE 0x00000004 /* Reserved for driver */
  458. #define VHDR_KEYFRAME 0x00000008 /* Key Frame */
  459. #define VHDR_VALID 0x0000000F /* valid flags */ /* ;Internal */
  460. // dwImageSize of VIDEOINCAPS
  461. /*****************************************************************************
  462. * @doc EXTERNAL CONSTANTS
  463. *
  464. * @const 27 | VIDEO_FORMAT_NUM_IMAGE_SIZE | Number of video input sizes used by the device.
  465. *
  466. * @const 0x00000001 | VIDEO_FORMAT_IMAGE_SIZE_40_30 | Video input device uses 40x30 pixel frames.
  467. *
  468. * @const 0x00000002 | VIDEO_FORMAT_IMAGE_SIZE_64_48 | Video input device uses 64x48 pixel frames.
  469. *
  470. * @const 0x00000004 | VIDEO_FORMAT_IMAGE_SIZE_80_60 | Video input device uses 80x60 pixel frames.
  471. *
  472. * @const 0x00000008 | VIDEO_FORMAT_IMAGE_SIZE_96_64 | Video input device uses 96x64 pixel frames.
  473. *
  474. * @const 0x00000010 | VIDEO_FORMAT_IMAGE_SIZE_112_80 | Video input device uses 112x80 pixel frames.
  475. *
  476. * @const 0x00000020 | VIDEO_FORMAT_IMAGE_SIZE_120_90 | Video input device uses 120x90 pixel frames.
  477. *
  478. * @const 0x00000040 | VIDEO_FORMAT_IMAGE_SIZE_128_96 | Video input device uses 128x96 (SQCIF) pixel frames.
  479. *
  480. * @const 0x00000080 | VIDEO_FORMAT_IMAGE_SIZE_144_112 | Video input device uses 144x112 pixel frames.
  481. *
  482. * @const 0x00000100 | VIDEO_FORMAT_IMAGE_SIZE_160_120 | Video input device uses 160x120 pixel frames.
  483. *
  484. * @const 0x00000200 | VIDEO_FORMAT_IMAGE_SIZE_160_128 | Video input device uses 160x128 pixel frames.
  485. *
  486. * @const 0x00000400 | VIDEO_FORMAT_IMAGE_SIZE_176_144 | Video input device uses 176x144 (QCIF) pixel frames.
  487. *
  488. * @const 0x00000800 | VIDEO_FORMAT_IMAGE_SIZE_192_160 | Video input device uses 192x160 pixel frames.
  489. *
  490. * @const 0x00001000 | VIDEO_FORMAT_IMAGE_SIZE_200_150 | Video input device uses 200x150 pixel frames.
  491. *
  492. * @const 0x00002000 | VIDEO_FORMAT_IMAGE_SIZE_208_176 | Video input device uses 208x176 pixel frames.
  493. *
  494. * @const 0x00004000 | VIDEO_FORMAT_IMAGE_SIZE_224_192 | Video input device uses 224x192 pixel frames.
  495. *
  496. * @const 0x00008000 | VIDEO_FORMAT_IMAGE_SIZE_240_180 | Video input device uses 240x180 pixel frames.
  497. *
  498. * @const 0x00010000 | VIDEO_FORMAT_IMAGE_SIZE_240_208 | Video input device uses 240x208 pixel frames.
  499. *
  500. * @const 0x00020000 | VIDEO_FORMAT_IMAGE_SIZE_256_224 | Video input device uses 256x224 pixel frames.
  501. *
  502. * @const 0x00040000 | VIDEO_FORMAT_IMAGE_SIZE_272_240 | Video input device uses 272x240 pixel frames.
  503. *
  504. * @const 0x00080000 | VIDEO_FORMAT_IMAGE_SIZE_280_210 | Video input device uses 280x210 pixel frames.
  505. *
  506. * @const 0x00100000 | VIDEO_FORMAT_IMAGE_SIZE_288_256 | Video input device uses 288x256 pixel frames.
  507. *
  508. * @const 0x00200000 | VIDEO_FORMAT_IMAGE_SIZE_304_272 | Video input device uses 304x272 pixel frames.
  509. *
  510. * @const 0x00400000 | VIDEO_FORMAT_IMAGE_SIZE_320_240 | Video input device uses 320x240 pixel frames.
  511. *
  512. * @const 0x00800000 | VIDEO_FORMAT_IMAGE_SIZE_320_288 | Video input device uses 320x288 pixel frames.
  513. *
  514. * @const 0x01000000 | VIDEO_FORMAT_IMAGE_SIZE_336_288 | Video input device uses 336x288 pixel frames.
  515. *
  516. * @const 0x02000000 | VIDEO_FORMAT_IMAGE_SIZE_352_288 | Video input device uses 352x288 (CIF) pixel frames.
  517. *
  518. * @const 0x04000000 | VIDEO_FORMAT_IMAGE_SIZE_640_480 | Video input device uses 640x480 pixel frames.
  519. *
  520. ****************************************************************************/
  521. #define VIDEO_FORMAT_NUM_IMAGE_SIZE 27
  522. #define VIDEO_FORMAT_IMAGE_SIZE_40_30 0x00000001
  523. #define VIDEO_FORMAT_IMAGE_SIZE_64_48 0x00000002
  524. #define VIDEO_FORMAT_IMAGE_SIZE_80_60 0x00000004
  525. #if !defined(_ALPHA_) && defined(USE_BILINEAR_MSH26X)
  526. #define VIDEO_FORMAT_IMAGE_SIZE_80_64 0x00000008
  527. #else
  528. #define VIDEO_FORMAT_IMAGE_SIZE_96_64 0x00000008
  529. #endif
  530. #define VIDEO_FORMAT_IMAGE_SIZE_112_80 0x00000010
  531. #define VIDEO_FORMAT_IMAGE_SIZE_120_90 0x00000020
  532. #define VIDEO_FORMAT_IMAGE_SIZE_128_96 0x00000040
  533. #define VIDEO_FORMAT_IMAGE_SIZE_144_112 0x00000080
  534. #define VIDEO_FORMAT_IMAGE_SIZE_160_120 0x00000100
  535. #define VIDEO_FORMAT_IMAGE_SIZE_160_128 0x00000200
  536. #define VIDEO_FORMAT_IMAGE_SIZE_176_144 0x00000400
  537. #define VIDEO_FORMAT_IMAGE_SIZE_192_160 0x00000800
  538. #define VIDEO_FORMAT_IMAGE_SIZE_200_150 0x00001000
  539. #define VIDEO_FORMAT_IMAGE_SIZE_208_176 0x00002000
  540. #define VIDEO_FORMAT_IMAGE_SIZE_224_192 0x00004000
  541. #define VIDEO_FORMAT_IMAGE_SIZE_240_180 0x00008000
  542. #define VIDEO_FORMAT_IMAGE_SIZE_240_208 0x00010000
  543. #define VIDEO_FORMAT_IMAGE_SIZE_256_224 0x00020000
  544. #define VIDEO_FORMAT_IMAGE_SIZE_272_240 0x00040000
  545. #define VIDEO_FORMAT_IMAGE_SIZE_280_210 0x00080000
  546. #define VIDEO_FORMAT_IMAGE_SIZE_288_256 0x00100000
  547. #define VIDEO_FORMAT_IMAGE_SIZE_304_272 0x00200000
  548. #define VIDEO_FORMAT_IMAGE_SIZE_320_240 0x00400000
  549. #define VIDEO_FORMAT_IMAGE_SIZE_320_288 0x00800000
  550. #define VIDEO_FORMAT_IMAGE_SIZE_336_288 0x01000000
  551. #define VIDEO_FORMAT_IMAGE_SIZE_352_288 0x02000000
  552. #define VIDEO_FORMAT_IMAGE_SIZE_640_480 0x04000000
  553. #define VIDEO_FORMAT_IMAGE_SIZE_USE_DEFAULT 0x80000000
  554. // dwNumColors of VIDEOINCAPS
  555. /*****************************************************************************
  556. * @doc EXTERNAL CONSTANTS
  557. *
  558. * @const 0x00000001 | VIDEO_FORMAT_NUM_COLORS_16 | Video input device uses 16 colors.
  559. *
  560. * @const 0x00000002 | VIDEO_FORMAT_NUM_COLORS_256 | Video input device uses 256 colors.
  561. *
  562. * @const 0x00000004 | VIDEO_FORMAT_NUM_COLORS_65536 | Video input device uses 65536 colors.
  563. *
  564. * @const 0x00000008 | VIDEO_FORMAT_NUM_COLORS_16777216 | Video input device uses 16777216 colors.
  565. *
  566. * @const 0x00000010 | VIDEO_FORMAT_NUM_COLORS_YVU9 | Video input device uses the YVU9 compressed format.
  567. *
  568. * @const 0x00000020 | VIDEO_FORMAT_NUM_COLORS_I420 | Video input device uses the I420 compressed format.
  569. *
  570. * @const 0x00000040 | VIDEO_FORMAT_NUM_COLORS_IYUV | Video input device uses the IYUV compressed format.
  571. *
  572. ****************************************************************************/
  573. #define VIDEO_FORMAT_NUM_COLORS_16 0x00000001
  574. #define VIDEO_FORMAT_NUM_COLORS_256 0x00000002
  575. #define VIDEO_FORMAT_NUM_COLORS_65536 0x00000004
  576. #define VIDEO_FORMAT_NUM_COLORS_16777216 0x00000008
  577. #define VIDEO_FORMAT_NUM_COLORS_YVU9 0x00000010
  578. #define VIDEO_FORMAT_NUM_COLORS_I420 0x00000020
  579. #define VIDEO_FORMAT_NUM_COLORS_IYUV 0x00000040
  580. #define VIDEO_FORMAT_NUM_COLORS_YUY2 0x00000080
  581. #define VIDEO_FORMAT_NUM_COLORS_UYVY 0x00000100
  582. // dwDialogs of VIDEOINCAPS
  583. /*****************************************************************************
  584. * @doc EXTERNAL CONSTANTS
  585. *
  586. * @const 0x00000000 | FORMAT_DLG_OFF | Disable video format dialog.
  587. *
  588. * @const 0x00000000 | SOURCE_DLG_OFF | Disable source dialog.
  589. *
  590. * @const 0x00000001 | FORMAT_DLG_ON | Enable video format dialog.
  591. *
  592. * @const 0x00000002 | SOURCE_DLG_ON | Enable source dialog.
  593. *
  594. ****************************************************************************/
  595. #define FORMAT_DLG_OFF 0x00000000
  596. #define SOURCE_DLG_OFF 0x00000000
  597. #define FORMAT_DLG_ON 0x00000001
  598. #define SOURCE_DLG_ON 0x00000002
  599. // dwFormats of VIDEOOUTCAPS
  600. /*****************************************************************************
  601. * @doc EXTERNAL CONSTANTS
  602. *
  603. * @const 0x00000001 | VIDEO_FORMAT_04 | Video output device supports 4bit DIBs
  604. *
  605. * @const 0x00000002 | VIDEO_FORMAT_08 | Video output device supports 8bit DIBs
  606. *
  607. * @const 0x00000004 | VIDEO_FORMAT_16 | Video output device supports 16bit DIBs
  608. *
  609. * @const 0x00000008 | VIDEO_FORMAT_24 | Video output device supports 24bit DIBs
  610. *
  611. * @const 0x00000008 | VIDEO_FORMAT_32 | Video output device supports 32bit DIBs
  612. *
  613. ****************************************************************************/
  614. #define VIDEO_FORMAT_04 0x00000001
  615. #define VIDEO_FORMAT_08 0x00000002
  616. #define VIDEO_FORMAT_16 0x00000004
  617. #define VIDEO_FORMAT_24 0x00000008
  618. #define VIDEO_FORMAT_32 0x00000010
  619. /****************************************************************************
  620. Error Return Values
  621. ****************************************************************************/
  622. /*****************************************************************************
  623. * @doc EXTERNAL CONSTANTS
  624. *
  625. * @const WAVERR_BASE | VIDEOERR_BASE | Base for video errors.
  626. *
  627. * @const (VIDEOERR_BASE + 0) | VIDEOERR_BADFORMAT | Unsupported video format.
  628. *
  629. * @const (VIDEOERR_BASE + 1) | VIDEOERR_INQUEUE | Header is already or still queued.
  630. *
  631. * @const (VIDEOERR_BASE + 2) | VIDEOERR_UNPREPARED | Header is not prepared.
  632. *
  633. * @const (VIDEOERR_BASE + 3) | VIDEOERR_NONSPECIFIC | Non specific error.
  634. *
  635. * @const (VIDEOERR_BASE + 3) | VIDEOERR_LASTERROR | Last video error in range.
  636. *
  637. ****************************************************************************/
  638. #define VIDEOERR_BASE WAVERR_BASE /* base for video errors */
  639. #define VIDEOERR_BADFORMAT (VIDEOERR_BASE + 0) /* unsupported video format */
  640. #define VIDEOERR_INQUEUE (VIDEOERR_BASE + 1) /* header is already queued */
  641. #define VIDEOERR_UNPREPARED (VIDEOERR_BASE + 2) /* header not prepared */
  642. #define VIDEOERR_NONSPECIFIC (VIDEOERR_BASE + 3) /* non specific */
  643. #define VIDEOERR_LASTERROR (VIDEOERR_BASE + 3) /* last error in range */
  644. #ifdef __cplusplus
  645. } /* End of extern "C" { */
  646. #endif /* __cplusplus */
  647. #pragma pack() /* Revert to default packing */
  648. #endif /* _INC_VIDEOINOUT */