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.

413 lines
18 KiB

  1. // $Header: G:/SwDev/WDM/Video/bt848/rcs/Capstrm.h 1.14 1998/05/01 05:05:10 tomz Exp $
  2. //==========================================================================;
  3. //
  4. // THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY
  5. // KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE
  6. // IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR
  7. // PURPOSE.
  8. //
  9. // Copyright (c) 1992 - 1996 Microsoft Corporation. All Rights Reserved.
  10. //
  11. //==========================================================================;
  12. #ifndef __CAPSTRM_H__
  13. #define __CAPSTRM_H__
  14. #ifdef __cplusplus
  15. extern "C" {
  16. #endif // __cplusplus
  17. //---------------------------------------------------------------------------
  18. // All of the data formats we might use
  19. //---------------------------------------------------------------------------
  20. #include "rgb24fmt.h"
  21. #include "rgb16fmt.h"
  22. #include "yuvfmt.h"
  23. #include "vbifmt.h"
  24. //---------------------------------------------------------------------------
  25. // Stream 0 (Capture) Formats
  26. //---------------------------------------------------------------------------
  27. PKSDATAFORMAT Stream0Formats[] =
  28. {
  29. // prefer RGB first for capture
  30. (PKSDATAFORMAT) &StreamFormatRGB555,
  31. //(PKSDATAFORMAT) &StreamFormatRGB565,
  32. (PKSDATAFORMAT) &StreamFormatRGB24Bpp,
  33. (PKSDATAFORMAT) &StreamFormatYUY2
  34. //(PKSDATAFORMAT) &StreamFormatYVYU,
  35. //(PKSDATAFORMAT) &StreamFormatUYVY,
  36. //(PKSDATAFORMAT) &StreamFormatYVU9
  37. };
  38. #define NUM_STREAM_0_FORMATS (sizeof (Stream0Formats) / sizeof (PKSDATAFORMAT))
  39. //---------------------------------------------------------------------------
  40. // Stream 1 (Preview) Formats
  41. //---------------------------------------------------------------------------
  42. PKSDATAFORMAT Stream1Formats[] =
  43. {
  44. // prefer YUV first for preview
  45. #if 0
  46. //TODO: leave VIDEOINFOHEADER2 out for now
  47. (PKSDATAFORMAT) &StreamFormat2YUY2,
  48. (PKSDATAFORMAT) &StreamFormat2RGB555,
  49. (PKSDATAFORMAT) &StreamFormat2RGB24Bpp,
  50. #else
  51. (PKSDATAFORMAT) &StreamFormatYUY2,
  52. (PKSDATAFORMAT) &StreamFormatRGB555,
  53. (PKSDATAFORMAT) &StreamFormatRGB24Bpp
  54. #endif
  55. //(PKSDATAFORMAT) &StreamFormatYVYU,
  56. //(PKSDATAFORMAT) &StreamFormatUYVY,
  57. //(PKSDATAFORMAT) &StreamFormatYVU9,
  58. //(PKSDATAFORMAT) &StreamFormatRGB565,
  59. };
  60. #define NUM_STREAM_1_FORMATS (sizeof (Stream1Formats) / sizeof (PKSDATAFORMAT))
  61. //---------------------------------------------------------------------------
  62. // VBI Stream Formats
  63. //---------------------------------------------------------------------------
  64. PKSDATAFORMAT VBIStreamFormats[] =
  65. {
  66. (PKSDATAFORMAT) &StreamFormatVBI
  67. };
  68. #define NUM_VBI_FORMATS (sizeof (VBIStreamFormats) / sizeof (PKSDATAFORMAT))
  69. //---------------------------------------------------------------------------
  70. // Analog Video Stream Formats
  71. //---------------------------------------------------------------------------
  72. static KS_DATARANGE_ANALOGVIDEO StreamFormatAnalogVideo =
  73. {
  74. // KS_DATARANGE_ANALOGVIDEO
  75. {
  76. {
  77. sizeof( KS_DATARANGE_ANALOGVIDEO ),
  78. 0,
  79. sizeof (KS_TVTUNER_CHANGE_INFO), // SampleSize
  80. 0,
  81. { 0x482dde1, 0x7817, 0x11cf, { 0x8a, 0x3, 0x0, 0xaa, 0x0, 0x6e, 0xcb, 0x65 } }, // MEDIATYPE_AnalogVideo
  82. { 0x482dde2, 0x7817, 0x11cf, { 0x8a, 0x3, 0x0, 0xaa, 0x0, 0x6e, 0xcb, 0x65 } }, // WILDCARD
  83. { 0x482dde0, 0x7817, 0x11cf, { 0x8a, 0x3, 0x0, 0xaa, 0x0, 0x6e, 0xcb, 0x65 } } // FORMAT_AnalogVideo
  84. }
  85. },
  86. // KS_ANALOGVIDEOINFO
  87. {
  88. { 0, 0, 720, 480 }, // rcSource;
  89. { 0, 0, 720, 480 }, // rcTarget;
  90. 720, // dwActiveWidth;
  91. 480, // dwActiveHeight;
  92. 0, // REFERENCE_TIME AvgTimePerFrame;
  93. }
  94. };
  95. static PKSDATAFORMAT AnalogVideoFormats[] =
  96. {
  97. (PKSDATAFORMAT) &StreamFormatAnalogVideo,
  98. };
  99. #define NUM_ANALOG_VIDEO_FORMATS SIZEOF_ARRAY( AnalogVideoFormats )
  100. // ------------------------------------------------------------------------
  101. // Property set for all video capture streams
  102. // ------------------------------------------------------------------------
  103. DEFINE_KSPROPERTY_TABLE( VideoStreamConnectionProperties )
  104. {
  105. DEFINE_KSPROPERTY_ITEM
  106. (
  107. KSPROPERTY_CONNECTION_ALLOCATORFRAMING,
  108. TRUE, // GetSupported or Handler
  109. sizeof( KSPROPERTY ), // MinProperty
  110. sizeof( KSALLOCATOR_FRAMING ), // MinData
  111. FALSE, // SetSupported or Handler
  112. NULL, // Values
  113. 0, // RelationsCount
  114. NULL, // Relations
  115. NULL, // SupportHandler
  116. sizeof( ULONG ) // SerializedSize
  117. )
  118. };
  119. // ------------------------------------------------------------------------
  120. // Array of all of the property sets supported by video streams
  121. // ------------------------------------------------------------------------
  122. DEFINE_KSPROPERTY_SET_TABLE( VideoStreamProperties )
  123. {
  124. DEFINE_KSPROPERTY_SET
  125. (
  126. &KSPROPSETID_Connection, // Set
  127. SIZEOF_ARRAY( VideoStreamConnectionProperties ), // PropertiesCount
  128. VideoStreamConnectionProperties, // PropertyItem
  129. 0, // FastIoCount
  130. NULL // FastIoTable
  131. )
  132. };
  133. #define NUMBER_VIDEO_STREAM_PROPERTIES (SIZEOF_ARRAY(VideoStreamProperties))
  134. //---------------------------------------------------------------------------
  135. // Create an array that holds the list of all of the streams supported
  136. //---------------------------------------------------------------------------
  137. typedef struct _ALL_STREAM_INFO {
  138. HW_STREAM_INFORMATION hwStreamInfo;
  139. HW_STREAM_OBJECT hwStreamObject;
  140. } ALL_STREAM_INFO, *PALL_STREAM_INFO;
  141. ALL_STREAM_INFO Streams [] =
  142. {
  143. // -----------------------------------------------------------------
  144. // Stream 0
  145. // -----------------------------------------------------------------
  146. // HW_STREAM_INFORMATION -------------------------------------------
  147. {
  148. {
  149. 1, // NumberOfPossibleInstances
  150. KSPIN_DATAFLOW_OUT, // DataFlow
  151. TRUE, // DataAccessible
  152. NUM_STREAM_0_FORMATS, // NumberOfFormatArrayEntries
  153. Stream0Formats, // StreamFormatsArray
  154. {
  155. 0, // ClassReserved[0]
  156. 0, // ClassReserved[1]
  157. 0, // ClassReserved[2]
  158. 0 // ClassReserved[3]
  159. },
  160. NUMBER_VIDEO_STREAM_PROPERTIES, // NumStreamPropArrayEntries
  161. (PKSPROPERTY_SET)VideoStreamProperties, // StreamPropertiesArray
  162. 0, // NumStreamEventArrayEntries;
  163. 0, // StreamEventsArray;
  164. (GUID *) &PINNAME_VIDEO_CAPTURE, // Category
  165. (GUID *) &PINNAME_VIDEO_CAPTURE, // Name
  166. 1, // MediumsCount
  167. &CaptureMediums[0], // Mediums
  168. },
  169. // HW_STREAM_OBJECT ------------------------------------------------
  170. {
  171. sizeof (HW_STREAM_OBJECT), // SizeOfThisPacket
  172. 0, // StreamNumber
  173. 0, // HwStreamExtension
  174. VideoReceiveDataPacket, // HwReceiveDataPacket
  175. VideoReceiveCtrlPacket, // HwReceiveControlPacket
  176. { NULL, 0 }, // HW_CLOCK_OBJECT
  177. FALSE, // Dma
  178. TRUE, // Pio
  179. NULL, // HwDeviceExtension
  180. sizeof (KS_FRAME_INFO), // StreamHeaderMediaSpecific
  181. 0, // StreamHeaderWorkspace
  182. TRUE, // Allocator
  183. NULL, // HwEventRoutine
  184. { 0, 0 }, // Reserved[2]
  185. },
  186. },
  187. // -----------------------------------------------------------------
  188. // Stream 1
  189. // -----------------------------------------------------------------
  190. // HW_STREAM_INFORMATION -------------------------------------------
  191. {
  192. {
  193. 1, // NumberOfPossibleInstances
  194. KSPIN_DATAFLOW_OUT, // DataFlow
  195. TRUE, // DataAccessible
  196. NUM_STREAM_1_FORMATS, // NumberOfFormatArrayEntries
  197. Stream1Formats, // StreamFormatsArray
  198. {
  199. 0, // ClassReserved[0]
  200. 0, // ClassReserved[1]
  201. 0, // ClassReserved[2]
  202. 0 // ClassReserved[3]
  203. },
  204. NUMBER_VIDEO_STREAM_PROPERTIES, // NumStreamPropArrayEntries
  205. (PKSPROPERTY_SET)VideoStreamProperties, // StreamPropertiesArray
  206. 0, // NumStreamEventArrayEntries;
  207. 0, // StreamEventsArray;
  208. //(GUID *) &PINNAME_VIDEO_VIDEOPORT, // Category
  209. //(GUID *) &PINNAME_VIDEO_VIDEOPORT, // Name
  210. (GUID *) &PINNAME_VIDEO_PREVIEW, // Category
  211. (GUID *) &PINNAME_VIDEO_PREVIEW, // Name
  212. 1, // MediumsCount
  213. &CaptureMediums[1], // Mediums
  214. },
  215. // HW_STREAM_OBJECT ------------------------------------------------
  216. {
  217. sizeof (HW_STREAM_OBJECT), // SizeOfThisPacket
  218. 1, // StreamNumber
  219. 0, // HwStreamExtension
  220. VideoReceiveDataPacket, // HwReceiveDataPacket
  221. VideoReceiveCtrlPacket, // HwReceiveControlPacket
  222. { NULL, 0 }, // HW_CLOCK_OBJECT
  223. FALSE, // Dma
  224. TRUE, // Pio
  225. 0, // HwDeviceExtension
  226. sizeof (KS_FRAME_INFO), // StreamHeaderMediaSpecific
  227. 0, // StreamHeaderWorkspace
  228. TRUE, // Allocator
  229. NULL, // HwEventRoutine
  230. { 0, 0 }, // Reserved[2]
  231. },
  232. },
  233. // -----------------------------------------------------------------
  234. // VBI Stream
  235. // -----------------------------------------------------------------
  236. // HW_STREAM_INFORMATION -------------------------------------------
  237. {
  238. {
  239. 1, // NumberOfPossibleInstances
  240. KSPIN_DATAFLOW_OUT, // DataFlow
  241. TRUE, // DataAccessible
  242. NUM_VBI_FORMATS, // NumberOfFormatArrayEntries
  243. VBIStreamFormats, // StreamFormatsArray
  244. {
  245. 0, // ClassReserved[0]
  246. 0, // ClassReserved[1]
  247. 0, // ClassReserved[2]
  248. 0 // ClassReserved[3]
  249. },
  250. /*[TMZ]*/ NUMBER_VIDEO_STREAM_PROPERTIES, // NumStreamPropArrayEntries
  251. /*[TMZ]*/ (PKSPROPERTY_SET)VideoStreamProperties, // StreamPropertiesArray
  252. 0, // NumStreamEventArrayEntries;
  253. 0, // StreamEventsArray;
  254. #if 1 // [TMZ] [!!!] [HACK] - ALLOW_VBI_PIN
  255. (GUID *) &PINNAME_VIDEO_VBI, // Category
  256. (GUID *) &PINNAME_VIDEO_VBI, // Name
  257. #else
  258. (GUID *) &PINNAME_VIDEO_STILL, // Category
  259. (GUID *) &PINNAME_VIDEO_STILL, // Name
  260. #endif
  261. 0, //1, // MediumsCount
  262. NULL, //&CaptureMediums[2], // Mediums
  263. },
  264. // HW_STREAM_OBJECT ------------------------------------------------
  265. {
  266. sizeof (HW_STREAM_OBJECT), // SizeOfThisPacket
  267. 2, // StreamNumber
  268. 0, // HwStreamExtension
  269. VideoReceiveDataPacket, // HwReceiveDataPacket
  270. VideoReceiveCtrlPacket, // HwReceiveControlPacket
  271. { NULL, 0 }, // HW_CLOCK_OBJECT
  272. FALSE, // Dma
  273. TRUE, // Pio
  274. 0, // HwDeviceExtension
  275. sizeof (KS_VBI_FRAME_INFO), // StreamHeaderMediaSpecific
  276. 0, // StreamHeaderWorkspace
  277. TRUE, // Allocator
  278. NULL, // HwEventRoutine
  279. { 0, 0 }, // Reserved[2]
  280. }
  281. },
  282. // -----------------------------------------------------------------
  283. // Analog Video Input Stream
  284. // -----------------------------------------------------------------
  285. // HW_STREAM_INFORMATION -------------------------------------------
  286. {
  287. {
  288. 1, // NumberOfPossibleInstances
  289. KSPIN_DATAFLOW_IN, // DataFlow
  290. TRUE, // DataAccessible
  291. NUM_ANALOG_VIDEO_FORMATS, // NumberOfFormatArrayEntries
  292. AnalogVideoFormats, // StreamFormatsArray
  293. {
  294. 0, // ClassReserved[0]
  295. 0, // ClassReserved[1]
  296. 0, // ClassReserved[2]
  297. 0 // ClassReserved[3]
  298. },
  299. 0, // NumStreamPropArrayEntries
  300. 0, // StreamPropertiesArray
  301. 0, // NumStreamEventArrayEntries;
  302. 0, // StreamEventsArray;
  303. (GUID *) &PINNAME_VIDEO_ANALOGVIDEOIN, // Category
  304. (GUID *) &PINNAME_VIDEO_ANALOGVIDEOIN, // Name
  305. 1, // MediumsCount
  306. &CaptureMediums[3], // Mediums
  307. },
  308. // HW_STREAM_OBJECT ------------------------------------------------
  309. {
  310. sizeof (HW_STREAM_OBJECT), // SizeOfThisPacket
  311. 3, // StreamNumber
  312. 0, // HwStreamExtension
  313. VideoReceiveDataPacket, // HwReceiveDataPacket
  314. VideoReceiveCtrlPacket, // HwReceiveControlPacket
  315. { NULL, 0 }, // HW_CLOCK_OBJECT
  316. FALSE, // Dma
  317. TRUE, // Pio
  318. 0, // HwDeviceExtension
  319. 0, // StreamHeaderMediaSpecific
  320. 0, // StreamHeaderWorkspace
  321. TRUE, // Allocator
  322. NULL, // HwEventRoutine
  323. { 0, 0 }, // Reserved[2]
  324. }
  325. }
  326. };
  327. #define DRIVER_STREAM_COUNT (sizeof (Streams) / sizeof (ALL_STREAM_INFO))
  328. //---------------------------------------------------------------------------
  329. // Topology
  330. //---------------------------------------------------------------------------
  331. // Categories define what the device does.
  332. static GUID Categories[] = {
  333. { STATIC_KSCATEGORY_VIDEO },
  334. { STATIC_KSCATEGORY_CAPTURE },
  335. { STATIC_KSCATEGORY_TVTUNER },
  336. { STATIC_KSCATEGORY_CROSSBAR },
  337. { STATIC_KSCATEGORY_TVAUDIO }
  338. };
  339. #define NUMBER_OF_CATEGORIES SIZEOF_ARRAY (Categories)
  340. static KSTOPOLOGY Topology = {
  341. NUMBER_OF_CATEGORIES,
  342. (GUID*) &Categories,
  343. 0,
  344. NULL,
  345. 0,
  346. NULL
  347. };
  348. //---------------------------------------------------------------------------
  349. // The Main stream header
  350. //---------------------------------------------------------------------------
  351. static HW_STREAM_HEADER StreamHeader =
  352. {
  353. DRIVER_STREAM_COUNT, // NumberOfStreams
  354. sizeof( HW_STREAM_INFORMATION ), // Future proofing
  355. 0, // NumDevPropArrayEntries set at init time
  356. NULL, // DevicePropertiesArray set at init time
  357. 0, // NumDevEventArrayEntries;
  358. NULL, // DeviceEventsArray;
  359. &Topology // Pointer to Device Topology
  360. };
  361. #ifdef __cplusplus
  362. }
  363. #endif // __cplusplus
  364. #endif // __CAPSTRM_H__