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.

86 lines
3.1 KiB

  1. /****************************************************************************
  2. * @doc INTERNAL WDMDRIVER
  3. *
  4. * @module WDMDrivr.h | Include file for <c CWDMDriver> class used to
  5. * access the streaming class driver using IOctls.
  6. *
  7. * @comm This code is based on the VfW to WDM mapper code written by
  8. * FelixA and E-zu Wu. The original code can be found on
  9. * \\redrum\slmro\proj\wdm10\\src\image\vfw\win9x\raytube.
  10. *
  11. * Documentation by George Shaw on kernel streaming can be found in
  12. * \\popcorn\razzle1\src\spec\ks\ks.doc.
  13. *
  14. * WDM streaming capture is discussed by Jay Borseth in
  15. * \\blues\public\jaybo\WDMVCap.doc.
  16. ***************************************************************************/
  17. #ifndef _WDMDRVR_H // { _WDMDRVR_H
  18. #define _WDMDRVR_H
  19. // Used to query and set video data ranges of a device
  20. typedef struct _tagDataRanges {
  21. ULONG Size;
  22. ULONG Count;
  23. KS_DATARANGE_VIDEO Data;
  24. } DATA_RANGES, * PDATA_RANGES;
  25. // Used to query/set video property values and ranges
  26. typedef struct {
  27. KSPROPERTY_DESCRIPTION proDesc;
  28. KSPROPERTY_MEMBERSHEADER proHdr;
  29. union {
  30. KSPROPERTY_STEPPING_LONG proData;
  31. ULONG ulData;
  32. };
  33. } PROCAMP_MEMBERSLIST;
  34. /****************************************************************************
  35. * @doc INTERNAL CWDMDRIVERCLASS
  36. *
  37. * @class CWDMDriver | This class provides access to the streaming class
  38. * driver, through which we acess the video capture mini-driver properties
  39. * using IOCtls.
  40. *
  41. * @mdata DWORD | CWDMDriver | m_dwDeviceID | Capture device ID.
  42. *
  43. * @mdata HANDLE | CWDMDriver | m_hDriver | This member holds the driver
  44. * file handle.
  45. *
  46. * @mdata PDATA_RANGES | CWDMDriver | m_pDataRanges | This member points
  47. * to the video data range structure.
  48. ***************************************************************************/
  49. class CWDMDriver
  50. {
  51. public:
  52. CWDMDriver(DWORD dwDeviceID);
  53. ~CWDMDriver();
  54. // Property functions
  55. BOOL GetPropertyValue(GUID guidPropertySet, ULONG ulPropertyId, PLONG plValue, PULONG pulFlags, PULONG pulCapabilities);
  56. BOOL GetDefaultValue(GUID guidPropertySet, ULONG ulPropertyId, PLONG plDefValue);
  57. BOOL GetRangeValues(GUID guidPropertySet, ULONG ulPropertyId, PLONG plMin, PLONG plMax, PLONG plStep);
  58. BOOL SetPropertyValue(GUID guidPropertySet, ULONG ulPropertyId, LONG lValue, ULONG ulFlags, ULONG ulCapabilities);
  59. // Device functions
  60. BOOL OpenDriver();
  61. BOOL CloseDriver();
  62. HANDLE GetDriverHandle() { return m_hDriver; }
  63. // Data range functions
  64. PDATA_RANGES GetDriverSupportedDataRanges() { return m_pDataRanges; };
  65. // Device IO function
  66. BOOL DeviceIoControl(HANDLE h, DWORD dwIoControlCode, LPVOID lpInBuffer, DWORD nInBufferSize, LPVOID lpOutBuffer, DWORD nOutBufferSize, LPDWORD lpBytesReturned, BOOL bOverlapped=TRUE);
  67. private:
  68. DWORD m_dwDeviceID; // Capture device ID
  69. HANDLE m_hDriver; // Driver file handle
  70. PDATA_RANGES m_pDataRanges; // Pin data ranges
  71. // Data range functions
  72. ULONG CreateDriverSupportedDataRanges();
  73. };
  74. #endif // } _WDMDRVR_H