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.

283 lines
11 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 StreamFormatIPv4 =
  54. {
  55. //
  56. // KSDATARANGE
  57. //
  58. sizeof (KSDATAFORMAT),
  59. 0,
  60. 1548, // sizeof a IPv4 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 StreamFormatNABTSFEC =
  67. {
  68. sizeof (KSDATARANGE),
  69. 0,
  70. sizeof (NABTSFEC_BUFFER),
  71. 0, // Reserved
  72. { STATIC_KSDATAFORMAT_TYPE_NABTS },
  73. { STATIC_KSDATAFORMAT_SUBTYPE_NABTS_FEC },
  74. { STATIC_KSDATAFORMAT_SPECIFIER_NONE }
  75. };
  76. //---------------------------------------------------------------------------
  77. // STREAM_Input Formats
  78. //---------------------------------------------------------------------------
  79. static PKSDATAFORMAT Stream0Formats[] =
  80. {
  81. (PKSDATAFORMAT) &StreamFormatNABTSFEC
  82. // Add more formats here for to mirror output formats for "passthrough" mode
  83. // The idea is that upstream capture drivers may have done some decoding already
  84. // or downstream drivers may wish to have the raw data without any decoding at all.
  85. // In that case all we need to do is copy the data(if there is a pending SRB) OR
  86. // forward the SRB to the downstream client.
  87. };
  88. #define NUM_STREAM_0_FORMATS (SIZEOF_ARRAY(Stream0Formats))
  89. //---------------------------------------------------------------------------
  90. // STREAM_Output Formats
  91. //---------------------------------------------------------------------------
  92. static PKSDATAFORMAT Stream1Formats[] =
  93. {
  94. (PKSDATAFORMAT) &StreamFormatIPv4,
  95. //
  96. // Add more formats here for whatever output formats are supported.
  97. //
  98. };
  99. #define NUM_STREAM_1_FORMATS (SIZEOF_ARRAY (Stream1Formats))
  100. //---------------------------------------------------------------------------
  101. //---------------------------------------------------------------------------
  102. // Create an array that holds the list of all of the streams supported
  103. //---------------------------------------------------------------------------
  104. typedef struct _ALL_STREAM_INFO
  105. {
  106. HW_STREAM_INFORMATION hwStreamInfo;
  107. HW_STREAM_OBJECT hwStreamObject;
  108. } ALL_STREAM_INFO, *PALL_STREAM_INFO;
  109. static ALL_STREAM_INFO Streams [] =
  110. {
  111. //
  112. // NABTS input stream
  113. //
  114. {
  115. // HW_STREAM_INFORMATION -------------------------------------------
  116. {
  117. 1, // NumberOfPossibleInstances
  118. KSPIN_DATAFLOW_IN, // DataFlow
  119. TRUE, // DataAccessible
  120. NUM_STREAM_0_FORMATS, // NumberOfFormatArrayEntries
  121. Stream0Formats, // StreamFormatsArray
  122. 0, // ClassReserved[0]
  123. 0, // ClassReserved[1]
  124. 0, // ClassReserved[2]
  125. 0, // ClassReserved[3]
  126. NUMBER_SLIP_STREAM_PROPERTIES, // Number of stream properties
  127. (PKSPROPERTY_SET) SlipStreamProperties, // Stream Property Array
  128. 0, // NumStreamEventArrayEntries
  129. 0, // StreamEventsArray
  130. NULL, // Category
  131. (GUID *)&PINNAME_VIDEO_NABTS, // Name
  132. 0, // MediumsCount
  133. NULL, // Mediums
  134. },
  135. // HW_STREAM_OBJECT ------------------------------------------------
  136. {
  137. sizeof (HW_STREAM_OBJECT), // SizeOfThisPacket
  138. 0, // StreamNumber
  139. (PVOID)NULL, // HwStreamExtension
  140. ReceiveDataPacket,
  141. ReceiveCtrlPacket,
  142. { // HW_CLOCK_OBJECT
  143. NULL, // .HWClockFunction
  144. 0, // .ClockSupportFlags
  145. },
  146. FALSE, // Dma
  147. TRUE, // Pio
  148. (PVOID)NULL, // HwDeviceExtension
  149. 0, // StreamHeaderMediaSpecific
  150. 0, // StreamHeaderWorkspace
  151. TRUE, // Allocator
  152. NULL, // HwEventRoutine
  153. },
  154. },
  155. //
  156. // IPv4 Control Interface Pin
  157. //
  158. {
  159. // HW_STREAM_INFORMATION -------------------------------------------
  160. {
  161. 1, // NumberOfPossibleInstances
  162. KSPIN_DATAFLOW_OUT, // DataFlow
  163. TRUE, // DataAccessible
  164. NUM_STREAM_1_FORMATS, // NumberOfFormatArrayEntries
  165. Stream1Formats, // StreamFormatsArray
  166. 0, // ClassReserved[0]
  167. 0, // ClassReserved[1]
  168. 0, // ClassReserved[2]
  169. 0, // ClassReserved[3]
  170. NUMBER_SLIP_STREAM_PROPERTIES, // Number of stream properties
  171. (PKSPROPERTY_SET) SlipStreamProperties, // Stream Property Array
  172. 0, // NumStreamEventArrayEntries
  173. 0, // StreamEventsArray
  174. NULL, // Category
  175. (GUID *)&PINNAME_IPSINK_INPUT, // Name
  176. 0, // MediumsCount
  177. NULL, // Mediums
  178. },
  179. // HW_STREAM_OBJECT ------------------------------------------------
  180. {
  181. sizeof (HW_STREAM_OBJECT), // SizeOfThisPacket
  182. 0, // StreamNumber
  183. (PVOID)NULL, // HwStreamExtension
  184. ReceiveDataPacket, // HwReceiveDataPacket Handler
  185. ReceiveCtrlPacket, // HwReceiveControlPacket Handler
  186. { // HW_CLOCK_OBJECT
  187. NULL, // .HWClockFunction
  188. 0, // .ClockSupportFlags
  189. },
  190. FALSE, // Dma
  191. TRUE, // Pio
  192. (PVOID)NULL, // HwDeviceExtension
  193. 0, // StreamHeaderMediaSpecific
  194. 0, // StreamHeaderWorkspace
  195. TRUE, // Allocator
  196. NULL, // HwEventRoutine
  197. },
  198. }
  199. };
  200. #define DRIVER_STREAM_COUNT (SIZEOF_ARRAY (Streams))
  201. //---------------------------------------------------------------------------
  202. // Topology
  203. //---------------------------------------------------------------------------
  204. // Categories define what the device does.
  205. static GUID Categories[] =
  206. {
  207. STATIC_KSCATEGORY_BDA_RECEIVER_COMPONENT
  208. };
  209. #define NUMBER_OF_CATEGORIES SIZEOF_ARRAY (Categories)
  210. static KSTOPOLOGY Topology = {
  211. NUMBER_OF_CATEGORIES,
  212. (GUID*) &Categories,
  213. 0,
  214. (GUID*) NULL,
  215. 0,
  216. NULL
  217. };
  218. //---------------------------------------------------------------------------
  219. // The Main stream header
  220. //---------------------------------------------------------------------------
  221. static HW_STREAM_HEADER StreamHeader =
  222. {
  223. DRIVER_STREAM_COUNT, // NumberOfStreams
  224. sizeof (HW_STREAM_INFORMATION), // Future proofing
  225. 0, // NumDevPropArrayEntries set at init time
  226. NULL, // DevicePropertiesArray set at init time
  227. 0, // NumDevEventArrayEntries;
  228. NULL, // DeviceEventsArray;
  229. &Topology // Pointer to Device Topology
  230. };
  231. #ifdef __cplusplus
  232. }
  233. #endif // __cplusplus
  234. #endif // __SLIP_STREAM_H__