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.

289 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 __MPE_STREAM_H__
  12. #define __MPE_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(MpeConnectionProperties)
  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(MpeStreamProperties)
  39. {
  40. DEFINE_KSPROPERTY_SET
  41. (
  42. &KSPROPSETID_Connection, // Set
  43. SIZEOF_ARRAY(MpeConnectionProperties), // PropertiesCount
  44. MpeConnectionProperties, // PropertyItems
  45. 0, // FastIoCount
  46. NULL // FastIoTable
  47. ),
  48. };
  49. #define NUMBER_MPE_STREAM_PROPERTIES (SIZEOF_ARRAY(MpeStreamProperties))
  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. 4096, // 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 StreamFormatMPE =
  67. {
  68. sizeof (KSDATARANGE),
  69. 0,
  70. 4093, //max sizeof (MPE_BUFFER),
  71. 0, // Reserved
  72. { STATIC_KSDATAFORMAT_TYPE_MPE },
  73. { STATIC_KSDATAFORMAT_SUBTYPE_NONE },
  74. { STATIC_KSDATAFORMAT_SPECIFIER_NONE }
  75. };
  76. //---------------------------------------------------------------------------
  77. // STREAM_Input Formats
  78. //---------------------------------------------------------------------------
  79. static PKSDATAFORMAT Stream0Formats[] =
  80. {
  81. (PKSDATAFORMAT) &StreamFormatMPE
  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. // MPE 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_MPE_STREAM_PROPERTIES, // Number of stream properties
  127. (PKSPROPERTY_SET) MpeStreamProperties, // Stream Property Array
  128. 0, // NumStreamEventArrayEntries
  129. 0, // StreamEventsArray
  130. NULL, // Category
  131. (GUID *)&PINNAME_MPE, // 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_MPE_STREAM_PROPERTIES, // Number of stream properties
  171. (PKSPROPERTY_SET) MpeStreamProperties, // 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. // Topology connections
  205. KSTOPOLOGY_CONNECTION rgConnections[] =
  206. {
  207. {-1, 0, -1, 1}
  208. };
  209. // Categories define what the device does.
  210. static GUID Categories[] =
  211. {
  212. STATIC_KSCATEGORY_BDA_RECEIVER_COMPONENT
  213. };
  214. #define NUMBER_OF_CATEGORIES SIZEOF_ARRAY (Categories)
  215. static KSTOPOLOGY Topology = {
  216. NUMBER_OF_CATEGORIES,
  217. (GUID*) &Categories,
  218. 0,
  219. (GUID*) NULL,
  220. 1,
  221. rgConnections,
  222. NULL,
  223. 0
  224. };
  225. //---------------------------------------------------------------------------
  226. // The Main stream header
  227. //---------------------------------------------------------------------------
  228. static HW_STREAM_HEADER StreamHeader =
  229. {
  230. DRIVER_STREAM_COUNT, // NumberOfStreams
  231. sizeof (HW_STREAM_INFORMATION), // Future proofing
  232. 0, // NumDevPropArrayEntries set at init time
  233. NULL, // DevicePropertiesArray set at init time
  234. 0, // NumDevEventArrayEntries;
  235. NULL, // DeviceEventsArray;
  236. &Topology // Pointer to Device Topology
  237. };
  238. #ifdef __cplusplus
  239. }
  240. #endif // __cplusplus
  241. #endif // __MPE_STREAM_H__