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.

767 lines
34 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) 1992 - 1999 Microsoft Corporation. All Rights Reserved.
  9. //
  10. //==========================================================================;
  11. #ifndef __CAPSTRM_H__
  12. #define __CAPSTRM_H__
  13. #ifdef __cplusplus
  14. extern "C" {
  15. #endif // __cplusplus
  16. KSPIN_MEDIUM StandardMedium = {
  17. STATIC_KSMEDIUMSETID_Standard,
  18. 0, 0
  19. };
  20. // ------------------------------------------------------------------------
  21. // Property sets for all video capture streams
  22. // ------------------------------------------------------------------------
  23. DEFINE_KSPROPERTY_TABLE(VideoStreamConnectionProperties)
  24. {
  25. DEFINE_KSPROPERTY_ITEM
  26. (
  27. KSPROPERTY_CONNECTION_ALLOCATORFRAMING,
  28. TRUE, // GetSupported or Handler
  29. sizeof(KSPROPERTY), // MinProperty
  30. sizeof(KSALLOCATOR_FRAMING), // MinData
  31. FALSE, // SetSupported or Handler
  32. NULL, // Values
  33. 0, // RelationsCount
  34. NULL, // Relations
  35. NULL, // SupportHandler
  36. 0 // SerializedSize
  37. ),
  38. };
  39. DEFINE_KSPROPERTY_TABLE(VideoStreamDroppedFramesProperties)
  40. {
  41. DEFINE_KSPROPERTY_ITEM
  42. (
  43. KSPROPERTY_DROPPEDFRAMES_CURRENT,
  44. TRUE, // GetSupported or Handler
  45. sizeof(KSPROPERTY_DROPPEDFRAMES_CURRENT_S),// MinProperty
  46. sizeof(KSPROPERTY_DROPPEDFRAMES_CURRENT_S),// MinData
  47. FALSE, // SetSupported or Handler
  48. NULL, // Values
  49. 0, // RelationsCount
  50. NULL, // Relations
  51. NULL, // SupportHandler
  52. 0 // SerializedSize
  53. ),
  54. };
  55. // ------------------------------------------------------------------------
  56. // Array of all of the property sets supported by video streams
  57. // ------------------------------------------------------------------------
  58. DEFINE_KSPROPERTY_SET_TABLE(VideoStreamProperties)
  59. {
  60. DEFINE_KSPROPERTY_SET
  61. (
  62. &KSPROPSETID_Connection, // Set
  63. SIZEOF_ARRAY(VideoStreamConnectionProperties), // PropertiesCount
  64. VideoStreamConnectionProperties, // PropertyItem
  65. 0, // FastIoCount
  66. NULL // FastIoTable
  67. ),
  68. DEFINE_KSPROPERTY_SET
  69. (
  70. &PROPSETID_VIDCAP_DROPPEDFRAMES, // Set
  71. SIZEOF_ARRAY(VideoStreamDroppedFramesProperties), // PropertiesCount
  72. VideoStreamDroppedFramesProperties, // PropertyItem
  73. 0, // FastIoCount
  74. NULL // FastIoTable
  75. ),
  76. };
  77. #define NUMBER_VIDEO_STREAM_PROPERTIES (SIZEOF_ARRAY(VideoStreamProperties))
  78. //---------------------------------------------------------------------------
  79. // All of the video and vbi data formats we might use
  80. //---------------------------------------------------------------------------
  81. #define D_X 320
  82. #define D_Y 240
  83. static KS_DATARANGE_VIDEO StreamFormatRGB24Bpp_Capture =
  84. {
  85. // KSDATARANGE
  86. {
  87. sizeof (KS_DATARANGE_VIDEO), // FormatSize
  88. 0, // Flags
  89. D_X * D_Y * 3, // SampleSize
  90. 0, // Reserved
  91. STATIC_KSDATAFORMAT_TYPE_VIDEO, // aka. MEDIATYPE_Video
  92. 0xe436eb7d, 0x524f, 0x11ce, 0x9f, 0x53, 0x00, 0x20, 0xaf, 0x0b, 0xa7, 0x70, //MEDIASUBTYPE_RGB24,
  93. STATIC_KSDATAFORMAT_SPECIFIER_VIDEOINFO // aka. FORMAT_VideoInfo
  94. },
  95. TRUE, // BOOL, bFixedSizeSamples (all samples same size?)
  96. TRUE, // BOOL, bTemporalCompression (all I frames?)
  97. 0, // Reserved (was StreamDescriptionFlags)
  98. 0, // Reserved (was MemoryAllocationFlags (KS_VIDEO_ALLOC_*))
  99. // _KS_VIDEO_STREAM_CONFIG_CAPS
  100. {
  101. STATIC_KSDATAFORMAT_SPECIFIER_VIDEOINFO, // GUID
  102. KS_AnalogVideo_NTSC_M |
  103. KS_AnalogVideo_PAL_B, // AnalogVideoStandard
  104. 720,480, // InputSize, (the inherent size of the incoming signal
  105. // with every digitized pixel unique)
  106. 160,120, // MinCroppingSize, smallest rcSrc cropping rect allowed
  107. 720,480, // MaxCroppingSize, largest rcSrc cropping rect allowed
  108. 8, // CropGranularityX, granularity of cropping size
  109. 1, // CropGranularityY
  110. 8, // CropAlignX, alignment of cropping rect
  111. 1, // CropAlignY;
  112. 160, 120, // MinOutputSize, smallest bitmap stream can produce
  113. 720, 480, // MaxOutputSize, largest bitmap stream can produce
  114. 8, // OutputGranularityX, granularity of output bitmap size
  115. 1, // OutputGranularityY;
  116. 0, // StretchTapsX (0 no stretch, 1 pix dup, 2 interp...)
  117. 0, // StretchTapsY
  118. 0, // ShrinkTapsX
  119. 0, // ShrinkTapsY
  120. 333667, // MinFrameInterval, 100 nS units
  121. 640000000, // MaxFrameInterval, 100 nS units
  122. 8 * 3 * 30 * 160 * 120, // MinBitsPerSecond;
  123. 8 * 3 * 30 * 720 * 480 // MaxBitsPerSecond;
  124. },
  125. // KS_VIDEOINFOHEADER (default format)
  126. {
  127. 0,0,0,0, // RECT rcSource;
  128. 0,0,0,0, // RECT rcTarget;
  129. D_X * D_Y * 3 * 30, // DWORD dwBitRate;
  130. 0L, // DWORD dwBitErrorRate;
  131. 333667, // REFERENCE_TIME AvgTimePerFrame;
  132. sizeof (KS_BITMAPINFOHEADER), // DWORD biSize;
  133. D_X, // LONG biWidth;
  134. D_Y, // LONG biHeight;
  135. 1, // WORD biPlanes;
  136. 24, // WORD biBitCount;
  137. KS_BI_RGB, // DWORD biCompression;
  138. D_X * D_Y * 3, // DWORD biSizeImage;
  139. 0, // LONG biXPelsPerMeter;
  140. 0, // LONG biYPelsPerMeter;
  141. 0, // DWORD biClrUsed;
  142. 0 // DWORD biClrImportant;
  143. }
  144. };
  145. #undef D_X
  146. #undef D_Y
  147. #define D_X 320
  148. #define D_Y 240
  149. static KS_DATARANGE_VIDEO StreamFormatUYU2_Capture =
  150. {
  151. // KSDATARANGE
  152. {
  153. sizeof (KS_DATARANGE_VIDEO), // FormatSize
  154. 0, // Flags
  155. D_X * D_Y * 2, // SampleSize
  156. 0, // Reserved
  157. STATIC_KSDATAFORMAT_TYPE_VIDEO, // aka. MEDIATYPE_Video
  158. 0x59565955, 0x0000, 0x0010, 0x80, 0x00, 0x00, 0xaa, 0x00, 0x38, 0x9b, 0x71, //MEDIASUBTYPE_UYVY,
  159. STATIC_KSDATAFORMAT_SPECIFIER_VIDEOINFO // aka. FORMAT_VideoInfo
  160. },
  161. TRUE, // BOOL, bFixedSizeSamples (all samples same size?)
  162. TRUE, // BOOL, bTemporalCompression (all I frames?)
  163. 0, // Reserved (was StreamDescriptionFlags)
  164. 0, // Reserved (was MemoryAllocationFlags (KS_VIDEO_ALLOC_*))
  165. // _KS_VIDEO_STREAM_CONFIG_CAPS
  166. {
  167. STATIC_KSDATAFORMAT_SPECIFIER_VIDEOINFO, // GUID
  168. KS_AnalogVideo_NTSC_M |
  169. KS_AnalogVideo_PAL_B, // AnalogVideoStandard
  170. 720,480, // InputSize, (the inherent size of the incoming signal
  171. // with every digitized pixel unique)
  172. 160,120, // MinCroppingSize, smallest rcSrc cropping rect allowed
  173. 720,480, // MaxCroppingSize, largest rcSrc cropping rect allowed
  174. 8, // CropGranularityX, granularity of cropping size
  175. 1, // CropGranularityY
  176. 8, // CropAlignX, alignment of cropping rect
  177. 1, // CropAlignY;
  178. 160, 120, // MinOutputSize, smallest bitmap stream can produce
  179. 720, 480, // MaxOutputSize, largest bitmap stream can produce
  180. 8, // OutputGranularityX, granularity of output bitmap size
  181. 1, // OutputGranularityY;
  182. 0, // StretchTapsX (0 no stretch, 1 pix dup, 2 interp...)
  183. 0, // StretchTapsY
  184. 0, // ShrinkTapsX
  185. 0, // ShrinkTapsY
  186. 333667, // MinFrameInterval, 100 nS units
  187. 640000000, // MaxFrameInterval, 100 nS units
  188. 8 * 2 * 30 * 160 * 120, // MinBitsPerSecond;
  189. 8 * 2 * 30 * 720 * 480 // MaxBitsPerSecond;
  190. },
  191. // KS_VIDEOINFOHEADER (default format)
  192. {
  193. 0,0,0,0, // RECT rcSource;
  194. 0,0,0,0, // RECT rcTarget;
  195. D_X * D_Y * 2 * 30, // DWORD dwBitRate;
  196. 0L, // DWORD dwBitErrorRate;
  197. 333667, // REFERENCE_TIME AvgTimePerFrame;
  198. sizeof (KS_BITMAPINFOHEADER), // DWORD biSize;
  199. D_X, // LONG biWidth;
  200. D_Y, // LONG biHeight;
  201. 1, // WORD biPlanes;
  202. 16, // WORD biBitCount;
  203. FOURCC_YUV422, // DWORD biCompression;
  204. D_X * D_Y * 2, // DWORD biSizeImage;
  205. 0, // LONG biXPelsPerMeter;
  206. 0, // LONG biYPelsPerMeter;
  207. 0, // DWORD biClrUsed;
  208. 0 // DWORD biClrImportant;
  209. }
  210. };
  211. #undef D_X
  212. #undef D_Y
  213. static KS_DATARANGE_ANALOGVIDEO StreamFormatAnalogVideo =
  214. {
  215. // KS_DATARANGE_ANALOGVIDEO
  216. {
  217. sizeof (KS_DATARANGE_ANALOGVIDEO), // FormatSize
  218. 0, // Flags
  219. sizeof (KS_TVTUNER_CHANGE_INFO), // SampleSize
  220. 0, // Reserved
  221. STATIC_KSDATAFORMAT_TYPE_ANALOGVIDEO, // aka MEDIATYPE_AnalogVideo
  222. STATIC_KSDATAFORMAT_SUBTYPE_NONE,
  223. STATIC_KSDATAFORMAT_SPECIFIER_ANALOGVIDEO, // aka FORMAT_AnalogVideo
  224. },
  225. // KS_ANALOGVIDEOINFO
  226. {
  227. 0, 0, 720, 480, // rcSource;
  228. 0, 0, 720, 480, // rcTarget;
  229. 720, // dwActiveWidth;
  230. 480, // dwActiveHeight;
  231. 0, // REFERENCE_TIME AvgTimePerFrame;
  232. }
  233. };
  234. #define VBIStride (768*2)
  235. #define VBISamples (768*2)
  236. #define VBIStart 10
  237. #define VBIEnd 21
  238. #define VBILines (((VBIEnd)-(VBIStart))+1)
  239. KS_DATARANGE_VIDEO_VBI StreamFormatVBI =
  240. {
  241. // KSDATARANGE
  242. {
  243. {
  244. sizeof( KS_DATARANGE_VIDEO_VBI ),
  245. 0,
  246. VBIStride * VBILines, // SampleSize
  247. 0, // Reserved
  248. { STATIC_KSDATAFORMAT_TYPE_VBI },
  249. { STATIC_KSDATAFORMAT_SUBTYPE_RAW8 },
  250. { STATIC_KSDATAFORMAT_SPECIFIER_VBI }
  251. }
  252. },
  253. TRUE, // BOOL, bFixedSizeSamples (all samples same size?)
  254. TRUE, // BOOL, bTemporalCompression (all I frames?)
  255. 0, // Reserved (was StreamDescriptionFlags)
  256. 0, // Reserved (was MemoryAllocationFlags (KS_VIDEO_ALLOC_*))
  257. // _KS_VIDEO_STREAM_CONFIG_CAPS
  258. {
  259. { STATIC_KSDATAFORMAT_SPECIFIER_VBI },
  260. KS_AnalogVideo_NTSC_M, // AnalogVideoStandard
  261. {
  262. VBIStride, 480 /*VBILines*/ // SIZE InputSize
  263. },
  264. {
  265. VBISamples, VBILines // SIZE MinCroppingSize; smallest rcSrc cropping rect allowed
  266. },
  267. {
  268. VBIStride, VBILines // SIZE MaxCroppingSize; largest rcSrc cropping rect allowed
  269. },
  270. 1, // int CropGranularityX; // granularity of cropping size
  271. 1, // int CropGranularityY;
  272. 1, // int CropAlignX; // alignment of cropping rect
  273. 1, // int CropAlignY;
  274. {
  275. VBISamples, VBILines // SIZE MinOutputSize; // smallest bitmap stream can produce
  276. },
  277. {
  278. VBIStride, VBILines // SIZE MaxOutputSize; // largest bitmap stream can produce
  279. },
  280. 1, // int OutputGranularityX; // granularity of output bitmap size
  281. 2, // int OutputGranularityY;
  282. 0, // StretchTapsX (0 no stretch, 1 pix dup, 2 interp...)
  283. 0, // StretchTapsY
  284. 0, // ShrinkTapsX
  285. 0, // ShrinkTapsY
  286. 166834, // LONGLONG MinFrameInterval; // 100 nS units
  287. 166834, // LONGLONG MaxFrameInterval; // 16683.4uS == 1/60 sec
  288. VBIStride * VBILines * 8 * 30 * 2, // LONG MinBitsPerSecond;
  289. VBIStride * VBILines * 8 * 30 * 2 // LONG MaxBitsPerSecond;
  290. },
  291. // KS_VBIINFOHEADER (default format)
  292. {
  293. VBIStart, // StartLine -- inclusive
  294. VBIEnd, // EndLine -- inclusive
  295. KS_VBISAMPLINGRATE_5X_NABTS, // SamplingFrequency; Hz.
  296. 732, // MinLineStartTime;
  297. 732, // MaxLineStartTime;
  298. 732, // ActualLineStartTime
  299. 0, // ActualLineEndTime;
  300. KS_AnalogVideo_NTSC_M, // VideoStandard;
  301. VBISamples, // SamplesPerLine;
  302. VBIStride, // StrideInBytes;
  303. VBIStride * VBILines // BufferSize;
  304. }
  305. };
  306. // output is NABTS records
  307. KSDATARANGE StreamFormatNABTS =
  308. {
  309. sizeof (KSDATARANGE),
  310. 0,
  311. sizeof (NABTS_BUFFER),
  312. 0, // Reserved
  313. { STATIC_KSDATAFORMAT_TYPE_VBI },
  314. { STATIC_KSDATAFORMAT_SUBTYPE_NABTS },
  315. { STATIC_KSDATAFORMAT_SPECIFIER_NONE }
  316. };
  317. KSDATARANGE StreamFormatCC =
  318. {
  319. // Definition of the CC stream
  320. {
  321. sizeof (KSDATARANGE), // FormatSize
  322. 0, // Flags
  323. sizeof (CC_HW_FIELD), // SampleSize
  324. 0, // Reserved
  325. { STATIC_KSDATAFORMAT_TYPE_VBI },
  326. { STATIC_KSDATAFORMAT_SUBTYPE_CC },
  327. { STATIC_KSDATAFORMAT_SPECIFIER_NONE }
  328. }
  329. };
  330. //---------------------------------------------------------------------------
  331. // STREAM_Capture Formats
  332. //---------------------------------------------------------------------------
  333. static PKSDATAFORMAT StreamCaptureFormats[] =
  334. {
  335. (PKSDATAFORMAT) &StreamFormatRGB24Bpp_Capture,
  336. (PKSDATAFORMAT) &StreamFormatUYU2_Capture,
  337. };
  338. #define NUM_STREAM_CAPTURE_FORMATS (SIZEOF_ARRAY(StreamCaptureFormats))
  339. //---------------------------------------------------------------------------
  340. // STREAM_Preview Formats
  341. //---------------------------------------------------------------------------
  342. static PKSDATAFORMAT StreamPreviewFormats[] =
  343. {
  344. (PKSDATAFORMAT) &StreamFormatRGB24Bpp_Capture,
  345. (PKSDATAFORMAT) &StreamFormatUYU2_Capture,
  346. };
  347. #define NUM_STREAM_PREVIEW_FORMATS (SIZEOF_ARRAY (StreamPreviewFormats))
  348. //---------------------------------------------------------------------------
  349. // STREAM_VBI Formats
  350. //---------------------------------------------------------------------------
  351. static PKSDATAFORMAT StreamVBIFormats[] =
  352. {
  353. (PKSDATAFORMAT) &StreamFormatVBI,
  354. };
  355. #define NUM_STREAM_VBI_FORMATS (SIZEOF_ARRAY(StreamVBIFormats))
  356. //---------------------------------------------------------------------------
  357. // STREAM_NABTS Formats
  358. //---------------------------------------------------------------------------
  359. static PKSDATAFORMAT StreamNABTSFormats[] =
  360. {
  361. (PKSDATAFORMAT) &StreamFormatNABTS,
  362. };
  363. #define NUM_STREAM_NABTS_FORMATS (SIZEOF_ARRAY(StreamNABTSFormats))
  364. static PKSDATAFORMAT StreamCCFormats[] =
  365. {
  366. (PKSDATAFORMAT) &StreamFormatCC,
  367. };
  368. #define NUM_STREAM_CC_FORMATS (SIZEOF_ARRAY (StreamCCFormats))
  369. //---------------------------------------------------------------------------
  370. // STREAM_AnalogVideoInput Formats
  371. //---------------------------------------------------------------------------
  372. static PKSDATAFORMAT StreamAnalogVidInFormats[] =
  373. {
  374. (PKSDATAFORMAT) &StreamFormatAnalogVideo,
  375. };
  376. #define NUM_STREAM_ANALOGVIDIN_FORMATS (SIZEOF_ARRAY (StreamAnalogVidInFormats))
  377. //---------------------------------------------------------------------------
  378. // Create an array that holds the list of all of the streams supported
  379. //---------------------------------------------------------------------------
  380. typedef struct _ALL_STREAM_INFO {
  381. HW_STREAM_INFORMATION hwStreamInfo;
  382. HW_STREAM_OBJECT hwStreamObject;
  383. } ALL_STREAM_INFO, *PALL_STREAM_INFO;
  384. // Warning: The StreamNumber element of the HW_STREAM_OBJECT below MUST be
  385. // the same as its position in the Streams[] array.
  386. static ALL_STREAM_INFO Streams [] =
  387. {
  388. // -----------------------------------------------------------------
  389. // STREAM_Capture
  390. // -----------------------------------------------------------------
  391. {
  392. // HW_STREAM_INFORMATION -------------------------------------------
  393. {
  394. 1, // NumberOfPossibleInstances
  395. KSPIN_DATAFLOW_OUT, // DataFlow
  396. TRUE, // DataAccessible
  397. NUM_STREAM_CAPTURE_FORMATS, // NumberOfFormatArrayEntries
  398. StreamCaptureFormats, // StreamFormatsArray
  399. 0, // ClassReserved[0]
  400. 0, // ClassReserved[1]
  401. 0, // ClassReserved[2]
  402. 0, // ClassReserved[3]
  403. NUMBER_VIDEO_STREAM_PROPERTIES, // NumStreamPropArrayEntries
  404. (PKSPROPERTY_SET) VideoStreamProperties,// StreamPropertiesArray
  405. 0, // NumStreamEventArrayEntries;
  406. 0, // StreamEventsArray;
  407. (GUID *) &PINNAME_VIDEO_CAPTURE, // Category
  408. (GUID *) &PINNAME_VIDEO_CAPTURE, // Name
  409. 1, // MediumsCount
  410. &StandardMedium, // Mediums
  411. FALSE, // BridgeStream
  412. },
  413. // HW_STREAM_OBJECT ------------------------------------------------
  414. {
  415. sizeof (HW_STREAM_OBJECT), // SizeOfThisPacket
  416. STREAM_Capture, // StreamNumber
  417. 0, // HwStreamExtension
  418. VideoReceiveDataPacket, // HwReceiveDataPacket
  419. VideoReceiveCtrlPacket, // HwReceiveControlPacket
  420. { NULL, 0 }, // HW_CLOCK_OBJECT
  421. FALSE, // Dma
  422. TRUE, // Pio
  423. NULL, // HwDeviceExtension
  424. sizeof (KS_FRAME_INFO), // StreamHeaderMediaSpecific
  425. 0, // StreamHeaderWorkspace
  426. FALSE, // Allocator
  427. NULL, // HwEventRoutine
  428. { 0, 0 }, // Reserved[2]
  429. },
  430. },
  431. // -----------------------------------------------------------------
  432. // STREAM_Preview
  433. // -----------------------------------------------------------------
  434. {
  435. // HW_STREAM_INFORMATION -------------------------------------------
  436. {
  437. 1, // NumberOfPossibleInstances
  438. KSPIN_DATAFLOW_OUT, // DataFlow
  439. TRUE, // DataAccessible
  440. NUM_STREAM_PREVIEW_FORMATS, // NumberOfFormatArrayEntries
  441. StreamPreviewFormats, // StreamFormatsArray
  442. 0, // ClassReserved[0]
  443. 0, // ClassReserved[1]
  444. 0, // ClassReserved[2]
  445. 0, // ClassReserved[3]
  446. NUMBER_VIDEO_STREAM_PROPERTIES, // NumStreamPropArrayEntries
  447. (PKSPROPERTY_SET) VideoStreamProperties,// StreamPropertiesArray
  448. 0, // NumStreamEventArrayEntries;
  449. 0, // StreamEventsArray;
  450. (GUID *) &PINNAME_VIDEO_PREVIEW, // Category
  451. (GUID *) &PINNAME_VIDEO_PREVIEW, // Name
  452. 1, // MediumsCount
  453. &StandardMedium, // Mediums
  454. FALSE, // BridgeStream
  455. },
  456. // HW_STREAM_OBJECT ------------------------------------------------
  457. {
  458. sizeof (HW_STREAM_OBJECT), // SizeOfThisPacket
  459. STREAM_Preview, // StreamNumber
  460. 0, // HwStreamExtension
  461. VideoReceiveDataPacket, // HwReceiveDataPacket
  462. VideoReceiveCtrlPacket, // HwReceiveControlPacket
  463. { NULL, 0 }, // HW_CLOCK_OBJECT
  464. FALSE, // Dma
  465. TRUE, // Pio
  466. 0, // HwDeviceExtension
  467. sizeof (KS_FRAME_INFO), // StreamHeaderMediaSpecific
  468. 0, // StreamHeaderWorkspace
  469. FALSE, // Allocator
  470. NULL, // HwEventRoutine
  471. { 0, 0 }, // Reserved[2]
  472. },
  473. },
  474. // -----------------------------------------------------------------
  475. // STREAM_VBI
  476. // -----------------------------------------------------------------
  477. {
  478. // HW_STREAM_INFORMATION -------------------------------------------
  479. {
  480. 1, // NumberOfPossibleInstances
  481. KSPIN_DATAFLOW_OUT, // DataFlow
  482. TRUE, // DataAccessible
  483. NUM_STREAM_VBI_FORMATS, // NumberOfFormatArrayEntries
  484. StreamVBIFormats, // StreamFormatsArray
  485. 0, // ClassReserved[0]
  486. 0, // ClassReserved[1]
  487. 0, // ClassReserved[2]
  488. 0, // ClassReserved[3]
  489. NUMBER_VIDEO_STREAM_PROPERTIES, // NumStreamPropArrayEntries
  490. (PKSPROPERTY_SET)VideoStreamProperties, // StreamPropertiesArray
  491. 0, // NumStreamEventArrayEntries
  492. 0, // StreamEventsArray
  493. (GUID *)&PINNAME_VIDEO_VBI, // Category
  494. (GUID *)&PINNAME_VIDEO_VBI, // Name
  495. 0, // MediumsCount
  496. NULL, // Mediums
  497. FALSE, // BridgeStream
  498. },
  499. // HW_STREAM_OBJECT ------------------------------------------------
  500. {
  501. sizeof (HW_STREAM_OBJECT), // SizeOfThisPacket
  502. STREAM_VBI, // StreamNumber
  503. (PVOID)NULL, // HwStreamExtension
  504. VBIReceiveDataPacket, // HwReceiveDataPacket
  505. VBIReceiveCtrlPacket, // HwReceiveControlPacket
  506. { // HW_CLOCK_OBJECT
  507. NULL, // .HWClockFunction
  508. 0, // .ClockSupportFlags
  509. },
  510. FALSE, // Dma
  511. TRUE, // Pio
  512. (PVOID)NULL, // HwDeviceExtension
  513. sizeof (KS_VBI_FRAME_INFO), // StreamHeaderMediaSpecific
  514. 0, // StreamHeaderWorkspace
  515. FALSE, // Allocator
  516. NULL, // HwEventRoutine
  517. { 0, 0 }, // Reserved[2]
  518. },
  519. },
  520. // -----------------------------------------------------------------
  521. // STREAM_CC (Closed Caption Output)
  522. // -----------------------------------------------------------------
  523. {
  524. // HW_STREAM_INFORMATION -------------------------------------------
  525. {
  526. 1, // NumberOfPossibleInstances
  527. KSPIN_DATAFLOW_OUT, // DataFlow
  528. TRUE, // DataAccessible
  529. NUM_STREAM_CC_FORMATS, // NumberOfFormatArrayEntries
  530. StreamCCFormats, // StreamFormatsArray
  531. 0, // ClassReserved[0]
  532. 0, // ClassReserved[1]
  533. 0, // ClassReserved[2]
  534. 0, // ClassReserved[3]
  535. NUMBER_VIDEO_STREAM_PROPERTIES, // NumStreamPropArrayEntries
  536. (PKSPROPERTY_SET)VideoStreamProperties, // StreamPropertiesArray
  537. 0, // NumStreamEventArrayEntries;
  538. 0, // StreamEventsArray;
  539. (GUID *)&PINNAME_VIDEO_CC_CAPTURE, // Category
  540. (GUID *)&PINNAME_VIDEO_CC_CAPTURE, // Name
  541. 0, // MediumsCount
  542. NULL, // Mediums
  543. FALSE, // BridgeStream
  544. },
  545. // HW_STREAM_OBJECT ------------------------------------------------
  546. {
  547. sizeof (HW_STREAM_OBJECT), // SizeOfThisPacket
  548. STREAM_CC, // StreamNumber
  549. (PVOID)NULL, // HwStreamExtension
  550. VBIReceiveDataPacket, // HwReceiveDataPacket
  551. VBIReceiveCtrlPacket, // HwReceiveControlPacket
  552. { // HW_CLOCK_OBJECT
  553. NULL, // .HWClockFunction
  554. 0, // .ClockSupportFlags
  555. },
  556. FALSE, // Dma
  557. TRUE, // Pio
  558. (PVOID)NULL, // HwDeviceExtension
  559. 0, // StreamHeaderMediaSpecific
  560. 0, // StreamHeaderWorkspace
  561. FALSE, // Allocator
  562. NULL, // HwEventRoutine
  563. { 0, 0 }, // Reserved[2]
  564. },
  565. },
  566. // -----------------------------------------------------------------
  567. // STREAM_NABTS
  568. // -----------------------------------------------------------------
  569. {
  570. // HW_STREAM_INFORMATION -------------------------------------------
  571. {
  572. 1, // NumberOfPossibleInstances
  573. KSPIN_DATAFLOW_OUT, // DataFlow
  574. TRUE, // DataAccessible
  575. NUM_STREAM_NABTS_FORMATS, // NumberOfFormatArrayEntries
  576. StreamNABTSFormats, // StreamFormatsArray
  577. 0, // ClassReserved[0]
  578. 0, // ClassReserved[1]
  579. 0, // ClassReserved[2]
  580. 0, // ClassReserved[3]
  581. NUMBER_VIDEO_STREAM_PROPERTIES, // NumStreamPropArrayEntries
  582. (PKSPROPERTY_SET)VideoStreamProperties, // StreamPropertiesArray
  583. 0, // NumStreamEventArrayEntries
  584. 0, // StreamEventsArray
  585. (GUID *)&PINNAME_VIDEO_NABTS_CAPTURE, // Category
  586. (GUID *)&PINNAME_VIDEO_NABTS_CAPTURE, // Name
  587. 0, // MediumsCount
  588. NULL, // Mediums
  589. FALSE, // BridgeStream
  590. },
  591. // HW_STREAM_OBJECT ------------------------------------------------
  592. {
  593. sizeof (HW_STREAM_OBJECT), // SizeOfThisPacket
  594. STREAM_NABTS, // StreamNumber
  595. (PVOID)NULL, // HwStreamExtension
  596. VBIReceiveDataPacket, // HwReceiveDataPacket
  597. VBIReceiveCtrlPacket, // HwReceiveControlPacket
  598. { // HW_CLOCK_OBJECT
  599. NULL, // .HWClockFunction
  600. 0, // .ClockSupportFlags
  601. },
  602. FALSE, // Dma
  603. TRUE, // Pio
  604. (PVOID)NULL, // HwDeviceExtension
  605. 0, // StreamHeaderMediaSpecific
  606. 0, // StreamHeaderWorkspace
  607. FALSE, // Allocator
  608. NULL, // HwEventRoutine
  609. { 0, 0 }, // Reserved[2]
  610. },
  611. },
  612. // -----------------------------------------------------------------
  613. // STREAM_AnalogVideoInput
  614. // -----------------------------------------------------------------
  615. {
  616. // HW_STREAM_INFORMATION -------------------------------------------
  617. {
  618. 1, // NumberOfPossibleInstances
  619. KSPIN_DATAFLOW_IN, // DataFlow
  620. TRUE, // DataAccessible
  621. NUM_STREAM_ANALOGVIDIN_FORMATS, // NumberOfFormatArrayEntries
  622. StreamAnalogVidInFormats, // StreamFormatsArray
  623. 0, // ClassReserved[0]
  624. 0, // ClassReserved[1]
  625. 0, // ClassReserved[2]
  626. 0, // ClassReserved[3]
  627. 0, // NumStreamPropArrayEntries
  628. 0, // StreamPropertiesArray
  629. 0, // NumStreamEventArrayEntries;
  630. 0, // StreamEventsArray;
  631. (GUID *) &PINNAME_VIDEO_ANALOGVIDEOIN, // Category
  632. (GUID *) &PINNAME_VIDEO_ANALOGVIDEOIN, // Name
  633. 1, // MediumsCount
  634. &CrossbarMediums[9], // Mediums
  635. FALSE, // BridgeStream
  636. },
  637. // HW_STREAM_OBJECT ------------------------------------------------
  638. {
  639. sizeof (HW_STREAM_OBJECT), // SizeOfThisPacket
  640. STREAM_AnalogVideoInput, // StreamNumber
  641. 0, // HwStreamExtension
  642. AnalogVideoReceiveDataPacket, // HwReceiveDataPacket
  643. AnalogVideoReceiveCtrlPacket, // HwReceiveControlPacket
  644. { NULL, 0 }, // HW_CLOCK_OBJECT
  645. FALSE, // Dma
  646. TRUE, // Pio
  647. 0, // HwDeviceExtension
  648. 0, // StreamHeaderMediaSpecific
  649. 0, // StreamHeaderWorkspace
  650. FALSE, // Allocator
  651. NULL, // HwEventRoutine
  652. { 0, 0 }, // Reserved[2]
  653. }
  654. }
  655. };
  656. #define DRIVER_STREAM_COUNT (SIZEOF_ARRAY (Streams))
  657. //---------------------------------------------------------------------------
  658. // Topology
  659. //---------------------------------------------------------------------------
  660. // Categories define what the device does.
  661. static const GUID Categories[] = {
  662. STATIC_KSCATEGORY_VIDEO,
  663. STATIC_KSCATEGORY_CAPTURE,
  664. STATIC_KSCATEGORY_TVTUNER,
  665. STATIC_KSCATEGORY_CROSSBAR,
  666. STATIC_KSCATEGORY_TVAUDIO
  667. };
  668. #define NUMBER_OF_CATEGORIES SIZEOF_ARRAY (Categories)
  669. static KSTOPOLOGY Topology = {
  670. NUMBER_OF_CATEGORIES, // CategoriesCount
  671. (GUID*) &Categories, // Categories
  672. 0, // TopologyNodesCount
  673. NULL, // TopologyNodes
  674. 0, // TopologyConnectionsCount
  675. NULL, // TopologyConnections
  676. NULL, // TopologyNodesNames
  677. 0, // Reserved
  678. };
  679. //---------------------------------------------------------------------------
  680. // The Main stream header
  681. //---------------------------------------------------------------------------
  682. static HW_STREAM_HEADER StreamHeader =
  683. {
  684. DRIVER_STREAM_COUNT, // NumberOfStreams
  685. sizeof (HW_STREAM_INFORMATION), // Future proofing
  686. 0, // NumDevPropArrayEntries set at init time
  687. NULL, // DevicePropertiesArray set at init time
  688. 0, // NumDevEventArrayEntries;
  689. NULL, // DeviceEventsArray;
  690. &Topology // Pointer to Device Topology
  691. };
  692. #ifdef __cplusplus
  693. }
  694. #endif // __cplusplus
  695. #endif // __CAPSTRM_H__
  696.