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.

483 lines
17 KiB

  1. //***************************************************************************
  2. //
  3. // FileName:
  4. // $Workfile: zivabrd.h $
  5. //
  6. // Author:
  7. // TOSHIBA [PCS](PSY) Seiichi Nakamura
  8. // Copyright (c) 1997 TOSHIBA CORPORATION
  9. //
  10. // Description:
  11. //
  12. //***************************************************************************
  13. // $Header: /DVD Drivers/ZiVA.WDM/zivabrd.h 38 99/04/21 2:46p Yagi $
  14. // $Modtime: 99/04/21 2:21p $
  15. // $Nokeywords:$
  16. //***************************************************************************
  17. // Date | Author | Description
  18. // -----------+--------------+--------------------------------------------
  19. // 1997.12.04 | Hideki Yagi | Add VideoProperty_FilmCamera.
  20. // | | This Property is necessary to support WSS.
  21. // 1998.02.19 | Hideki Yagi | Add AudioProperty_AC3OutputMode.
  22. // | | This Property is necessary to support KARAOKE.
  23. // 1998.03.27 | Hideki Yagi | Add GetCapability method.
  24. // | | Add VideoProperty_SuquarePixel.
  25. // 1998.05.01 | Hideki Yagi | Add SubpicProperty_FlushBuff.
  26. // 1998.05.12 | Hideki Yagi | Add m_VSyncEventList.
  27. // 1998.09.25 | Hideki Yagi | Add m_WrapperType.
  28. // | |
  29. //
  30. #ifndef _ZIVA_BOARD_H_
  31. #define _ZIVA_BOARD_H_
  32. class CZiVA;
  33. class CIOIF;
  34. //***************************************************************************
  35. // KernelService HWInt Help Class
  36. //***************************************************************************
  37. class CAutoHwInt
  38. {
  39. private:
  40. IKernelService *m_pKernelObj;
  41. public:
  42. CAutoHwInt( IKernelService *pKernelObj )
  43. {
  44. m_pKernelObj = NULL;
  45. ASSERT( pKernelObj != NULL );
  46. m_pKernelObj = pKernelObj;
  47. m_pKernelObj->DisableHwInt();
  48. };
  49. ~CAutoHwInt( void )
  50. {
  51. m_pKernelObj->EnableHwInt();
  52. };
  53. };
  54. //***************************************************************************
  55. // IMBoardListItem Help Class
  56. //***************************************************************************
  57. class CList
  58. {
  59. private:
  60. IMBoardListItem *pTopItem;
  61. IMBoardListItem *pCurrentItem;
  62. public:
  63. CList( void );
  64. void Init( void );
  65. BOOL SearchItem( IMBoardListItem *pItem );
  66. BOOL AddItem( IMBoardListItem *pItem );
  67. BOOL DeleteItem( IMBoardListItem *pItem );
  68. BOOL SetCurrentToTop( void );
  69. IMBoardListItem *GetNext( void );
  70. IMBoardListItem *SearchBottomItem( void );
  71. };
  72. //***************************************************************************
  73. // VideoPropatySet Class
  74. //***************************************************************************
  75. class CVideoPropSet
  76. {
  77. public:
  78. VideoProperty_TVSystem_Value m_TVSystem;
  79. VideoProperty_AspectRatio_Value m_AspectRatio;
  80. VideoProperty_DisplayMode_Value m_DisplayMode;
  81. VideoSizeStruc m_Size;
  82. VideoProperty_DigitalOut_Value m_DigitalOut;
  83. UCHAR m_DigitalPalette[3][256];
  84. VideoAPSStruc m_APS;
  85. VideoProperty_ClosedCaption_Value m_ClosedCaption;
  86. VideoProperty_OutputSource_Value m_OutputSource;
  87. VideoProperty_CompositeOut_Value m_CompositeOut;
  88. VideoProperty_SVideoOut_Value m_SVideoOut;
  89. VideoProperty_SkipFieldControl_Value m_SkipFieldControl;
  90. VideoProperty_FilmCamera_Value m_FilmCamera;
  91. VideoProperty_SquarePixel_Value m_SquarePixel;
  92. //by oka
  93. VideoProperty_OSD_Switch_Value m_OSDSwitch;
  94. public:
  95. CVideoPropSet(){ Init(); };
  96. void Init( void )
  97. {
  98. // setup default value
  99. m_TVSystem = TV_NTSC;
  100. m_AspectRatio = Aspect_04_03;
  101. m_DisplayMode = Display_Original;
  102. m_Size.ResHorizontal = 720;
  103. m_Size.ResVertical = 480;
  104. m_DigitalOut = DigitalOut_Off;
  105. for( int i = 0 ; i < 3 ; i ++ )
  106. for( int j = 0 ; j < 256; j ++ )
  107. m_DigitalPalette[i][j] = (UCHAR)j;
  108. m_APS.CgmsType = CgmsType_Off;
  109. m_APS.APSType = ApsType_Off;
  110. m_ClosedCaption = ClosedCaption_Off;
  111. m_OutputSource = OutputSource_DVD;
  112. m_CompositeOut = CompositeOut_Off;
  113. m_SVideoOut = SVideoOut_Off;
  114. m_SkipFieldControl = SkipFieldControl_Off;
  115. m_FilmCamera = Source_Camera;
  116. m_SquarePixel = SquarePixel_Off;
  117. // by oka
  118. m_OSDSwitch = Video_OSD_Off;
  119. };
  120. };
  121. //***************************************************************************
  122. // AudioPropatySet Class
  123. //***************************************************************************
  124. class CAudioPropSet
  125. {
  126. public:
  127. AudioProperty_Type_Value m_Type;
  128. DWORD m_StreamNo;
  129. DWORD m_Volume;
  130. DWORD m_Sampling;
  131. DWORD m_ChannelNo;
  132. DWORD m_Quant;
  133. AudioProperty_AudioOut_Value m_OutType;
  134. AudioProperty_Cgms_Value m_Cgms;
  135. AudioProperty_AnalogOut_Value m_AnalogOut;
  136. AudioProperty_DigitalOut_Value m_DigitalOut;
  137. DWORD m_AC3DRangeLowBoost;
  138. DWORD m_AC3DRangeHighCut;
  139. AudioProperty_AC3OperateMode_Value m_AC3OperateMode;
  140. AudioProperty_AC3OutputMode_Value m_AC3OutputMode;
  141. public:
  142. CAudioPropSet(){ Init(); };
  143. void Init( void )
  144. {
  145. // setup default value
  146. m_Type = AudioType_AC3;
  147. m_StreamNo = 0;
  148. m_Volume = 100;
  149. m_Sampling = 48000;
  150. m_ChannelNo = 2;
  151. m_Quant = 16;
  152. m_OutType = AudioOut_Encoded;
  153. m_Cgms = AudioCgms_Off;
  154. m_AnalogOut = AudioAnalogOut_On;
  155. m_DigitalOut = AudioDigitalOut_Off;
  156. m_AC3DRangeLowBoost = 128;
  157. m_AC3DRangeHighCut = 128;
  158. m_AC3OperateMode = AC3OperateLine;
  159. };
  160. };
  161. //***************************************************************************
  162. // SubpicPropatySet Class
  163. //***************************************************************************
  164. class CSubpicPropSet
  165. {
  166. public:
  167. DWORD m_StreamNo;
  168. UCHAR m_Palette[48];
  169. SubpHlightStruc m_Hlight;
  170. SubpicProperty_State_Value m_OutType;
  171. // by oka
  172. SubpHlightButtonStruc m_HlightButton;
  173. public:
  174. // setup default value
  175. CSubpicPropSet(){ Init(); };
  176. void Init( void )
  177. {
  178. m_StreamNo = 0;
  179. for( int i = 0 ; i < 48 ; i ++ )
  180. m_Palette[ i ] = 0;
  181. m_Hlight.Hlight_Switch = Hlight_Off;
  182. m_Hlight.Hlight_StartX = 0;
  183. m_Hlight.Hlight_EndX = 0;
  184. m_Hlight.Hlight_StartY = 0;
  185. m_Hlight.Hlight_EndY = 0;
  186. m_Hlight.Hlight_Color = 0;
  187. m_Hlight.Hlight_Contrast= 0;
  188. m_OutType = Subpic_On;
  189. // by oka
  190. m_HlightButton.Hlight_Button = 0;
  191. m_HlightButton.Hlight_Action = Button_Unhighlight;
  192. };
  193. };
  194. //***************************************************************************
  195. // ZiVA Board Class
  196. //***************************************************************************
  197. class CMPEGBoardHAL: public IClassLibHAL, public IWrapperHAL
  198. {
  199. //
  200. private:
  201. IKernelService *m_pKernelObj; // Kernel Service Object
  202. CIOIF ioif; // IO interface object
  203. CZiVA ziva; // ZiVA chip control object
  204. CADV7175A adv7175a; // ADV7175A control object
  205. CADV7170 adv7170; // ADV7170 ccontrol object
  206. CADV *adv; // pointer to ADV object
  207. CMixHALStream m_Stream; // Mix Hal Stream object
  208. #ifdef POWERCHECK_BY_FLAG
  209. POWERSTATE m_PowerState; // Hardware power state
  210. #endif
  211. CList m_SendDataEventList;
  212. CList m_StartVOBUEventList;
  213. CList m_EndVOBEventList;
  214. CList m_VUnderFlowEventList;
  215. CList m_AUnderFlowEventList;
  216. CList m_SPUnderFlowEventList;
  217. CList m_VOverFlowEventList;
  218. CList m_AOverFlowEventList;
  219. CList m_SPOverFlowEventList;
  220. // by oka
  221. CList m_ButtonActivteEventList;
  222. CList m_NextPictureEventList;
  223. CList m_UserDataEventList;
  224. // end
  225. CList m_VSyncEventList; // 98.05.12 H.Yagi
  226. CVideoPropSet m_VideoProp; // Video Property Set
  227. CAudioPropSet m_AudioProp; // Audio Property Set
  228. CSubpicPropSet m_SubpicProp; // Subpic Property Set
  229. DWORD m_DMABufferLinearAddr; // DMA buffer addr
  230. DWORD m_DMABufferPhysicalAddr; // DMA buffer addr
  231. BOOL fMasterAbortFlag;
  232. BOOL fRDYDFlag;
  233. BOOL fENDPFlag;
  234. BOOL fENDCFlag;
  235. DWORD m_NaviCount;
  236. DWORD m_EventIntMask;
  237. // by oka
  238. DWORD m_ZivaPbtIntMask; // stock mask for PBT_INT
  239. DWORD m_MaskReference[24]; // interrupt bit reference counter
  240. BOOL m_NeedPowerOnDelay; // power on delay for audio
  241. DWORD m_PowerOnTime; // power on time.
  242. // 1998.8.18 seichan
  243. //DisplayMode��ZiVA��PICV���荞�݂Őݒ肷�邽�߂̃t���O
  244. BOOL m_SetVideoProperty_DisplayMode_Event;
  245. WRAPPERTYPE m_WrapperType; // WrappertType Flag
  246. private:
  247. void NotifyEvent( CList *pList , VOID *Ret );
  248. void CheckZiVAInterrupt( DWORD dwIntFlag );
  249. DWORD GetDMABufferLinearAddr( void ) { return m_DMABufferLinearAddr; };
  250. DWORD GetDMABufferPhysicalAddr( void ) { return m_DMABufferPhysicalAddr; };
  251. void ClearMasterAbortEvent( void );
  252. void SetMasterAbortEvent( void );
  253. BOOL IsMasterAbortOccurred( void );
  254. BOOL WaitMasterAbort( void );
  255. void ClearRDYDEvent( void );
  256. void SetRDYDEvent( void );
  257. BOOL IsRDYDOccurred( void );
  258. BOOL WaitRDYD( void );
  259. void ClearENDPEvent( void );
  260. void SetENDPEvent( void );
  261. BOOL IsENDPOccurred( void );
  262. BOOL WaitENDP( void );
  263. void ClearENDCEvent( void );
  264. void SetENDCEvent( void );
  265. BOOL IsENDCOccurred( void );
  266. BOOL WaitENDC( void );
  267. DWORD GetEventIntMask( void ){ return m_EventIntMask; };
  268. // by oka
  269. BOOL SetEventIntMask( DWORD mask );
  270. BOOL UnsetEventIntMask( DWORD mask );
  271. // by oka for Closed Caption
  272. inline void SetUSRData( void );
  273. inline void SendCCData( void );
  274. DWORD m_CCData[CC_DATA_SIZE];
  275. DWORD m_CCDataPoint;
  276. DWORD m_CCDataNumber;
  277. DWORD m_CCRingBufferStart;
  278. DWORD m_CCRingBufferNumber;
  279. DWORD m_CCstart; // User Data Area start point
  280. DWORD m_CCend; // User Data Area end point
  281. DWORD m_CCsend_point; //�����O�o�b�t�@�ł̃|�C���^�[
  282. DWORD m_CCpending; //�����‚��Ȃ�������
  283. DWORD m_CCnumber; //�������f�[�^�̐�
  284. // by oka for OnScreenDisplay
  285. DWORD m_OSDStartAddr;
  286. DWORD m_OSDEndAddr;
  287. // end
  288. //-------------------------------------------------------------------
  289. // Video property private functions( Set series )
  290. //-------------------------------------------------------------------
  291. BOOL SetVideoProperty_TVSystem( PVOID pData );
  292. BOOL SetVideoProperty_AspectRatio( PVOID pData );
  293. BOOL SetVideoProperty_DisplayMode( PVOID pData );
  294. BOOL SetVideoProperty_Resolution( PVOID pData );
  295. BOOL SetVideoProperty_DigitalOut( PVOID pData );
  296. BOOL SetVideoProperty_DigitalPalette( PVOID pData );
  297. BOOL SetVideoProperty_APS( PVOID pData );
  298. BOOL SetVideoProperty_ClosedCaption( PVOID pData );
  299. BOOL SetVideoProperty_OutputSource( PVOID pData );
  300. BOOL SetVideoProperty_CompositeOut( PVOID pData );
  301. BOOL SetVideoProperty_SVideoOut( PVOID pData );
  302. BOOL SetVideoProperty_SkipFieldControl( PVOID pData );
  303. BOOL SetVideoProperty_FilmCamera( PVOID pData );
  304. BOOL SetVideoProperty_SquarePixel( PVOID pData );
  305. // by oka
  306. BOOL SetVideoProperty_Digest( PVOID pData );
  307. BOOL SetVideoProperty_OSDData( PVOID pData );
  308. BOOL SetVideoProperty_OSDSwitch( PVOID pData );
  309. BOOL SetVideoProperty_Magnify( PVOID pData );
  310. BOOL SetVideoProperty_ClosedCaptionData( PVOID pData );
  311. //-------------------------------------------------------------------
  312. // Video property private functions( Get series )
  313. //-------------------------------------------------------------------
  314. BOOL GetVideoProperty_TVSystem( PVOID pData );
  315. BOOL GetVideoProperty_AspectRatio( PVOID pData );
  316. BOOL GetVideoProperty_DisplayMode( PVOID pData );
  317. BOOL GetVideoProperty_Resolution( PVOID pData );
  318. BOOL GetVideoProperty_DigitalOut( PVOID pData );
  319. BOOL GetVideoProperty_DigitalPalette( PVOID pData );
  320. BOOL GetVideoProperty_APS( PVOID pData );
  321. BOOL GetVideoProperty_ClosedCaption( PVOID pData );
  322. BOOL GetVideoProperty_OutputSource( PVOID pData );
  323. BOOL GetVideoProperty_CompositeOut( PVOID pData );
  324. BOOL GetVideoProperty_SVideoOut( PVOID pData );
  325. BOOL GetVideoProperty_SkipFieldControl( PVOID pData );
  326. BOOL GetVideoProperty_FilmCamera( PVOID pData );
  327. BOOL GetVideoProperty_SquarePixel( PVOID pData );
  328. // by oka
  329. BOOL GetVideoProperty_Digest( PVOID pData );
  330. BOOL GetVideoProperty_OSDData( PVOID pData );
  331. BOOL GetVideoProperty_OSDSwitch( PVOID pData );
  332. BOOL GetVideoProperty_Magnify( PVOID pData );
  333. BOOL GetVideoProperty_ClosedCaptionData( PVOID pData );
  334. //-------------------------------------------------------------------
  335. // Audio property private functions( Set series )
  336. //-------------------------------------------------------------------
  337. BOOL SetAudioProperty_Type( PVOID pData );
  338. BOOL SetAudioProperty_Number( PVOID pData );
  339. BOOL SetAudioProperty_Volume( PVOID pData );
  340. BOOL SetAudioProperty_Sampling( PVOID pData );
  341. BOOL SetAudioProperty_Channel( PVOID pData );
  342. BOOL SetAudioProperty_Quant( PVOID pData );
  343. BOOL SetAudioProperty_AudioOut( PVOID pData );
  344. BOOL SetAudioProperty_Cgms( PVOID pData );
  345. BOOL SetAudioProperty_AnalogOut( PVOID pData );
  346. BOOL SetAudioProperty_DigitalOut( PVOID pData );
  347. BOOL SetAudioProperty_AC3DRangeLowBoost( PVOID pData );
  348. BOOL SetAudioProperty_AC3DRangeHighCut( PVOID pData );
  349. BOOL SetAudioProperty_AC3OperateMode( PVOID pData );
  350. BOOL SetAudioProperty_AC3OutputMode( PVOID pData );
  351. //-------------------------------------------------------------------
  352. // Audio property private functions( Get series )
  353. //-------------------------------------------------------------------
  354. BOOL GetAudioProperty_Type( PVOID pData );
  355. BOOL GetAudioProperty_Number( PVOID pData );
  356. BOOL GetAudioProperty_Volume( PVOID pData );
  357. BOOL GetAudioProperty_Sampling( PVOID pData );
  358. BOOL GetAudioProperty_Channel( PVOID pData );
  359. BOOL GetAudioProperty_Quant( PVOID pData );
  360. BOOL GetAudioProperty_AudioOut( PVOID pData );
  361. BOOL GetAudioProperty_Cgms( PVOID pData );
  362. BOOL GetAudioProperty_AnalogOut( PVOID pData );
  363. BOOL GetAudioProperty_DigitalOut( PVOID pData );
  364. BOOL GetAudioProperty_AC3DRangeLowBoost( PVOID pData );
  365. BOOL GetAudioProperty_AC3DRangeHighCut( PVOID pData );
  366. BOOL GetAudioProperty_AC3OperateMode( PVOID pData );
  367. BOOL GetAudioProperty_AC3OutputMode( PVOID pData );
  368. //-------------------------------------------------------------------
  369. // Subpic property private functions( Set series )
  370. //-------------------------------------------------------------------
  371. BOOL SetSubpicProperty_Number( PVOID pData );
  372. BOOL SetSubpicProperty_Palette( PVOID pData );
  373. BOOL SetSubpicProperty_Hilight( PVOID pData );
  374. BOOL SetSubpicProperty_State( PVOID pData );
  375. // by oka
  376. BOOL SetSubpicProperty_HilightButton( PVOID pData );
  377. BOOL SetSubpicProperty_FlushBuff( PVOID pData );
  378. //-------------------------------------------------------------------
  379. // Subpic property private functions( Get series )
  380. //-------------------------------------------------------------------
  381. BOOL GetSubpicProperty_Number( PVOID pData );
  382. BOOL GetSubpicProperty_Palette( PVOID pData );
  383. BOOL GetSubpicProperty_Hilight( PVOID pData );
  384. BOOL GetSubpicProperty_State( PVOID pData );
  385. // by oka
  386. BOOL GetSubpicProperty_HilightButton( PVOID pData );
  387. BOOL GetSubpicProperty_FlushBuff( PVOID pData );
  388. public:
  389. CMPEGBoardHAL();
  390. ~CMPEGBoardHAL();
  391. //---------------------------------------------------------------------------
  392. // HAL interface for Wrapper
  393. //---------------------------------------------------------------------------
  394. HALRESULT Init( WRAPPERTYPE wraptype );
  395. HALRESULT SetKernelService( IKernelService *pKernelService );
  396. HALRESULT SetSinkWrapper( IMPEGBoardEvent *pMPEGBoardEvent );
  397. HALRESULT UnsetSinkWrapper( IMPEGBoardEvent *pMPEGBoardEvent );
  398. HALRESULT HALHwInterrupt( void );
  399. HALRESULT QueryDMABufferSize( DWORD *Size, DWORD *BFlag );
  400. HALRESULT SetDMABuffer( DWORD LinearAddr, DWORD physicalAddr );
  401. // add by H.Yagi 1999.04.21
  402. HALRESULT GetHALType( HALTYPE *HALType ){ *HALType = HalType_ZIVA; return(HAL_SUCCESS); };
  403. //---------------------------------------------------------------------------
  404. // HAL interface for Class Library
  405. //---------------------------------------------------------------------------
  406. HALRESULT GetMixHALStream( IHALStreamControl **ppHALStreamControl );
  407. HALRESULT GetVideoHALStream( IHALStreamControl **ppHALStreamControl );
  408. HALRESULT GetAudioHALStream( IHALStreamControl **ppHALStreamControl );
  409. HALRESULT GetSubpicHALStream( IHALStreamControl **ppHALStreamControl );
  410. HALRESULT SetVideoProperty( VIDEOPROPTYPE PropertyType, VOID *pData );
  411. HALRESULT GetVideoProperty( VIDEOPROPTYPE PropertyType, VOID *pData );
  412. HALRESULT SetAudioProperty( AUDIOPROPTYPE PropertyType, VOID *pData );
  413. HALRESULT GetAudioProperty( AUDIOPROPTYPE PropertyType, VOID *pData );
  414. HALRESULT SetSubpicProperty( SUBPICPROPTYPE PropertyType, VOID *pData );
  415. HALRESULT GetSubpicProperty( SUBPICPROPTYPE PropertyType, VOID *pData );
  416. HALRESULT SetSinkClassLib( IMPEGBoardEvent *pMPEGBoardEvent );
  417. HALRESULT UnsetSinkClassLib( IMPEGBoardEvent *pMPEGBoardEvent );
  418. HALRESULT SetPowerState( POWERSTATE Switch );
  419. HALRESULT GetPowerState( POWERSTATE *pSwitch );
  420. HALRESULT SetSTC( DWORD STCValue );
  421. HALRESULT GetSTC( DWORD *pSTCValue );
  422. HALRESULT GetCapability( CAPSTYPE PropType, DWORD *pPropType );
  423. // by oka
  424. CUserData m_UserData;
  425. friend CMixHALStream;
  426. };
  427. //---------------------------------------------------------------------------
  428. //
  429. //---------------------------------------------------------------------------
  430. #endif // _ZIVA_BOARD_H_
  431. //***************************************************************************
  432. // End of ZiVABoard class header
  433. //***************************************************************************