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.

215 lines
6.0 KiB

  1. /******************************************************************************\
  2. * *
  3. * ZIVAWDM.H - ZiVA hardware control API. *
  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. #ifndef _ZIVAWDM_H_
  13. #define _ZIVAWDM_H_
  14. #ifdef GATEWAY
  15. #define LRCK_DELAY
  16. #endif
  17. #define AUTHENTICATION_TIMEOUT_COUNT 200
  18. #define ZIVA_STREAM_TYPE_MPEG_PROGRAM 0 // DVD MPEG-2 program stream
  19. #define ZIVA_STREAM_TYPE_MPEG_SYSTEM 1 // MPEG-1 system stream
  20. #define ZIVA_STREAM_TYPE_CDROM_MPEG 2 // VideoCD CD-ROM sector stream
  21. #define ZIVA_STREAM_TYPE_CDDA 3 // CD-DA PCM sector stream
  22. #define ZIVA_STREAM_TYPE_AUDIO_ELEMENTARY 0x10 // Audio elementary stream
  23. #define ZIVA_STREAM_TYPE_VIDEO_ELEMENTARY 0x11 // Video elementary stream
  24. #define NTSC 1
  25. #define PAL 2
  26. typedef enum _ZIVA_STREAM
  27. {
  28. ZivaVideo = 0,
  29. ZivaAudio,
  30. ZivaSubpicture,
  31. #if defined (ENCORE)
  32. ZivaAnalog,
  33. #elif defined(DECODER_DVDPC)|| defined(EZDVD)
  34. ZivaYUV,
  35. #endif
  36. ZivaCCOut,
  37. ZivaNumberOfStreams
  38. } ZIVA_STREAM, *PZIVA_STREAM;
  39. #define DISC_KEY_SIZE 2048
  40. typedef enum _ZIVA_STATE
  41. {
  42. ZIVA_STATE_PLAY = 0,
  43. ZIVA_STATE_PAUSE,
  44. ZIVA_STATE_STOP,
  45. ZIVA_STATE_SCAN,
  46. ZIVA_STATE_STEP,
  47. ZIVA_STATE_SLOWMOTION
  48. } ZIVA_STATE;
  49. typedef struct _INT_STATUS_INFO
  50. {
  51. DWORD dwStatus; // Interrupt status
  52. DWORD dwButton;
  53. DWORD dwError;
  54. DWORD dwBuffer;
  55. DWORD dwUnderflow;
  56. DWORD dwAOR;
  57. DWORD dwAEE;
  58. } INT_STATUS_INFO, * PINT_STATUS_INFO;
  59. typedef struct _HW_DEVICE_EXTENSION
  60. {
  61. ULONG dwDVDHostBaseAddress; // Board base address
  62. ULONG dwHostAccessRangeLength; // and its length
  63. ULONG dwDVDCFifoBaseAddress;
  64. ULONG dwDVDAMCCBaseAddress;
  65. ULONG dwDVDFPGABaseAddress;
  66. ULONG dwDVD6807BaseAddress;
  67. BOOLEAN bVideoStreamOpened;
  68. BOOLEAN bAudioStreamOpened;
  69. BOOLEAN bSubPictureStreamOpened;
  70. BOOLEAN bOverlayInitialized;
  71. int nAnalogStreamOpened;
  72. int iTotalOpenedStreams;
  73. BOOLEAN bVideoCanAuthenticate;
  74. BOOLEAN bAudioCanAuthenticate;
  75. BOOLEAN bSubPictureCanAuthenticate;
  76. int iStreamToAuthenticateOn;
  77. BOOLEAN bValidSPU;
  78. KSPROPERTY_SPHLI hli;
  79. PHW_STREAM_REQUEST_BLOCK pCurrentVideoSrb; // Currently DMAing Video Srb
  80. DWORD dwCurrentVideoSample; // Currently DMAing Video Sample (page)
  81. PHW_STREAM_REQUEST_BLOCK pCurrentAudioSrb; // Currently DMAing Audio Srb
  82. DWORD dwCurrentAudioSample; // Currently DMAing Audio Sample (page)
  83. PHW_STREAM_REQUEST_BLOCK pCurrentSubPictureSrb; // Currently DMAing SubPicture Srb
  84. DWORD dwCurrentSubPictureSample; // Currently DMAing SubPicture Sample (page)
  85. ZIVA_STREAM CurrentlySentStream; // Currently DMAing Stream
  86. WORD wNextSrbOrderNumber;
  87. BOOLEAN bInterruptPending;
  88. BOOLEAN bPlayCommandPending;
  89. BOOLEAN bScanCommandPending;
  90. BOOLEAN bSlowCommandPending;
  91. BOOLEAN bEndFlush;
  92. BOOL bTimerScheduled;
  93. int nTimeoutCount;
  94. int nStopCount, nPauseCount, nPlayCount;
  95. #ifdef ENCORE
  96. BOOL bIsVxp524;
  97. int nVGAMode; // TRUE - current, FALSE - new, (-1) - new VGA!
  98. DWORD dwColorKey;
  99. #endif
  100. ULONG VideoPort;
  101. PHW_STREAM_OBJECT pstroYUV;
  102. KS_AMVPDATAINFO VPFmt;
  103. ULONG ddrawHandle;
  104. ULONG VidPortID;
  105. ULONG SurfaceHandle;
  106. //#endif
  107. PUCHAR pDiscKeyBufferLinear;
  108. STREAM_PHYSICAL_ADDRESS pDiscKeyBufferPhysical;
  109. PDEVICE_OBJECT pPhysicalDeviceObj;
  110. ULONG NewRate;
  111. BOOLEAN bToBeDiscontinued;
  112. BOOLEAN bDiscontinued;
  113. BOOLEAN bAbortAtPause;
  114. BOOLEAN bRateChangeFromSlowMotion;
  115. DWORD dwCurrentVideoPage;
  116. DWORD dwCurrentAudioPage;
  117. DWORD dwCurrentSubPicturePage;
  118. LONG dwVideoDataUsed;
  119. LONG dwAudioDataUsed;
  120. LONG dwSubPictureDataUsed;
  121. BOOLEAN bMove;
  122. /* DWORD VidBufferSize[50];
  123. DWORD VideoPageTable[50];
  124. DWORD AudBufferSize[50];
  125. DWORD AudioPageTable[50];
  126. DWORD SubPictureBufferSize[50];
  127. DWORD SubPicturePageTable[50];*/
  128. BOOLEAN bStreamNumberCouldBeChanged;
  129. WORD wCurrentStreamNumber;
  130. BOOLEAN bSwitchDecryptionOn;
  131. ZIVA_STATE zInitialState;
  132. PHW_STREAM_OBJECT pstroCC;
  133. DWORD gdwCount;
  134. BYTE *gbpCurData;
  135. BOOLEAN bHliPending;
  136. DWORD dwFirstVideoOrdNum;
  137. DWORD dwFirstAudioOrdNum;
  138. DWORD dwFirstSbpOrdNum;
  139. PHW_STREAM_OBJECT pstroAud;
  140. DWORD dwVSyncCount;
  141. LONG nApsMode;
  142. WORD VidSystem;
  143. ULONG ulLevel;
  144. BOOL fAtleastOne;
  145. DWORD dwPrevSTC;
  146. BOOL bTrickModeToPlay;
  147. STREAM_SYSTEM_TIME VideoSTC;
  148. ULONGLONG prevStrm;
  149. BOOL fFirstSTC;
  150. ULONG cCCRec, cCCDeq, cCCCB ,cCCQ;
  151. struct _HW_DEVICE_EXTENSION *pCCDevEx;
  152. PHW_STREAM_REQUEST_BLOCK pSrbQ;
  153. DWORD dwUserDataBuffer[ 160 ];
  154. DWORD dwUserDataSize;
  155. BOOL fReSync;
  156. BOOL bInitialized;
  157. } HW_DEVICE_EXTENSION, *PHW_DEVICE_EXTENSION;
  158. typedef struct _HW_STREAM_EXTENSION
  159. {
  160. KSSTATE ksState;
  161. BOOL bCanBeRun;
  162. BOOL bVideoEnabled;
  163. } HW_STREAM_EXTENSION, *PHW_STREAM_EXTENSION;
  164. BOOL _stdcall ZivaHw_Initialize( PHW_DEVICE_EXTENSION pHwDevExt );
  165. BOOL _stdcall ZivaHW_LoadUCode();
  166. BOOL _stdcall ZivaHw_Play();
  167. BOOL _stdcall ZivaHw_Scan();
  168. BOOL _stdcall ZivaHw_SlowMotion( WORD wRatio );
  169. BOOL _stdcall ZivaHw_Pause();
  170. BOOL ZivaHw_Reset();
  171. BOOL ZivaHw_Abort();
  172. ZIVA_STATE ZivaHw_GetState();
  173. BOOL ZivaHW_GetNotificationDirect( PINT_STATUS_INFO pInfo );
  174. BOOL ZivaHw_FlushBuffers( );
  175. void ZivaHW_ForceCodedAspectRatio(WORD wRatio);
  176. void ZivaHw_SetDisplayMode( WORD wDisplay, WORD wMode );
  177. void ZivaHw_SetVideoMode(PHW_DEVICE_EXTENSION pHwDevExt);
  178. BOOL ZivaHw_GetUserData(PHW_DEVICE_EXTENSION pHwDevExt);
  179. #endif // _ZIVAWDM_H_