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.

1808 lines
53 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. //
  12. // This file handles all adapter property sets
  13. //
  14. #include "strmini.h"
  15. #include "ksmedia.h"
  16. #include "capmain.h"
  17. #include "capdebug.h"
  18. #include "capxfer.h"
  19. #define DEFINE_MEDIUMS
  20. #include "mediums.h"
  21. // -------------------------------------------------------------------
  22. // A few notes about property set handling
  23. //
  24. // Property sets used in Testcap are of two varieties, those that have
  25. // default values, ranges, and stepping, such as VideoProcAmp and CameraControl,
  26. // and those which don't have defaults and ranges, such as TVTuner and
  27. // Crossbar.
  28. //
  29. // Default values and stepping are established by tables in capprop.h,
  30. // no code is required to implement this other than initally creating the tables.
  31. //
  32. // Many of the property sets require the ability to modify a number
  33. // of input parameters. Since KS doesn't allow this inherently, you'll
  34. // note that some property sets require copying the provided input parameters
  35. // to the ouput parameter list, effectively creating a "read, modify, write"
  36. // capability. For this reason, the input and output parameter lists
  37. // use identical structures.
  38. //
  39. // On an SRB_GET_DEVICE_PROPERTY, read-only input data to the driver is provided as:
  40. // pSrb->CommandData.PropertyInfo
  41. //
  42. // ... while the output data pointer is:
  43. // pSrb->CommandData.PropertyInfo.PropertyInfo
  44. //
  45. // -------------------------------------------------------------------
  46. // -------------------------------------------------------------------
  47. // XBar pin definitions
  48. // -------------------------------------------------------------------
  49. typedef struct _XBAR_PIN_DESCRIPTION {
  50. ULONG PinType;
  51. ULONG SynthImageCommand; // This driver simulates different inputs by synthesizing images
  52. ULONG RelatedPinIndex;
  53. const KSPIN_MEDIUM *Medium; // Describes hardware connectivity
  54. } XBAR_PIN_DESCRIPTION, *PXBAR_PIN_DESCRIPTION;
  55. XBAR_PIN_DESCRIPTION XBarInputPins[] = {
  56. // First list the video input pins, then the audio inputs, then the output pins
  57. // Note that audio pin index 6 is shared between two video inputs (index 1 and index 2)
  58. // PinType SynthImageCommand RelatedPinIndex Medium
  59. /*0*/ KS_PhysConn_Video_Tuner, IMAGE_XFER_NTSC_EIA_100AMP_100SAT, 5, &CrossbarMediums[0],
  60. /*1*/ KS_PhysConn_Video_Composite, IMAGE_XFER_NTSC_EIA_75AMP_100SAT, 6, &CrossbarMediums[1],
  61. /*2*/ KS_PhysConn_Video_SVideo, IMAGE_XFER_BLACK, 6, &CrossbarMediums[2],
  62. /*3*/ KS_PhysConn_Video_Tuner, IMAGE_XFER_WHITE, 7, &CrossbarMediums[3],
  63. /*4*/ KS_PhysConn_Video_Composite, IMAGE_XFER_GRAY_INCREASING, 8, &CrossbarMediums[4],
  64. /*5*/ KS_PhysConn_Audio_Tuner, 0, 0, &CrossbarMediums[5],
  65. /*6*/ KS_PhysConn_Audio_Line, 0, 1, &CrossbarMediums[6],
  66. /*7*/ KS_PhysConn_Audio_Tuner, 0, 3, &CrossbarMediums[7],
  67. /*8*/ KS_PhysConn_Audio_Line, 0, 4, &CrossbarMediums[8],
  68. };
  69. #define NUMBER_OF_XBAR_INPUTS (SIZEOF_ARRAY (XBarInputPins))
  70. XBAR_PIN_DESCRIPTION XBarOutputPins[] = {
  71. // PinType SynthImageCommand RelatedPinIndex
  72. /*0*/ KS_PhysConn_Video_VideoDecoder, 0, 1, &CrossbarMediums[9],
  73. /*1*/ KS_PhysConn_Audio_AudioDecoder, 0, 0, &CrossbarMediums[10],
  74. };
  75. #define NUMBER_OF_XBAR_OUTPUTS (SIZEOF_ARRAY (XBarOutputPins))
  76. #define NUMBER_OF_XBAR_PINS_TOTAL (NUMBER_OF_XBAR_INPUTS + NUMBER_OF_XBAR_OUTPUTS)
  77. // -------------------------------------------------------------------
  78. // XBar Property Set functions
  79. // -------------------------------------------------------------------
  80. /*
  81. ** AdapterSetCrossbarProperty ()
  82. **
  83. ** Handles Set operations on the Crossbar property set.
  84. ** Testcap uses this to select an image to synthesize.
  85. **
  86. ** Arguments:
  87. **
  88. ** pSRB -
  89. ** Pointer to the HW_STREAM_REQUEST_BLOCK
  90. **
  91. ** Returns:
  92. **
  93. ** Side Effects: none
  94. */
  95. VOID
  96. STREAMAPI
  97. AdapterSetCrossbarProperty(
  98. PHW_STREAM_REQUEST_BLOCK pSrb
  99. )
  100. {
  101. PHW_DEVICE_EXTENSION pHwDevExt = ((PHW_DEVICE_EXTENSION)pSrb->HwDeviceExtension);
  102. PSTREAM_PROPERTY_DESCRIPTOR pSPD = pSrb->CommandData.PropertyInfo;
  103. ULONG Id = pSPD->Property->Id; // index of the property
  104. ULONG nS = pSPD->PropertyOutputSize; // size of data supplied
  105. switch (Id) {
  106. case KSPROPERTY_CROSSBAR_ROUTE: // W
  107. {
  108. PKSPROPERTY_CROSSBAR_ROUTE_S pRoute =
  109. (PKSPROPERTY_CROSSBAR_ROUTE_S)pSPD->PropertyInfo;
  110. ASSERT (nS >= sizeof (KSPROPERTY_CROSSBAR_ROUTE_S));
  111. // Copy the input property info to the output property info
  112. RtlCopyMemory( pRoute,
  113. pSPD->Property,
  114. sizeof (KSPROPERTY_CROSSBAR_ROUTE_S));
  115. // Default to failure
  116. pRoute->CanRoute = 0;
  117. // if video
  118. if (pRoute->IndexOutputPin == 0) {
  119. if (pRoute->IndexInputPin <= 4) {
  120. pHwDevExt->VideoInputConnected = pRoute->IndexInputPin;
  121. pRoute->CanRoute = 1;
  122. }
  123. }
  124. // if audio
  125. else if (pRoute->IndexOutputPin == 1) {
  126. // Special case! Audio Routing of (-1) means mute!!!
  127. if (pRoute->IndexInputPin == -1) {
  128. pHwDevExt->AudioInputConnected = pRoute->IndexInputPin;
  129. pRoute->CanRoute = 1;
  130. }
  131. else if (pRoute->IndexInputPin > 4 && pRoute->IndexInputPin <= 8) {
  132. pHwDevExt->AudioInputConnected = pRoute->IndexInputPin;
  133. pRoute->CanRoute = 1;
  134. }
  135. }
  136. // Somebody passed bogus data
  137. if (pRoute->CanRoute == 0) {
  138. pSrb->Status = STATUS_INVALID_PARAMETER;
  139. }
  140. }
  141. break;
  142. default:
  143. TRAP;
  144. break;
  145. }
  146. }
  147. /*
  148. ** AdapterGetCrossbarProperty ()
  149. **
  150. ** Handles Get operations on the Crossbar property set.
  151. ** Testcap uses this to select an image to synthesize.
  152. **
  153. ** Arguments:
  154. **
  155. ** pSRB -
  156. ** Pointer to the HW_STREAM_REQUEST_BLOCK
  157. **
  158. ** Returns:
  159. **
  160. ** Side Effects: none
  161. */
  162. VOID
  163. STREAMAPI
  164. AdapterGetCrossbarProperty(
  165. PHW_STREAM_REQUEST_BLOCK pSrb
  166. )
  167. {
  168. PHW_DEVICE_EXTENSION pHwDevExt = ((PHW_DEVICE_EXTENSION)pSrb->HwDeviceExtension);
  169. PSTREAM_PROPERTY_DESCRIPTOR pSPD = pSrb->CommandData.PropertyInfo;
  170. ULONG Id = pSPD->Property->Id; // index of the property
  171. ULONG nS = pSPD->PropertyOutputSize; // size of data supplied
  172. switch (Id) {
  173. case KSPROPERTY_CROSSBAR_CAPS: // R
  174. {
  175. PKSPROPERTY_CROSSBAR_CAPS_S pCaps =
  176. (PKSPROPERTY_CROSSBAR_CAPS_S)pSPD->PropertyInfo;
  177. if (nS < sizeof (KSPROPERTY_CROSSBAR_CAPS_S))
  178. break;
  179. // Copy the input property info to the output property info
  180. RtlCopyMemory( pCaps,
  181. pSPD->Property,
  182. sizeof (KSPROPERTY_CROSSBAR_CAPS_S));
  183. pCaps->NumberOfInputs = NUMBER_OF_XBAR_INPUTS;
  184. pCaps->NumberOfOutputs = NUMBER_OF_XBAR_OUTPUTS;
  185. pSrb->ActualBytesTransferred = sizeof (KSPROPERTY_CROSSBAR_CAPS_S);
  186. }
  187. break;
  188. case KSPROPERTY_CROSSBAR_CAN_ROUTE: // R
  189. {
  190. PKSPROPERTY_CROSSBAR_ROUTE_S pRoute =
  191. (PKSPROPERTY_CROSSBAR_ROUTE_S)pSPD->PropertyInfo;
  192. if (nS < sizeof (KSPROPERTY_CROSSBAR_ROUTE_S))
  193. break;
  194. // Copy the input property info to the output property info
  195. RtlCopyMemory( pRoute,
  196. pSPD->Property,
  197. sizeof (KSPROPERTY_CROSSBAR_ROUTE_S));
  198. // Special case, audio output routed to (-1) means mute
  199. if (pRoute->IndexOutputPin == 1 && pRoute->IndexInputPin == -1) {
  200. pRoute->CanRoute = TRUE;
  201. }
  202. else if ((pRoute->IndexInputPin >= NUMBER_OF_XBAR_INPUTS) ||
  203. (pRoute->IndexOutputPin >= NUMBER_OF_XBAR_OUTPUTS)) {
  204. pRoute->CanRoute = FALSE;
  205. }
  206. else if ((pRoute->IndexInputPin <= 4) &&
  207. (pRoute->IndexOutputPin == 0) ||
  208. (pRoute->IndexInputPin >= 5) &&
  209. (pRoute->IndexOutputPin == 1)) {
  210. // This driver allows any video input to connect to any video output
  211. // and any audio input to connect to any audio output
  212. pRoute->CanRoute = TRUE;
  213. }
  214. else {
  215. pRoute->CanRoute = FALSE;
  216. }
  217. pSrb->ActualBytesTransferred = sizeof (KSPROPERTY_CROSSBAR_ROUTE_S);
  218. }
  219. break;
  220. case KSPROPERTY_CROSSBAR_PININFO: // R
  221. {
  222. PKSPROPERTY_CROSSBAR_PININFO_S pPinInfo =
  223. (PKSPROPERTY_CROSSBAR_PININFO_S)pSPD->PropertyInfo;
  224. if (nS < sizeof (KSPROPERTY_CROSSBAR_PININFO_S))
  225. break;
  226. // Copy the input property info to the output property info
  227. RtlCopyMemory( pPinInfo,
  228. pSPD->Property,
  229. sizeof (KSPROPERTY_CROSSBAR_PININFO_S));
  230. if (pPinInfo->Direction == KSPIN_DATAFLOW_IN) {
  231. ASSERT (pPinInfo->Index < NUMBER_OF_XBAR_INPUTS);
  232. pPinInfo->PinType = XBarInputPins[pPinInfo->Index].PinType;
  233. pPinInfo->RelatedPinIndex = XBarInputPins[pPinInfo->Index].RelatedPinIndex;
  234. pPinInfo->Medium = *XBarInputPins[pPinInfo->Index].Medium;
  235. }
  236. else {
  237. ASSERT (pPinInfo->Index < NUMBER_OF_XBAR_OUTPUTS);
  238. pPinInfo->PinType = XBarOutputPins[pPinInfo->Index].PinType;
  239. pPinInfo->RelatedPinIndex = XBarOutputPins[pPinInfo->Index].RelatedPinIndex;
  240. pPinInfo->Medium = *XBarOutputPins[pPinInfo->Index].Medium;
  241. }
  242. pPinInfo->Medium.Id = pHwDevExt->DriverMediumInstanceCount; // Multiple instance support
  243. pSrb->ActualBytesTransferred = sizeof (KSPROPERTY_CROSSBAR_PININFO_S);
  244. }
  245. break;
  246. case KSPROPERTY_CROSSBAR_ROUTE: // R
  247. {
  248. PKSPROPERTY_CROSSBAR_ROUTE_S pRoute =
  249. (PKSPROPERTY_CROSSBAR_ROUTE_S)pSPD->PropertyInfo;
  250. if (nS < sizeof (KSPROPERTY_CROSSBAR_ROUTE_S))
  251. break;
  252. // Copy the input property info to the output property info
  253. RtlCopyMemory( pRoute,
  254. pSPD->Property,
  255. sizeof (KSPROPERTY_CROSSBAR_ROUTE_S));
  256. // Sanity check
  257. if (pRoute->IndexOutputPin >= NUMBER_OF_XBAR_OUTPUTS) {
  258. pRoute->CanRoute = FALSE;
  259. }
  260. // querying the the video output pin
  261. else if (pRoute->IndexOutputPin == 0) {
  262. pRoute->IndexInputPin = pHwDevExt->VideoInputConnected;
  263. pRoute->CanRoute = TRUE;
  264. }
  265. // querying the the audio output pin
  266. else if (pRoute->IndexOutputPin == 1) {
  267. pRoute->IndexInputPin = pHwDevExt->AudioInputConnected;
  268. pRoute->CanRoute = TRUE;
  269. }
  270. pSrb->ActualBytesTransferred = sizeof (KSPROPERTY_CROSSBAR_ROUTE_S);
  271. }
  272. break;
  273. default:
  274. TRAP;
  275. break;
  276. }
  277. }
  278. // -------------------------------------------------------------------
  279. // TVTuner Property Set functions
  280. // -------------------------------------------------------------------
  281. /*
  282. ** AdapterSetTunerProperty ()
  283. **
  284. ** Handles Set operations on the TvTuner property set.
  285. ** Testcap uses this for demo purposes only.
  286. **
  287. ** Arguments:
  288. **
  289. ** pSRB -
  290. ** Pointer to the HW_STREAM_REQUEST_BLOCK
  291. **
  292. ** Returns:
  293. **
  294. ** Side Effects: none
  295. */
  296. VOID
  297. STREAMAPI
  298. AdapterSetTunerProperty(
  299. PHW_STREAM_REQUEST_BLOCK pSrb
  300. )
  301. {
  302. PHW_DEVICE_EXTENSION pHwDevExt = ((PHW_DEVICE_EXTENSION)pSrb->HwDeviceExtension);
  303. PSTREAM_PROPERTY_DESCRIPTOR pSPD = pSrb->CommandData.PropertyInfo;
  304. ULONG Id = pSPD->Property->Id; // index of the property
  305. ULONG nS = pSPD->PropertyOutputSize; // size of data supplied
  306. switch (Id) {
  307. case KSPROPERTY_TUNER_MODE:
  308. {
  309. PKSPROPERTY_TUNER_MODE_S pMode =
  310. (PKSPROPERTY_TUNER_MODE_S)pSPD->Property;
  311. ASSERT (pMode->Mode & (KSPROPERTY_TUNER_MODE_TV |
  312. KSPROPERTY_TUNER_MODE_AM_RADIO |
  313. KSPROPERTY_TUNER_MODE_FM_RADIO |
  314. KSPROPERTY_TUNER_MODE_ATSC));
  315. pHwDevExt->TunerMode = pMode->Mode;
  316. }
  317. break;
  318. case KSPROPERTY_TUNER_STANDARD:
  319. {
  320. PKSPROPERTY_TUNER_STANDARD_S pStandard_S =
  321. (PKSPROPERTY_TUNER_STANDARD_S) pSPD->Property;
  322. pHwDevExt->VideoStandard = pStandard_S->Standard;
  323. }
  324. break;
  325. case KSPROPERTY_TUNER_FREQUENCY:
  326. {
  327. PKSPROPERTY_TUNER_FREQUENCY_S pFreq_S =
  328. (PKSPROPERTY_TUNER_FREQUENCY_S) pSPD->Property;
  329. pHwDevExt->Frequency = pFreq_S->Frequency;
  330. pHwDevExt->Country = pFreq_S->Country;
  331. pHwDevExt->Channel = pFreq_S->Channel;
  332. }
  333. break;
  334. case KSPROPERTY_TUNER_INPUT:
  335. {
  336. PKSPROPERTY_TUNER_INPUT_S pInput_S =
  337. (PKSPROPERTY_TUNER_INPUT_S) pSPD->Property;
  338. pHwDevExt->TunerInput = pInput_S->InputIndex;
  339. }
  340. break;
  341. default:
  342. TRAP;
  343. break;
  344. }
  345. }
  346. /*
  347. ** AdapterGetTunerProperty ()
  348. **
  349. ** Handles Get operations on the TvTuner property set.
  350. ** Testcap uses this for demo purposes only.
  351. **
  352. ** Arguments:
  353. **
  354. ** pSRB -
  355. ** Pointer to the HW_STREAM_REQUEST_BLOCK
  356. **
  357. ** Returns:
  358. **
  359. ** Side Effects: none
  360. */
  361. VOID
  362. STREAMAPI
  363. AdapterGetTunerProperty(
  364. PHW_STREAM_REQUEST_BLOCK pSrb
  365. )
  366. {
  367. PHW_DEVICE_EXTENSION pHwDevExt = ((PHW_DEVICE_EXTENSION)pSrb->HwDeviceExtension);
  368. PSTREAM_PROPERTY_DESCRIPTOR pSPD = pSrb->CommandData.PropertyInfo;
  369. ULONG Id = pSPD->Property->Id; // index of the property
  370. ULONG nS = pSPD->PropertyOutputSize; // size of data supplied
  371. PVOID pV = pSPD->PropertyInfo; // pointer to the output data
  372. ASSERT (nS >= sizeof (LONG));
  373. switch (Id) {
  374. case KSPROPERTY_TUNER_CAPS:
  375. {
  376. PKSPROPERTY_TUNER_CAPS_S pCaps =
  377. (PKSPROPERTY_TUNER_CAPS_S)pSPD->Property;
  378. ASSERT (nS >= sizeof( KSPROPERTY_TUNER_CAPS_S ) );
  379. // now work with the output buffer
  380. pCaps =(PKSPROPERTY_TUNER_CAPS_S)pV;
  381. pCaps->ModesSupported =
  382. KSPROPERTY_TUNER_MODE_TV |
  383. KSPROPERTY_TUNER_MODE_FM_RADIO |
  384. KSPROPERTY_TUNER_MODE_AM_RADIO |
  385. KSPROPERTY_TUNER_MODE_ATSC;
  386. pCaps->VideoMedium = TVTunerMediums[0];
  387. pCaps->VideoMedium.Id = pHwDevExt->DriverMediumInstanceCount; // Multiple instance support
  388. pCaps->TVAudioMedium = TVTunerMediums[1];
  389. pCaps->TVAudioMedium.Id = pHwDevExt->DriverMediumInstanceCount; // Multiple instance support
  390. pCaps->RadioAudioMedium = TVTunerMediums[2]; // No separate radio audio pin?
  391. pCaps->RadioAudioMedium.Id = pHwDevExt->DriverMediumInstanceCount; // Multiple instance support
  392. pSrb->ActualBytesTransferred = sizeof( KSPROPERTY_TUNER_CAPS_S );
  393. }
  394. break;
  395. case KSPROPERTY_TUNER_MODE:
  396. {
  397. PKSPROPERTY_TUNER_MODE_S pMode =
  398. (PKSPROPERTY_TUNER_MODE_S)pSPD->Property;
  399. ASSERT (nS >= sizeof( KSPROPERTY_TUNER_MODE_S ) );
  400. // now work with the output buffer
  401. pMode =(PKSPROPERTY_TUNER_MODE_S)pV;
  402. pMode->Mode = pHwDevExt->TunerMode;
  403. pSrb->ActualBytesTransferred = sizeof( KSPROPERTY_TUNER_MODE_S);
  404. }
  405. break;
  406. case KSPROPERTY_TUNER_MODE_CAPS:
  407. {
  408. PKSPROPERTY_TUNER_MODE_CAPS_S pCaps =
  409. (PKSPROPERTY_TUNER_MODE_CAPS_S) pSPD->Property;
  410. ASSERT (nS >= sizeof (KSPROPERTY_TUNER_MODE_CAPS_S));
  411. // now work with the output buffer
  412. pCaps = (PKSPROPERTY_TUNER_MODE_CAPS_S) pV;
  413. pCaps->Mode = ((PKSPROPERTY_TUNER_MODE_CAPS_S) pSPD->Property)->Mode;
  414. pSrb->ActualBytesTransferred = sizeof (KSPROPERTY_TUNER_MODE_CAPS_S);
  415. switch (pCaps->Mode) {
  416. case KSPROPERTY_TUNER_MODE_TV:
  417. case KSPROPERTY_TUNER_MODE_ATSC:
  418. // List the formats actually supported by the tuner in this mode
  419. pCaps->StandardsSupported =
  420. (pHwDevExt->TunerMode == KSPROPERTY_TUNER_MODE_ATSC) ?
  421. KS_AnalogVideo_NTSC_M
  422. :
  423. KS_AnalogVideo_NTSC_M
  424. | KS_AnalogVideo_PAL_B
  425. | KS_AnalogVideo_PAL_D
  426. // | KS_AnalogVideo_PAL_H
  427. // | KS_AnalogVideo_PAL_I
  428. | KS_AnalogVideo_PAL_M
  429. | KS_AnalogVideo_PAL_N
  430. | KS_AnalogVideo_PAL_N_COMBO
  431. // | KS_AnalogVideo_SECAM_B
  432. // | KS_AnalogVideo_SECAM_D
  433. // | KS_AnalogVideo_SECAM_G
  434. // | KS_AnalogVideo_SECAM_H
  435. // | KS_AnalogVideo_SECAM_K
  436. // | KS_AnalogVideo_SECAM_K1
  437. // | KS_AnalogVideo_SECAM_L
  438. ;
  439. //
  440. // Get the min and max frequencies supported
  441. //
  442. pCaps->MinFrequency = 55250000L;
  443. pCaps->MaxFrequency = 997250000L;
  444. // What is the frequency step size?
  445. pCaps->TuningGranularity = 62500L;
  446. // How many inputs are on the tuner?
  447. pCaps->NumberOfInputs = 1;
  448. // What is the maximum settling time in milliseconds?
  449. pCaps->SettlingTime = 100;
  450. //
  451. // Strategy defines how the tuner knows when it is in tune:
  452. //
  453. // KS_TUNER_STRATEGY_PLL (Has PLL offset information)
  454. // KS_TUNER_STRATEGY_SIGNAL_STRENGTH (has signal strength info)
  455. // KS_TUNER_STRATEGY_DRIVER_TUNES (driver handles all fine tuning)
  456. //
  457. pCaps->Strategy = KS_TUNER_STRATEGY_PLL;
  458. break;
  459. case KSPROPERTY_TUNER_MODE_FM_RADIO:
  460. pCaps->StandardsSupported = 0;
  461. pCaps->MinFrequency = 88100000L;
  462. pCaps->MaxFrequency = 107900000L;
  463. // What is the frequency step size?
  464. pCaps->TuningGranularity = 200000L;
  465. // How many inputs are on the tuner?
  466. pCaps->NumberOfInputs = 1;
  467. // What is the maximum settling time in milliseconds?
  468. pCaps->SettlingTime = 100;
  469. // Strategy defines how the tuner knows when it is in tune:
  470. pCaps->Strategy = KS_TUNER_STRATEGY_DRIVER_TUNES;
  471. break;
  472. case KSPROPERTY_TUNER_MODE_AM_RADIO:
  473. pCaps->StandardsSupported = 0;
  474. pCaps->MinFrequency = 540000L;
  475. pCaps->MaxFrequency = 1700000L;
  476. // What is the frequency step size?
  477. pCaps->TuningGranularity = 1000L;
  478. // How many inputs are on the tuner?
  479. pCaps->NumberOfInputs = 1;
  480. // What is the maximum settling time in milliseconds?
  481. pCaps->SettlingTime = 100;
  482. // Strategy defines how the tuner knows when it is in tune:
  483. pCaps->Strategy = KS_TUNER_STRATEGY_DRIVER_TUNES;
  484. break;
  485. default:
  486. ASSERT (FALSE);
  487. break;
  488. }
  489. }
  490. break;
  491. case KSPROPERTY_TUNER_STANDARD:
  492. {
  493. // What is the currently selected video standard?
  494. ((PKSPROPERTY_TUNER_STANDARD_S) pSPD->PropertyInfo)->Standard =
  495. pHwDevExt->VideoStandard;
  496. pSrb->ActualBytesTransferred = sizeof (KSPROPERTY_TUNER_STANDARD_S);
  497. }
  498. break;
  499. case KSPROPERTY_TUNER_INPUT:
  500. {
  501. // What is the currently selected input?
  502. ((PKSPROPERTY_TUNER_INPUT_S) pSPD->PropertyInfo)->InputIndex =
  503. pHwDevExt->TunerInput;
  504. pSrb->ActualBytesTransferred = sizeof (KSPROPERTY_TUNER_INPUT_S);
  505. }
  506. break;
  507. case KSPROPERTY_TUNER_STATUS:
  508. // Return the status of the tuner
  509. // PLLOffset is in units of TuningGranularity
  510. // SignalStrength is 0 to 100
  511. // Set Busy to 1 if tuning is still in process
  512. {
  513. PKSPROPERTY_TUNER_STATUS_S pStatus =
  514. (PKSPROPERTY_TUNER_STATUS_S) pSPD->PropertyInfo;
  515. ASSERT (nS >= sizeof (KSPROPERTY_TUNER_STATUS_S));
  516. pStatus->CurrentFrequency = pHwDevExt->Frequency;
  517. pStatus->PLLOffset = 0;
  518. pStatus->SignalStrength = 100;
  519. pStatus->Busy = pHwDevExt->Busy;
  520. pSrb->ActualBytesTransferred = sizeof (KSPROPERTY_TUNER_STATUS_S);
  521. }
  522. break;
  523. case KSPROPERTY_TUNER_IF_MEDIUM:
  524. {
  525. // Only Digital TV tuners should support this property
  526. PKSPROPERTY_TUNER_IF_MEDIUM_S pMedium =
  527. (PKSPROPERTY_TUNER_IF_MEDIUM_S)pSPD->Property;
  528. ASSERT (nS >= sizeof( KSPROPERTY_TUNER_IF_MEDIUM_S) );
  529. // now work with the output buffer
  530. pMedium =(PKSPROPERTY_TUNER_IF_MEDIUM_S)pV;
  531. pMedium->IFMedium = TVTunerMediums[3];
  532. pMedium->IFMedium.Id = pHwDevExt->DriverMediumInstanceCount; // Multiple instance support
  533. pSrb->ActualBytesTransferred = sizeof (KSPROPERTY_TUNER_IF_MEDIUM_S);
  534. }
  535. break;
  536. default:
  537. TRAP;
  538. break;
  539. }
  540. }
  541. // -------------------------------------------------------------------
  542. // VideoProcAmp functions
  543. // -------------------------------------------------------------------
  544. /*
  545. ** AdapterSetVideoProcAmpProperty ()
  546. **
  547. ** Handles Set operations on the VideoProcAmp property set.
  548. ** Testcap uses this for demo purposes only.
  549. **
  550. ** Arguments:
  551. **
  552. ** pSRB -
  553. ** Pointer to the HW_STREAM_REQUEST_BLOCK
  554. **
  555. ** Returns:
  556. **
  557. ** Side Effects: none
  558. */
  559. VOID
  560. STREAMAPI
  561. AdapterSetVideoProcAmpProperty(
  562. PHW_STREAM_REQUEST_BLOCK pSrb
  563. )
  564. {
  565. PHW_DEVICE_EXTENSION pHwDevExt = ((PHW_DEVICE_EXTENSION)pSrb->HwDeviceExtension);
  566. PSTREAM_PROPERTY_DESCRIPTOR pSPD = pSrb->CommandData.PropertyInfo;
  567. ULONG Id = pSPD->Property->Id; // index of the property
  568. PKSPROPERTY_VIDEOPROCAMP_S pS = (PKSPROPERTY_VIDEOPROCAMP_S) pSPD->PropertyInfo;
  569. ASSERT (pSPD->PropertyInputSize >= sizeof (KSPROPERTY_VIDEOPROCAMP_S));
  570. switch (Id) {
  571. case KSPROPERTY_VIDEOPROCAMP_BRIGHTNESS:
  572. pHwDevExt->Brightness = pS->Value;
  573. pHwDevExt->BrightnessFlags = pS->Flags;
  574. break;
  575. case KSPROPERTY_VIDEOPROCAMP_CONTRAST:
  576. pHwDevExt->Contrast = pS->Value;
  577. pHwDevExt->ContrastFlags = pS->Flags;
  578. break;
  579. case KSPROPERTY_VIDEOPROCAMP_COLORENABLE:
  580. pHwDevExt->ColorEnable = pS->Value;
  581. pHwDevExt->ColorEnableFlags = pS->Flags;
  582. break;
  583. default:
  584. TRAP;
  585. break;
  586. }
  587. }
  588. /*
  589. ** AdapterGetVideoProcAmpProperty ()
  590. **
  591. ** Handles Get operations on the VideoProcAmp property set.
  592. ** Testcap uses this for demo purposes only.
  593. **
  594. ** Arguments:
  595. **
  596. ** pSRB -
  597. ** Pointer to the HW_STREAM_REQUEST_BLOCK
  598. **
  599. ** Returns:
  600. **
  601. ** Side Effects: none
  602. */
  603. VOID
  604. STREAMAPI
  605. AdapterGetVideoProcAmpProperty(
  606. PHW_STREAM_REQUEST_BLOCK pSrb
  607. )
  608. {
  609. PHW_DEVICE_EXTENSION pHwDevExt = ((PHW_DEVICE_EXTENSION)pSrb->HwDeviceExtension);
  610. PSTREAM_PROPERTY_DESCRIPTOR pSPD = pSrb->CommandData.PropertyInfo;
  611. ULONG Id = pSPD->Property->Id; // index of the property
  612. PKSPROPERTY_VIDEOPROCAMP_S pS = (PKSPROPERTY_VIDEOPROCAMP_S) pSPD->PropertyInfo;
  613. ASSERT (pSPD->PropertyOutputSize >= sizeof (KSPROPERTY_VIDEOPROCAMP_S));
  614. switch (Id) {
  615. case KSPROPERTY_VIDEOPROCAMP_BRIGHTNESS:
  616. pS->Value = pHwDevExt->Brightness;
  617. pS->Flags = pHwDevExt->BrightnessFlags;
  618. pS->Capabilities = KSPROPERTY_VIDEOPROCAMP_FLAGS_MANUAL |
  619. KSPROPERTY_VIDEOPROCAMP_FLAGS_AUTO;
  620. break;
  621. case KSPROPERTY_VIDEOPROCAMP_CONTRAST:
  622. pS->Value = pHwDevExt->Contrast;
  623. pS->Flags = pHwDevExt->ContrastFlags;
  624. pS->Capabilities = KSPROPERTY_VIDEOPROCAMP_FLAGS_MANUAL |
  625. KSPROPERTY_VIDEOPROCAMP_FLAGS_AUTO;
  626. break;
  627. case KSPROPERTY_VIDEOPROCAMP_COLORENABLE:
  628. pS->Value = pHwDevExt->ColorEnable;
  629. pS->Flags = pHwDevExt->ColorEnableFlags;
  630. pS->Capabilities = KSPROPERTY_VIDEOPROCAMP_FLAGS_MANUAL;
  631. break;
  632. default:
  633. TRAP;
  634. break;
  635. }
  636. pSrb->ActualBytesTransferred = sizeof (KSPROPERTY_VIDEOPROCAMP_S);
  637. }
  638. // -------------------------------------------------------------------
  639. // CameraControl functions
  640. // -------------------------------------------------------------------
  641. /*
  642. ** AdapterSetCameraControlProperty ()
  643. **
  644. ** Handles Set operations on the CameraControl property set.
  645. ** Testcap uses this for demo purposes only.
  646. **
  647. ** Arguments:
  648. **
  649. ** pSRB -
  650. ** Pointer to the HW_STREAM_REQUEST_BLOCK
  651. **
  652. ** Returns:
  653. **
  654. ** Side Effects: none
  655. */
  656. VOID
  657. STREAMAPI
  658. AdapterSetCameraControlProperty(
  659. PHW_STREAM_REQUEST_BLOCK pSrb
  660. )
  661. {
  662. PHW_DEVICE_EXTENSION pHwDevExt = ((PHW_DEVICE_EXTENSION)pSrb->HwDeviceExtension);
  663. PSTREAM_PROPERTY_DESCRIPTOR pSPD = pSrb->CommandData.PropertyInfo;
  664. ULONG Id = pSPD->Property->Id; // index of the property
  665. PKSPROPERTY_CAMERACONTROL_S pS = (PKSPROPERTY_CAMERACONTROL_S) pSPD->PropertyInfo;
  666. ASSERT (pSPD->PropertyInputSize >= sizeof (KSPROPERTY_CAMERACONTROL_S));
  667. switch (Id) {
  668. case KSPROPERTY_CAMERACONTROL_ZOOM:
  669. pHwDevExt->Zoom = pS->Value;
  670. pHwDevExt->ZoomFlags = pS->Flags;
  671. break;
  672. case KSPROPERTY_CAMERACONTROL_FOCUS:
  673. pHwDevExt->Focus = pS->Value;
  674. pHwDevExt->FocusFlags = pS->Flags;
  675. break;
  676. default:
  677. TRAP;
  678. break;
  679. }
  680. }
  681. /*
  682. ** AdapterGetCameraControlProperty ()
  683. **
  684. ** Handles Get operations on the CameraControl property set.
  685. ** Testcap uses this for demo purposes only.
  686. **
  687. ** Arguments:
  688. **
  689. ** pSRB -
  690. ** Pointer to the HW_STREAM_REQUEST_BLOCK
  691. **
  692. ** Returns:
  693. **
  694. ** Side Effects: none
  695. */
  696. VOID
  697. STREAMAPI
  698. AdapterGetCameraControlProperty(
  699. PHW_STREAM_REQUEST_BLOCK pSrb
  700. )
  701. {
  702. PHW_DEVICE_EXTENSION pHwDevExt = ((PHW_DEVICE_EXTENSION)pSrb->HwDeviceExtension);
  703. PSTREAM_PROPERTY_DESCRIPTOR pSPD = pSrb->CommandData.PropertyInfo;
  704. ULONG Id = pSPD->Property->Id; // index of the property
  705. PKSPROPERTY_CAMERACONTROL_S pS = (PKSPROPERTY_CAMERACONTROL_S) pSPD->PropertyInfo; // pointer to the output data
  706. ASSERT (pSPD->PropertyOutputSize >= sizeof (KSPROPERTY_CAMERACONTROL_S));
  707. switch (Id) {
  708. case KSPROPERTY_CAMERACONTROL_ZOOM:
  709. pS->Value = pHwDevExt->Zoom;
  710. pS->Flags = pHwDevExt->ZoomFlags;
  711. pS->Capabilities = KSPROPERTY_CAMERACONTROL_FLAGS_MANUAL |
  712. KSPROPERTY_CAMERACONTROL_FLAGS_AUTO;
  713. break;
  714. case KSPROPERTY_CAMERACONTROL_FOCUS:
  715. pS->Value = pHwDevExt->Focus;
  716. pS->Flags = pHwDevExt->FocusFlags;
  717. pS->Capabilities = KSPROPERTY_CAMERACONTROL_FLAGS_MANUAL |
  718. KSPROPERTY_CAMERACONTROL_FLAGS_AUTO;
  719. break;
  720. default:
  721. TRAP;
  722. break;
  723. }
  724. pSrb->ActualBytesTransferred = sizeof (KSPROPERTY_CAMERACONTROL_S);
  725. }
  726. // -------------------------------------------------------------------
  727. // TVAudio functions
  728. // -------------------------------------------------------------------
  729. /*
  730. ** AdapterSetTVAudioProperty ()
  731. **
  732. ** Handles Set operations on the TVAudio property set.
  733. ** Testcap uses this for demo purposes only.
  734. **
  735. ** Arguments:
  736. **
  737. ** pSRB -
  738. ** Pointer to the HW_STREAM_REQUEST_BLOCK
  739. **
  740. ** Returns:
  741. **
  742. ** Side Effects: none
  743. */
  744. VOID
  745. STREAMAPI
  746. AdapterSetTVAudioProperty(
  747. PHW_STREAM_REQUEST_BLOCK pSrb
  748. )
  749. {
  750. PHW_DEVICE_EXTENSION pHwDevExt = ((PHW_DEVICE_EXTENSION)pSrb->HwDeviceExtension);
  751. PSTREAM_PROPERTY_DESCRIPTOR pSPD = pSrb->CommandData.PropertyInfo;
  752. ULONG Id = pSPD->Property->Id; // index of the property
  753. switch (Id) {
  754. case KSPROPERTY_TVAUDIO_MODE:
  755. {
  756. PKSPROPERTY_TVAUDIO_S pS = (PKSPROPERTY_TVAUDIO_S) pSPD->PropertyInfo;
  757. pHwDevExt->TVAudioMode = pS->Mode;
  758. }
  759. break;
  760. default:
  761. TRAP;
  762. break;
  763. }
  764. }
  765. /*
  766. ** AdapterGetTVAudioProperty ()
  767. **
  768. ** Handles Get operations on the TVAudio property set.
  769. ** Testcap uses this for demo purposes only.
  770. **
  771. ** Arguments:
  772. **
  773. ** pSRB -
  774. ** Pointer to the HW_STREAM_REQUEST_BLOCK
  775. **
  776. ** Returns:
  777. **
  778. ** Side Effects: none
  779. */
  780. VOID
  781. STREAMAPI
  782. AdapterGetTVAudioProperty(
  783. PHW_STREAM_REQUEST_BLOCK pSrb
  784. )
  785. {
  786. PHW_DEVICE_EXTENSION pHwDevExt = ((PHW_DEVICE_EXTENSION)pSrb->HwDeviceExtension);
  787. PSTREAM_PROPERTY_DESCRIPTOR pSPD = pSrb->CommandData.PropertyInfo;
  788. ULONG Id = pSPD->Property->Id; // index of the property
  789. switch (Id) {
  790. case KSPROPERTY_TVAUDIO_CAPS:
  791. {
  792. PKSPROPERTY_TVAUDIO_CAPS_S pS = (PKSPROPERTY_TVAUDIO_CAPS_S) pSPD->PropertyInfo; // pointer to the data
  793. ASSERT (pSPD->PropertyOutputSize >= sizeof (KSPROPERTY_TVAUDIO_CAPS_S));
  794. pS->InputMedium = TVAudioMediums[0];
  795. pS->InputMedium.Id = pHwDevExt->DriverMediumInstanceCount; // Multiple instance support
  796. pS->OutputMedium = TVAudioMediums[1];
  797. pS->OutputMedium.Id = pHwDevExt->DriverMediumInstanceCount; // Multiple instance support
  798. // Report all of the possible audio decoding modes the hardware is capabable of
  799. pS->Capabilities = KS_TVAUDIO_MODE_MONO |
  800. KS_TVAUDIO_MODE_STEREO |
  801. KS_TVAUDIO_MODE_LANG_A |
  802. KS_TVAUDIO_MODE_LANG_B ;
  803. pSrb->ActualBytesTransferred = sizeof (KSPROPERTY_TVAUDIO_CAPS_S);
  804. }
  805. break;
  806. case KSPROPERTY_TVAUDIO_MODE:
  807. {
  808. PKSPROPERTY_TVAUDIO_S pS = (PKSPROPERTY_TVAUDIO_S) pSPD->PropertyInfo; // pointer to the data
  809. ASSERT (pSPD->PropertyOutputSize >= sizeof (KSPROPERTY_TVAUDIO_S));
  810. // Report the currently selected mode
  811. pS->Mode = pHwDevExt->TVAudioMode;
  812. pSrb->ActualBytesTransferred = sizeof (KSPROPERTY_TVAUDIO_S);
  813. }
  814. break;
  815. case KSPROPERTY_TVAUDIO_CURRENTLY_AVAILABLE_MODES:
  816. {
  817. PKSPROPERTY_TVAUDIO_S pS = (PKSPROPERTY_TVAUDIO_S) pSPD->PropertyInfo; // pointer to the data
  818. ASSERT (pSPD->PropertyOutputSize >= sizeof (KSPROPERTY_TVAUDIO_S));
  819. // Report which audio modes could potentially be selected right now
  820. pS->Mode = KS_TVAUDIO_MODE_MONO |
  821. KS_TVAUDIO_MODE_STEREO |
  822. KS_TVAUDIO_MODE_LANG_A ;
  823. pSrb->ActualBytesTransferred = sizeof (KSPROPERTY_TVAUDIO_S);
  824. }
  825. break;
  826. default:
  827. TRAP;
  828. break;
  829. }
  830. }
  831. // -------------------------------------------------------------------
  832. // AnalogVideoDecoder functions
  833. // -------------------------------------------------------------------
  834. /*
  835. ** AdapterSetAnalogVideoDecoderProperty ()
  836. **
  837. ** Handles Set operations on the AnalogVideoDecoder property set.
  838. ** Testcap uses this for demo purposes only.
  839. **
  840. ** Arguments:
  841. **
  842. ** pSRB -
  843. ** Pointer to the HW_STREAM_REQUEST_BLOCK
  844. **
  845. ** Returns:
  846. **
  847. ** Side Effects: none
  848. */
  849. VOID
  850. STREAMAPI
  851. AdapterSetAnalogVideoDecoderProperty(
  852. PHW_STREAM_REQUEST_BLOCK pSrb
  853. )
  854. {
  855. PHW_DEVICE_EXTENSION pHwDevExt = ((PHW_DEVICE_EXTENSION)pSrb->HwDeviceExtension);
  856. PSTREAM_PROPERTY_DESCRIPTOR pSPD = pSrb->CommandData.PropertyInfo;
  857. ULONG Id = pSPD->Property->Id; // index of the property
  858. PKSPROPERTY_VIDEODECODER_S pS = (PKSPROPERTY_VIDEODECODER_S) pSPD->PropertyInfo;
  859. ASSERT (pSPD->PropertyInputSize >= sizeof (KSPROPERTY_VIDEODECODER_S));
  860. switch (Id) {
  861. case KSPROPERTY_VIDEODECODER_STANDARD:
  862. {
  863. pHwDevExt->VideoDecoderVideoStandard = pS->Value;
  864. }
  865. break;
  866. case KSPROPERTY_VIDEODECODER_OUTPUT_ENABLE:
  867. {
  868. pHwDevExt->VideoDecoderOutputEnable = pS->Value;
  869. }
  870. break;
  871. case KSPROPERTY_VIDEODECODER_VCR_TIMING:
  872. {
  873. pHwDevExt->VideoDecoderVCRTiming = pS->Value;
  874. }
  875. break;
  876. default:
  877. TRAP;
  878. break;
  879. }
  880. }
  881. /*
  882. ** AdapterGetAnalogVideoDecoderProperty ()
  883. **
  884. ** Handles Get operations on the AnalogVideoDecoder property set.
  885. ** Testcap uses this for demo purposes only.
  886. **
  887. ** Arguments:
  888. **
  889. ** pSRB -
  890. ** Pointer to the HW_STREAM_REQUEST_BLOCK
  891. **
  892. ** Returns:
  893. **
  894. ** Side Effects: none
  895. */
  896. VOID
  897. STREAMAPI
  898. AdapterGetAnalogVideoDecoderProperty(
  899. PHW_STREAM_REQUEST_BLOCK pSrb
  900. )
  901. {
  902. PHW_DEVICE_EXTENSION pHwDevExt = ((PHW_DEVICE_EXTENSION)pSrb->HwDeviceExtension);
  903. PSTREAM_PROPERTY_DESCRIPTOR pSPD = pSrb->CommandData.PropertyInfo;
  904. ULONG Id = pSPD->Property->Id; // index of the property
  905. switch (Id) {
  906. case KSPROPERTY_VIDEODECODER_CAPS:
  907. {
  908. PKSPROPERTY_VIDEODECODER_CAPS_S pS = (PKSPROPERTY_VIDEODECODER_CAPS_S) pSPD->PropertyInfo; // pointer to the data
  909. ASSERT (pSPD->PropertyOutputSize >= sizeof (KSPROPERTY_VIDEODECODER_CAPS_S));
  910. pS->StandardsSupported =
  911. KS_AnalogVideo_NTSC_M
  912. | KS_AnalogVideo_PAL_B
  913. | KS_AnalogVideo_PAL_D
  914. // | KS_AnalogVideo_PAL_H
  915. // | KS_AnalogVideo_PAL_I
  916. | KS_AnalogVideo_PAL_M
  917. | KS_AnalogVideo_PAL_N
  918. // | KS_AnalogVideo_SECAM_B
  919. // | KS_AnalogVideo_SECAM_D
  920. // | KS_AnalogVideo_SECAM_G
  921. // | KS_AnalogVideo_SECAM_H
  922. // | KS_AnalogVideo_SECAM_K
  923. // | KS_AnalogVideo_SECAM_K1
  924. // | KS_AnalogVideo_SECAM_L
  925. ;
  926. pS->Capabilities = KS_VIDEODECODER_FLAGS_CAN_DISABLE_OUTPUT |
  927. KS_VIDEODECODER_FLAGS_CAN_USE_VCR_LOCKING |
  928. KS_VIDEODECODER_FLAGS_CAN_INDICATE_LOCKED ;
  929. pS->SettlingTime = 10; // How long to delay after tuning before
  930. // Locked indicator is valid
  931. pS->HSyncPerVSync = 6; // HSync per VSync
  932. pSrb->ActualBytesTransferred = sizeof (KSPROPERTY_VIDEODECODER_CAPS_S);
  933. }
  934. break;
  935. case KSPROPERTY_VIDEODECODER_STANDARD:
  936. {
  937. PKSPROPERTY_VIDEODECODER_S pS = (PKSPROPERTY_VIDEODECODER_S) pSPD->PropertyInfo; // pointer to the data
  938. ASSERT (pSPD->PropertyOutputSize >= sizeof (KSPROPERTY_VIDEODECODER_S));
  939. pS->Value = pHwDevExt->VideoDecoderVideoStandard;
  940. pSrb->ActualBytesTransferred = sizeof (KSPROPERTY_VIDEODECODER_S);
  941. }
  942. break;
  943. case KSPROPERTY_VIDEODECODER_STATUS:
  944. {
  945. PKSPROPERTY_VIDEODECODER_STATUS_S pS = (PKSPROPERTY_VIDEODECODER_STATUS_S) pSPD->PropertyInfo; // pointer to the data
  946. ASSERT (pSPD->PropertyOutputSize >= sizeof (KSPROPERTY_VIDEODECODER_STATUS_S));
  947. pS->NumberOfLines = (pHwDevExt->VideoDecoderVideoStandard & KS_AnalogVideo_NTSC_Mask)
  948. ? 525 : 625;
  949. // Just to make things interesting, simulate that some channels aren't locked
  950. // In the US, these are channels 54 through 70
  951. pS->SignalLocked = (pHwDevExt->Frequency < 400000000 || pHwDevExt->Frequency > 500000000);
  952. pSrb->ActualBytesTransferred = sizeof (KSPROPERTY_VIDEODECODER_S);
  953. }
  954. break;
  955. case KSPROPERTY_VIDEODECODER_OUTPUT_ENABLE:
  956. {
  957. PKSPROPERTY_VIDEODECODER_S pS = (PKSPROPERTY_VIDEODECODER_S) pSPD->PropertyInfo; // pointer to the data
  958. ASSERT (pSPD->PropertyOutputSize >= sizeof (KSPROPERTY_VIDEODECODER_S));
  959. pS->Value = pHwDevExt->VideoDecoderOutputEnable;
  960. pSrb->ActualBytesTransferred = sizeof (KSPROPERTY_VIDEODECODER_S);
  961. }
  962. break;
  963. case KSPROPERTY_VIDEODECODER_VCR_TIMING:
  964. {
  965. PKSPROPERTY_VIDEODECODER_S pS = (PKSPROPERTY_VIDEODECODER_S) pSPD->PropertyInfo; // pointer to the data
  966. ASSERT (pSPD->PropertyOutputSize >= sizeof (KSPROPERTY_VIDEODECODER_S));
  967. pS->Value = pHwDevExt->VideoDecoderVCRTiming;
  968. pSrb->ActualBytesTransferred = sizeof (KSPROPERTY_VIDEODECODER_S);
  969. }
  970. break;
  971. default:
  972. TRAP;
  973. break;
  974. }
  975. }
  976. // -------------------------------------------------------------------
  977. // VideoControl functions
  978. // -------------------------------------------------------------------
  979. /*
  980. ** AdapterSetVideoControlProperty ()
  981. **
  982. ** Handles Set operations on the VideoControl property set.
  983. ** Testcap uses this for demo purposes only.
  984. **
  985. ** Arguments:
  986. **
  987. ** pSRB -
  988. ** Pointer to the HW_STREAM_REQUEST_BLOCK
  989. **
  990. ** Returns:
  991. **
  992. ** Side Effects: none
  993. */
  994. VOID
  995. STREAMAPI
  996. AdapterSetVideoControlProperty(
  997. PHW_STREAM_REQUEST_BLOCK pSrb
  998. )
  999. {
  1000. PHW_DEVICE_EXTENSION pHwDevExt = ((PHW_DEVICE_EXTENSION)pSrb->HwDeviceExtension);
  1001. PSTREAM_PROPERTY_DESCRIPTOR pSPD = pSrb->CommandData.PropertyInfo;
  1002. ULONG Id = pSPD->Property->Id; // index of the property
  1003. PKSPROPERTY_VIDEOCONTROL_MODE_S pS = (PKSPROPERTY_VIDEOCONTROL_MODE_S) pSPD->PropertyInfo;
  1004. PSTREAMEX pStrmEx;
  1005. ULONG StreamIndex;
  1006. ULONG *pVideoControlMode;
  1007. // For this property set, the StreamIndex is always in the same place
  1008. // for each property
  1009. StreamIndex = ((PKSPROPERTY_VIDEOCONTROL_CAPS_S) pSPD->Property)->StreamIndex;
  1010. ASSERT (StreamIndex < MAX_TESTCAP_STREAMS);
  1011. // Verify the stream index is valid
  1012. if (StreamIndex >= MAX_TESTCAP_STREAMS) {
  1013. pSrb->Status = STATUS_INVALID_PARAMETER;
  1014. return;
  1015. }
  1016. pStrmEx = (PSTREAMEX) pHwDevExt->pStrmEx[StreamIndex];
  1017. // If the stream is not opened when this property set is used,
  1018. // store the values in the HwDevExt
  1019. if (pStrmEx) {
  1020. pVideoControlMode = &pStrmEx->VideoControlMode;
  1021. }
  1022. else {
  1023. pVideoControlMode = &pHwDevExt->VideoControlMode;
  1024. }
  1025. ASSERT (pSPD->PropertyInputSize >= sizeof (KSPROPERTY_VIDEOCONTROL_MODE_S));
  1026. switch (Id) {
  1027. case KSPROPERTY_VIDEOCONTROL_MODE:
  1028. {
  1029. *pVideoControlMode = pS->Mode;
  1030. }
  1031. break;
  1032. default:
  1033. TRAP;
  1034. break;
  1035. }
  1036. }
  1037. /*
  1038. ** AdapterGetVideoControlProperty ()
  1039. **
  1040. ** Handles Get operations on the VideoControl property set.
  1041. ** Testcap uses this for demo purposes only.
  1042. **
  1043. ** Arguments:
  1044. **
  1045. ** pSRB -
  1046. ** Pointer to the HW_STREAM_REQUEST_BLOCK
  1047. **
  1048. ** Returns:
  1049. **
  1050. ** Side Effects: none
  1051. */
  1052. VOID
  1053. STREAMAPI
  1054. AdapterGetVideoControlProperty(
  1055. PHW_STREAM_REQUEST_BLOCK pSrb
  1056. )
  1057. {
  1058. PHW_DEVICE_EXTENSION pHwDevExt = ((PHW_DEVICE_EXTENSION)pSrb->HwDeviceExtension);
  1059. PSTREAM_PROPERTY_DESCRIPTOR pSPD = pSrb->CommandData.PropertyInfo;
  1060. ULONG Id = pSPD->Property->Id; // index of the property
  1061. PSTREAMEX pStrmEx;
  1062. ULONG StreamIndex;
  1063. ULONG *pVideoControlMode;
  1064. // For this property set, the StreamIndex is always in the same place
  1065. // for each property
  1066. StreamIndex = ((PKSPROPERTY_VIDEOCONTROL_CAPS_S) pSPD->Property)->StreamIndex;
  1067. ASSERT (StreamIndex < MAX_TESTCAP_STREAMS);
  1068. // Verify the stream index is valid
  1069. if (StreamIndex >= MAX_TESTCAP_STREAMS) {
  1070. pSrb->Status = STATUS_INVALID_PARAMETER;
  1071. return;
  1072. }
  1073. pStrmEx = (PSTREAMEX) pHwDevExt->pStrmEx[StreamIndex];
  1074. // If the stream is not opened when this property set is used,
  1075. // store the values in the HwDevExt
  1076. if (pStrmEx) {
  1077. pVideoControlMode = &pStrmEx->VideoControlMode;
  1078. }
  1079. else {
  1080. pVideoControlMode = &pHwDevExt->VideoControlMode;
  1081. }
  1082. switch (Id) {
  1083. case KSPROPERTY_VIDEOCONTROL_CAPS:
  1084. {
  1085. PKSPROPERTY_VIDEOCONTROL_CAPS_S pS = (PKSPROPERTY_VIDEOCONTROL_CAPS_S) pSPD->PropertyInfo; // pointer to the data
  1086. ASSERT (pSPD->PropertyOutputSize >= sizeof (KSPROPERTY_VIDEOCONTROL_CAPS_S));
  1087. pS->VideoControlCaps =
  1088. KS_VideoControlFlag_FlipHorizontal
  1089. // | KS_VideoControlFlag_FlipVertical
  1090. // | KS_VideoControlFlag_ExternalTriggerEnable
  1091. // | KS_VideoControlFlag_Trigger
  1092. ;
  1093. pSrb->ActualBytesTransferred = sizeof (KSPROPERTY_VIDEOCONTROL_CAPS_S);
  1094. }
  1095. break;
  1096. case KSPROPERTY_VIDEOCONTROL_ACTUAL_FRAME_RATE:
  1097. {
  1098. PKSPROPERTY_VIDEOCONTROL_ACTUAL_FRAME_RATE_S pS =
  1099. (PKSPROPERTY_VIDEOCONTROL_ACTUAL_FRAME_RATE_S) pSPD->PropertyInfo; // pointer to the data
  1100. ASSERT (pSPD->PropertyOutputSize >= sizeof (KSPROPERTY_VIDEOCONTROL_ACTUAL_FRAME_RATE_S));
  1101. pS->CurrentActualFrameRate = 15; // TODO: Implement the right rates in shipping drivers.
  1102. pS->CurrentMaxAvailableFrameRate = 15; // TODO: Implement the right rates in shipping drivers.
  1103. pSrb->ActualBytesTransferred = sizeof (KSPROPERTY_VIDEOCONTROL_ACTUAL_FRAME_RATE_S);
  1104. }
  1105. break;
  1106. case KSPROPERTY_VIDEOCONTROL_FRAME_RATES:
  1107. {
  1108. // todo
  1109. }
  1110. break;
  1111. case KSPROPERTY_VIDEOCONTROL_MODE:
  1112. {
  1113. PKSPROPERTY_VIDEOCONTROL_MODE_S pS = (PKSPROPERTY_VIDEOCONTROL_MODE_S) pSPD->PropertyInfo; // pointer to the data
  1114. ASSERT (pSPD->PropertyOutputSize >= sizeof (KSPROPERTY_VIDEOCONTROL_MODE_S));
  1115. pS->Mode = *pVideoControlMode;
  1116. pSrb->ActualBytesTransferred = sizeof (KSPROPERTY_VIDEOCONTROL_MODE_S);
  1117. }
  1118. break;
  1119. default:
  1120. TRAP;
  1121. break;
  1122. }
  1123. }
  1124. /*
  1125. ** AdapterGetVideoCompressionProperty()
  1126. **
  1127. ** Gets compressor settings
  1128. **
  1129. ** Arguments:
  1130. **
  1131. ** pSrb - pointer to the stream request block for properties
  1132. **
  1133. ** Returns:
  1134. **
  1135. ** Side Effects: none
  1136. */
  1137. VOID
  1138. STREAMAPI
  1139. AdapterGetVideoCompressionProperty(
  1140. PHW_STREAM_REQUEST_BLOCK pSrb
  1141. )
  1142. {
  1143. PHW_DEVICE_EXTENSION pHwDevExt = ((PHW_DEVICE_EXTENSION)pSrb->HwDeviceExtension);
  1144. PSTREAMEX pStrmEx;
  1145. PSTREAM_PROPERTY_DESCRIPTOR pSPD = pSrb->CommandData.PropertyInfo;
  1146. ULONG Id = pSPD->Property->Id; // index of the property
  1147. ULONG StreamIndex;
  1148. PCOMPRESSION_SETTINGS pCompressionSettings;
  1149. // For this property set, the StreamIndex is always in the same place
  1150. // for each property
  1151. StreamIndex = ((PKSPROPERTY_VIDEOCOMPRESSION_S) pSPD->Property)->StreamIndex;
  1152. ASSERT (StreamIndex < MAX_TESTCAP_STREAMS);
  1153. // Verify the stream index is valid
  1154. if (StreamIndex >= MAX_TESTCAP_STREAMS) {
  1155. pSrb->Status = STATUS_INVALID_PARAMETER;
  1156. return;
  1157. }
  1158. pStrmEx = (PSTREAMEX) pHwDevExt->pStrmEx[StreamIndex];
  1159. // If the stream is not opened when this property set is used,
  1160. // store the values in the HwDevExt
  1161. if (pStrmEx) {
  1162. pCompressionSettings = &pStrmEx->CompressionSettings;
  1163. }
  1164. else {
  1165. pCompressionSettings = &pHwDevExt->CompressionSettings;
  1166. }
  1167. switch (Id) {
  1168. case KSPROPERTY_VIDEOCOMPRESSION_GETINFO:
  1169. {
  1170. PKSPROPERTY_VIDEOCOMPRESSION_GETINFO_S pS =
  1171. (PKSPROPERTY_VIDEOCOMPRESSION_GETINFO_S) pSPD->PropertyInfo;
  1172. pS->DefaultKeyFrameRate = 15; // Key frame rate
  1173. pS->DefaultPFrameRate = 3; // Predeicted frames per Key frame
  1174. pS->DefaultQuality = 5000; // 0 to 10000
  1175. pS->Capabilities =
  1176. KS_CompressionCaps_CanQuality |
  1177. KS_CompressionCaps_CanKeyFrame |
  1178. KS_CompressionCaps_CanBFrame ;
  1179. pSrb->ActualBytesTransferred = sizeof (KSPROPERTY_VIDEOCOMPRESSION_GETINFO_S);
  1180. }
  1181. break;
  1182. case KSPROPERTY_VIDEOCOMPRESSION_KEYFRAME_RATE:
  1183. {
  1184. PKSPROPERTY_VIDEOCOMPRESSION_S pS =
  1185. (PKSPROPERTY_VIDEOCOMPRESSION_S) pSPD->PropertyInfo;
  1186. pS->Value = pCompressionSettings->CompressionKeyFrameRate;
  1187. pSrb->ActualBytesTransferred = sizeof (KSPROPERTY_VIDEOCOMPRESSION_S);
  1188. }
  1189. break;
  1190. case KSPROPERTY_VIDEOCOMPRESSION_PFRAMES_PER_KEYFRAME:
  1191. {
  1192. PKSPROPERTY_VIDEOCOMPRESSION_S pS =
  1193. (PKSPROPERTY_VIDEOCOMPRESSION_S) pSPD->PropertyInfo;
  1194. pS->Value = pCompressionSettings->CompressionPFramesPerKeyFrame;
  1195. pSrb->ActualBytesTransferred = sizeof (KSPROPERTY_VIDEOCOMPRESSION_S);
  1196. }
  1197. break;
  1198. case KSPROPERTY_VIDEOCOMPRESSION_QUALITY:
  1199. {
  1200. PKSPROPERTY_VIDEOCOMPRESSION_S pS =
  1201. (PKSPROPERTY_VIDEOCOMPRESSION_S) pSPD->PropertyInfo;
  1202. pS->Value = pCompressionSettings->CompressionQuality;
  1203. pSrb->ActualBytesTransferred = sizeof (KSPROPERTY_VIDEOCOMPRESSION_S);
  1204. }
  1205. break;
  1206. default:
  1207. TRAP;
  1208. break;
  1209. }
  1210. }
  1211. /*
  1212. ** AdapterSetVideoCompressionProperty()
  1213. **
  1214. ** Sets compressor settings
  1215. **
  1216. ** Arguments:
  1217. **
  1218. ** pSrb - pointer to the stream request block for properties
  1219. **
  1220. ** Returns:
  1221. **
  1222. ** Side Effects: none
  1223. */
  1224. VOID
  1225. STREAMAPI
  1226. AdapterSetVideoCompressionProperty(
  1227. PHW_STREAM_REQUEST_BLOCK pSrb
  1228. )
  1229. {
  1230. PHW_DEVICE_EXTENSION pHwDevExt = ((PHW_DEVICE_EXTENSION)pSrb->HwDeviceExtension);
  1231. PSTREAMEX pStrmEx;
  1232. PSTREAM_PROPERTY_DESCRIPTOR pSPD = pSrb->CommandData.PropertyInfo;
  1233. PKSPROPERTY_VIDEOCOMPRESSION_S pS = (PKSPROPERTY_VIDEOCOMPRESSION_S) pSPD->Property;
  1234. ULONG Id = pSPD->Property->Id; // index of the property
  1235. ULONG StreamIndex;
  1236. PCOMPRESSION_SETTINGS pCompressionSettings;
  1237. // For this property set, the StreamIndex is always in the same place
  1238. // for each property
  1239. StreamIndex = ((PKSPROPERTY_VIDEOCOMPRESSION_S) pSPD->Property)->StreamIndex;
  1240. ASSERT (StreamIndex < MAX_TESTCAP_STREAMS);
  1241. // Verify the stream index is valid
  1242. if (StreamIndex >= MAX_TESTCAP_STREAMS) {
  1243. pSrb->Status = STATUS_INVALID_PARAMETER;
  1244. return;
  1245. }
  1246. pStrmEx = (PSTREAMEX) pHwDevExt->pStrmEx[StreamIndex];
  1247. // If the stream is not opened when this property set is used,
  1248. // store the values in the HwDevExt
  1249. if (pStrmEx) {
  1250. pCompressionSettings = &pStrmEx->CompressionSettings;
  1251. }
  1252. else {
  1253. pCompressionSettings = &pHwDevExt->CompressionSettings;
  1254. }
  1255. switch (Id) {
  1256. case KSPROPERTY_VIDEOCOMPRESSION_KEYFRAME_RATE:
  1257. {
  1258. pCompressionSettings->CompressionKeyFrameRate = pS->Value;
  1259. }
  1260. break;
  1261. case KSPROPERTY_VIDEOCOMPRESSION_PFRAMES_PER_KEYFRAME:
  1262. {
  1263. pCompressionSettings->CompressionPFramesPerKeyFrame = pS->Value;
  1264. }
  1265. break;
  1266. case KSPROPERTY_VIDEOCOMPRESSION_QUALITY:
  1267. {
  1268. pCompressionSettings->CompressionQuality = pS->Value;
  1269. }
  1270. break;
  1271. default:
  1272. TRAP;
  1273. break;
  1274. }
  1275. }
  1276. /*
  1277. ** AdapterGetVBIProperty()
  1278. **
  1279. ** Gets VBI settings
  1280. **
  1281. ** Arguments:
  1282. **
  1283. ** pSrb - pointer to the stream request block for properties
  1284. **
  1285. ** Returns:
  1286. **
  1287. ** Side Effects: none
  1288. */
  1289. VOID
  1290. STREAMAPI
  1291. AdapterGetVBIProperty(
  1292. PHW_STREAM_REQUEST_BLOCK pSrb
  1293. )
  1294. {
  1295. PHW_DEVICE_EXTENSION pHwDevExt = pSrb->HwDeviceExtension;
  1296. PSTREAMEX pStrmEx;
  1297. PSTREAM_PROPERTY_DESCRIPTOR pSPD = pSrb->CommandData.PropertyInfo;
  1298. ULONG Id = pSPD->Property->Id; // index of the property
  1299. ULONG StreamIndex;
  1300. PVBICAP_PROPERTIES_PROTECTION_S pS =
  1301. (PVBICAP_PROPERTIES_PROTECTION_S) pSPD->PropertyInfo;
  1302. StreamIndex = pS->StreamIndex;
  1303. ASSERT (StreamIndex < MAX_TESTCAP_STREAMS);
  1304. // Verify the stream index is valid
  1305. if (StreamIndex >= MAX_TESTCAP_STREAMS) {
  1306. pSrb->Status = STATUS_INVALID_PARAMETER;
  1307. return;
  1308. }
  1309. pStrmEx = (PSTREAMEX) pHwDevExt->pStrmEx[StreamIndex];
  1310. pS->Status = 0;
  1311. if (pHwDevExt->ProtectionStatus & KS_VBI_FLAG_MV_PRESENT)
  1312. pS->Status |= KS_VBICAP_PROTECTION_MV_PRESENT;
  1313. if (pHwDevExt->ProtectionStatus & KS_VBI_FLAG_MV_HARDWARE)
  1314. pS->Status |= KS_VBICAP_PROTECTION_MV_HARDWARE;
  1315. if (pHwDevExt->ProtectionStatus & KS_VBI_FLAG_MV_DETECTED)
  1316. pS->Status |= KS_VBICAP_PROTECTION_MV_DETECTED;
  1317. pSrb->ActualBytesTransferred = sizeof (*pS);
  1318. }
  1319. #if DBG
  1320. /*
  1321. ** AdapterSetVBIProperty()
  1322. **
  1323. ** Sets VBI settings
  1324. **
  1325. ** Arguments:
  1326. **
  1327. ** pSrb - pointer to the stream request block for properties
  1328. **
  1329. ** Returns:
  1330. **
  1331. ** Side Effects: none
  1332. */
  1333. VOID
  1334. STREAMAPI
  1335. AdapterSetVBIProperty(
  1336. PHW_STREAM_REQUEST_BLOCK pSrb
  1337. )
  1338. {
  1339. PHW_DEVICE_EXTENSION pHwDevExt = pSrb->HwDeviceExtension;
  1340. PSTREAMEX pStrmEx;
  1341. PSTREAM_PROPERTY_DESCRIPTOR pSPD = pSrb->CommandData.PropertyInfo;
  1342. ULONG Id = pSPD->Property->Id; // index of the property
  1343. ULONG StreamIndex;
  1344. PVBICAP_PROPERTIES_PROTECTION_S pS =
  1345. (PVBICAP_PROPERTIES_PROTECTION_S) pSPD->PropertyInfo;
  1346. StreamIndex = pS->StreamIndex;
  1347. ASSERT (StreamIndex < MAX_TESTCAP_STREAMS);
  1348. // Verify the stream index is valid
  1349. if (StreamIndex >= MAX_TESTCAP_STREAMS) {
  1350. pSrb->Status = STATUS_INVALID_PARAMETER;
  1351. return;
  1352. }
  1353. pStrmEx = (PSTREAMEX) pHwDevExt->pStrmEx[StreamIndex];
  1354. pHwDevExt->ProtectionStatus = 0;
  1355. if (pS->Status & KS_VBICAP_PROTECTION_MV_PRESENT)
  1356. pHwDevExt->ProtectionStatus |= KS_VBI_FLAG_MV_PRESENT;
  1357. if (pS->Status & KS_VBICAP_PROTECTION_MV_HARDWARE)
  1358. pHwDevExt->ProtectionStatus |= KS_VBI_FLAG_MV_HARDWARE;
  1359. if (pS->Status & KS_VBICAP_PROTECTION_MV_DETECTED)
  1360. pHwDevExt->ProtectionStatus |= KS_VBI_FLAG_MV_DETECTED;
  1361. }
  1362. #endif //DBG
  1363. // -------------------------------------------------------------------
  1364. // General entry point for all get/set adapter properties
  1365. // -------------------------------------------------------------------
  1366. /*
  1367. ** AdapterSetProperty ()
  1368. **
  1369. ** Handles Set operations for all adapter properties.
  1370. **
  1371. ** Arguments:
  1372. **
  1373. ** pSRB -
  1374. ** Pointer to the HW_STREAM_REQUEST_BLOCK
  1375. **
  1376. ** Returns:
  1377. **
  1378. ** Side Effects: none
  1379. */
  1380. VOID
  1381. STREAMAPI
  1382. AdapterSetProperty(
  1383. PHW_STREAM_REQUEST_BLOCK pSrb
  1384. )
  1385. {
  1386. PSTREAM_PROPERTY_DESCRIPTOR pSPD = pSrb->CommandData.PropertyInfo;
  1387. if (IsEqualGUID(&PROPSETID_VIDCAP_CROSSBAR, &pSPD->Property->Set)) {
  1388. AdapterSetCrossbarProperty (pSrb);
  1389. }
  1390. else if (IsEqualGUID(&PROPSETID_TUNER, &pSPD->Property->Set)) {
  1391. AdapterSetTunerProperty (pSrb);
  1392. }
  1393. else if (IsEqualGUID(&PROPSETID_VIDCAP_VIDEOPROCAMP, &pSPD->Property->Set)) {
  1394. AdapterSetVideoProcAmpProperty (pSrb);
  1395. }
  1396. else if (IsEqualGUID(&PROPSETID_VIDCAP_CAMERACONTROL, &pSPD->Property->Set)) {
  1397. AdapterSetCameraControlProperty (pSrb);
  1398. }
  1399. else if (IsEqualGUID(&PROPSETID_VIDCAP_TVAUDIO, &pSPD->Property->Set)) {
  1400. AdapterSetTVAudioProperty (pSrb);
  1401. }
  1402. else if (IsEqualGUID(&PROPSETID_VIDCAP_VIDEODECODER, &pSPD->Property->Set)) {
  1403. AdapterSetAnalogVideoDecoderProperty (pSrb);
  1404. }
  1405. else if (IsEqualGUID(&PROPSETID_VIDCAP_VIDEOCONTROL, &pSPD->Property->Set)) {
  1406. AdapterSetVideoControlProperty (pSrb);
  1407. }
  1408. else if (IsEqualGUID (&PROPSETID_VIDCAP_VIDEOCOMPRESSION, &pSPD->Property->Set)) {
  1409. AdapterSetVideoCompressionProperty (pSrb);
  1410. }
  1411. #if DBG
  1412. // Can't normally set protection status; only allow this for DEBUGGING
  1413. else if (IsEqualGUID (&KSPROPSETID_VBICAP_PROPERTIES, &pSPD->Property->Set)) {
  1414. AdapterSetVBIProperty (pSrb);
  1415. }
  1416. #endif //DBG
  1417. else {
  1418. //
  1419. // We should never get here
  1420. //
  1421. TRAP;
  1422. pSrb->Status = STATUS_NOT_IMPLEMENTED;
  1423. }
  1424. }
  1425. /*
  1426. ** AdapterGetProperty ()
  1427. **
  1428. ** Handles Get operations for all adapter properties.
  1429. **
  1430. ** Arguments:
  1431. **
  1432. ** pSRB -
  1433. ** Pointer to the HW_STREAM_REQUEST_BLOCK
  1434. **
  1435. ** Returns:
  1436. **
  1437. ** Side Effects: none
  1438. */
  1439. VOID
  1440. STREAMAPI
  1441. AdapterGetProperty(
  1442. PHW_STREAM_REQUEST_BLOCK pSrb
  1443. )
  1444. {
  1445. PSTREAM_PROPERTY_DESCRIPTOR pSPD = pSrb->CommandData.PropertyInfo;
  1446. if (IsEqualGUID (&PROPSETID_VIDCAP_CROSSBAR, &pSPD->Property->Set)) {
  1447. AdapterGetCrossbarProperty (pSrb);
  1448. }
  1449. else if (IsEqualGUID (&PROPSETID_TUNER, &pSPD->Property->Set)) {
  1450. AdapterGetTunerProperty (pSrb);
  1451. }
  1452. else if (IsEqualGUID(&PROPSETID_VIDCAP_VIDEOPROCAMP, &pSPD->Property->Set)) {
  1453. AdapterGetVideoProcAmpProperty (pSrb);
  1454. }
  1455. else if (IsEqualGUID(&PROPSETID_VIDCAP_CAMERACONTROL, &pSPD->Property->Set)) {
  1456. AdapterGetCameraControlProperty (pSrb);
  1457. }
  1458. else if (IsEqualGUID(&PROPSETID_VIDCAP_TVAUDIO, &pSPD->Property->Set)) {
  1459. AdapterGetTVAudioProperty (pSrb);
  1460. }
  1461. else if (IsEqualGUID(&PROPSETID_VIDCAP_VIDEODECODER, &pSPD->Property->Set)) {
  1462. AdapterGetAnalogVideoDecoderProperty (pSrb);
  1463. }
  1464. else if (IsEqualGUID(&PROPSETID_VIDCAP_VIDEOCONTROL, &pSPD->Property->Set)) {
  1465. AdapterGetVideoControlProperty (pSrb);
  1466. }
  1467. else if (IsEqualGUID (&PROPSETID_VIDCAP_VIDEOCOMPRESSION, &pSPD->Property->Set)) {
  1468. AdapterGetVideoCompressionProperty (pSrb);
  1469. }
  1470. else if (IsEqualGUID (&KSPROPSETID_VBICAP_PROPERTIES, &pSPD->Property->Set)) {
  1471. AdapterGetVBIProperty (pSrb);
  1472. }
  1473. else {
  1474. //
  1475. // We should never get here
  1476. //
  1477. TRAP;
  1478. pSrb->Status = STATUS_NOT_IMPLEMENTED;
  1479. }
  1480. }