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.

551 lines
16 KiB

  1. /******************************************************************************
  2. *
  3. * $RCSfile: AnlgProp.c $
  4. * $Source: u:/si/VXP/Wdm/Encore/AnlgProp.c $
  5. * $Author: Max $
  6. * $Date: 1998/08/28 00:53:07 $
  7. * $Revision: 1.3 $
  8. *
  9. * Written by: Max Paklin
  10. * Purpose: Implementation of analog stream for WDM driver
  11. *
  12. *******************************************************************************
  13. *
  14. * Copyright 1996-98, AuraVision Corporation. All rights reserved.
  15. *
  16. * AuraVision Corporation makes no warranty of any kind, express or implied,
  17. * with regard to this software. In no event shall AuraVision Corporation
  18. * be liable for incidental or consequential damages in connection with or
  19. * arising from the furnishing, performance, or use of this software.
  20. *
  21. *******************************************************************************/
  22. #include "Headers.h"
  23. #pragma hdrstop
  24. #include "adapter.h"
  25. #include "zivawdm.h"
  26. #include "monovxd.h"
  27. #ifdef ENCORE
  28. #include "avwinwdm.h"
  29. #include "anlgstrm.h"
  30. #include "AvInt.h"
  31. #include "MVStub.h"
  32. const GUID AVKSPROPSETID_Align = { STATIC_AVKSPROPSETID_Align };
  33. const GUID AVKSPROPSETID_Key = { STATIC_AVKSPROPSETID_Key };
  34. const GUID AVKSPROPSETID_Dove = { STATIC_AVKSPROPSETID_Dove };
  35. const GUID AVKSPROPSETID_Misc = { STATIC_AVKSPROPSETID_Misc };
  36. extern void STREAMAPI RunAutoSetup( PHW_STREAM_REQUEST_BLOCK pSrb );
  37. VOID AdapterGetProperty( PHW_STREAM_REQUEST_BLOCK pSrb )
  38. {
  39. PSTREAM_PROPERTY_DESCRIPTOR pSPD = pSrb->CommandData.PropertyInfo;
  40. PHW_DEVICE_EXTENSION pHwDevExt = (PHW_DEVICE_EXTENSION)pSrb->HwDeviceExtension;
  41. ULONG uId = pSPD->Property->Id;
  42. UINT uIndex = (UINT)(-1), uSize;
  43. PUINT pValue;
  44. BOOL bDove = FALSE;
  45. DebugPrint(( DebugLevelVerbose, "ZiVA: Begin AdapterGetProperty()\n" ));
  46. pSrb->Status = STATUS_NOT_IMPLEMENTED;
  47. if( IsEqualGUID( &AVKSPROPSETID_Align, &pSPD->Property->Set ) )
  48. {
  49. pValue = (PULONG)pSPD->PropertyInfo;
  50. uSize = sizeof( ULONG );
  51. ASSERT( pSPD->PropertyInputSize >= uSize );
  52. switch( uId )
  53. {
  54. case AVKSPROPERTY_ALIGN_XPOSITION:
  55. uIndex = AVXPOSITION;
  56. break;
  57. case AVKSPROPERTY_ALIGN_YPOSITION:
  58. uIndex = AVYPOSITION;
  59. break;
  60. case AVKSPROPERTY_ALIGN_INPUTDELAY:
  61. uIndex = AVINALIGN;
  62. break;
  63. case AVKSPROPERTY_ALIGN_WIDTHRATIO:
  64. uIndex = WIDTH_RATIO;
  65. bDove = TRUE;
  66. break;
  67. case AVKSPROPERTY_ALIGN_CLOCKDELAY:
  68. uIndex = CLOCK_DELAY;
  69. bDove = TRUE;
  70. break;
  71. case AVKSPROPERTY_ALIGN_CROPLEFT:
  72. uIndex = AVCROPLEFTOFFSET;
  73. break;
  74. case AVKSPROPERTY_ALIGN_CROPTOP:
  75. uIndex = AVCROPTOPOFFSET;
  76. break;
  77. case AVKSPROPERTY_ALIGN_CROPRIGHT:
  78. uIndex = AVCROPRIGHTOFFSET;
  79. break;
  80. case AVKSPROPERTY_ALIGN_CROPBOTTOM:
  81. uIndex = AVCROPBOTTOMOFFSET;
  82. }
  83. }
  84. else if( IsEqualGUID( &AVKSPROPSETID_Key, &pSPD->Property->Set ) )
  85. {
  86. switch( uId )
  87. {
  88. case AVKSPROPERTY_KEY_MODE:
  89. if( pSPD->PropertyInputSize < sizeof( ULONG ) )
  90. pSrb->Status = STATUS_BUFFER_TOO_SMALL;
  91. else
  92. {
  93. UINT uMode = AV_GetKeyMode();
  94. if( uMode == KEY_NONE )
  95. {
  96. AV_SetKeyMode( KEY_COLOR, FALSE );
  97. uMode = AV_GetKeyMode();
  98. }
  99. *((PULONG)pSPD->PropertyInfo) = uMode;
  100. pSrb->Status = STATUS_SUCCESS;
  101. pSrb->ActualBytesTransferred = sizeof( ULONG );
  102. }
  103. break;
  104. case AVKSPROPERTY_KEY_KEYCOLORS:
  105. if( pSPD->PropertyOutputSize < sizeof( AVKSPROPERTY_KEYCOLORS_S ) )
  106. pSrb->Status = STATUS_BUFFER_TOO_SMALL;
  107. else
  108. {
  109. UINT uMode = AV_GetKeyMode();
  110. PAVKSPROPERTY_KEYCOLORS_S pColors = (PAVKSPROPERTY_KEYCOLORS_S)pSPD->PropertyInfo;
  111. switch( uMode )
  112. {
  113. case AVKSPROPERTY_KEYMODE_COLOR:
  114. pColors->lohiRed.lLow = DOVE_GetParam( DOVEREDLOW );
  115. pColors->lohiRed.lHigh = DOVE_GetParam( DOVEREDHIGH );
  116. pColors->lohiGreen.lLow = DOVE_GetParam( DOVEGREENLOW );
  117. pColors->lohiGreen.lHigh= DOVE_GetParam( DOVEGREENHIGH );
  118. pColors->lohiBlue.lLow = DOVE_GetParam( DOVEBLUELOW );
  119. pColors->lohiBlue.lHigh = DOVE_GetParam( DOVEBLUEHIGH );
  120. case AVKSPROPERTY_KEYMODE_CHROMA:
  121. if( uMode == AVKSPROPERTY_KEYMODE_CHROMA )
  122. {
  123. pColors->lohiRed.lLow = AV_GetParameter( AVREDLOW );
  124. pColors->lohiRed.lHigh = AV_GetParameter( AVREDHIGH );
  125. pColors->lohiGreen.lLow = AV_GetParameter( AVGREENLOW );
  126. pColors->lohiGreen.lHigh= AV_GetParameter( AVGREENHIGH );
  127. pColors->lohiBlue.lLow = AV_GetParameter( AVBLUELOW );
  128. pColors->lohiBlue.lHigh = AV_GetParameter( AVBLUEHIGH );
  129. }
  130. pColors->lohiRed.lDefault =
  131. pColors->lohiGreen.lDefault = pColors->lohiBlue.lDefault = 0;
  132. pColors->lohiRed.lMin = pColors->lohiGreen.lMin = pColors->lohiBlue.lMin = 0;
  133. pColors->lohiRed.lMax = pColors->lohiGreen.lMax = pColors->lohiBlue.lMax = 255;
  134. pSrb->ActualBytesTransferred = sizeof( *pColors );
  135. pSrb->Status = STATUS_SUCCESS;
  136. break;
  137. default:
  138. pSrb->Status = STATUS_NOT_IMPLEMENTED;
  139. break;
  140. }
  141. }
  142. break;
  143. }
  144. }
  145. else if( IsEqualGUID( &AVKSPROPSETID_Dove, &pSPD->Property->Set ) )
  146. {
  147. pValue = (PULONG)pSPD->PropertyInfo;
  148. uSize = sizeof( ULONG );
  149. ASSERT( pSPD->PropertyInputSize >= uSize );
  150. switch( uId )
  151. {
  152. case AVKSPROPERTY_DOVE_VERSION:
  153. *pValue = TRUE; // Creative board only uses Anp82
  154. pSrb->Status = STATUS_SUCCESS;
  155. pSrb->ActualBytesTransferred = sizeof( ULONG );
  156. break;
  157. case AVKSPROPERTY_DOVE_DAC:
  158. if( pSPD->PropertyOutputSize < sizeof( AVKSPROPERTY_DOVEDAC_S ) )
  159. pSrb->Status = STATUS_BUFFER_TOO_SMALL;
  160. else
  161. {
  162. PAVKSPROPERTY_DOVEDAC_S pDac = (PAVKSPROPERTY_DOVEDAC_S)pSPD->PropertyInfo;
  163. pDac->valRed.lValue = DOVE_GetParam( DACRED );
  164. pDac->valGreen.lValue = DOVE_GetParam( DACGREEN );
  165. pDac->valBlue.lValue = DOVE_GetParam( DACBLUE );
  166. pDac->valCommonGain.lValue = DOVE_GetParam( COMMONGAIN );
  167. pDac->valRed.lMin = pDac->valRed.lDefault =
  168. pDac->valGreen.lMin = pDac->valGreen.lDefault =
  169. pDac->valBlue.lMin = pDac->valBlue.lDefault =
  170. pDac->valCommonGain.lMin= pDac->valCommonGain.lDefault = 0;
  171. pDac->valRed.lMax = pDac->valGreen.lMax = pDac->valBlue.lMax = 15;
  172. pDac->valCommonGain.lMax = 63;
  173. pSrb->Status = STATUS_SUCCESS;
  174. pSrb->ActualBytesTransferred = sizeof( *pDac );
  175. }
  176. break;
  177. case AVKSPROPERTY_DOVE_ALPHAMIXING:
  178. uIndex = ALPHA;
  179. bDove = TRUE;
  180. break;
  181. case AVKSPROPERTY_DOVE_FADINGTIME:
  182. uIndex = AVFADING;
  183. bDove = TRUE;
  184. }
  185. }
  186. else if( IsEqualGUID( &AVKSPROPSETID_Misc, &pSPD->Property->Set ) )
  187. {
  188. pValue = (PULONG)pSPD->PropertyInfo;
  189. uSize = sizeof( ULONG );
  190. ASSERT( pSPD->PropertyInputSize >= sizeof( ULONG ) );
  191. switch( uId )
  192. {
  193. case AVKSPROPERTY_MISC_SKEWRISE:
  194. uIndex = AVSKEWRISE;
  195. break;
  196. case AVKSPROPERTY_MISC_FILTER:
  197. *pValue = AV_SetTScaleMode( -1 );
  198. pSrb->Status = STATUS_SUCCESS;
  199. pSrb->ActualBytesTransferred = sizeof( *pValue );
  200. break;
  201. case AVKSPROPERTY_MISC_NEGATIVE:
  202. uIndex = AVNEGATIVE;
  203. break;
  204. }
  205. }
  206. else if( IsEqualGUID( &PROPSETID_VIDCAP_VIDEOPROCAMP, &pSPD->Property->Set ) )
  207. {
  208. PKSPROPERTY_VIDEOPROCAMP_S pS = (PKSPROPERTY_VIDEOPROCAMP_S)pSPD->PropertyInfo;
  209. if( pSPD->PropertyInputSize == sizeof( ULONG ) )
  210. {
  211. pValue = (PULONG)pSPD->PropertyInfo;
  212. uSize = sizeof( ULONG );
  213. }
  214. else
  215. {
  216. pValue = &pS->Value;
  217. uSize = sizeof( KSPROPERTY_VIDEOPROCAMP_S );
  218. ASSERT( pSPD->PropertyInputSize >= uSize );
  219. }
  220. switch( uId )
  221. {
  222. case KSPROPERTY_VIDEOPROCAMP_BRIGHTNESS:
  223. uIndex = AVBRIGHTNESS;
  224. break;
  225. case KSPROPERTY_VIDEOPROCAMP_CONTRAST:
  226. uIndex = AVCONTRAST;
  227. break;
  228. case KSPROPERTY_VIDEOPROCAMP_SATURATION:
  229. uIndex = AVSATURATION;
  230. break;
  231. case KSPROPERTY_VIDEOPROCAMP_SHARPNESS:
  232. uIndex = AVSHARP;
  233. break;
  234. case KSPROPERTY_VIDEOPROCAMP_GAMMA:
  235. uIndex = AVGAMMA;
  236. break;
  237. case KSPROPERTY_VIDEOPROCAMP_BACKLIGHT_COMPENSATION:
  238. uIndex = AVSOLARIZATION;
  239. break;
  240. }
  241. if( uIndex != (UINT)(-1) && uSize == sizeof( KSPROPERTY_VIDEOPROCAMP_S ) )
  242. {
  243. pS->Property.Set = pSPD->Property->Set;
  244. pS->Property.Id = uId;
  245. pS->Property.Flags = KSPROPERTY_TYPE_GET;
  246. pS->Flags = KSPROPERTY_VIDEOPROCAMP_FLAGS_MANUAL;
  247. pS->Capabilities = KSPROPERTY_VIDEOPROCAMP_FLAGS_MANUAL;
  248. }
  249. }
  250. else if( IsEqualGUID( &KSPROPSETID_Pin, &pSPD->Property->Set ) )
  251. {
  252. if( uId == KSPROPERTY_PIN_CINSTANCES )
  253. {
  254. PKSP_PIN pPin = (PKSP_PIN)pSPD->PropertyInfo;
  255. PKSPIN_CINSTANCES pksPinInstances = (PKSPIN_CINSTANCES)(pSPD->PropertyInfo);
  256. ASSERT( pSPD->PropertyInputSize >= sizeof( *pPin ) );
  257. if( pSPD->PropertyOutputSize < sizeof( *pksPinInstances ) )
  258. pSrb->Status = STATUS_BUFFER_TOO_SMALL;
  259. else
  260. {
  261. pksPinInstances->PossibleCount = 1;
  262. pksPinInstances->CurrentCount = 0;
  263. pSrb->ActualBytesTransferred = sizeof( *pksPinInstances );
  264. pSrb->Status = STATUS_SUCCESS;
  265. }
  266. }
  267. }
  268. if( uIndex != (UINT)(-1) )
  269. {
  270. #ifndef DEBUG
  271. if( pSPD->PropertyInputSize < uSize )
  272. pSrb->Status = STATUS_BUFFER_TOO_SMALL;
  273. else
  274. #endif
  275. {
  276. *pValue = bDove ? DOVE_GetParam( (WORD)uIndex ) : AV_GetParameter( uIndex );
  277. pSrb->Status = STATUS_SUCCESS;
  278. pSrb->ActualBytesTransferred = uSize;
  279. }
  280. }
  281. DebugPrint(( DebugLevelVerbose, "ZiVA: End AdapterGetProperty()\n" ));
  282. }
  283. VOID AdapterSetProperty( PHW_STREAM_REQUEST_BLOCK pSrb )
  284. {
  285. PHW_DEVICE_EXTENSION pHwDevExt = (PHW_DEVICE_EXTENSION)pSrb->HwDeviceExtension;
  286. PSTREAM_PROPERTY_DESCRIPTOR pSPD = pSrb->CommandData.PropertyInfo;
  287. ULONG uId = pSPD->Property->Id;
  288. UINT uIndex = (UINT)(-1), uValue;
  289. BOOL bDove = FALSE;
  290. DebugPrint(( DebugLevelVerbose, "ZiVA: Begin AdapterSetProperty()\n" ));
  291. pSrb->Status = STATUS_NOT_IMPLEMENTED;
  292. if( IsEqualGUID( &AVKSPROPSETID_Align, &pSPD->Property->Set ) )
  293. {
  294. ASSERT( pSPD->PropertyOutputSize >= sizeof( ULONG ) );
  295. uValue = *((PULONG)pSPD->PropertyInfo);
  296. switch( uId )
  297. {
  298. case AVKSPROPERTY_ALIGN_XPOSITION:
  299. uIndex = AVXPOSITION;
  300. break;
  301. case AVKSPROPERTY_ALIGN_YPOSITION:
  302. uIndex = AVYPOSITION;
  303. break;
  304. case AVKSPROPERTY_ALIGN_INPUTDELAY:
  305. uIndex = AVINALIGN;
  306. break;
  307. case AVKSPROPERTY_ALIGN_WIDTHRATIO:
  308. uIndex = WIDTH_RATIO;
  309. bDove = TRUE;
  310. break;
  311. case AVKSPROPERTY_ALIGN_CLOCKDELAY:
  312. uIndex = CLOCK_DELAY;
  313. bDove = TRUE;
  314. break;
  315. case AVKSPROPERTY_ALIGN_CROPLEFT:
  316. uIndex = AVCROPLEFTOFFSET;
  317. break;
  318. case AVKSPROPERTY_ALIGN_CROPTOP:
  319. uIndex = AVCROPTOPOFFSET;
  320. break;
  321. case AVKSPROPERTY_ALIGN_CROPRIGHT:
  322. uIndex = AVCROPRIGHTOFFSET;
  323. break;
  324. case AVKSPROPERTY_ALIGN_CROPBOTTOM:
  325. uIndex = AVCROPBOTTOMOFFSET;
  326. }
  327. }
  328. else if( IsEqualGUID( &AVKSPROPSETID_Key, &pSPD->Property->Set ) )
  329. {
  330. switch( uId )
  331. {
  332. case AVKSPROPERTY_KEY_MODE:
  333. if( pSPD->PropertyOutputSize < sizeof( ULONG ) )
  334. pSrb->Status = STATUS_BUFFER_TOO_SMALL;
  335. else
  336. {
  337. AV_SetKeyMode( *((PULONG)pSPD->PropertyInfo), TRUE );
  338. pSrb->Status = STATUS_SUCCESS;
  339. }
  340. break;
  341. case AVKSPROPERTY_KEY_KEYCOLORS:
  342. if( pSPD->PropertyOutputSize < sizeof( AVKSPROPERTY_KEYCOLORS_S ) )
  343. pSrb->Status = STATUS_BUFFER_TOO_SMALL;
  344. else
  345. {
  346. PAVKSPROPERTY_KEYCOLORS_S pColors = (PAVKSPROPERTY_KEYCOLORS_S)pSPD->PropertyInfo;
  347. switch( AV_GetKeyMode() )
  348. {
  349. case AVKSPROPERTY_KEYMODE_COLOR:
  350. DoveSetColorRange( (WORD)pColors->lohiRed.lHigh, (WORD)pColors->lohiRed.lLow,
  351. (WORD)pColors->lohiGreen.lHigh, (WORD)pColors->lohiGreen.lLow,
  352. (WORD)pColors->lohiBlue.lHigh, (WORD)pColors->lohiBlue.lLow );
  353. pSrb->Status = STATUS_SUCCESS;
  354. break;
  355. case AVKSPROPERTY_KEYMODE_CHROMA:
  356. AV_SetChromaRange( pColors->lohiRed.lLow, pColors->lohiRed.lHigh,
  357. pColors->lohiGreen.lLow, pColors->lohiGreen.lHigh,
  358. pColors->lohiBlue.lLow, pColors->lohiBlue.lHigh );
  359. pSrb->Status = STATUS_SUCCESS;
  360. break;
  361. default:
  362. pSrb->Status = STATUS_NOT_IMPLEMENTED;
  363. break;
  364. }
  365. }
  366. break;
  367. }
  368. }
  369. else if( IsEqualGUID( &AVKSPROPSETID_Dove, &pSPD->Property->Set ) )
  370. {
  371. ASSERT( pSPD->PropertyOutputSize >= sizeof( ULONG ) );
  372. uValue = *((PULONG)pSPD->PropertyInfo);
  373. switch( uId )
  374. {
  375. case AVKSPROPERTY_DOVE_DAC:
  376. if( pSPD->PropertyOutputSize < sizeof( AVKSPROPERTY_DOVEDAC_S ) )
  377. pSrb->Status = STATUS_BUFFER_TOO_SMALL;
  378. else
  379. {
  380. PAVKSPROPERTY_DOVEDAC_S pDac = (PAVKSPROPERTY_DOVEDAC_S)pSPD->PropertyInfo;
  381. DoveSetDAC( (WORD)pDac->valRed.lValue, (WORD)pDac->valGreen.lValue,
  382. (WORD)pDac->valBlue.lValue, (WORD)pDac->valCommonGain.lValue );
  383. pSrb->Status = STATUS_SUCCESS;
  384. }
  385. break;
  386. case AVKSPROPERTY_DOVE_ALPHAMIXING:
  387. DoveSetAlphaMix( (WORD)uValue );
  388. pSrb->Status = STATUS_SUCCESS;
  389. break;
  390. case AVKSPROPERTY_DOVE_FADINGTIME:
  391. uIndex = AVFADING;
  392. bDove = TRUE;
  393. break;
  394. case AVKSPROPERTY_DOVE_FADEIN:
  395. DoveFadeIn( DOVE_GetParam( AVFADING ) );
  396. pSrb->Status = STATUS_SUCCESS;
  397. break;
  398. case AVKSPROPERTY_DOVE_FADEOUT:
  399. DoveFadeOut( DOVE_GetParam( AVFADING ) );
  400. pSrb->Status = STATUS_SUCCESS;
  401. break;
  402. case AVKSPROPERTY_DOVE_AUTO:
  403. switch( uValue )
  404. {
  405. case AVKSPROPERTY_DOVEAUTO_REFERENCE1:
  406. pSrb->Status = STATUS_PENDING;
  407. pHwDevExt->nVGAMode = AP_NEWVGAAFTERFIRSTSTEP;
  408. break;
  409. case AVKSPROPERTY_DOVEAUTO_REFERENCE2:
  410. pSrb->Status = STATUS_PENDING;
  411. pHwDevExt->nVGAMode = AP_NEWVGAAFTERSECONDSTEP;
  412. break;
  413. case AVKSPROPERTY_DOVEAUTO_ALIGN:
  414. pSrb->Status = STATUS_PENDING;
  415. pHwDevExt->nVGAMode = AP_NEWMODEAFTERFIRSTSTEP;
  416. break;
  417. case AVKSPROPERTY_DOVEAUTO_COLORKEY:
  418. pSrb->Status = STATUS_PENDING;
  419. pHwDevExt->nVGAMode = AP_NEWMODEAFTERSECONDSTEP;
  420. }
  421. if( pSrb->Status == STATUS_PENDING )
  422. StreamClassCallAtNewPriority( pSrb->StreamObject, pSrb->HwDeviceExtension,
  423. Low, (PHW_PRIORITY_ROUTINE)RunAutoSetup, pSrb );
  424. break;
  425. }
  426. }
  427. else if( IsEqualGUID( &AVKSPROPSETID_Misc, &pSPD->Property->Set ) )
  428. {
  429. ASSERT( pSPD->PropertyOutputSize >= sizeof( ULONG ) );
  430. uValue = *((PULONG)pSPD->PropertyInfo);
  431. switch( uId )
  432. {
  433. case AVKSPROPERTY_MISC_SKEWRISE:
  434. uIndex = AVSKEWRISE;
  435. break;
  436. case AVKSPROPERTY_MISC_FILTER:
  437. AV_SetTScaleMode( uValue );
  438. pSrb->Status = STATUS_SUCCESS;
  439. break;
  440. case AVKSPROPERTY_MISC_NEGATIVE:
  441. uIndex = AVNEGATIVE;
  442. break;
  443. }
  444. }
  445. else if( IsEqualGUID( &PROPSETID_VIDCAP_VIDEOPROCAMP, &pSPD->Property->Set ) )
  446. {
  447. if( pSPD->PropertyOutputSize == sizeof( ULONG ) )
  448. uValue = *((PULONG)pSPD->PropertyInfo);
  449. else
  450. {
  451. uValue = ((PKSPROPERTY_VIDEOPROCAMP_S)pSPD->PropertyInfo)->Value;
  452. ASSERT( pSPD->PropertyOutputSize >= sizeof( KSPROPERTY_VIDEOPROCAMP_S ) );
  453. }
  454. switch( uId )
  455. {
  456. case KSPROPERTY_VIDEOPROCAMP_BRIGHTNESS:
  457. uIndex = AVBRIGHTNESS;
  458. break;
  459. case KSPROPERTY_VIDEOPROCAMP_CONTRAST:
  460. uIndex = AVCONTRAST;
  461. break;
  462. case KSPROPERTY_VIDEOPROCAMP_SATURATION:
  463. uIndex = AVSATURATION;
  464. break;
  465. case KSPROPERTY_VIDEOPROCAMP_SHARPNESS:
  466. uIndex = AVSHARP;
  467. break;
  468. case KSPROPERTY_VIDEOPROCAMP_GAMMA:
  469. uIndex = AVGAMMA;
  470. break;
  471. case KSPROPERTY_VIDEOPROCAMP_BACKLIGHT_COMPENSATION:
  472. uIndex = AVSOLARIZATION;
  473. break;
  474. }
  475. }
  476. else if( IsEqualGUID( &KSPROPSETID_CopyProt, &pSPD->Property->Set ) )
  477. {
  478. if( uId == KSPROPERTY_COPY_MACROVISION )
  479. {
  480. BOOL bSystem = pHwDevExt->VidSystem == PAL ? FALSE:TRUE;
  481. pHwDevExt->ulLevel = ((PKS_COPY_MACROVISION)pSrb->CommandData.PropertyInfo->PropertyInfo)->MACROVISIONLevel;
  482. MonoOutStr( "Set MV level->" );
  483. MonoOutULong( pHwDevExt->ulLevel );
  484. MonoOutChar( ' ' );
  485. if( !SetMacroVisionLevel( bSystem, pHwDevExt->ulLevel ) )
  486. {
  487. MonoOutSetBlink( TRUE );
  488. MonoOutSetUnderscore( TRUE );
  489. MonoOutStr( "Set MV level->FAILED!" );
  490. MonoOutSetBlink( FALSE );
  491. MonoOutSetUnderscore( FALSE );
  492. DebugPrint(( DebugLevelWarning, "Set Macrovision level to %d FAILED!\n", pHwDevExt->ulLevel ));
  493. pSrb->Status = STATUS_IO_DEVICE_ERROR;
  494. }
  495. else
  496. pSrb->Status = STATUS_SUCCESS;
  497. }
  498. }
  499. if( uIndex != (UINT)(-1) )
  500. {
  501. UINT uOldParam = AV_GetParameter( uIndex );
  502. pSrb->Status = STATUS_SUCCESS;
  503. if( uOldParam != uValue )
  504. {
  505. if( bDove )
  506. {
  507. DOVE_SetParam( (WORD)uIndex, (WORD)uValue );
  508. AV_UpdateVideo();
  509. }
  510. else
  511. {
  512. UINT uResult = AV_SetParameter( uIndex, uValue );
  513. if( uResult & 0x01 )
  514. {
  515. if( uResult & 0x02 )
  516. AV_UpdateVideo();
  517. }
  518. else
  519. pSrb->Status = STATUS_IO_DEVICE_ERROR;
  520. }
  521. }
  522. }
  523. DebugPrint(( DebugLevelVerbose, "ZiVA: End AdapterSetProperty()\n" ));
  524. }
  525. #endif // #ifdef ENCORE