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.

307 lines
12 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 __SLIP_STREAM_H__
  12. #define __SLIP_STREAM_H__
  13. #ifdef __cplusplus
  14. extern "C" {
  15. #endif // __cplusplus
  16. // ------------------------------------------------------------------------
  17. // Property set for all video capture streams
  18. // ------------------------------------------------------------------------
  19. DEFINE_KSPROPERTY_TABLE(SlipConnectionProperties)
  20. {
  21. DEFINE_KSPROPERTY_ITEM
  22. (
  23. KSPROPERTY_CONNECTION_ALLOCATORFRAMING,
  24. TRUE, // GetSupported or Handler
  25. sizeof(KSPROPERTY), // MinProperty
  26. sizeof(KSALLOCATOR_FRAMING), // MinData
  27. FALSE, // SetSupported or Handler
  28. NULL, // Values
  29. 0, // RelationsCount
  30. NULL, // Relations
  31. NULL, // SupportHandler
  32. sizeof(ULONG) // SerializedSize
  33. )
  34. };
  35. // ------------------------------------------------------------------------
  36. // Array of all of the property sets supported by video streams
  37. // ------------------------------------------------------------------------
  38. DEFINE_KSPROPERTY_SET_TABLE(SlipStreamProperties)
  39. {
  40. DEFINE_KSPROPERTY_SET
  41. (
  42. &KSPROPSETID_Connection, // Set
  43. SIZEOF_ARRAY(SlipConnectionProperties), // PropertiesCount
  44. SlipConnectionProperties, // PropertyItems
  45. 0, // FastIoCount
  46. NULL // FastIoTable
  47. ),
  48. };
  49. #define NUMBER_SLIP_STREAM_PROPERTIES (SIZEOF_ARRAY(SlipStreamProperties))
  50. //---------------------------------------------------------------------------
  51. // All of the video and vbi data formats we might use
  52. //---------------------------------------------------------------------------
  53. KSDATARANGE StreamFormatSlip =
  54. {
  55. //
  56. // KSDATARANGE
  57. //
  58. sizeof (KSDATAFORMAT),
  59. 0,
  60. 1548, // sizeof a SLIP Packet
  61. 0, // Reserved
  62. { STATIC_KSDATAFORMAT_TYPE_BDA_IP },
  63. { STATIC_KSDATAFORMAT_SUBTYPE_BDA_IP },
  64. { STATIC_KSDATAFORMAT_SPECIFIER_BDA_IP }
  65. };
  66. KSDATARANGE StreamFormatIPv4 =
  67. {
  68. //
  69. // KSDATARANGE
  70. //
  71. sizeof (KSDATAFORMAT),
  72. 0,
  73. 1548, // sizeof a IPv4 Packet
  74. 0, // Reserved
  75. { STATIC_KSDATAFORMAT_TYPE_BDA_IP },
  76. { STATIC_KSDATAFORMAT_SUBTYPE_BDA_IP },
  77. { STATIC_KSDATAFORMAT_SPECIFIER_BDA_IP }
  78. };
  79. KSDATARANGE StreamFormatNABTS =
  80. {
  81. sizeof (KSDATARANGE),
  82. 0,
  83. sizeof (NABTS_BUFFER) + 8, //$$BUG NOTE Add 8
  84. 0, // Reserved
  85. { STATIC_KSDATAFORMAT_TYPE_NABTS },
  86. { STATIC_KSDATAFORMAT_SUBTYPE_NABTS },
  87. { STATIC_KSDATAFORMAT_SPECIFIER_NONE }
  88. };
  89. KSDATARANGE StreamFormatNABTSFEC =
  90. {
  91. sizeof (KSDATARANGE),
  92. 0,
  93. sizeof (NABTSFEC_BUFFER),
  94. 0, // Reserved
  95. { STATIC_KSDATAFORMAT_TYPE_NABTS },
  96. { STATIC_KSDATAFORMAT_SUBTYPE_NABTS_FEC },
  97. { STATIC_KSDATAFORMAT_SPECIFIER_NONE }
  98. };
  99. //---------------------------------------------------------------------------
  100. // STREAM_Input Formats
  101. //---------------------------------------------------------------------------
  102. static PKSDATAFORMAT Stream0Formats[] =
  103. {
  104. // (PKSDATAFORMAT) &StreamFormatNABTS,
  105. (PKSDATAFORMAT) &StreamFormatNABTSFEC
  106. // Add more formats here for to mirror output formats for "passthrough" mode
  107. // The idea is that upstream capture drivers may have done some decoding already
  108. // or downstream drivers may wish to have the raw data without any decoding at all.
  109. // In that case all we need to do is copy the data(if there is a pending SRB) OR
  110. // forward the SRB to the downstream client.
  111. };
  112. #define NUM_STREAM_0_FORMATS (SIZEOF_ARRAY(Stream0Formats))
  113. //---------------------------------------------------------------------------
  114. // STREAM_Output Formats
  115. //---------------------------------------------------------------------------
  116. static PKSDATAFORMAT Stream1Formats[] =
  117. {
  118. (PKSDATAFORMAT) &StreamFormatIPv4,
  119. //
  120. // Add more formats here for whatever output formats are supported.
  121. //
  122. };
  123. #define NUM_STREAM_1_FORMATS (SIZEOF_ARRAY (Stream1Formats))
  124. //---------------------------------------------------------------------------
  125. //---------------------------------------------------------------------------
  126. // Create an array that holds the list of all of the streams supported
  127. //---------------------------------------------------------------------------
  128. typedef struct _ALL_STREAM_INFO
  129. {
  130. HW_STREAM_INFORMATION hwStreamInfo;
  131. HW_STREAM_OBJECT hwStreamObject;
  132. } ALL_STREAM_INFO, *PALL_STREAM_INFO;
  133. static ALL_STREAM_INFO Streams [] =
  134. {
  135. //
  136. // NABTS input stream
  137. //
  138. {
  139. // HW_STREAM_INFORMATION -------------------------------------------
  140. {
  141. 1, // NumberOfPossibleInstances
  142. KSPIN_DATAFLOW_IN, // DataFlow
  143. TRUE, // DataAccessible
  144. NUM_STREAM_0_FORMATS, // NumberOfFormatArrayEntries
  145. Stream0Formats, // StreamFormatsArray
  146. 0, // ClassReserved[0]
  147. 0, // ClassReserved[1]
  148. 0, // ClassReserved[2]
  149. 0, // ClassReserved[3]
  150. NUMBER_SLIP_STREAM_PROPERTIES, // Number of stream properties
  151. (PKSPROPERTY_SET) SlipStreamProperties, // Stream Property Array
  152. 0, // NumStreamEventArrayEntries
  153. 0, // StreamEventsArray
  154. NULL, // Category
  155. (GUID *)&PINNAME_VIDEO_NABTS, // Name
  156. 0, // MediumsCount
  157. NULL, // Mediums
  158. },
  159. // HW_STREAM_OBJECT ------------------------------------------------
  160. {
  161. sizeof (HW_STREAM_OBJECT), // SizeOfThisPacket
  162. 0, // StreamNumber
  163. (PVOID)NULL, // HwStreamExtension
  164. ReceiveDataPacket,
  165. ReceiveCtrlPacket,
  166. { // HW_CLOCK_OBJECT
  167. NULL, // .HWClockFunction
  168. 0, // .ClockSupportFlags
  169. },
  170. FALSE, // Dma
  171. TRUE, // Pio
  172. (PVOID)NULL, // HwDeviceExtension
  173. 0, // StreamHeaderMediaSpecific
  174. 0, // StreamHeaderWorkspace
  175. TRUE, // Allocator
  176. NULL, // HwEventRoutine
  177. },
  178. },
  179. //
  180. // IPv4 Control Interface Pin
  181. //
  182. {
  183. // HW_STREAM_INFORMATION -------------------------------------------
  184. {
  185. 1, // NumberOfPossibleInstances
  186. KSPIN_DATAFLOW_OUT, // DataFlow
  187. TRUE, // DataAccessible
  188. NUM_STREAM_1_FORMATS, // NumberOfFormatArrayEntries
  189. Stream1Formats, // StreamFormatsArray
  190. 0, // ClassReserved[0]
  191. 0, // ClassReserved[1]
  192. 0, // ClassReserved[2]
  193. 0, // ClassReserved[3]
  194. NUMBER_SLIP_STREAM_PROPERTIES, // Number of stream properties
  195. (PKSPROPERTY_SET) SlipStreamProperties, // Stream Property Array
  196. 0, // NumStreamEventArrayEntries
  197. 0, // StreamEventsArray
  198. NULL, // Category
  199. (GUID *)&PINNAME_IPSINK_INPUT, // Name
  200. 0, // MediumsCount
  201. NULL, // Mediums
  202. },
  203. // HW_STREAM_OBJECT ------------------------------------------------
  204. {
  205. sizeof (HW_STREAM_OBJECT), // SizeOfThisPacket
  206. 0, // StreamNumber
  207. (PVOID)NULL, // HwStreamExtension
  208. ReceiveDataPacket, // HwReceiveDataPacket Handler
  209. ReceiveCtrlPacket, // HwReceiveControlPacket Handler
  210. { // HW_CLOCK_OBJECT
  211. NULL, // .HWClockFunction
  212. 0, // .ClockSupportFlags
  213. },
  214. FALSE, // Dma
  215. TRUE, // Pio
  216. (PVOID)NULL, // HwDeviceExtension
  217. 0, // StreamHeaderMediaSpecific
  218. 0, // StreamHeaderWorkspace
  219. TRUE, // Allocator
  220. NULL, // HwEventRoutine
  221. },
  222. }
  223. };
  224. #define DRIVER_STREAM_COUNT (SIZEOF_ARRAY (Streams))
  225. //---------------------------------------------------------------------------
  226. // Topology
  227. //---------------------------------------------------------------------------
  228. // Categories define what the device does.
  229. static GUID Categories[] =
  230. {
  231. STATIC_KSCATEGORY_BDA_RECEIVER_COMPONENT
  232. };
  233. #define NUMBER_OF_CATEGORIES SIZEOF_ARRAY (Categories)
  234. static KSTOPOLOGY Topology = {
  235. NUMBER_OF_CATEGORIES,
  236. (GUID*) &Categories,
  237. 0,
  238. (GUID*) NULL,
  239. 0,
  240. NULL
  241. };
  242. //---------------------------------------------------------------------------
  243. // The Main stream header
  244. //---------------------------------------------------------------------------
  245. static HW_STREAM_HEADER StreamHeader =
  246. {
  247. DRIVER_STREAM_COUNT, // NumberOfStreams
  248. sizeof (HW_STREAM_INFORMATION), // Future proofing
  249. 0, // NumDevPropArrayEntries set at init time
  250. NULL, // DevicePropertiesArray set at init time
  251. 0, // NumDevEventArrayEntries;
  252. NULL, // DeviceEventsArray;
  253. &Topology // Pointer to Device Topology
  254. };
  255. #ifdef __cplusplus
  256. }
  257. #endif // __cplusplus
  258. #endif // __SLIP_STREAM_H__