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.

642 lines
17 KiB

  1. /******************************************************************************\
  2. * *
  3. * SBPSTRM.C - Subpicture stream control related code. *
  4. * *
  5. * Copyright (c) C-Cube Microsystems 1996 *
  6. * All Rights Reserved. *
  7. * *
  8. * Use of C-Cube Microsystems code is governed by terms and conditions *
  9. * stated in the accompanying licensing statement. *
  10. * *
  11. \******************************************************************************/
  12. #include "Headers.h"
  13. #pragma hdrstop
  14. #include "hli.h"
  15. #include "copyprot.h"
  16. #include "sbpstrm.h"
  17. #include "bmaster.h"
  18. #include "cl6100.h"
  19. //*****************************************************************************
  20. // STATIC FUNCTIONS DECLARATION
  21. //*****************************************************************************
  22. static VOID SubpictureSendPacket(PHW_STREAM_REQUEST_BLOCK pSrb);
  23. static void SubpictureQueryAccept(PHW_STREAM_REQUEST_BLOCK pSrb);
  24. static void SetSubpictureProperty( PHW_STREAM_REQUEST_BLOCK pSrb );
  25. static void GetSubpictureProperty( PHW_STREAM_REQUEST_BLOCK pSrb );
  26. static void SetSubPictureRateChange( PHW_STREAM_REQUEST_BLOCK pSrb );
  27. static void GetSubPictureRateChange( PHW_STREAM_REQUEST_BLOCK pSrb );
  28. extern BOOL bJustHighLight;
  29. /*
  30. ** SubpictureReceiveCtrlPacket()
  31. **
  32. ** Receives packet commands that control the Subpicture stream
  33. **
  34. ** Arguments:
  35. **
  36. ** pSrb - The stream request block for the Subpicture stream
  37. **
  38. ** Returns:
  39. **
  40. ** Side Effects: none
  41. */
  42. VOID STREAMAPI SubpictureReceiveCtrlPacket( IN PHW_STREAM_REQUEST_BLOCK pSrb )
  43. {
  44. PHW_DEVICE_EXTENSION pdevext = (PHW_DEVICE_EXTENSION)pSrb->HwDeviceExtension;
  45. DebugPrint(( DebugLevelVerbose, "ZiVA: Begin SubpictureReceiveCtrlPacket->" ));
  46. switch( pSrb->Command )
  47. {
  48. case SRB_SET_STREAM_STATE:
  49. DebugPrint(( DebugLevelVerbose, "SRB_SET_STREAM_STATE\n" ));
  50. AdapterSetState( pSrb );
  51. break;
  52. case SRB_GET_STREAM_PROPERTY:
  53. DebugPrint(( DebugLevelVerbose, "SRB_GET_STREAM_PROPERTY\n" ));
  54. GetSubpictureProperty( pSrb );
  55. break;
  56. case SRB_SET_STREAM_PROPERTY:
  57. DebugPrint(( DebugLevelVerbose, "SRB_SET_STREAM_PROPERTY\n" ));
  58. SetSubpictureProperty( pSrb );
  59. break;
  60. case SRB_PROPOSE_DATA_FORMAT:
  61. DebugPrint(( DebugLevelVerbose, "SRB_PROPOSE_DATA_FORMAT\n" ));
  62. SubpictureQueryAccept( pSrb );
  63. break;
  64. case SRB_OPEN_MASTER_CLOCK:
  65. case SRB_CLOSE_MASTER_CLOCK:
  66. case SRB_INDICATE_MASTER_CLOCK:
  67. //hMaster = pSrb->CommandData.MasterClockHandle;
  68. pSrb->Status = STATUS_SUCCESS;
  69. break;
  70. case SRB_BEGIN_FLUSH : // beginning flush state
  71. MonoOutStr(" Sbp : SRB_BEGIN_FLUSH ");
  72. #ifndef DECODER_DVDPC
  73. pdevext->bInterruptPending = FALSE;
  74. #endif
  75. if (pdevext->pCurrentSubPictureSrb)
  76. {
  77. ZivaHw_Abort();
  78. // adapterUpdateNextSrbOrderNumberOnDiscardSrb(pdevext->pCurrentSubPictureSrb);
  79. pdevext->pCurrentSubPictureSrb->Status = STATUS_SUCCESS;
  80. AdapterReleaseRequest( pdevext->pCurrentSubPictureSrb );
  81. pdevext->pCurrentSubPictureSrb = NULL;
  82. pdevext->dwCurrentSubPictureSample = 0;
  83. pdevext->dwCurrentSubPicturePage = 0;
  84. }
  85. pSrb->Status = STATUS_SUCCESS;
  86. break;
  87. case SRB_END_FLUSH: // ending flush state
  88. MonoOutStr(" Sbp : SRB_END_FLUSH ");
  89. // ZivaHw_Play();
  90. pdevext->bPlayCommandPending = TRUE;
  91. pSrb->Status = STATUS_SUCCESS;
  92. if (pdevext->pCurrentSubPictureSrb)
  93. {
  94. pdevext->pCurrentSubPictureSrb->Status = STATUS_SUCCESS;
  95. AdapterReleaseRequest( pdevext->pCurrentSubPictureSrb );
  96. pdevext->pCurrentSubPictureSrb = NULL;
  97. pdevext->dwCurrentSubPictureSample = 0;
  98. pdevext->dwCurrentSubPicturePage = 0;
  99. }
  100. pdevext->bEndFlush = TRUE;
  101. // FinishCurrentPacketAndSendNextOne( pdevext );
  102. break;
  103. default:
  104. DebugPrint(( DebugLevelInfo, "!!!! UNKNOWN COMMAND !!!! :::> %X\n", pSrb->Command ));
  105. pSrb->Status = STATUS_NOT_IMPLEMENTED;
  106. }
  107. AdapterReleaseRequest( pSrb );
  108. DebugPrint(( DebugLevelVerbose, "ZiVA: End SubpictureReceiveCtrlPacket\n" ));
  109. }
  110. /*
  111. ** SubpictureReceiveDataPacket()
  112. **
  113. ** Receives Subpicture data packets
  114. **
  115. ** Arguments:
  116. **
  117. ** pSrb - Stream request block for the Subpicture device
  118. **
  119. ** Returns:
  120. **
  121. ** Side Effects: none
  122. */
  123. VOID STREAMAPI SubpictureReceiveDataPacket( IN PHW_STREAM_REQUEST_BLOCK pSrb )
  124. {
  125. PHW_DEVICE_EXTENSION pdevext = (PHW_DEVICE_EXTENSION)pSrb->HwDeviceExtension;
  126. switch( pSrb->Command )
  127. {
  128. case SRB_WRITE_DATA:
  129. if(bJustHighLight)
  130. {
  131. pSrb->TimeoutCounter = pSrb->TimeoutOriginal = pSrb->TimeoutCounter / 5;
  132. bJustHighLight = FALSE;
  133. MonoOutStr("SP TimeOut Counter Reduced");
  134. }
  135. SubpictureSendPacket( pSrb );
  136. break;
  137. default:
  138. DebugPrint(( DebugLevelWarning, "!!!! UNKNOWN COMMAND !!!! :::> %X\n", pSrb->Command ));
  139. pSrb->Status = STATUS_NOT_IMPLEMENTED;
  140. AdapterReleaseRequest( pSrb );
  141. }
  142. }
  143. DWORD PTStoSTC( BYTE *pPts )
  144. {
  145. return (((DWORD)*(pPts+1)) << 22) +
  146. (((DWORD)*(pPts+2)) << 14) +
  147. (((DWORD)*(pPts+3)) << 7) +
  148. (((DWORD)*(pPts+4)) >> 1);
  149. }
  150. #if 0
  151. static BOOLEAN PreparePageTable(PHW_STREAM_REQUEST_BLOCK pSrb)
  152. {
  153. DWORD i = 0;
  154. DWORD k = 0;
  155. DWORD j = 0;
  156. PKSSCATTER_GATHER pSGList;
  157. DWORD dwSum = 0;
  158. PHW_DEVICE_EXTENSION pHwDevExt = (PHW_DEVICE_EXTENSION)pSrb->HwDeviceExtension;
  159. if(pSrb == NULL)
  160. {
  161. #ifdef DEBUG
  162. MonoOutStr("PreparePageTable::pSrb is NULL");
  163. #endif
  164. return FALSE;
  165. }
  166. pSGList = pSrb->ScatterGatherBuffer;
  167. if(pSGList == NULL)
  168. {
  169. #ifdef DEBUG
  170. MonoOutStr("PreparePageTable::pSGList is NULL");
  171. #endif
  172. return FALSE;
  173. }
  174. while( j < pSrb->NumberOfBuffers)
  175. {
  176. dwSum = 0;
  177. k = 0;
  178. do
  179. {
  180. dwSum += pSGList[i].Length;
  181. i++;
  182. k++;
  183. }while(dwSum < pHwDevExt->SubPictureBufferSize[j]);
  184. pHwDevExt->SubPicturePageTable[j] = k;
  185. j++;
  186. if(j > 50)
  187. {
  188. #ifdef DEBUG
  189. MonoOutStr("PreparePageTable::ArrayCrossingLimit");
  190. #endif
  191. return FALSE;
  192. }
  193. }
  194. return TRUE;
  195. }
  196. #endif
  197. /*
  198. ** SubpictureSendPacket()
  199. **
  200. ** Routine to initialise the stream data packet handling
  201. **
  202. ** Arguments:
  203. **
  204. ** pSrb - Pointer to the stream request block
  205. **
  206. ** Returns:
  207. **
  208. ** Side Effects: none
  209. */
  210. static VOID SubpictureSendPacket( PHW_STREAM_REQUEST_BLOCK pSrb )
  211. {
  212. PHW_DEVICE_EXTENSION pHwDevExt = (PHW_DEVICE_EXTENSION)pSrb->HwDeviceExtension;
  213. KSSTREAM_HEADER* pHeader;
  214. BYTE* pData;
  215. ULONG ulSample;
  216. static BOOL bStreamNumberCouldBeChanged = FALSE;
  217. static WORD wCurrentStreamNumber = 0;
  218. if (CheckAndReleaseIfCtrlPkt(pSrb))
  219. return;
  220. pHeader = (PKSSTREAM_HEADER)pSrb->CommandData.DataBufferArray;
  221. // Lets check what we've got in this Srb
  222. for( ulSample = 0; ulSample < pSrb->NumberOfBuffers; ulSample++, pHeader++ )
  223. {
  224. pData = pHeader->Data;
  225. #ifdef DEBUG
  226. if( pHeader->OptionsFlags & ~(KSSTREAM_HEADER_OPTIONSF_SPLICEPOINT |
  227. KSSTREAM_HEADER_OPTIONSF_PREROLL |
  228. KSSTREAM_HEADER_OPTIONSF_DATADISCONTINUITY |
  229. KSSTREAM_HEADER_OPTIONSF_TYPECHANGED |
  230. KSSTREAM_HEADER_OPTIONSF_TIMEVALID |
  231. KSSTREAM_HEADER_OPTIONSF_TIMEDISCONTINUITY |
  232. KSSTREAM_HEADER_OPTIONSF_FLUSHONPAUSE |
  233. KSSTREAM_HEADER_OPTIONSF_DURATIONVALID |
  234. KSSTREAM_HEADER_OPTIONSF_LOOPEDDATA) )
  235. DebugPrint(( DebugLevelWarning, "ZiVA: !!!!!!!!! NEW KSSTREAM_HEADER_OPTIONSF_ ADDED !!!!!!!!!\n" ));
  236. MonoOutChar('S');
  237. MonoOutULong(( pHeader->TypeSpecificFlags) >> 16 );
  238. MonoOutChar( '.' );
  239. #endif // DEBUG
  240. if(pHwDevExt->dwFirstSbpOrdNum == -1)
  241. {
  242. pHwDevExt->dwFirstSbpOrdNum = (pHeader->TypeSpecificFlags) >> 16;
  243. MonoOutStr("FirstSbpBuffer");
  244. MonoOutULong( (pHeader->TypeSpecificFlags) >> 16 );
  245. }
  246. // pHwDevExt->SubPictureBufferSize[ulSample] = pHeader->DataUsed;
  247. if( pHeader->OptionsFlags & KSSTREAM_HEADER_OPTIONSF_DATADISCONTINUITY )
  248. {
  249. MonoOutStr( " S->DISCONT " );
  250. bStreamNumberCouldBeChanged = TRUE;
  251. }
  252. if( pHeader->OptionsFlags & KSSTREAM_HEADER_OPTIONSF_TYPECHANGED )
  253. {
  254. DebugPrint(( DebugLevelVerbose, "ZiVA: Processing Subpicture stream format.\n" ));
  255. MonoOutStr( " S->TYPECHANGED " );
  256. bStreamNumberCouldBeChanged = TRUE;
  257. }
  258. // Check for the stream number
  259. #ifndef ZERO_STREAM_NUMBER
  260. if( bStreamNumberCouldBeChanged )
  261. #endif
  262. {
  263. if( pData && pHeader->DataUsed )
  264. {
  265. WORD wStuffingLength;
  266. WORD wPesHeaderLength;
  267. WORD wOffset;
  268. WORD wNewStream;
  269. if(pHeader->DataUsed < 23)
  270. {
  271. pHwDevExt->bStreamNumberCouldBeChanged = FALSE;
  272. continue;
  273. }
  274. // Find the location of the stream ID and number
  275. wStuffingLength = *(pData+13) & 0x03;
  276. wPesHeaderLength = *(pData+22);
  277. wOffset = 22;
  278. if ( wPesHeaderLength >= 5 )
  279. {
  280. // PTS is present here
  281. DWORD dwPTS = PTStoSTC( pData+23 );
  282. MonoOutChar('=');
  283. MonoOutULong( dwPTS );
  284. MonoOutChar('=');
  285. DVD_GetSTC();
  286. }
  287. wOffset = wOffset + wPesHeaderLength;
  288. wOffset = wOffset + wStuffingLength + 1;
  289. if(pHeader->DataUsed < wOffset)
  290. {
  291. pHwDevExt->bStreamNumberCouldBeChanged = FALSE;
  292. continue;
  293. }
  294. // Get Stream Number
  295. //WORD wNewStream = *(pData+31);
  296. wNewStream = *(pData+wOffset);
  297. if( (wNewStream & 0xE0) == 0x20 )
  298. {
  299. #ifndef ZERO_STREAM_NUMBER
  300. *(pData+wOffset) = wNewStream & 0xE0;
  301. #else
  302. if( (wNewStream & 0x1F) != wCurrentStreamNumber )
  303. {
  304. wCurrentStreamNumber = wNewStream & 0x1F;
  305. #ifndef MICROCODE_ACCEPTS_ANY_STREAM
  306. DVD_SetStreams( 1, wCurrentStreamNumber ); // Select the current stream number
  307. #endif
  308. }
  309. bStreamNumberCouldBeChanged = FALSE;
  310. #endif // ZERO_STREAM_NUMBER
  311. }
  312. else
  313. MonoOutStr( " !!! SubPicture Pack with wrong ID !!! " );
  314. // Also note that valid SPU most likely was received here
  315. pHwDevExt->bValidSPU = TRUE;
  316. }
  317. }
  318. }
  319. // Register this Srb
  320. if( pHwDevExt->pCurrentSubPictureSrb )
  321. {
  322. DebugPrint(( DebugLevelVerbose, "ZiVA: !!!!!!!!!!! ERROR: Subpicture slot is not empty !!!!!!!!!!\n" ));
  323. MonoOutStr("!!!!!!!SPSlotIsNotEmpty!!!!!!!!");
  324. }
  325. // if(!PreparePageTable(pSrb))
  326. // MonoOutStr("!!!Sp PageTable prepfailed");
  327. pHwDevExt->pCurrentSubPictureSrb = pSrb;
  328. AdapterSendData( pHwDevExt );
  329. }
  330. /*
  331. ** SetSubpictureProperty()
  332. **
  333. **
  334. **
  335. ** Arguments:
  336. **
  337. ** pSrb - Pointer to the stream request block
  338. **
  339. ** Returns:
  340. **
  341. ** Side Effects: none
  342. */
  343. static void SetSubpictureProperty( PHW_STREAM_REQUEST_BLOCK pSrb )
  344. {
  345. PHW_DEVICE_EXTENSION pHwDevExt = (PHW_DEVICE_EXTENSION)pSrb->HwDeviceExtension;
  346. PSTREAM_PROPERTY_DESCRIPTOR pSPD = pSrb->CommandData.PropertyInfo;
  347. pSrb->Status = STATUS_SUCCESS;
  348. if( IsEqualGUID( &KSPROPSETID_DvdSubPic, &pSPD->Property->Set ) )
  349. { // KSPROPSETID_DvdSubPic
  350. switch ( pSrb->CommandData.PropertyInfo->Property->Id )
  351. {
  352. // look for the palette property
  353. case KSPROPERTY_DVDSUBPIC_PALETTE:
  354. {
  355. PKSPROPERTY_SPPAL pSpPal = (PKSPROPERTY_SPPAL)pSrb->CommandData.PropertyInfo->PropertyInfo;
  356. DWORD dwPalettes[16];
  357. int i;
  358. for ( i=0; i<16; i++ )
  359. dwPalettes[i] = ((DWORD)(pSpPal->sppal[i].Y) << 16) +
  360. ((DWORD)(pSpPal->sppal[i].U)) +
  361. ((DWORD)(pSpPal->sppal[i].V) << 8);
  362. if ( !DVD_SetPalette( dwPalettes ) )
  363. pSrb->Status = STATUS_IO_DEVICE_ERROR;
  364. }
  365. break;
  366. // look for HLI property
  367. case KSPROPERTY_DVDSUBPIC_HLI:
  368. // if(!pHwDevExt->bHliPending)
  369. { // Copy HLI to the Device Extensions
  370. MonoOutStr("HC");
  371. pHwDevExt->bHliPending = TRUE;
  372. pHwDevExt->hli = *(PKSPROPERTY_SPHLI)pSrb->CommandData.PropertyInfo->PropertyInfo;
  373. HighlightSetPropIfAdapterReady( pHwDevExt );
  374. }
  375. break;
  376. case KSPROPERTY_DVDSUBPIC_COMPOSIT_ON:
  377. if (*((PKSPROPERTY_COMPOSIT_ON)pSrb->CommandData.PropertyInfo->PropertyInfo))
  378. {
  379. if ( !DVD_SetSubPictureMute( FALSE ) )
  380. pSrb->Status = STATUS_IO_DEVICE_ERROR;
  381. }
  382. else
  383. {
  384. if ( !DVD_SetSubPictureMute( TRUE ) )
  385. pSrb->Status = STATUS_IO_DEVICE_ERROR;
  386. }
  387. break;
  388. default:
  389. pSrb->Status = STATUS_NOT_IMPLEMENTED;
  390. break;
  391. }
  392. }
  393. else if( IsEqualGUID( &KSPROPSETID_CopyProt, &pSPD->Property->Set ) )
  394. { // KSPROPSETID_CopyProt
  395. CopyProtSetPropIfAdapterReady( pSrb );
  396. }
  397. else if( IsEqualGUID( &KSPROPSETID_TSRateChange, &pSPD->Property->Set ) )
  398. { // this is a transfer rate change property go handle it there
  399. SetSubPictureRateChange( pSrb );
  400. }
  401. }
  402. /*
  403. ** GetSubpictureProperty()
  404. **
  405. **
  406. **
  407. ** Arguments:
  408. **
  409. ** pSrb - Pointer to the stream request block
  410. **
  411. ** Returns:
  412. **
  413. ** Side Effects: none
  414. */
  415. static void GetSubpictureProperty( PHW_STREAM_REQUEST_BLOCK pSrb )
  416. {
  417. PHW_DEVICE_EXTENSION phwdevext = (PHW_DEVICE_EXTENSION)pSrb->HwDeviceExtension;
  418. PSTREAM_PROPERTY_DESCRIPTOR pSPD = pSrb->CommandData.PropertyInfo;
  419. if( IsEqualGUID( &KSPROPSETID_CopyProt, &pSPD->Property->Set ) )
  420. { // this is a copy protection property go handle it there
  421. CopyProtGetProp( pSrb );
  422. }
  423. else if( IsEqualGUID( &KSPROPSETID_TSRateChange, &pSPD->Property->Set ) )
  424. { // this is a transfer rate change property go handle it there
  425. GetSubPictureRateChange( pSrb );
  426. }
  427. else
  428. pSrb->Status = STATUS_NOT_IMPLEMENTED;
  429. }
  430. static void GetSubPictureRateChange( PHW_STREAM_REQUEST_BLOCK pSrb )
  431. {
  432. PHW_DEVICE_EXTENSION pHwDevExt = (PHW_DEVICE_EXTENSION)pSrb->HwDeviceExtension;
  433. DebugPrint(( DebugLevelVerbose, "ZiVA: GetSubPictureRateChange()->" ));
  434. switch( pSrb->CommandData.PropertyInfo->Property->Id )
  435. {
  436. case KS_AM_RATE_SimpleRateChange:
  437. {
  438. KS_AM_SimpleRateChange* pRateChange;
  439. DebugPrint(( DebugLevelVerbose, "KS_AM_RATE_SimpleRateChange\n" ));
  440. pSrb->ActualBytesTransferred = sizeof( KS_AM_RATE_SimpleRateChange );
  441. pRateChange = (KS_AM_SimpleRateChange*)pSrb->CommandData.PropertyInfo->PropertyInfo;
  442. pRateChange->StartTime = 0/*pHwDevExt->SubPictureStartTime*/;
  443. pRateChange->Rate = 10000 /*pHwDevExt->SubPictureRate*/;
  444. }
  445. pSrb->Status = STATUS_SUCCESS;
  446. break;
  447. case KS_AM_RATE_ExactRateChange:
  448. DebugPrint(( DebugLevelVerbose, "KS_AM_RATE_ExactRateChange (NOT IMPLEMENTED)\n" ));
  449. pSrb->Status = STATUS_NOT_IMPLEMENTED;
  450. break;
  451. case KS_AM_RATE_MaxFullDataRate:
  452. {
  453. KS_AM_MaxFullDataRate* pMaxRate;
  454. DebugPrint(( DebugLevelVerbose, "KS_AM_RATE_MaxFullDataRate\n" ));
  455. pSrb->ActualBytesTransferred = sizeof (KS_AM_RATE_MaxFullDataRate);
  456. pMaxRate = (KS_AM_MaxFullDataRate*)pSrb->CommandData.PropertyInfo->PropertyInfo;
  457. *pMaxRate = 10000 /*pHwDevExt->SubPictureMaxFullRate*/;
  458. }
  459. pSrb->Status = STATUS_SUCCESS;
  460. break;
  461. case KS_AM_RATE_Step:
  462. DebugPrint(( DebugLevelVerbose, "KS_AM_RATE_Step (NOT IMPLEMENTED)\n" ));
  463. pSrb->Status = STATUS_NOT_IMPLEMENTED;
  464. }
  465. }
  466. static void SetSubPictureRateChange( PHW_STREAM_REQUEST_BLOCK pSrb )
  467. {
  468. PHW_DEVICE_EXTENSION pHwDevExt = (PHW_DEVICE_EXTENSION)pSrb->HwDeviceExtension;
  469. DebugPrint(( DebugLevelVerbose, "ZiVA: SetSubPictureRateChange()->" ));
  470. switch( pSrb->CommandData.PropertyInfo->Property->Id )
  471. {
  472. case KS_AM_RATE_SimpleRateChange:
  473. {
  474. KS_AM_SimpleRateChange* pRateChange;
  475. REFERENCE_TIME NewStartTime;
  476. LONG NewRate;
  477. DebugPrint(( DebugLevelVerbose, "KS_AM_RATE_SimpleRateChange\n" ));
  478. pRateChange = (KS_AM_SimpleRateChange*)pSrb->CommandData.PropertyInfo->PropertyInfo;
  479. NewStartTime = pRateChange->StartTime;
  480. NewRate = ( pRateChange->Rate < 0 ) ? -pRateChange->Rate : pRateChange->Rate;
  481. DebugPrint(( DebugLevelVerbose, "ZiVA: Received Data\r\n" ));
  482. DebugPrint(( DebugLevelVerbose, "ZiVA: StartTime = 0x%08x\r\n", NewStartTime ));
  483. DebugPrint(( DebugLevelVerbose, "ZiVA: Rate = 0x%08x\r\n", NewRate ));
  484. //pHwDevExt->SubPictureInterceptTime =
  485. // (pHwDevExt->SubPictureInterceptTime-NewStartTime)*
  486. // pHwDevExt->SubPictureRate/NewRate + NewStartTime;
  487. /* We will rely on the video stream
  488. if( NewRate == 10000 )
  489. ZivaHw_Play();
  490. else
  491. ZivaHw_Scan();
  492. pHwDevExt->SubPictureRate = NewRate;
  493. if( NewRate == 10000 )
  494. {
  495. pHwDevExt->SubPictureInterceptTime = 0;
  496. pHwDevExt->SubPictureStartTime = 0;
  497. }
  498. else
  499. {
  500. pHwDevExt->SubPictureInterceptTime = (-NewStartTime) * 10000 / NewRate + NewStartTime;
  501. pHwDevExt->SubPictureStartTime = NewStartTime;
  502. }
  503. SetRateChange( pHwDevExt, 0x01 );*/
  504. }
  505. pSrb->Status = STATUS_SUCCESS;
  506. break;
  507. case KS_AM_RATE_ExactRateChange :
  508. pSrb->Status = STATUS_NOT_IMPLEMENTED;
  509. break;
  510. case KS_AM_RATE_MaxFullDataRate :
  511. pSrb->Status = STATUS_NOT_IMPLEMENTED;
  512. break;
  513. case KS_AM_RATE_Step :
  514. pSrb->Status = STATUS_NOT_IMPLEMENTED;
  515. break;
  516. }
  517. }
  518. /*
  519. ** SubpictureQueryAccept()
  520. **
  521. **
  522. **
  523. ** Arguments:
  524. **
  525. ** pSrb - Pointer to the stream request block
  526. **
  527. ** Returns:
  528. **
  529. ** Side Effects: none
  530. */
  531. static void SubpictureQueryAccept( PHW_STREAM_REQUEST_BLOCK pSrb )
  532. {
  533. PKSDATAFORMAT pfmt = pSrb->CommandData.OpenFormat;
  534. KS_MPEGVIDEOINFO2* pblock = (KS_MPEGVIDEOINFO2*)((PBYTE)pfmt + sizeof( KSDATAFORMAT ));
  535. DebugPrint(( DebugLevelVerbose, "ZiVA: Begin SubpictureQueryAccept()\n" ));
  536. // pick up the format block and examine it. Default to not implemented
  537. pSrb->Status = STATUS_SUCCESS;
  538. if( pfmt->FormatSize != sizeof( KSDATAFORMAT ) + sizeof( KS_MPEGVIDEOINFO2 ) )
  539. return;
  540. /* switch( pblock->hdr.dwPixAspectRatio )
  541. {
  542. case PixAspectRatio_NTSC4x3:
  543. case PixAspectRatio_NTSC16x9:
  544. pSrb->Status = STATUS_SUCCESS;
  545. return;
  546. default:
  547. return;
  548. }*/
  549. DebugPrint(( DebugLevelVerbose, "ZiVA: End SubpictureQueryAccept()\n" ));
  550. }