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.

430 lines
15 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 - 1996 Microsoft Corporation. All Rights Reserved.
  9. //
  10. //==========================================================================;
  11. #ifndef __BDASTRM_H__
  12. #define __BDASTRM_H__
  13. #ifdef __cplusplus
  14. extern "C" {
  15. #endif // __cplusplus
  16. ////////////////////////////////////////////////////////////////////////////////////////////
  17. //
  18. //
  19. //
  20. DEFINE_KSPROPERTY_TABLE(IPSinkConnectionProperties)
  21. {
  22. DEFINE_KSPROPERTY_ITEM
  23. (
  24. KSPROPERTY_CONNECTION_ALLOCATORFRAMING,
  25. TRUE, // GetSupported or Handler
  26. sizeof(KSPROPERTY), // MinProperty
  27. sizeof(KSALLOCATOR_FRAMING), // MinData
  28. FALSE, // SetSupported or Handler
  29. NULL, // Values
  30. 0, // RelationsCount
  31. NULL, // Relations
  32. NULL, // SupportHandler
  33. sizeof(ULONG) // SerializedSize
  34. ),
  35. };
  36. ////////////////////////////////////////////////////////////////////////////////////////////
  37. //
  38. //
  39. //
  40. DEFINE_KSPROPERTY_TABLE(StreamAllocatorProperties)
  41. {
  42. DEFINE_KSPROPERTY_ITEM_STREAM_ALLOCATOR
  43. (
  44. FALSE,
  45. TRUE
  46. )
  47. };
  48. ////////////////////////////////////////////////////////////////////////////////////////////
  49. //
  50. //
  51. //
  52. DEFINE_KSPROPERTY_SET_TABLE(IPSinkStreamProperties)
  53. {
  54. DEFINE_KSPROPERTY_SET
  55. (
  56. &KSPROPSETID_Connection, // Set
  57. SIZEOF_ARRAY(IPSinkConnectionProperties), // PropertiesCount
  58. IPSinkConnectionProperties, // PropertyItems
  59. 0, // FastIoCount
  60. NULL // FastIoTable
  61. ),
  62. DEFINE_KSPROPERTY_SET
  63. (
  64. &KSPROPSETID_Stream, // Set
  65. SIZEOF_ARRAY(StreamAllocatorProperties), // PropertiesCount
  66. StreamAllocatorProperties, // PropertyItems
  67. 0, // FastIoCount
  68. NULL // FastIoTable
  69. ),
  70. };
  71. #define NUMBER_IPSINK_STREAM_PROPERTIES (SIZEOF_ARRAY(IPSinkStreamProperties))
  72. ////////////////////////////////////////////////////////////////////////////////////////////
  73. //
  74. //
  75. //
  76. DEFINE_KSPROPERTY_TABLE(IPSinkDefaultProperties)
  77. {
  78. DEFINE_KSPROPERTY_ITEM
  79. (
  80. KSPROPERTY_IPSINK_MULTICASTLIST,
  81. TRUE,
  82. sizeof (KSPROPERTY),
  83. 0,
  84. FALSE,
  85. NULL,
  86. 0,
  87. NULL,
  88. NULL,
  89. 0,
  90. ),
  91. DEFINE_KSPROPERTY_ITEM
  92. (
  93. KSPROPERTY_IPSINK_ADAPTER_DESCRIPTION,
  94. TRUE,
  95. sizeof (KSPROPERTY),
  96. 0,
  97. FALSE,
  98. NULL,
  99. 0,
  100. NULL,
  101. NULL,
  102. 0,
  103. ),
  104. DEFINE_KSPROPERTY_ITEM
  105. (
  106. KSPROPERTY_IPSINK_ADAPTER_ADDRESS,
  107. TRUE, // GetSupported or Handler
  108. sizeof(KSPROPERTY), // MinProperty
  109. 0, // MinData
  110. TRUE, // SetSupported or Handler
  111. NULL, // Values
  112. 0, // RelationsCount
  113. NULL, // Relations
  114. NULL, // SupportHandler
  115. 0, // SerializedSize
  116. )
  117. };
  118. ////////////////////////////////////////////////////////////////////////////////////////////
  119. //
  120. //
  121. //
  122. DEFINE_KSPROPERTY_SET_TABLE(IPSinkCodecProperties)
  123. {
  124. DEFINE_KSPROPERTY_SET
  125. (
  126. &IID_IBDA_IPSinkControl, // Set
  127. SIZEOF_ARRAY(IPSinkDefaultProperties), // PropertiesCount
  128. IPSinkDefaultProperties, // PropertyItems
  129. 0, // FastIoCount
  130. NULL // FastIoTable
  131. ),
  132. };
  133. #define NUMBER_IPSINK_CODEC_PROPERTIES (SIZEOF_ARRAY(IPSinkCodecProperties))
  134. ////////////////////////////////////////////////////////////////////////////////////////////
  135. //
  136. //
  137. //
  138. DEFINE_KSEVENT_TABLE(IPSinkDefaultEvents)
  139. {
  140. DEFINE_KSEVENT_ITEM
  141. (
  142. KSEVENT_IPSINK_MULTICASTLIST, // Event Id
  143. sizeof (KSEVENTDATA), // Minimum size of event data
  144. 0, // size of extra data staorage
  145. NULL, // Add Handler
  146. NULL, // RemoveHandler
  147. NULL // SupportHandler
  148. ),
  149. DEFINE_KSEVENT_ITEM
  150. (
  151. KSEVENT_IPSINK_ADAPTER_DESCRIPTION, // Event Id
  152. sizeof (KSEVENTDATA), // Minimum size of event data
  153. 0, // size of extra data staorage
  154. NULL, // Add Handler
  155. NULL, // RemoveHandler
  156. NULL // SupportHandler
  157. )
  158. };
  159. DEFINE_KSEVENT_SET_TABLE(IPSinkEvents)
  160. {
  161. DEFINE_KSEVENT_SET
  162. (
  163. &IID_IBDA_IPSinkEvent, // Event GUID
  164. SIZEOF_ARRAY(IPSinkDefaultEvents), // Event count
  165. IPSinkDefaultEvents // Event items
  166. ),
  167. };
  168. #define NUMBER_IPSINK_EVENTS (SIZEOF_ARRAY(IPSinkEvents))
  169. //---------------------------------------------------------------------------
  170. // All of the video and vbi data formats we might use
  171. //---------------------------------------------------------------------------
  172. KS_DATAFORMAT_IPSINK_IP StreamFormatIPSinkIP =
  173. {
  174. //
  175. // KSDATARANGE
  176. //
  177. sizeof (KSDATAFORMAT),
  178. 0,
  179. 4096, // sizeof an MPE section
  180. 0, // Reserved
  181. { STATIC_KSDATAFORMAT_TYPE_BDA_IP },
  182. { STATIC_KSDATAFORMAT_SUBTYPE_BDA_IP },
  183. { STATIC_KSDATAFORMAT_SPECIFIER_BDA_IP }
  184. };
  185. KS_DATAFORMAT_IPSINK_IP StreamFormatNetControl =
  186. {
  187. //
  188. // KSDATARANGE
  189. //
  190. sizeof (KSDATAFORMAT),
  191. 0,
  192. 4093, // sizeof an IP Packet
  193. 0, // Reserved
  194. { STATIC_KSDATAFORMAT_TYPE_BDA_IP_CONTROL },
  195. { STATIC_KSDATAFORMAT_SUBTYPE_BDA_IP_CONTROL },
  196. { STATIC_KSDATAFORMAT_SPECIFIER_NONE }
  197. };
  198. //---------------------------------------------------------------------------
  199. // STREAM_Input Formats
  200. //---------------------------------------------------------------------------
  201. static PKSDATAFORMAT Stream0Formats[] =
  202. {
  203. (PKSDATAFORMAT) &StreamFormatIPSinkIP,
  204. // Add more formats here for to mirror output formats for "passthrough" mode
  205. // The idea is that upstream capture drivers may have done some decoding already
  206. // or downstream drivers may wish to have the raw data without any decoding at all.
  207. // In that case all we need to do is copy the data(if there is a pending SRB) OR
  208. // forward the SRB to the downstream client.
  209. };
  210. #define NUM_STREAM_0_FORMATS (SIZEOF_ARRAY(Stream0Formats))
  211. //---------------------------------------------------------------------------
  212. // STREAM_Output Formats
  213. //---------------------------------------------------------------------------
  214. static PKSDATAFORMAT Stream1Formats[] =
  215. {
  216. (PKSDATAFORMAT) &StreamFormatNetControl,
  217. //
  218. // Add more formats here for whatever output formats are supported.
  219. //
  220. };
  221. #define NUM_STREAM_1_FORMATS (SIZEOF_ARRAY (Stream1Formats))
  222. //---------------------------------------------------------------------------
  223. // Create an array that holds the list of all of the streams supported
  224. //---------------------------------------------------------------------------
  225. typedef struct _ALL_STREAM_INFO
  226. {
  227. HW_STREAM_INFORMATION hwStreamInfo;
  228. HW_STREAM_OBJECT hwStreamObject;
  229. } ALL_STREAM_INFO, *PALL_STREAM_INFO;
  230. static ALL_STREAM_INFO Streams [] =
  231. {
  232. {
  233. // HW_STREAM_INFORMATION -------------------------------------------
  234. {
  235. 1, // NumberOfPossibleInstances
  236. KSPIN_DATAFLOW_IN, // DataFlow
  237. TRUE, // DataAccessible
  238. NUM_STREAM_0_FORMATS, // NumberOfFormatArrayEntries
  239. Stream0Formats, // StreamFormatsArray
  240. 0, // ClassReserved[0]
  241. 0, // ClassReserved[1]
  242. 0, // ClassReserved[2]
  243. 0, // ClassReserved[3]
  244. NUMBER_IPSINK_STREAM_PROPERTIES, // Number of stream properties
  245. (PKSPROPERTY_SET) IPSinkStreamProperties, // Stream Property Array
  246. 0, // NumStreamEventArrayEntries
  247. 0, // StreamEventsArray
  248. NULL, // Category
  249. (GUID*) &PINNAME_IPSINK, // Name
  250. 0, // MediumsCount
  251. NULL, // Mediums
  252. FALSE, // BridgeStream
  253. 0, 0 // Reserved
  254. },
  255. // HW_STREAM_OBJECT ------------------------------------------------
  256. {
  257. sizeof (HW_STREAM_OBJECT), // SizeOfThisPacket
  258. 0, // StreamNumber
  259. (PVOID)NULL, // HwStreamExtension
  260. ReceiveDataPacket,
  261. ReceiveCtrlPacket,
  262. { // HW_CLOCK_OBJECT
  263. NULL, // .HWClockFunction
  264. 0, // .ClockSupportFlags
  265. },
  266. FALSE, // Dma
  267. TRUE, // Pio
  268. (PVOID)NULL, // HwDeviceExtension
  269. //sizeof (KS_VBI_FRAME_INFO), // StreamHeaderMediaSpecific
  270. 0,
  271. 0, // StreamHeaderWorkspace
  272. FALSE, // Allocator
  273. EventHandler, // HwEventRoutine
  274. },
  275. },
  276. //
  277. // Network Provider Control Interface Pin
  278. //
  279. {
  280. // HW_STREAM_INFORMATION -------------------------------------------
  281. {
  282. 1, // NumberOfPossibleInstances
  283. KSPIN_DATAFLOW_OUT, // DataFlow
  284. TRUE, // DataAccessible
  285. NUM_STREAM_1_FORMATS, // NumberOfFormatArrayEntries
  286. Stream1Formats, // StreamFormatsArray
  287. 0, // ClassReserved[0]
  288. 0, // ClassReserved[1]
  289. 0, // ClassReserved[2]
  290. 0, // ClassReserved[3]
  291. NUMBER_IPSINK_STREAM_PROPERTIES, // Number of stream properties
  292. (PKSPROPERTY_SET) IPSinkStreamProperties, // Stream Property Array
  293. 0,
  294. 0,
  295. NULL,
  296. (GUID *)&PINNAME_BDA_NET_CONTROL, // Name
  297. 0, // MediumsCount
  298. NULL, // Mediums
  299. FALSE, // BridgeStream
  300. 0, 0 // Reserved
  301. },
  302. // HW_STREAM_OBJECT ------------------------------------------------
  303. {
  304. sizeof (HW_STREAM_OBJECT), // SizeOfThisPacket
  305. 0, // StreamNumber
  306. (PVOID)NULL, // HwStreamExtension
  307. ReceiveDataPacket, // HwReceiveDataPacket
  308. ReceiveCtrlPacket, // HwReceiveControlPacket
  309. { // HW_CLOCK_OBJECT
  310. NULL, // .HWClockFunction
  311. 0, // .ClockSupportFlags
  312. },
  313. FALSE, // Dma
  314. TRUE, // Pio
  315. (PVOID)NULL, // HwDeviceExtension
  316. //sizeof (KS_VBI_FRAME_INFO), // StreamHeaderMediaSpecific
  317. 0,
  318. 0, // StreamHeaderWorkspace
  319. FALSE, // Allocator
  320. NULL, // HwEventRoutine
  321. },
  322. }
  323. };
  324. #define DRIVER_STREAM_COUNT (SIZEOF_ARRAY (Streams))
  325. //---------------------------------------------------------------------------
  326. // Topology
  327. //---------------------------------------------------------------------------
  328. // Topology connections
  329. KSTOPOLOGY_CONNECTION rgConnections[] =
  330. {
  331. {-1, 0, -1, 1}
  332. };
  333. // Categories define what the device does.
  334. static GUID Categories[] =
  335. {
  336. STATIC_KSCATEGORY_BDA_IP_SINK
  337. };
  338. #define NUMBER_OF_CATEGORIES SIZEOF_ARRAY (Categories)
  339. static KSTOPOLOGY Topology = {
  340. NUMBER_OF_CATEGORIES,
  341. (GUID*) &Categories,
  342. 0,
  343. (GUID*) NULL,
  344. 1,
  345. rgConnections,
  346. NULL,
  347. 0
  348. };
  349. //---------------------------------------------------------------------------
  350. // The Main stream header
  351. //---------------------------------------------------------------------------
  352. static HW_STREAM_HEADER StreamHeader =
  353. {
  354. DRIVER_STREAM_COUNT, // NumberOfStreams
  355. sizeof (HW_STREAM_INFORMATION), // Future proofing
  356. 0, // NumDevPropArrayEntries set at init time
  357. NULL, // DevicePropertiesArray set at init time
  358. 0, // NumDevEventArrayEntries;
  359. NULL, // DeviceEventsArray;
  360. &Topology // Pointer to Device Topology
  361. };
  362. #ifdef __cplusplus
  363. }
  364. #endif // __cplusplus
  365. #endif // __BDASTRM_H__