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.

1180 lines
41 KiB

  1. /*++
  2. Copyright (c) 1999 Microsoft Corporation
  3. Module Name:
  4. ObjDesc.cpp
  5. Abstract:
  6. Static object description data structures.
  7. This file includes initial descriptors for all filter, pin, and node
  8. objects exposed by this driver. It also include descriptors for the
  9. properties, methods, and events on those objects.
  10. --*/
  11. #include "BDATuner.h"
  12. #ifdef ALLOC_DATA_PRAGMA
  13. #pragma const_seg("PAGECONST")
  14. #endif // ALLOC_DATA_PRAGMA
  15. #ifdef ALLOC_PRAGMA
  16. #pragma code_seg("PAGE")
  17. #endif // ALLOC_PRAGMA
  18. //
  19. // Before defining structures for nodes, pins, and filters,
  20. // it may be useful to show the filter's template topology here.
  21. //
  22. // The sample filter's topology:
  23. //
  24. // Node Type 0 Node Type 1
  25. // | |
  26. // v v
  27. // --------------- --------------------
  28. // Antenna | | | | Transport
  29. // In Pin --------| Tuner Node |--X--| Demodulator Node |------------ Out Pin
  30. // ^ ^ | | ^ | | ^ ^
  31. // | | --------------- | -------------------- | |
  32. // | | | | |
  33. // | -- Connection 0 -- Connection 1 -- Connection 2 |
  34. // | Topology Joint |
  35. // ---- Pin Type 0 Pin Type 1 ----
  36. //
  37. //
  38. //===========================================================================
  39. //
  40. // Node definitions
  41. //
  42. // Nodes are special in that, though they are defined at the filter level,
  43. // they are actually associated with a pin type. The filter's node
  44. // descriptor list is actually a list of node types.
  45. //
  46. // BDA allows a node type to appear only once in a template topology.
  47. // This means that a node in an actual filter topology can be uniquely
  48. // identified by specifying the node type along with the actual input and
  49. // output pin IDs of the the path that the node appears in.
  50. //
  51. // Note that the dispatch routines for nodes actually point to
  52. // pin-specific methods because the context data associated with
  53. // a node is stored in the pin context.
  54. //
  55. // Node property begin with a KSP_NODE structure that contains the node type of the node to which
  56. // that property applies. This begs the question:
  57. //
  58. // "How is a node uniquely identified by only the node type?"
  59. //
  60. // The BDA Support Library uses the concept of a topology joint to solve
  61. // this problem. Nodes upstream of a topology joint have their properties
  62. // dispatched to the input pin of the path. Properties for nodes
  63. // downstream of the joint are dispatched to the output pin of the path
  64. // containing the node.
  65. //
  66. // Node properties and methods should only be accessed from the
  67. // appropriate pin. The BDA Support Library helps assure this by
  68. // automatically merging a node type's automation table onto the automation
  69. // table of the correct pin. This pin is called the controlling pin
  70. // for that node type.
  71. //
  72. //===========================================================================
  73. typedef enum {
  74. BDA_SAMPLE_TUNER_NODE = 0,
  75. BDA_SAMPLE_DEMODULATOR_NODE
  76. }BDA_SAMPLE_NODES;
  77. //===========================================================================
  78. //
  79. // BDA Sample Tuner Node (Node Type 0) definitions
  80. //
  81. // Define structures here for the Properties, Methods, and Events
  82. // available on the BDA Sample Tuner Node.
  83. //
  84. // This node is associated with an antenna input pin, therefore, the node
  85. // properties should be set/retrieved using the antenna input pin. The
  86. // BDA Support Library will automatically merge the node's automation
  87. // table into the automation table for the antenna input pin.
  88. //
  89. // Properties and methods are dispatched to the Antenna class.
  90. //
  91. //===========================================================================
  92. //
  93. // BDA Sample Tune Frequency Filter
  94. //
  95. // Define dispatch routines for specific properties.
  96. //
  97. // One property is used to get and set the tuner's center frequency.
  98. // For this property, define dispatch routines to get and set the frequency.
  99. //
  100. // Other properties can be used to get and set the tuner's frequency range,
  101. // as well as to report signal strength.
  102. //
  103. // These properties must be supported by BDA and
  104. // defined elsewhere (for example, in Bdamedia.h).
  105. //
  106. DEFINE_KSPROPERTY_TABLE(SampleTunerNodeFrequencyProperties)
  107. {
  108. DEFINE_KSPROPERTY_ITEM_BDA_RF_TUNER_FREQUENCY(
  109. CAntennaPin::GetCenterFrequency,
  110. CAntennaPin::PutCenterFrequency
  111. ),
  112. DEFINE_KSPROPERTY_ITEM_BDA_RF_TUNER_FREQUENCY_MULTIPLIER(
  113. NULL, NULL
  114. ),
  115. #ifdef SATELLITE_TUNER
  116. DEFINE_KSPROPERTY_ITEM_BDA_RF_TUNER_POLARITY(
  117. NULL, NULL
  118. ),
  119. DEFINE_KSPROPERTY_ITEM_BDA_RF_TUNER_RANGE(
  120. NULL, NULL
  121. ),
  122. #endif // SATELLITE_TUNER
  123. #ifdef CHANNEL_BASED_TUNER
  124. DEFINE_KSPROPERTY_ITEM_BDA_RF_TUNER_TRANSPONDER(
  125. NULL, NULL
  126. ),
  127. #endif // CHANNEL_BASED_TUNER
  128. #ifdef DVBT_TUNER
  129. DEFINE_KSPROPERTY_ITEM_BDA_RF_TUNER_BANDWIDTH(
  130. NULL, NULL
  131. ),
  132. #endif // DVBT_TUNER
  133. };
  134. //
  135. // BDA Signal Statistics Properties
  136. //
  137. // Defines the dispatch routines for the Signal Statistics Properties
  138. // on the RF Tuner, Demodulator, and PID Filter Nodes
  139. //
  140. DEFINE_KSPROPERTY_TABLE(SampleRFSignalStatsProperties)
  141. {
  142. #ifdef OPTIONAL_SIGNAL_STATISTICS
  143. DEFINE_KSPROPERTY_ITEM_BDA_SIGNAL_STRENGTH(
  144. NULL, NULL
  145. ),
  146. #endif // OPTIONAL_SIGNAL_STATISTICS
  147. DEFINE_KSPROPERTY_ITEM_BDA_SIGNAL_PRESENT(
  148. CAntennaPin::GetSignalStatus,
  149. NULL
  150. ),
  151. };
  152. //
  153. // Define the Property Sets for the sample tuner node from the
  154. // previously defined node properties and from property sets
  155. // that BDA supports.
  156. // These supported property sets must be defined elsewhere
  157. // (for example, in Bdamedia.h).
  158. //
  159. // Associate the sample tuner node with the antenna input pin.
  160. //
  161. DEFINE_KSPROPERTY_SET_TABLE(SampleTunerNodePropertySets)
  162. {
  163. DEFINE_KSPROPERTY_SET
  164. (
  165. &KSPROPSETID_BdaFrequencyFilter, // Property Set defined elsewhere
  166. SIZEOF_ARRAY(SampleTunerNodeFrequencyProperties), // Number of properties in the array
  167. SampleTunerNodeFrequencyProperties, // Property set array
  168. 0, // FastIoCount
  169. NULL // FastIoTable
  170. ),
  171. DEFINE_KSPROPERTY_SET
  172. (
  173. &KSPROPSETID_BdaSignalStats, // Property Set defined elsewhere
  174. SIZEOF_ARRAY(SampleRFSignalStatsProperties), // Number of properties in the array
  175. SampleRFSignalStatsProperties, // Property set array
  176. 0, // FastIoCount
  177. NULL // FastIoTable
  178. )
  179. };
  180. //
  181. // Define the Automation Table for the BDA sample tuner node.
  182. //
  183. DEFINE_KSAUTOMATION_TABLE(SampleTunerNodeAutomation) {
  184. DEFINE_KSAUTOMATION_PROPERTIES(SampleTunerNodePropertySets),
  185. DEFINE_KSAUTOMATION_METHODS_NULL,
  186. DEFINE_KSAUTOMATION_EVENTS_NULL
  187. };
  188. //===========================================================================
  189. //
  190. // Sample Demodulator Node definitions
  191. //
  192. // This structure defines the Properties, Methods, and Events
  193. // available on the BDA Demodulator Node.
  194. //
  195. // This node is associated with a transport output pin and thus the node
  196. // properties should be set/put using the transport output pin.
  197. //
  198. //===========================================================================
  199. //
  200. // BDA Signal Statistics Properties for Demodulator Node
  201. //
  202. // Defines the dispatch routines for the Signal Statistics Properties
  203. // on the Demodulator Node.
  204. //
  205. DEFINE_KSPROPERTY_TABLE(SampleDemodSignalStatsProperties)
  206. {
  207. #ifdef OPTIONAL_SIGNAL_STATISTICS
  208. DEFINE_KSPROPERTY_ITEM_BDA_SIGNAL_QUALITY(
  209. NULL, NULL
  210. ),
  211. #endif // OPTIONAL_SIGNAL_STATISTICS
  212. DEFINE_KSPROPERTY_ITEM_BDA_SIGNAL_LOCKED(
  213. CTransportPin::GetSignalStatus,
  214. NULL
  215. ),
  216. };
  217. DEFINE_KSPROPERTY_TABLE(SampleAutoDemodProperties)
  218. {
  219. DEFINE_KSPROPERTY_ITEM_BDA_AUTODEMODULATE_START(
  220. NULL,
  221. CTransportPin::PutAutoDemodProperty
  222. ),
  223. DEFINE_KSPROPERTY_ITEM_BDA_AUTODEMODULATE_STOP(
  224. NULL,
  225. CTransportPin::PutAutoDemodProperty
  226. )
  227. };
  228. #if !ATSC_RECEIVER
  229. //
  230. // BDA Digital Demodulator Property Set for Demodulator Node
  231. //
  232. // Defines the dispatch routines for the Digital Demodulator Properties
  233. // on the Demodulator Node.
  234. //
  235. DEFINE_KSPROPERTY_TABLE(SampleDigitalDemodProperties)
  236. {
  237. DEFINE_KSPROPERTY_ITEM_BDA_MODULATION_TYPE(
  238. CTransportPin::GetDigitalDemodProperty,
  239. CTransportPin::PutDigitalDemodProperty
  240. ),
  241. DEFINE_KSPROPERTY_ITEM_BDA_INNER_FEC_TYPE(
  242. CTransportPin::GetDigitalDemodProperty,
  243. CTransportPin::PutDigitalDemodProperty
  244. ),
  245. DEFINE_KSPROPERTY_ITEM_BDA_INNER_FEC_RATE(
  246. CTransportPin::GetDigitalDemodProperty,
  247. CTransportPin::PutDigitalDemodProperty
  248. ),
  249. DEFINE_KSPROPERTY_ITEM_BDA_OUTER_FEC_TYPE(
  250. CTransportPin::GetDigitalDemodProperty,
  251. CTransportPin::PutDigitalDemodProperty
  252. ),
  253. DEFINE_KSPROPERTY_ITEM_BDA_OUTER_FEC_RATE(
  254. CTransportPin::GetDigitalDemodProperty,
  255. CTransportPin::PutDigitalDemodProperty
  256. ),
  257. DEFINE_KSPROPERTY_ITEM_BDA_SYMBOL_RATE(
  258. CTransportPin::GetDigitalDemodProperty,
  259. CTransportPin::PutDigitalDemodProperty
  260. ),
  261. #if DVBS_RECEIVER
  262. DEFINE_KSPROPERTY_ITEM_BDA_SPECTRAL_INVERSION(
  263. CTransportPin::GetDigitalDemodProperty,
  264. CTransportPin::PutDigitalDemodProperty
  265. ),
  266. #endif // DVBS_RECEIVER
  267. #if DVBT_RECEIVER
  268. DEFINE_KSPROPERTY_ITEM_BDA_GUARD_INTERVAL(
  269. CTransportPin::GetDigitalDemodProperty,
  270. CTransportPin::PutDigitalDemodProperty
  271. ),
  272. DEFINE_KSPROPERTY_ITEM_BDA_TRANSMISSION_MODE(
  273. CTransportPin::GetDigitalDemodProperty,
  274. CTransportPin::PutDigitalDemodProperty
  275. )
  276. #endif // DVBT_RECEIVER
  277. };
  278. #endif // !ATSC_RECEIVER
  279. //
  280. // Sample Demodulator Node Extension Properties
  281. //
  282. // Define dispatch routines for a set of driver specific
  283. // demodulator node properties. This is how venders add support
  284. // for properties that are specific to their hardware. They can
  285. // access these properties through a KSProxy plugin.
  286. //
  287. DEFINE_KSPROPERTY_TABLE(BdaSampleDemodExtensionProperties)
  288. {
  289. DEFINE_KSPROPERTY_ITEM_BDA_SAMPLE_DEMOD_EXTENSION_PROPERTY1( // A read and write property
  290. CTransportPin::GetExtensionProperties, // or NULL if not method to get the property
  291. CTransportPin::PutExtensionProperties // or NULL if not method to put the property
  292. ),
  293. DEFINE_KSPROPERTY_ITEM_BDA_SAMPLE_DEMOD_EXTENSION_PROPERTY2( //A read only property
  294. CTransportPin::GetExtensionProperties, // or NULL if not method to get the property
  295. NULL // or NULL if not method to put the property
  296. ),
  297. DEFINE_KSPROPERTY_ITEM_BDA_SAMPLE_DEMOD_EXTENSION_PROPERTY3( //A write only property
  298. NULL, // or NULL if not method to get the property
  299. CTransportPin::PutExtensionProperties // or NULL if not method to put the property
  300. ),
  301. };
  302. //
  303. // Demodulator Node Property Sets supported
  304. //
  305. // This table defines all property sets supported by the
  306. // Demodulator Node associated with the transport output pin.
  307. //
  308. DEFINE_KSPROPERTY_SET_TABLE(SampleDemodNodePropertySets)
  309. {
  310. DEFINE_KSPROPERTY_SET
  311. (
  312. &KSPROPSETID_BdaAutodemodulate, // Set
  313. SIZEOF_ARRAY(SampleAutoDemodProperties), // PropertiesCount
  314. SampleAutoDemodProperties, // PropertyItems
  315. 0, // FastIoCount
  316. NULL // FastIoTable
  317. ),
  318. #if !ATSC_RECEIVER
  319. DEFINE_KSPROPERTY_SET
  320. (
  321. &KSPROPSETID_BdaDigitalDemodulator, // Set
  322. SIZEOF_ARRAY(SampleDigitalDemodProperties), // PropertiesCount
  323. SampleDigitalDemodProperties, // PropertyItems
  324. 0, // FastIoCount
  325. NULL // FastIoTable
  326. ),
  327. #endif // !ATSC_RECEIVER
  328. DEFINE_KSPROPERTY_SET
  329. (
  330. &KSPROPSETID_BdaSignalStats, // Set
  331. SIZEOF_ARRAY(SampleDemodSignalStatsProperties), // PropertiesCount
  332. SampleDemodSignalStatsProperties, // PropertyItems
  333. 0, // FastIoCount
  334. NULL // FastIoTable
  335. ),
  336. DEFINE_KSPROPERTY_SET
  337. (
  338. &KSPROPSETID_BdaSampleDemodExtensionProperties, // Set
  339. SIZEOF_ARRAY(BdaSampleDemodExtensionProperties), // Number of properties in the array
  340. BdaSampleDemodExtensionProperties, // Property set array
  341. 0, // FastIoCount
  342. NULL // FastIoTable
  343. ),
  344. //
  345. // Additional property sets for the node can be added here.
  346. //
  347. };
  348. //
  349. // Demodulator Node Automation Table
  350. //
  351. // This structure defines the Properties, Methods, and Events
  352. // available on the BDA Demodulator Node.
  353. // These are used to set the symbol rate, and Viterbi rate,
  354. // as well as to report signal lock and signal quality.
  355. //
  356. DEFINE_KSAUTOMATION_TABLE(SampleDemodulatorNodeAutomation) {
  357. DEFINE_KSAUTOMATION_PROPERTIES( SampleDemodNodePropertySets),
  358. DEFINE_KSAUTOMATION_METHODS_NULL,
  359. DEFINE_KSAUTOMATION_EVENTS_NULL
  360. };
  361. //===========================================================================
  362. //
  363. // Antenna Pin Definitions
  364. //
  365. //===========================================================================
  366. //
  367. // The BDA Support Library automatically merges the RF tuner node properties,
  368. // methods, and events onto the antenna pin's automation table. It also
  369. // merges properties, methods, and events the that are require and
  370. // supplied by the BDA Support Library.
  371. //
  372. //
  373. // The hardware vendor may want to provide driver specific properties,
  374. // methods, or events on the antenna pin or override those provided by
  375. // the BDA Support Library. Such roperties, methods, and events will
  376. // be defined here.
  377. //
  378. //
  379. // Define the Automation Table for the antenna pin.
  380. //
  381. //
  382. DEFINE_KSAUTOMATION_TABLE(AntennaAutomation) {
  383. DEFINE_KSAUTOMATION_PROPERTIES_NULL,
  384. DEFINE_KSAUTOMATION_METHODS_NULL,
  385. DEFINE_KSAUTOMATION_EVENTS_NULL
  386. };
  387. //
  388. // Dispatch Table for the antenna pin.
  389. //
  390. const
  391. KSPIN_DISPATCH
  392. AntennaPinDispatch =
  393. {
  394. CAntennaPin::PinCreate, // Create
  395. CAntennaPin::PinClose, // Close
  396. NULL, // Process siganl data
  397. NULL, // Reset
  398. NULL, // SetDataFormat
  399. CAntennaPin::PinSetDeviceState, // SetDeviceState
  400. NULL, // Connect
  401. NULL, // Disconnect
  402. NULL, // Clock
  403. NULL // Allocator
  404. };
  405. //
  406. // Format the input antenna stream connection.
  407. //
  408. // Used to connect the input antenna pin to a specific upstream filter,
  409. // such as the network provider.
  410. //
  411. const KS_DATARANGE_BDA_ANTENNA AntennaPinRange =
  412. {
  413. // insert the KSDATARANGE and KSDATAFORMAT here
  414. {
  415. sizeof( KS_DATARANGE_BDA_ANTENNA), // FormatSize
  416. 0, // Flags - (N/A)
  417. 0, // SampleSize - (N/A)
  418. 0, // Reserved
  419. { STATIC_KSDATAFORMAT_TYPE_BDA_ANTENNA }, // MajorFormat
  420. { STATIC_KSDATAFORMAT_SUBTYPE_NONE }, // SubFormat
  421. { STATIC_KSDATAFORMAT_SPECIFIER_NONE } // Specifier
  422. }
  423. };
  424. // Format Ranges of Antenna Input Pin.
  425. //
  426. static PKSDATAFORMAT AntennaPinRanges[] =
  427. {
  428. (PKSDATAFORMAT) &AntennaPinRange,
  429. // Add more formats here if additional antenna signal formats are supported.
  430. //
  431. };
  432. //===========================================================================
  433. //
  434. // Transport Output Pin Definitions
  435. //
  436. //===========================================================================
  437. //
  438. // The BDA Support Library automatically merges the RF tuner node properties,
  439. // methods, and events onto the antenna pin's automation table. It also
  440. // merges properties, methods, and events the that are require and
  441. // supplied by the BDA Support Library.
  442. //
  443. //
  444. // The hardware vendor may want to provide driver specific properties,
  445. // methods, or events on the antenna pin or override those provided by
  446. // the BDA Support Library. Such roperties, methods, and events will
  447. // be defined here.
  448. //
  449. //
  450. // Define the Automation Table for the transport pin.
  451. //
  452. //
  453. DEFINE_KSAUTOMATION_TABLE(TransportAutomation) {
  454. DEFINE_KSAUTOMATION_PROPERTIES_NULL,
  455. DEFINE_KSAUTOMATION_METHODS_NULL,
  456. DEFINE_KSAUTOMATION_EVENTS_NULL
  457. };
  458. //
  459. // Dispatch Table for the transport Output pin.
  460. //
  461. // Since data on the transport is actually delivered to the
  462. // PCI bridge in hardware, this pin does not process data.
  463. //
  464. // Connection of, and state transitions on, this pin help the
  465. // driver to determine when to allocate hardware resources for
  466. // each node.
  467. //
  468. const
  469. KSPIN_DISPATCH
  470. TransportPinDispatch =
  471. {
  472. CTransportPin::PinCreate, // Create
  473. CTransportPin::PinClose, // Close
  474. NULL, // Process
  475. NULL, // Reset
  476. NULL, // SetDataFormat
  477. NULL, //SetDeviceState
  478. NULL, // Connect
  479. NULL, // Disconnect
  480. NULL, // Clock
  481. NULL // Allocator
  482. };
  483. //
  484. // Format the output Transport Stream Connection
  485. //
  486. // Used to connect the output pin to a specific downstream filter
  487. //
  488. const KS_DATARANGE_BDA_TRANSPORT TransportPinRange =
  489. {
  490. // insert the KSDATARANGE and KSDATAFORMAT here
  491. {
  492. sizeof( KS_DATARANGE_BDA_TRANSPORT), // FormatSize
  493. 0, // Flags - (N/A)
  494. 0, // SampleSize - (N/A)
  495. 0, // Reserved
  496. { STATIC_KSDATAFORMAT_TYPE_STREAM }, // MajorFormat
  497. { STATIC_KSDATAFORMAT_TYPE_MPEG2_TRANSPORT }, // SubFormat
  498. { STATIC_KSDATAFORMAT_SPECIFIER_BDA_TRANSPORT } // Specifier
  499. },
  500. // insert the BDA_TRANSPORT_INFO here
  501. {
  502. 188, // ulcbPhyiscalPacket
  503. 312 * 188, // ulcbPhyiscalFrame
  504. 0, // ulcbPhyiscalFrameAlignment (no requirement)
  505. 0 // AvgTimePerFrame (not known)
  506. }
  507. };
  508. // Format Ranges of Transport Output Pin.
  509. //
  510. static PKSDATAFORMAT TransportPinRanges[] =
  511. {
  512. (PKSDATAFORMAT) &TransportPinRange,
  513. // Add more formats here if additional transport formats are supported.
  514. //
  515. };
  516. // Medium GUIDs for the Transport Output Pin.
  517. //
  518. // This insures contection to the correct Capture Filter pin.
  519. //
  520. // {F102C41F-7FA1-4842-A0C8-DC41176EC844}
  521. #define GUID_BdaSWRcv 0xf102c41f, 0x7fa1, 0x4842, 0xa0, 0xc8, 0xdc, 0x41, 0x17, 0x6e, 0xc8, 0x44
  522. const KSPIN_MEDIUM TransportPinMedium =
  523. {
  524. GUID_BdaSWRcv, 0, 0
  525. };
  526. //===========================================================================
  527. //
  528. // Filter definitions
  529. //
  530. // Define arrays here that contain the types of nodes and pins that are possible for the filter
  531. // Define structures here that describe Properties, Methods, and Events available on the filter
  532. //
  533. // Properties can be used to set and retrieve information for the filter.
  534. // Methods can be used to perform operations on the filter.
  535. //
  536. //===========================================================================
  537. //
  538. // Template Node Descriptors
  539. //
  540. // Define an array that contains all the node types that are available in the template
  541. // topology of the filter.
  542. // These node types must be supported by BDA and
  543. // defined elsewhere (for example, in Bdamedia.h).
  544. //
  545. const
  546. KSNODE_DESCRIPTOR
  547. NodeDescriptors[] =
  548. {
  549. {
  550. &SampleTunerNodeAutomation, // Point to KSAUTOMATION_TABLE structure for the node's automation table
  551. &KSNODE_BDA_RF_TUNER, // Point to the guid that defines function of the node
  552. NULL // Point to the guid that represents the name of the topology node
  553. },
  554. #if ATSC_RECEIVER
  555. {
  556. &SampleDemodulatorNodeAutomation, // Point to KSAUTOMATION_TABLE
  557. &KSNODE_BDA_8VSB_DEMODULATOR, // Point to the guid that defines the topology node
  558. NULL // Point to the guid that represents the name of the topology node
  559. }
  560. #elif DVBS_RECEIVER
  561. {
  562. &SampleDemodulatorNodeAutomation, // Point to KSAUTOMATION_TABLE
  563. &KSNODE_BDA_QPSK_DEMODULATOR, // Point to the guid that defines the topology node
  564. NULL // Point to the guid that represents the name of the topology node
  565. }
  566. #elif DVBT_RECEIVER
  567. {
  568. &SampleDemodulatorNodeAutomation, // Point to KSAUTOMATION_TABLE
  569. &KSNODE_BDA_COFDM_DEMODULATOR, // Point to the guid that defines the topology node
  570. NULL // Point to the guid that represents the name of the topology node
  571. }
  572. #elif CABLE_RECEIVER
  573. {
  574. &SampleDemodulatorNodeAutomation, // Point to KSAUTOMATION_TABLE
  575. &KSNODE_BDA_QAM_DEMODULATOR, // Point to the guid that defines the topology node
  576. NULL // Point to the guid that represents the name of the topology node
  577. }
  578. #endif
  579. };
  580. //
  581. // Initial Pin Descriptors
  582. //
  583. // This data structure defines the pins that will appear on the filer
  584. // when it is first created.
  585. //
  586. // All BDA filters should expose at lease one input pin to insure that
  587. // the filter can be properly inserted in a BDA receiver graph. The
  588. // initial pins can be created in a number of ways.
  589. //
  590. // The initial filters descriptor passed in to BdaInitFilter can include
  591. // a list of n pin descriptors that correspond to the first n of m pin
  592. // descriptors in the template filter descriptor. This list of pin
  593. // descriptors will usually only include those input pins that are
  594. // ALWAYS exposed by the filter in question.
  595. //
  596. // Alternatively, the driver may call BdaCreatePin from its filter Create
  597. // dispatch function for each pin that it ALWAYS wants exposed.
  598. //
  599. // This filter uses an initial filter descriptor to force the Antenna
  600. // input pin to always be exposed.
  601. //
  602. const
  603. KSPIN_DESCRIPTOR_EX
  604. InitialPinDescriptors[] =
  605. {
  606. // Antenna Input Pin
  607. //
  608. {
  609. &AntennaPinDispatch, // Point to the dispatch table for the input pin
  610. &AntennaAutomation, // Point to the automation table for the input pin
  611. { // Specify members of a KSPIN_DESCRIPTOR structure for the input pin
  612. 0, // Interfaces
  613. NULL,
  614. 0, // Mediums
  615. NULL,
  616. SIZEOF_ARRAY(AntennaPinRanges),
  617. AntennaPinRanges,
  618. KSPIN_DATAFLOW_IN, // specifies that data flow is into the pin
  619. KSPIN_COMMUNICATION_BOTH, // specifies that the pin factory instantiates pins
  620. // that are both IRP sinks and IRP sources
  621. NULL, // Category GUID
  622. NULL, // GUID of the localized Unicode string name for the pin type
  623. 0
  624. }, // Specify flags
  625. KSPIN_FLAG_DO_NOT_USE_STANDARD_TRANSPORT |
  626. KSPIN_FLAG_FRAMES_NOT_REQUIRED_FOR_PROCESSING |
  627. KSPIN_FLAG_FIXED_FORMAT,
  628. 1, // Specify the maximum number of possible instances of the input pin
  629. 1, // Specify the number of instances of this pin type that are necessary for proper functioning of this filter
  630. NULL, // Point to KSALLOCATOR_FRAMING_EX structure for allocator framing
  631. CAntennaPin::IntersectDataFormat // Point to the data intersection handler function
  632. }
  633. };
  634. //
  635. // Template Pin Descriptors
  636. //
  637. // This data structure defines the pin types available in the filters
  638. // template topology. These structures will be used to create a
  639. // KDPinFactory for a pin type when BdaCreatePin or BdaMethodCreatePin
  640. // are called.
  641. //
  642. // This structure defines ALL pins the filter is capable of supporting,
  643. // including those pins which may only be created dynamically by a ring
  644. // 3 component such as a Network Provider.
  645. //
  646. //
  647. const
  648. KSPIN_DESCRIPTOR_EX
  649. TemplatePinDescriptors[] =
  650. {
  651. // Antenna Input Pin
  652. //
  653. {
  654. &AntennaPinDispatch, // Point to the dispatch table for the input pin
  655. &AntennaAutomation, // Point to the automation table for the input pin
  656. { // Specify members of a KSPIN_DESCRIPTOR structure for the input pin
  657. 0, // Interfaces
  658. NULL,
  659. 0, // Mediums
  660. NULL,
  661. SIZEOF_ARRAY(AntennaPinRanges),
  662. AntennaPinRanges,
  663. KSPIN_DATAFLOW_IN, // specifies that data flow is into the pin
  664. KSPIN_COMMUNICATION_BOTH, // specifies that the pin factory instantiates pins
  665. // that are both IRP sinks and IRP sources
  666. NULL, // Category GUID
  667. NULL, // GUID of the localized Unicode string name for the pin type
  668. 0
  669. }, // Specify flags
  670. KSPIN_FLAG_DO_NOT_USE_STANDARD_TRANSPORT |
  671. KSPIN_FLAG_FRAMES_NOT_REQUIRED_FOR_PROCESSING |
  672. KSPIN_FLAG_FIXED_FORMAT,
  673. 1, // Specify the maximum number of possible instances of the input pin
  674. 1, // Specify the number of instances of this pin type that are necessary for proper functioning of this filter
  675. NULL, // Point to KSALLOCATOR_FRAMING_EX structure for allocator framing
  676. CAntennaPin::IntersectDataFormat // Point to the data intersection handler function
  677. },
  678. // Tranport Output Pin
  679. //
  680. {
  681. &TransportPinDispatch, // Point to the dispatch table for the output pin
  682. &TransportAutomation, // Point to the automation table for the output pin
  683. { // Specify members of a KSPIN_DESCRIPTOR structure for the output pin
  684. 0, // Interfaces
  685. NULL,
  686. 1, // Mediums
  687. &TransportPinMedium,
  688. SIZEOF_ARRAY(TransportPinRanges),
  689. TransportPinRanges,
  690. // 0,
  691. // NULL,
  692. KSPIN_DATAFLOW_OUT, // specifies that data flow is out of the pin
  693. KSPIN_COMMUNICATION_BOTH, // specifies that the pin factory instantiates pins
  694. // that are both IRP sinks and IRP sources
  695. // NULL,//Name
  696. // NULL,//Category
  697. (GUID *) &PINNAME_BDA_TRANSPORT, // Category GUID
  698. (GUID *) &PINNAME_BDA_TRANSPORT, // GUID of the localized Unicode string
  699. // name for the pin type
  700. 0
  701. }, // Specify flags
  702. KSPIN_FLAG_DO_NOT_USE_STANDARD_TRANSPORT |
  703. KSPIN_FLAG_FRAMES_NOT_REQUIRED_FOR_PROCESSING |
  704. KSPIN_FLAG_FIXED_FORMAT,
  705. 1, // Specify the maximum number of possible instances of the output pin
  706. 0, // Specify the number of instances of this pin type that are necessary for proper functioning of this filter
  707. NULL, // Allocator Framing
  708. CTransportPin::IntersectDataFormat // Point to the data intersection handler function
  709. }
  710. };
  711. //
  712. // BDA Device Topology Property Set
  713. //
  714. // The BDA Support Library supplies a default implementation of the
  715. // BDA Device Topology Property Set. If the driver needs to override
  716. // this default implemenation, the definitions for the override properties
  717. // will be defined here.
  718. //
  719. //
  720. // BDA Change Sync Method Set
  721. //
  722. // The Change Sync Method Set is required on BDA filters. Setting a
  723. // node property should not become effective on the underlying device
  724. // until CommitChanges is called.
  725. //
  726. // The BDA Support Library provides routines that handle committing
  727. // changes to topology. The BDA Support Library routines should be
  728. // called from the driver's implementation before the driver implementation
  729. // returns.
  730. //
  731. DEFINE_KSMETHOD_TABLE(BdaChangeSyncMethods)
  732. {
  733. DEFINE_KSMETHOD_ITEM_BDA_START_CHANGES(
  734. CFilter::StartChanges, // Calls BdaStartChanges
  735. NULL
  736. ),
  737. DEFINE_KSMETHOD_ITEM_BDA_CHECK_CHANGES(
  738. CFilter::CheckChanges, // Calls BdaCheckChanges
  739. NULL
  740. ),
  741. DEFINE_KSMETHOD_ITEM_BDA_COMMIT_CHANGES(
  742. CFilter::CommitChanges, // Calls BdaCommitChanges
  743. NULL
  744. ),
  745. DEFINE_KSMETHOD_ITEM_BDA_GET_CHANGE_STATE(
  746. CFilter::GetChangeState, // Calls BdaGetChangeState
  747. NULL
  748. )
  749. };
  750. // Override the standard pin medium property set so that we can provide
  751. // device specific medium information.
  752. //
  753. // Because the property is on a Pin Factory and not on a pin instance,
  754. // this is a filter property.
  755. //
  756. DEFINE_KSPROPERTY_TABLE( SampleFilterPropertyOverrides)
  757. {
  758. DEFINE_KSPROPERTY_ITEM_PIN_MEDIUMS(
  759. CFilter::GetMedium
  760. )
  761. };
  762. DEFINE_KSPROPERTY_SET_TABLE(SampleFilterPropertySets)
  763. {
  764. DEFINE_KSPROPERTY_SET
  765. (
  766. &KSPROPSETID_Pin, // Property Set GUID
  767. SIZEOF_ARRAY(SampleFilterPropertyOverrides), // Number of Properties
  768. SampleFilterPropertyOverrides, // Array of KSPROPERTY_ITEM structures
  769. 0, // FastIoCount
  770. NULL // FastIoTable
  771. )
  772. //
  773. // Additional property sets for the filter can be added here.
  774. //
  775. };
  776. //
  777. // BDA Device Configuration Method Set
  778. //
  779. // The BDA Support Library provides a default implementation of
  780. // the BDA Device Configuration Method Set. In this example, the
  781. // driver overrides the CreateTopology method. Note that the
  782. // support libraries CreateTopology method is called before the
  783. // driver's implementation returns.
  784. //
  785. DEFINE_KSMETHOD_TABLE(BdaDeviceConfigurationMethods)
  786. {
  787. DEFINE_KSMETHOD_ITEM_BDA_CREATE_TOPOLOGY(
  788. CFilter::CreateTopology, // Calls BdaMethodCreateTopology
  789. NULL
  790. )
  791. };
  792. //
  793. // Define an array of method sets that the filter supports
  794. //
  795. DEFINE_KSMETHOD_SET_TABLE(FilterMethodSets)
  796. {
  797. DEFINE_KSMETHOD_SET
  798. (
  799. &KSMETHODSETID_BdaChangeSync, // Method set GUID
  800. SIZEOF_ARRAY(BdaChangeSyncMethods), // Number of methods
  801. BdaChangeSyncMethods, // Array of KSMETHOD_ITEM structures
  802. 0, // FastIoCount
  803. NULL // FastIoTable
  804. ),
  805. DEFINE_KSMETHOD_SET
  806. (
  807. &KSMETHODSETID_BdaDeviceConfiguration, // Method set GUID
  808. SIZEOF_ARRAY(BdaDeviceConfigurationMethods), // Number of methods
  809. BdaDeviceConfigurationMethods, // Array of KSMETHOD_ITEM structures
  810. 0, // FastIoCount
  811. NULL // FastIoTable
  812. )
  813. };
  814. //
  815. // Filter Automation Table
  816. //
  817. // Lists all Property, Method, and Event Set tables for the filter
  818. //
  819. DEFINE_KSAUTOMATION_TABLE(FilterAutomation) {
  820. //DEFINE_KSAUTOMATION_PROPERTIES(SampleFilterPropertySets),
  821. DEFINE_KSAUTOMATION_PROPERTIES_NULL,
  822. DEFINE_KSAUTOMATION_METHODS(FilterMethodSets),
  823. DEFINE_KSAUTOMATION_EVENTS_NULL
  824. };
  825. //
  826. // Filter Dispatch Table
  827. //
  828. // Lists the dispatch routines for major events at the filter
  829. // level.
  830. //
  831. const
  832. KSFILTER_DISPATCH
  833. FilterDispatch =
  834. {
  835. CFilter::Create, // Create
  836. CFilter::FilterClose, // Close
  837. NULL, // Process
  838. NULL // Reset
  839. };
  840. //
  841. // Define the name GUID for our digital tuner filter.
  842. //
  843. // NOTE! You must use a different GUID for each type of filter that
  844. // your driver exposes.
  845. //
  846. #define STATIC_KSNAME_BdaSWTunerFilter\
  847. 0x91b0cc87L, 0x9905, 0x4d65, 0xa0, 0xd1, 0x58, 0x61, 0xc6, 0xf2, 0x2c, 0xbf
  848. DEFINE_GUIDSTRUCT("91B0CC87-9905-4d65-A0D1-5861C6F22CBF", KSNAME_BdaSWTunerFilter);
  849. #define KSNAME_BdaSWTunerFilter DEFINE_GUIDNAMED(KSNAME_BdaSWTunerFilter)
  850. // Must match the KSSTRING used in the installation INFs interface sections
  851. // AND must match the KSNAME GUID above.
  852. //
  853. #define KSSTRING_BdaSWTunerFilter L"{91B0CC87-9905-4d65-A0D1-5861C6F22CBF}"
  854. //
  855. // Define the Filter Factory Descriptor for the filter
  856. //
  857. // This structure brings together all of the structures that define
  858. // the tuner filter as it appears when it is first instantiated.
  859. // Note that not all of the template pin and node types may be exposed as
  860. // pin and node factories when the filter is first instanciated.
  861. //
  862. // If a driver exposes more than one filter, each filter must have a
  863. // unique ReferenceGuid.
  864. //
  865. DEFINE_KSFILTER_DESCRIPTOR(InitialFilterDescriptor)
  866. {
  867. &FilterDispatch, // Dispatch
  868. &FilterAutomation, // AutomationTable
  869. KSFILTER_DESCRIPTOR_VERSION, // Version
  870. 0, // Flags
  871. &KSNAME_BdaSWTunerFilter, // ReferenceGuid
  872. DEFINE_KSFILTER_PIN_DESCRIPTORS(InitialPinDescriptors),
  873. // PinDescriptorsCount; must expose at least one pin
  874. // PinDescriptorSize; size of each item
  875. // PinDescriptors; table of pin descriptors
  876. DEFINE_KSFILTER_CATEGORY(KSCATEGORY_BDA_NETWORK_TUNER),
  877. // CategoriesCount; number of categories in the table
  878. // Categories; table of categories
  879. DEFINE_KSFILTER_NODE_DESCRIPTORS_NULL,
  880. // NodeDescriptorsCount; in this case, 0
  881. // NodeDescriptorSize; in this case, 0
  882. // NodeDescriptors; in this case, NULL
  883. DEFINE_KSFILTER_DEFAULT_CONNECTIONS,
  884. // Automatically fills in the connections table for a filter which defines no explicit connections
  885. // ConnectionsCount; number of connections in the table
  886. // Connections; table of connections
  887. NULL // ComponentId; in this case, no ID is provided
  888. };
  889. //===========================================================================
  890. //
  891. // Define Filter Template Topology
  892. //
  893. //===========================================================================
  894. //
  895. // Define BDA Template Topology Connections
  896. //
  897. // Lists the Connections that are possible between pin types and
  898. // node types. This, together with the Template Filter Descriptor, and
  899. // the Pin Pairings, describe how topologies can be created in the filter.
  900. //
  901. // =========== ============
  902. // AntennaPin ----| RF Node |--Joint--|Demod Node|----TransportPin
  903. // =========== ============
  904. //
  905. // The RF Node of this filter is controlled by the Antenna input pin.
  906. // RF properties will be set as NODE properties (with NodeType == 0)
  907. // on the filter's Antenna Pin
  908. //
  909. // The Demodulator Node of this filter is controlled by the Transport output pin.
  910. // Demod properties will be set as NODE properties (with NodeType == 1)
  911. // on the filter's Transport Pin
  912. //
  913. const
  914. KSTOPOLOGY_CONNECTION TemplateFilterConnections[] =
  915. { // KSFILTER_NODE is defined as ((ULONG)-1) in ks.h
  916. // Indicate pin types by the item number is the TemplatePinDescriptors array.
  917. // Indicate node types by either the item number in the NodeDescriptors array
  918. // or the element in the BDA_SAMPLE_NODE enumeration.
  919. { KSFILTER_NODE, 0, BDA_SAMPLE_TUNER_NODE, 0},
  920. { BDA_SAMPLE_TUNER_NODE, 1, BDA_SAMPLE_DEMODULATOR_NODE, 0},
  921. { BDA_SAMPLE_DEMODULATOR_NODE, 1, KSFILTER_NODE, 1}
  922. };
  923. //
  924. // Template Joints between the Antenna and Transport Pin Types.
  925. //
  926. // Lists the template joints between the Antenna Input Pin Type and
  927. // the Transport Output Pin Type.
  928. //
  929. // In this case the RF Node is considered to belong to the antennea input
  930. // pin and the 8VSB Demodulator Node is considered to belong to the
  931. // tranport stream output pin.
  932. //
  933. const
  934. ULONG AntennaTransportJoints[] =
  935. {
  936. 1 // joint occurs between the two node types (second element in array)
  937. // indicates that 1st node is controlled by input pin and 2nd node by output pin
  938. };
  939. //
  940. // Define Template Pin Parings.
  941. //
  942. // Array of BDA_PIN_PAIRING structures that are used to determine
  943. // which nodes get duplicated when more than one output pin type is
  944. // connected to a single input pin type or when more that one input pin
  945. // type is connected to a single output pin type.
  946. //
  947. const
  948. BDA_PIN_PAIRING TemplatePinPairings[] =
  949. {
  950. // Input pin to Output pin Topology Joints
  951. //
  952. {
  953. 0, // ulInputPin; 0 element in the TemplatePinDescriptors array.
  954. 1, // ulOutputPin; 1 element in the TemplatePinDescriptors array.
  955. 1, // ulcMaxInputsPerOutput
  956. 1, // ulcMinInputsPerOutput
  957. 1, // ulcMaxOutputsPerInput
  958. 1, // ulcMinOutputsPerInput
  959. SIZEOF_ARRAY(AntennaTransportJoints), // ulcTopologyJoints
  960. AntennaTransportJoints // pTopologyJoints; array of joints
  961. }
  962. // If applicable, list topology of joints between other pins.
  963. //
  964. };
  965. //
  966. // Define the Filter Factory Descriptor that the BDA support library uses
  967. // to create template topology for the filter.
  968. //
  969. // This KSFILTER_DESCRIPTOR structure combines the structures that
  970. // define the topologies that the filter can assume as a result of
  971. // pin factory and topology creation methods.
  972. // Note that not all of the template pin and node types may be exposed as
  973. // pin and node factories when the filter is first instanciated.
  974. //
  975. DEFINE_KSFILTER_DESCRIPTOR(TemplateFilterDescriptor)
  976. {
  977. &FilterDispatch, // Dispatch
  978. &FilterAutomation, // AutomationTable
  979. KSFILTER_DESCRIPTOR_VERSION, // Version
  980. 0, // Flags
  981. &KSNAME_BdaSWTunerFilter, // ReferenceGuid
  982. DEFINE_KSFILTER_PIN_DESCRIPTORS(TemplatePinDescriptors),
  983. // PinDescriptorsCount; exposes all template pins
  984. // PinDescriptorSize; size of each item
  985. // PinDescriptors; table of pin descriptors
  986. DEFINE_KSFILTER_CATEGORY(KSCATEGORY_BDA_NETWORK_TUNER),
  987. // CategoriesCount; number of categories in the table
  988. // Categories; table of categories
  989. DEFINE_KSFILTER_NODE_DESCRIPTORS(NodeDescriptors),
  990. // NodeDescriptorsCount; exposes all template nodes
  991. // NodeDescriptorSize; size of each item
  992. // NodeDescriptors; table of node descriptors
  993. DEFINE_KSFILTER_CONNECTIONS(TemplateFilterConnections),
  994. // ConnectionsCount; number of connections in the table
  995. // Connections; table of connections
  996. NULL // ComponentId; in this case, no ID is provided
  997. };
  998. //
  999. // Define BDA Template Topology Descriptor for the filter.
  1000. //
  1001. // This structure combines the filter descriptor and pin pairings that
  1002. // the BDA support library uses to create an instance of the filter.
  1003. //
  1004. const
  1005. BDA_FILTER_TEMPLATE
  1006. BdaFilterTemplate =
  1007. {
  1008. &TemplateFilterDescriptor,
  1009. SIZEOF_ARRAY(TemplatePinPairings),
  1010. TemplatePinPairings
  1011. };
  1012. //===========================================================================
  1013. //
  1014. // Define the Device
  1015. //
  1016. //===========================================================================
  1017. //
  1018. // Define Device Dispatch Table
  1019. //
  1020. // List the dispatch routines for the major events that occur
  1021. // during the existence of the underlying device.
  1022. //
  1023. extern
  1024. const
  1025. KSDEVICE_DISPATCH
  1026. DeviceDispatch =
  1027. {
  1028. CDevice::Create, // Add
  1029. CDevice::Start, // Start
  1030. NULL, // PostStart
  1031. NULL, // QueryStop
  1032. NULL, // CancelStop
  1033. NULL, // Stop
  1034. NULL, // QueryRemove
  1035. NULL, // CancelRemove
  1036. NULL, // Remove
  1037. NULL, // QueryCapabilities
  1038. NULL, // SurpriseRemoval
  1039. NULL, // QueryPower
  1040. NULL // SetPower
  1041. };
  1042. //
  1043. // Define Device Descriptor
  1044. //
  1045. // Combines structures that define the device and any non-BDA
  1046. // intial filter factories that can be created on it.
  1047. // Note that this structure does not include the template topology
  1048. // structures as they are specific to BDA.
  1049. //
  1050. extern
  1051. const
  1052. KSDEVICE_DESCRIPTOR
  1053. DeviceDescriptor =
  1054. {
  1055. &DeviceDispatch, // Dispatch
  1056. 0, // SIZEOF_ARRAY( FilterDescriptors), // FilterDescriptorsCount
  1057. NULL, // FilterDescriptors // FilterDescriptors
  1058. };