Leaked source code of windows server 2003
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.

640 lines
28 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. //
  8. // Copyright (c) 1996 - 1998 Microsoft Corporation. All Rights Reserved.
  9. //
  10. //===========================================================================
  11. //
  12. // External functions
  13. //
  14. #include "sonydcam.h"
  15. //
  16. // Local variables
  17. //
  18. CAMERA_ISOCH_INFO IsochInfoTable[] = {
  19. 0, SPEED_FLAGS_100, 0, // Reserved <---+
  20. 0, SPEED_FLAGS_100, 0, // 3.75 fps |
  21. 15, SPEED_FLAGS_100, 57600, // 7.5 fps |
  22. 30, SPEED_FLAGS_100, 57600, // 15 fps +- Mode0
  23. 60, SPEED_FLAGS_100, 57600, // 30 fps |
  24. 0, SPEED_FLAGS_100, 0, // 60 fps <---+
  25. 0, SPEED_FLAGS_100, 0, // Reserved <---+
  26. 20, SPEED_FLAGS_100, 153600, // 3.75 fps |
  27. 40, SPEED_FLAGS_100, 153600, // 7.5 fps |
  28. 80, SPEED_FLAGS_100, 153600, // 15 fps +- Mode1
  29. 160, SPEED_FLAGS_100, 153600, // 30 fps |
  30. 0, SPEED_FLAGS_100, 0, // 60 fps <---+
  31. 0, SPEED_FLAGS_100, 0, // Reserved <---+
  32. 60, SPEED_FLAGS_100, 460800, // 3.75 fps |
  33. 120, SPEED_FLAGS_100, 460800, // 7.5 fps |
  34. 240, SPEED_FLAGS_100, 460800, // 15 fps +- Mode2
  35. 480, SPEED_FLAGS_200, 460800, // 30 fps |
  36. 0, SPEED_FLAGS_100, 0, // 60 fps <---+
  37. 0, SPEED_FLAGS_100, 0, // Reserved <---+
  38. 80, SPEED_FLAGS_100, 614400, // 3.75 fps |
  39. 160, SPEED_FLAGS_100, 614400, // 7.5 fps |
  40. 320, SPEED_FLAGS_200, 614400, // 15 fps +- Mode3
  41. 640, SPEED_FLAGS_400, 614400, // 30 fps |
  42. 0, SPEED_FLAGS_100, 0, // 60 fps <---+
  43. 0, SPEED_FLAGS_100, 0, // Reserved <---+
  44. 120, SPEED_FLAGS_100, 921600, // 3.75 fps |
  45. 240, SPEED_FLAGS_100, 921600, // 7.5 fps |
  46. 480, SPEED_FLAGS_200, 921600, // 15 fps +- Mode4
  47. 960, SPEED_FLAGS_400, 921600, // 30 fps |
  48. 0, SPEED_FLAGS_100, 0, // 60 fps <---+
  49. 0, SPEED_FLAGS_100, 0, // Reserved <---+
  50. 40, SPEED_FLAGS_100, 307200, // 3.75 fps |
  51. 80, SPEED_FLAGS_100, 307200, // 7.5 fps |
  52. 160, SPEED_FLAGS_100, 307200, // 15 fps +- Mode5
  53. 320, SPEED_FLAGS_200, 307200, // 30 fps |
  54. 640, SPEED_FLAGS_400, 307200, // 60 fps <---+
  55. };
  56. // ------------------------------------------------------------------------
  57. // Property set for all video capture streams
  58. // ------------------------------------------------------------------------
  59. DEFINE_KSPROPERTY_TABLE(VideoStreamConnectionProperties)
  60. {
  61. DEFINE_KSPROPERTY_ITEM
  62. (
  63. KSPROPERTY_CONNECTION_ALLOCATORFRAMING,
  64. TRUE, // GetSupported or Handler
  65. sizeof(KSPROPERTY), // MinProperty
  66. sizeof(KSALLOCATOR_FRAMING), // MinData
  67. FALSE, // SetSupported or Handler
  68. NULL, // Values
  69. 0, // RelationsCount
  70. NULL, // Relations
  71. NULL, // SupportHandler
  72. sizeof(ULONG) // SerializedSize
  73. ),
  74. };
  75. DEFINE_KSPROPERTY_TABLE(VideoStreamDroppedFramesProperties)
  76. {
  77. DEFINE_KSPROPERTY_ITEM
  78. (
  79. KSPROPERTY_DROPPEDFRAMES_CURRENT,
  80. TRUE, // GetSupported or Handler
  81. sizeof(KSPROPERTY_DROPPEDFRAMES_CURRENT_S),// MinProperty
  82. sizeof(KSPROPERTY_DROPPEDFRAMES_CURRENT_S),// MinData
  83. FALSE, // SetSupported or Handler
  84. NULL, // Values
  85. 0, // RelationsCount
  86. NULL, // Relations
  87. NULL, // SupportHandler
  88. 0 // SerializedSize
  89. ),
  90. };
  91. // ------------------------------------------------------------------------
  92. // Array of all of the property sets supported by video streams
  93. // ------------------------------------------------------------------------
  94. DEFINE_KSPROPERTY_SET_TABLE(VideoStreamProperties)
  95. {
  96. DEFINE_KSPROPERTY_SET
  97. (
  98. &KSPROPSETID_Connection, // Set
  99. SIZEOF_ARRAY(VideoStreamConnectionProperties), // PropertiesCount
  100. VideoStreamConnectionProperties, // PropertyItem
  101. 0, // FastIoCount
  102. NULL // FastIoTable
  103. ),
  104. DEFINE_KSPROPERTY_SET
  105. (
  106. &PROPSETID_VIDCAP_DROPPEDFRAMES, // Set
  107. SIZEOF_ARRAY(VideoStreamDroppedFramesProperties), // PropertiesCount
  108. VideoStreamDroppedFramesProperties, // PropertyItem
  109. 0, // FastIoCount
  110. NULL // FastIoTable
  111. ),
  112. };
  113. #define NUMBER_VIDEO_STREAM_PROPERTIES (SIZEOF_ARRAY(VideoStreamProperties))
  114. #ifndef mmioFOURCC
  115. #define mmioFOURCC( ch0, ch1, ch2, ch3 ) \
  116. ( (DWORD)(BYTE)(ch0) | ( (DWORD)(BYTE)(ch1) << 8 ) | \
  117. ( (DWORD)(BYTE)(ch2) << 16 ) | ( (DWORD)(BYTE)(ch3) << 24 ) )
  118. #endif
  119. //
  120. // FourCC of the YUV formats
  121. // For information about FourCC, go to http://www.webartz.com/fourcc/indexyuv.htm
  122. //
  123. #define FOURCC_Y444 mmioFOURCC('Y', '4', '4', '4') // TIYUV: 1394 conferencing camera 4:4:4 mode 0
  124. #define FOURCC_UYVY mmioFOURCC('U', 'Y', 'V', 'Y') // MSYUV: 1394 conferencing camera 4:4:4 mode 1 and 3
  125. #define FOURCC_Y411 mmioFOURCC('Y', '4', '1', '1') // TIYUV: 1394 conferencing camera 4:1:1 mode 2
  126. #define FOURCC_Y800 mmioFOURCC('Y', '8', '0', '0') // TIYUV: 1394 conferencing camera 4:1:1 mode 5
  127. #ifdef SUPPORT_YUV444
  128. #define DX 160
  129. #define DY 120
  130. #define DBITCOUNT 32
  131. KS_DATARANGE_VIDEO DCAM_StreamMode_0 =
  132. {
  133. // KSDATARANGE
  134. {
  135. sizeof (KS_DATARANGE_VIDEO), // Flags
  136. 0,
  137. 57600, // SampleSize
  138. 0, // Reserved
  139. STATIC_KSDATAFORMAT_TYPE_VIDEO,
  140. FOURCC_Y444, 0x0000, 0x0010, 0x80, 0x00, 0x00, 0xaa, 0x00, 0x38, 0x9b, 0x71,
  141. STATIC_KSDATAFORMAT_SPECIFIER_VIDEOINFO
  142. },
  143. TRUE, // BOOL, bFixedSizeSamples (all samples same size?)
  144. TRUE, // BOOL, bTemporalCompression (all I frames?)
  145. KS_VIDEOSTREAM_CAPTURE, // StreamDescriptionFlags (KS_VIDEO_DESC_*)
  146. 0, // MemoryAllocationFlags (KS_VIDEO_ALLOC_*)
  147. // _KS_VIDEO_STREAM_CONFIG_CAPS
  148. {
  149. STATIC_KSDATAFORMAT_SPECIFIER_VIDEOINFO,
  150. KS_AnalogVideo_None, // AnalogVideoStandard
  151. DX,DY, // InputSize, (the inherent size of the incoming signal
  152. // with every digitized pixel unique)
  153. DX,DY, // MinCroppingSize, smallest rcSrc cropping rect allowed
  154. DX,DY, // MaxCroppingSize, largest rcSrc cropping rect allowed
  155. 1, // CropGranularityX, granularity of cropping size
  156. 1, // CropGranularityY
  157. 1, // CropAlignX, alignment of cropping rect
  158. 1, // CropAlignY;
  159. DX, DY, // MinOutputSize, smallest bitmap stream can produce
  160. DX, DY, // MaxOutputSize, largest bitmap stream can produce
  161. DX, // OutputGranularityX, granularity of output bitmap size
  162. DY, // OutputGranularityY;
  163. 0, // StretchTapsX (0 no stretch, 1 pix dup, 2 interp...)
  164. 0, // StretchTapsY
  165. 0, // ShrinkTapsX
  166. 0, // ShrinkTapsY
  167. // Allow 1% difference
  168. 333000, // MinFrameInterval (10,000,000 / 30.00FPS), 100nS units
  169. 1333333, // MaxFrameInterval (10,000,000 / 7.50FPS), 100nS units
  170. 4608000, // (DX * DY * DBITCOUNT) * DFPS_MIN, // MinBitsPerSecond (7.50 FPS);
  171. 36864000, // (DX * DY * DBITCOUNT) * DFPS_MAX // MaxBitsPerSecond (30.0 FPS);
  172. },
  173. // KS_VIDEOINFOHEADER (default format)
  174. {
  175. 0,0,0,0, // RECT rcSource;
  176. 0,0,0,0, // RECT rcTarget;
  177. 13824000, // DWORD dwBitRate; 57600 * 30FPS * 8 bit/Byte
  178. 0L, // DWORD dwBitErrorRate;
  179. 333333, // REFERENCE_TIME AvgTimePerFrame (30 FPS);
  180. sizeof (KS_BITMAPINFOHEADER), // DWORD biSize;
  181. DX, // LONG biWidth;
  182. DY, // LONG biHeight;
  183. 1, // WORD biPlanes;
  184. DBITCOUNT, // WORD biBitCount;
  185. FOURCC_Y444, // DWORD biCompression;
  186. 57600, // DWORD biSizeImage;
  187. 0, // LONG biXPelsPerMeter;
  188. 0, // LONG biYPelsPerMeter;
  189. 0, // DWORD biClrUsed;
  190. 0 // DWORD biClrImportant;
  191. }
  192. };
  193. #endif
  194. #undef DX
  195. #undef DY
  196. #undef DBITCOUNT
  197. #define DX 320
  198. #define DY 240
  199. #define DBITCOUNT 16
  200. KS_DATARANGE_VIDEO DCAM_StreamMode_1 =
  201. {
  202. // KSDATARANGE
  203. {
  204. sizeof (KS_DATARANGE_VIDEO), // Flags
  205. 0,
  206. 153600, // SampleSize
  207. 0, // Reserved
  208. STATIC_KSDATAFORMAT_TYPE_VIDEO,
  209. FOURCC_UYVY, 0x0000, 0x0010, 0x80, 0x00, 0x00, 0xaa, 0x00, 0x38, 0x9b, 0x71,
  210. STATIC_KSDATAFORMAT_SPECIFIER_VIDEOINFO
  211. },
  212. TRUE, // BOOL, bFixedSizeSamples (all samples same size?)
  213. TRUE, // BOOL, bTemporalCompression (all I frames?)
  214. KS_VIDEOSTREAM_CAPTURE, // StreamDescriptionFlags (KS_VIDEO_DESC_*)
  215. 0, // MemoryAllocationFlags (KS_VIDEO_ALLOC_*)
  216. // _KS_VIDEO_STREAM_CONFIG_CAPS
  217. {
  218. STATIC_KSDATAFORMAT_SPECIFIER_VIDEOINFO,
  219. KS_AnalogVideo_None, // AnalogVideoStandard
  220. DX,DY, // InputSize, (the inherent size of the incoming signal
  221. // with every digitized pixel unique)
  222. DX,DY, // MinCroppingSize, smallest rcSrc cropping rect allowed
  223. DX,DY, // MaxCroppingSize, largest rcSrc cropping rect allowed
  224. 1, // CropGranularityX, granularity of cropping size
  225. 1, // CropGranularityY
  226. 1, // CropAlignX, alignment of cropping rect
  227. 1, // CropAlignY;
  228. DX, DY, // MinOutputSize, smallest bitmap stream can produce
  229. DX, DY, // MaxOutputSize, largest bitmap stream can produce
  230. DX, // OutputGranularityX, granularity of output bitmap size
  231. DY, // OutputGranularityY;
  232. 0, // StretchTapsX (0 no stretch, 1 pix dup, 2 interp...)
  233. 0, // StretchTapsY
  234. 0, // ShrinkTapsX
  235. 0, // ShrinkTapsY
  236. // Allow 1% difference
  237. 333000, // MinFrameInterval (10,000,000 / 30.00FPS), 100nS units
  238. 2666666, // MaxFrameInterval (10,000,000 / 3.75FPS), 100nS units
  239. 4608000, // (DX * DY * DBITCOUNT) * DFPS_MIN, // MinBitsPerSecond (3.75 FPS);
  240. 36864000, // (DX * DY * DBITCOUNT) * DFPS_MAX // MaxBitsPerSecond (30.0 FPS);
  241. },
  242. // KS_VIDEOINFOHEADER (default format)
  243. {
  244. 0,0,0,0, // RECT rcSource;
  245. 0,0,0,0, // RECT rcTarget;
  246. 18432000, // DWORD dwBitRate; 153600 * 15FPS * 8 bit/Byte
  247. 0L, // DWORD dwBitErrorRate;
  248. 666666, // REFERENCE_TIME AvgTimePerFrame (15 FPS);
  249. sizeof (KS_BITMAPINFOHEADER), // DWORD biSize;
  250. DX, // LONG biWidth;
  251. DY, // LONG biHeight;
  252. 1, // WORD biPlanes;
  253. DBITCOUNT, // WORD biBitCount;
  254. FOURCC_UYVY, // DWORD biCompression;
  255. 153600, // DWORD biSizeImage;
  256. 0, // LONG biXPelsPerMeter;
  257. 0, // LONG biYPelsPerMeter;
  258. 0, // DWORD biClrUsed;
  259. 0 // DWORD biClrImportant;
  260. }
  261. };
  262. #ifdef SUPPORT_YUV411
  263. #undef DX
  264. #undef DY
  265. #undef DBITCOUNT
  266. //
  267. // This has format of UYYV YYUY YVYY (8Y+2U+2V = 12 bytes = 8 pixels)
  268. //
  269. #define DX 640
  270. #define DY 480
  271. #define DBITCOUNT 12
  272. // To support Mode 2, 640x480, FourCC=Y411
  273. KS_DATARANGE_VIDEO DCAM_StreamMode_2 =
  274. {
  275. // KSDATARANGE
  276. {
  277. sizeof (KS_DATARANGE_VIDEO),
  278. 0, // Flags
  279. 460800, // SampleSize
  280. 0, // Reserved
  281. STATIC_KSDATAFORMAT_TYPE_VIDEO,
  282. FOURCC_Y411, 0x0000, 0x0010, 0x80, 0x00, 0x00, 0xaa, 0x00, 0x38, 0x9b, 0x71,
  283. STATIC_KSDATAFORMAT_SPECIFIER_VIDEOINFO
  284. },
  285. TRUE, // BOOL, bFixedSizeSamples (all samples same size?)
  286. TRUE, // BOOL, bTemporalCompression (all I frames?)
  287. KS_VIDEOSTREAM_CAPTURE, // StreamDescriptionFlags (KS_VIDEO_DESC_*)
  288. 0, // MemoryAllocationFlags (KS_VIDEO_ALLOC_*)
  289. // _KS_VIDEO_STREAM_CONFIG_CAPS
  290. {
  291. STATIC_KSDATAFORMAT_SPECIFIER_VIDEOINFO,
  292. KS_AnalogVideo_None, // AnalogVideoStandard
  293. DX,DY, // InputSize, (the inherent size of the incoming signal
  294. // with every digitized pixel unique)
  295. DX,DY, // MinCroppingSize, smallest rcSrc cropping rect allowed
  296. DX,DY, // MaxCroppingSize, largest rcSrc cropping rect allowed
  297. 1, // CropGranularityX, granularity of cropping size
  298. 1, // CropGranularityY
  299. 1, // CropAlignX, alignment of cropping rect
  300. 1, // CropAlignY;
  301. DX, DY, // MinOutputSize, smallest bitmap stream can produce
  302. DX, DY, // MaxOutputSize, largest bitmap stream can produce
  303. DX, // OutputGranularityX, granularity of output bitmap size
  304. DY, // OutputGranularityY;
  305. 0, // StretchTapsX (0 no stretch, 1 pix dup, 2 interp...)
  306. 0, // StretchTapsY
  307. 0, // ShrinkTapsX
  308. 0, // ShrinkTapsY
  309. // allow 1% difference
  310. 333000, // MinFrameInterval (10,000,000 / 30.00FPS), 100nS units
  311. 2666666, // MaxFrameInterval (10,000,000 / 3.75FPS), 100nS units
  312. 27648000, // MinBitsPerSecond (7.5 FPS);
  313. 110592000 // MaxBitsPerSecond (30.0 FPS);
  314. },
  315. // KS_VIDEOINFOHEADER (default format)
  316. {
  317. 0,0,0,0, // RECT rcSource;
  318. 0,0,0,0, // RECT rcTarget;
  319. 110592000, // DWORD dwBitRate;
  320. 0L, // DWORD dwBitErrorRate;
  321. 333333, // REFERENCE_TIME AvgTimePerFrame (30 FPS);
  322. sizeof (KS_BITMAPINFOHEADER), // DWORD biSize;
  323. DX, // LONG biWidth;
  324. DY, // LONG biHeight;
  325. 1, // WORD biPlanes;
  326. DBITCOUNT, // WORD biBitCount;
  327. FOURCC_Y411, // DWORD biCompression;
  328. 460800, // DWORD biSizeImage;
  329. 0, // LONG biXPelsPerMeter;
  330. 0, // LONG biYPelsPerMeter;
  331. 0, // DWORD biClrUsed;
  332. 0 // DWORD biClrImportant;
  333. }
  334. };
  335. #endif // SUPPORT_YUV411
  336. #undef DX
  337. #undef DY
  338. #undef DBITCOUNT
  339. #define DX 640
  340. #define DY 480
  341. #define DBITCOUNT 16
  342. // To support mode3, 640x480
  343. KS_DATARANGE_VIDEO DCAM_StreamMode_3 =
  344. {
  345. // KSDATARANGE
  346. {
  347. sizeof (KS_DATARANGE_VIDEO),
  348. 0, // Flags
  349. 614400, // SampleSize
  350. 0, // Reserved
  351. STATIC_KSDATAFORMAT_TYPE_VIDEO,
  352. FOURCC_UYVY, 0x0000, 0x0010, 0x80, 0x00, 0x00, 0xaa, 0x00, 0x38, 0x9b, 0x71,
  353. STATIC_KSDATAFORMAT_SPECIFIER_VIDEOINFO
  354. },
  355. TRUE, // BOOL, bFixedSizeSamples (all samples same size?)
  356. TRUE, // BOOL, bTemporalCompression (all I frames?)
  357. KS_VIDEOSTREAM_CAPTURE, // StreamDescriptionFlags (KS_VIDEO_DESC_*)
  358. 0, // MemoryAllocationFlags (KS_VIDEO_ALLOC_*)
  359. // _KS_VIDEO_STREAM_CONFIG_CAPS
  360. {
  361. STATIC_KSDATAFORMAT_SPECIFIER_VIDEOINFO,
  362. KS_AnalogVideo_None, // AnalogVideoStandard
  363. DX,DY, // InputSize, (the inherent size of the incoming signal
  364. // with every digitized pixel unique)
  365. DX,DY, // MinCroppingSize, smallest rcSrc cropping rect allowed
  366. DX,DY, // MaxCroppingSize, largest rcSrc cropping rect allowed
  367. 1, // CropGranularityX, granularity of cropping size
  368. 1, // CropGranularityY
  369. 1, // CropAlignX, alignment of cropping rect
  370. 1, // CropAlignY;
  371. DX, DY, // MinOutputSize, smallest bitmap stream can produce
  372. DX, DY, // MaxOutputSize, largest bitmap stream can produce
  373. DX, // OutputGranularityX, granularity of output bitmap size
  374. DY, // OutputGranularityY;
  375. 0, // StretchTapsX (0 no stretch, 1 pix dup, 2 interp...)
  376. 0, // StretchTapsY
  377. 0, // ShrinkTapsX
  378. 0, // ShrinkTapsY
  379. 666666, // MinFrameInterval (10,000,000 / 15.00FPS), 100nS units
  380. 2666666, // MaxFrameInterval (10,000,000 / 3.75FPS), 100nS units
  381. 36864000, // MinBitsPerSecond ( 7.5 FPS);
  382. 73728000, // MaxBitsPerSecond (15 FPS);
  383. },
  384. // KS_VIDEOINFOHEADER (default format)
  385. {
  386. 0,0,0,0, // RECT rcSource;
  387. 0,0,0,0, // RECT rcTarget;
  388. 73728000, // DWORD dwBitRate;
  389. 0L, // DWORD dwBitErrorRate;
  390. 666666, // REFERENCE_TIME AvgTimePerFrame (15 FPS);
  391. sizeof (KS_BITMAPINFOHEADER), // DWORD biSize;
  392. DX, // LONG biWidth;
  393. DY, // LONG biHeight;
  394. 1, // WORD biPlanes;
  395. DBITCOUNT, // WORD biBitCount;
  396. FOURCC_UYVY, // DWORD biCompression;
  397. 614400, // DWORD biSizeImage;
  398. 0, // LONG biXPelsPerMeter;
  399. 0, // LONG biYPelsPerMeter;
  400. 0, // DWORD biClrUsed;
  401. 0 // DWORD biClrImportant;
  402. }
  403. };
  404. #ifdef SUPPORT_RGB24
  405. #undef DX
  406. #undef DY
  407. #undef DBITCOUNT
  408. #undef DFPS_DEF
  409. #undef DFPS_MAX
  410. #undef DFPS_MIN
  411. #define DX 640
  412. #define DY 480
  413. #define DBITCOUNT 24
  414. // To support mode4, 640x480, RGB
  415. KS_DATARANGE_VIDEO DCAM_StreamMode_4 =
  416. {
  417. // KSDATARANGE
  418. {
  419. sizeof (KS_DATARANGE_VIDEO),
  420. 0, // Flags
  421. 921600, // SampleSize
  422. 0, // Reserved
  423. STATIC_KSDATAFORMAT_TYPE_VIDEO,
  424. 0xe436eb7d, 0x524f, 0x11ce, 0x9f, 0x53, 0x00, 0x20, 0xaf, 0x0b, 0xa7, 0x70,
  425. STATIC_KSDATAFORMAT_SPECIFIER_VIDEOINFO
  426. },
  427. TRUE, // BOOL, bFixedSizeSamples (all samples same size?)
  428. TRUE, // BOOL, bTemporalCompression (all I frames?)
  429. KS_VIDEOSTREAM_CAPTURE, // StreamDescriptionFlags (KS_VIDEO_DESC_*)
  430. 0, // MemoryAllocationFlags (KS_VIDEO_ALLOC_*)
  431. // _KS_VIDEO_STREAM_CONFIG_CAPS
  432. {
  433. STATIC_KSDATAFORMAT_SPECIFIER_VIDEOINFO,
  434. KS_AnalogVideo_None, // AnalogVideoStandard
  435. DX,DY, // InputSize, (the inherent size of the incoming signal
  436. // with every digitized pixel unique)
  437. DX,DY, // MinCroppingSize, smallest rcSrc cropping rect allowed
  438. DX,DY, // MaxCroppingSize, largest rcSrc cropping rect allowed
  439. 1, // CropGranularityX, granularity of cropping size
  440. 1, // CropGranularityY
  441. 1, // CropAlignX, alignment of cropping rect
  442. 1, // CropAlignY;
  443. DX, DY, // MinOutputSize, smallest bitmap stream can produce
  444. DX, DY, // MaxOutputSize, largest bitmap stream can produce
  445. DX, // OutputGranularityX, granularity of output bitmap size
  446. DY, // OutputGranularityY;
  447. 0, // StretchTapsX (0 no stretch, 1 pix dup, 2 interp...)
  448. 0, // StretchTapsY
  449. 0, // ShrinkTapsX
  450. 0, // ShrinkTapsY
  451. 666666, // MinFrameInterval (10,000,000 / 15.00FPS), 100nS units
  452. 2666666, // MaxFrameInterval (10,000,000 / 3.75FPS), 100nS units
  453. 55296000, // MinBitsPerSecond ( 7.50 FPS);
  454. 110592000 // MaxBitsPerSecond (15.00 FPS);
  455. },
  456. // KS_VIDEOINFOHEADER (default format)
  457. {
  458. 0,0,0,0, // RECT rcSource;
  459. 0,0,0,0, // RECT rcTarget;
  460. 110592000, // DWORD dwBitRate;
  461. 0L, // DWORD dwBitErrorRate;
  462. 666666, // REFERENCE_TIME AvgTimePerFrame (15 FPS);
  463. sizeof (KS_BITMAPINFOHEADER), // DWORD biSize;
  464. DX, // LONG biWidth;
  465. -DY, // LONG biHeight; -biHeight indicate TopDown for RGB
  466. 1, // WORD biPlanes;
  467. DBITCOUNT, // WORD biBitCount;
  468. KS_BI_RGB, // DWORD biCompression;
  469. 921600, // DWORD biSizeImage;
  470. 0, // LONG biXPelsPerMeter;
  471. 0, // LONG biYPelsPerMeter;
  472. 0, // DWORD biClrUsed;
  473. 0 // DWORD biClrImportant;
  474. }
  475. };
  476. #endif // SUPPORT_RGB24
  477. #ifdef SUPPORT_YUV800
  478. #undef DX
  479. #undef DY
  480. #undef DBITCOUNT
  481. #define DX 640
  482. #define DY 480
  483. #define DBITCOUNT 8
  484. KS_DATARANGE_VIDEO DCAM_StreamMode_5 =
  485. {
  486. // KSDATARANGE
  487. {
  488. sizeof (KS_DATARANGE_VIDEO), // Flags
  489. 0,
  490. 307200, // SampleSize
  491. 0, // Reserved
  492. STATIC_KSDATAFORMAT_TYPE_VIDEO,
  493. FOURCC_Y800, 0x0000, 0x0010, 0x80, 0x00, 0x00, 0xaa, 0x00, 0x38, 0x9b, 0x71,
  494. STATIC_KSDATAFORMAT_SPECIFIER_VIDEOINFO
  495. },
  496. TRUE, // BOOL, bFixedSizeSamples (all samples same size?)
  497. TRUE, // BOOL, bTemporalCompression (all I frames?)
  498. KS_VIDEOSTREAM_CAPTURE, // StreamDescriptionFlags (KS_VIDEO_DESC_*)
  499. 0, // MemoryAllocationFlags (KS_VIDEO_ALLOC_*)
  500. // _KS_VIDEO_STREAM_CONFIG_CAPS
  501. {
  502. STATIC_KSDATAFORMAT_SPECIFIER_VIDEOINFO,
  503. KS_AnalogVideo_None, // AnalogVideoStandard
  504. DX,DY, // InputSize, (the inherent size of the incoming signal
  505. // with every digitized pixel unique)
  506. DX,DY, // MinCroppingSize, smallest rcSrc cropping rect allowed
  507. DX,DY, // MaxCroppingSize, largest rcSrc cropping rect allowed
  508. 1, // CropGranularityX, granularity of cropping size
  509. 1, // CropGranularityY
  510. 1, // CropAlignX, alignment of cropping rect
  511. 1, // CropAlignY;
  512. DX, DY, // MinOutputSize, smallest bitmap stream can produce
  513. DX, DY, // MaxOutputSize, largest bitmap stream can produce
  514. DX, // OutputGranularityX, granularity of output bitmap size
  515. DY, // OutputGranularityY;
  516. 0, // StretchTapsX (0 no stretch, 1 pix dup, 2 interp...)
  517. 0, // StretchTapsY
  518. 0, // ShrinkTapsX
  519. 0, // ShrinkTapsY
  520. // Allow 1% difference
  521. 333000, // MinFrameInterval (10,000,000 / 30.00FPS), 100nS units
  522. 2666666, // MaxFrameInterval (10,000,000 / 3.75FPS), 100nS units
  523. 4608000, // (DX * DY * DBITCOUNT) * DFPS_MIN, // MinBitsPerSecond (3.75 FPS);
  524. 36864000, // (DX * DY * DBITCOUNT) * DFPS_MAX // MaxBitsPerSecond (30.0 FPS);
  525. },
  526. // KS_VIDEOINFOHEADER (default format)
  527. {
  528. 0,0,0,0, // RECT rcSource;
  529. 0,0,0,0, // RECT rcTarget;
  530. 73728000, // DWORD dwBitRate; 307200 * 30FPS * 8 bit/Byte
  531. 0L, // DWORD dwBitErrorRate;
  532. 333333, // REFERENCE_TIME AvgTimePerFrame (30 FPS);
  533. sizeof (KS_BITMAPINFOHEADER), // DWORD biSize;
  534. DX, // LONG biWidth;
  535. DY, // LONG biHeight;
  536. 1, // WORD biPlanes;
  537. DBITCOUNT, // WORD biBitCount;
  538. FOURCC_Y800, // DWORD biCompression;
  539. 307200, // DWORD biSizeImage;
  540. 0, // LONG biXPelsPerMeter;
  541. 0, // LONG biYPelsPerMeter;
  542. 0, // DWORD biClrUsed;
  543. 0 // DWORD biClrImportant;
  544. }
  545. };
  546. #endif
  547. //---------------------------------------------------------------------------
  548. // Topology
  549. //---------------------------------------------------------------------------
  550. // Categories define what the device does.
  551. static GUID Categories[] = {
  552. STATIC_KSCATEGORY_VIDEO,
  553. STATIC_KSCATEGORY_CAPTURE
  554. };
  555. #define NUMBER_OF_CATEGORIES SIZEOF_ARRAY (Categories)
  556. static KSTOPOLOGY Topology = {
  557. NUMBER_OF_CATEGORIES,
  558. (GUID*) &Categories,
  559. 0,
  560. NULL,
  561. 0,
  562. NULL
  563. };