Leaked source code of windows server 2003
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.

234 lines
8.1 KiB

  1. // $Header: G:/SwDev/WDM/Video/bt848/rcs/Capmain.h 1.9 1998/05/11 23:59:56 tomz Exp $
  2. //==========================================================================;
  3. //
  4. // THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY
  5. // KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE
  6. // IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR
  7. // PURPOSE.
  8. //
  9. // Copyright (c) 1992 - 1996 Microsoft Corporation. All Rights Reserved.
  10. //
  11. //==========================================================================;
  12. #ifndef __CAPMAIN_H__
  13. #define __CAPMAIN_H__
  14. #ifdef __cplusplus
  15. extern "C" {
  16. #endif // __cplusplus
  17. #include "device.h"
  18. // adapted from ksmedia.h
  19. #define KS_SIZE_PREHEADER2 (FIELD_OFFSET(KS_VIDEOINFOHEADER2,bmiHeader))
  20. #define KS_SIZE_VIDEOHEADER2(pbmi) ((pbmi)->bmiHeader.biSize + KS_SIZE_PREHEADER2)
  21. /*****************************************************************************
  22. *
  23. * The following structures are samples of information that could be used in
  24. * a device extension structure
  25. *
  26. *****************************************************************************/
  27. //
  28. // definition of the full HW device extension structure This is the structure
  29. // that will be allocated in HW_INITIALIZATION by the stream class driver
  30. // Any information that is used in processing a device request (as opposed to
  31. // a STREAM based request) should be in this structure. A pointer to this
  32. // structure will be passed in all requests to the minidriver. (See
  33. // HW_STREAM_REQUEST_BLOCK in STRMINI.H)
  34. //
  35. typedef struct _HW_DEVICE_EXTENSION {
  36. PsDevice *psdevice;
  37. //PULONG ioBaseLocal; // board base address
  38. //USHORT Irq; // irq level
  39. //PHW_STREAM_REQUEST_BLOCK pCurSrb; // current device request in progress
  40. // The following will be the memory where we store or PsDevice class instance
  41. // This must be last
  42. DWORD psdevicemem[1];
  43. } HW_DEVICE_EXTENSION, *PHW_DEVICE_EXTENSION;
  44. //
  45. // this structure is our per stream extension structure. This stores
  46. // information that is relevant on a per stream basis. Whenever a new stream
  47. // is opened, the stream class driver will allocate whatever extension size
  48. // is specified in the HwInitData.PerStreamExtensionSize.
  49. //
  50. typedef union {
  51. KS_FRAME_INFO VideoFrameInfo;
  52. KS_VBI_FRAME_INFO VbiFrameInfo;
  53. } ALL_FRAME_INFO;
  54. typedef struct _STREAMEX {
  55. PVOID videochannel;
  56. ALL_FRAME_INFO FrameInfo;
  57. ULONG StreamNumber;
  58. //KS_VIDEOINFOHEADER *pVideoInfoHeader; // format (variable size!)
  59. //KSSTATE KSState; // Run, Stop, Pause
  60. //BOOLEAN fStreamOpen; // TRUE if stream is open
  61. //STREAM_SYSTEM_TIME videoSTC; // current video presentation time
  62. //PHW_STREAM_REQUEST_BLOCK pCurrentSRB; // video request in progress
  63. //PVOID pDMABuf; // pointer to the video DMA buffer
  64. //STREAM_PHYSICAL_ADDRESS pPhysDmaBuf; // physical address of DMA buffer
  65. //ULONG cDmaBuf; // size of DMA buffer
  66. //KSSTATE DeviceState; // current device state
  67. //BOOLEAN IRQExpected; // IRQ expected
  68. // The following will be the memory where we store or PsDevice class instance
  69. // This must be last
  70. DWORD videochannelmem[1];
  71. } STREAMEX, *PSTREAMEX;
  72. //
  73. // this structure defines the per request extension. It defines any storage
  74. // space that the min driver may need in each request packet.
  75. //
  76. typedef struct _SRB_EXTENSION {
  77. LIST_ENTRY ListEntry;
  78. PHW_STREAM_REQUEST_BLOCK pSrb;
  79. HANDLE hUserSurfaceHandle; // DDraw
  80. HANDLE hKernelSurfaceHandle; // DDraw
  81. } SRB_EXTENSION, * PSRB_EXTENSION;
  82. /*****************************************************************************
  83. *
  84. * the following section defines prototypes for the minidriver initialization
  85. * routines
  86. *
  87. ******************************************************************************/
  88. //
  89. // DriverEntry:
  90. //
  91. // This routine is called when the mini driver is first loaded. The driver
  92. // should then call the StreamClassRegisterAdapter function to register with
  93. // the stream class driver
  94. //
  95. ULONG DriverEntry (PVOID Context1, PVOID Context2);
  96. //
  97. // This routine is called by the stream class driver with configuration
  98. // information for an adapter that the mini driver should load on. The mini
  99. // driver should still perform a small verification to determine that the
  100. // adapter is present at the specified addresses, but should not attempt to
  101. // find an adapter as it would have with previous NT miniports.
  102. //
  103. // All initialization of the adapter should also be performed at this time.
  104. //
  105. BOOLEAN HwInitialize (IN OUT PHW_STREAM_REQUEST_BLOCK pSrb);
  106. //
  107. // This routine is called when the system is going to remove or disable the
  108. // device.
  109. //
  110. // The mini-driver should free any system resources that it allocated at this
  111. // time. Note that system resources allocated for the mini-driver by the
  112. // stream class driver will be free'd by the stream driver, and should not be
  113. // free'd in this routine. (Such as the HW_DEVICE_EXTENSION)
  114. //
  115. BOOLEAN HwUnInitialize ( IN PVOID DeviceExtension);
  116. BOOLEAN HwQueryUnload ( IN PVOID DeviceExtension);
  117. //
  118. // This is the prototype for the Hardware Interrupt Handler. This routine
  119. // will be called whenever the minidriver receives an interrupt
  120. //
  121. BOOLEAN HwInterrupt ( IN PHW_DEVICE_EXTENSION pDeviceExtension );
  122. //
  123. // This is the prototype for the stream enumeration function. This routine
  124. // provides the stream class driver with the information on data stream types
  125. // supported
  126. //
  127. VOID AdapterStreamInfo(PHW_STREAM_REQUEST_BLOCK pSrb);
  128. //
  129. // This is the prototype for the stream open function
  130. //
  131. VOID AdapterOpenStream(PHW_STREAM_REQUEST_BLOCK pSrb);
  132. //
  133. // This is the prototype for the stream close function
  134. //
  135. VOID AdapterCloseStream(PHW_STREAM_REQUEST_BLOCK pSrb);
  136. //
  137. // This is the prototype for the AdapterReceivePacket routine. This is the
  138. // entry point for command packets that are sent to the adapter (not to a
  139. // specific open stream)
  140. //
  141. VOID STREAMAPI AdapterReceivePacket(IN PHW_STREAM_REQUEST_BLOCK Srb);
  142. //
  143. // This is the protoype for the cancel packet routine. This routine enables
  144. // the stream class driver to cancel an outstanding packet.
  145. //
  146. VOID STREAMAPI AdapterCancelPacket(IN PHW_STREAM_REQUEST_BLOCK Srb);
  147. //
  148. // This is the packet timeout function. The adapter may choose to ignore a
  149. // packet timeout, or rest the adapter and cancel the requests, as required.
  150. //
  151. VOID STREAMAPI AdapterTimeoutPacket(IN PHW_STREAM_REQUEST_BLOCK Srb);
  152. //
  153. // prototypes for data handling routines
  154. //
  155. VOID STREAMAPI VideoReceiveDataPacket(IN PHW_STREAM_REQUEST_BLOCK pSrb);
  156. VOID STREAMAPI VideoReceiveCtrlPacket(IN PHW_STREAM_REQUEST_BLOCK pSrb);
  157. VOID STREAMAPI AnalogReceiveDataPacket(IN PHW_STREAM_REQUEST_BLOCK pSrb);
  158. VOID STREAMAPI AnalogReceiveCtrlPacket(IN PHW_STREAM_REQUEST_BLOCK pSrb);
  159. void EnableIRQ(PHW_STREAM_OBJECT pstrm);
  160. void DisableIRQ(PHW_STREAM_OBJECT pstrm);
  161. //
  162. // prototypes for properties and states
  163. //
  164. //VOID SetVideoState(PHW_STREAM_REQUEST_BLOCK pSrb);
  165. void GetVidLvl(PHW_STREAM_REQUEST_BLOCK pSrb);
  166. VOID GetVideoProperty(PHW_STREAM_REQUEST_BLOCK pSrb);
  167. #ifdef ENABLE_DDRAW_STUFF
  168. DWORD FAR PASCAL DirectDrawEventCallback( DWORD, PVOID, DWORD, DWORD );
  169. BOOL RegisterForDirectDrawEvents( PHW_STREAM_REQUEST_BLOCK );
  170. BOOL UnregisterForDirectDrawEvents( PHW_STREAM_REQUEST_BLOCK );
  171. BOOL OpenKernelDirectDraw( PHW_STREAM_REQUEST_BLOCK );
  172. BOOL CloseKernelDirectDraw( PHW_STREAM_REQUEST_BLOCK );
  173. BOOL IsKernelLockAndFlipAvailable( PHW_STREAM_REQUEST_BLOCK );
  174. BOOL OpenKernelDDrawSurfaceHandle( IN PHW_STREAM_REQUEST_BLOCK );
  175. BOOL CloseKernelDDrawSurfaceHandle( IN PHW_STREAM_REQUEST_BLOCK );
  176. BOOL FlipOverlay( HANDLE, HANDLE, HANDLE );
  177. #endif
  178. #ifdef __cplusplus
  179. }
  180. #endif // __cplusplus
  181. #endif //__CAPMAIN_H__