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.

127 lines
4.5 KiB

  1. // DCAP.H
  2. //
  3. // Created 31-Jul-96 [JonT]
  4. #ifndef _DCAP_H
  5. #define _DCAP_H
  6. #pragma pack(1) /* Assume byte packing throughout */
  7. #ifdef __cplusplus
  8. extern "C" { /* Assume C declarations for C++ */
  9. #endif /* __cplusplus */
  10. // API defines. These allow optimized DLL import code generation
  11. #ifdef __DCAP_BUILD__
  12. #define DCAPI WINAPI
  13. #else
  14. #define DCAPI __declspec(dllimport) __stdcall
  15. #endif
  16. // Equates
  17. #define MAX_CAPDEV_NAME MAX_PATH
  18. #define MAX_CAPDEV_DESCRIPTION MAX_PATH
  19. #define MAX_CAPDEV_VERSION 80
  20. #define MIN_STREAMING_CAPTURE_BUFFERS 2
  21. // Equates for "InitializeStreaming" flags
  22. #define STREAMING_PREFER_STREAMING 0x0
  23. #define STREAMING_PREFER_FRAME_GRAB 0x1
  24. // CaptureDeviceDialog flags
  25. #define CAPDEV_DIALOG_QUERY 1 // Queries if the dialog exists
  26. #define CAPDEV_DIALOG_IMAGE 0 // (default and mutually exclusive with
  27. #define CAPDEV_DIALOG_SOURCE 2 // CAPDEV_DIALOG_SOURCE)
  28. // Errors
  29. #define DCAP_ERRORBIT 0x20000000
  30. #define ERROR_DCAP_DEVICE_IN_USE (DCAP_ERRORBIT | 0x0001)
  31. #define ERROR_DCAP_BAD_INSTALL (DCAP_ERRORBIT | 0x0002)
  32. #define ERROR_DCAP_NONSPECIFIC (DCAP_ERRORBIT | 0x0003)
  33. #define ERROR_DCAP_NO_DRIVER_SUPPORT (DCAP_ERRORBIT | 0x0004)
  34. #define ERROR_DCAP_NOT_WHILE_STREAMING (DCAP_ERRORBIT | 0x0005)
  35. #define ERROR_DCAP_FORMAT_NOT_SUPPORTED (DCAP_ERRORBIT | 0x0006)
  36. #define ERROR_DCAP_BAD_FRAMERATE (DCAP_ERRORBIT | 0x0007)
  37. #define ERROR_DCAP_BAD_PARAM (DCAP_ERRORBIT | 0x0008)
  38. #define ERROR_DCAP_DIALOG_FORMAT (DCAP_ERRORBIT | 0x0009) // can't reset format changes caused by dialog
  39. #define ERROR_DCAP_DIALOG_STREAM (DCAP_ERRORBIT | 0x000A) // can't re-establish stream after dialog
  40. // Structures
  41. #ifndef __DCAP_BUILD__
  42. typedef HANDLE HCAPDEV;
  43. typedef HANDLE HFRAMEBUF;
  44. #endif
  45. typedef struct _FINDCAPTUREDEVICE
  46. {
  47. DWORD dwSize;
  48. int nDeviceIndex;
  49. char szDeviceName[MAX_CAPDEV_NAME];
  50. char szDeviceDescription[MAX_CAPDEV_DESCRIPTION];
  51. char szDeviceVersion[MAX_CAPDEV_VERSION];
  52. } FINDCAPTUREDEVICE;
  53. typedef struct _CAPSTREAM
  54. {
  55. DWORD dwSize;
  56. int nFPSx100;
  57. int ncCapBuffers;
  58. HANDLE hevWait;
  59. } CAPSTREAM;
  60. typedef struct _CAPTUREPALETTE
  61. {
  62. WORD wVersion;
  63. WORD wcEntries;
  64. PALETTEENTRY pe[256];
  65. } CAPTUREPALETTE, FAR* LPCAPTUREPALETTE;
  66. typedef struct _CAPFRAMEINFO
  67. {
  68. LPSTR lpData;
  69. DWORD dwcbData;
  70. DWORD dwTimestamp;
  71. DWORD dwFlags;
  72. } CAPFRAMEINFO;
  73. // Prototypes
  74. int DCAPI GetNumCaptureDevices();
  75. BOOL DCAPI FindFirstCaptureDevice(IN OUT FINDCAPTUREDEVICE* lpfcd, char* szDeviceDescription);
  76. BOOL DCAPI FindFirstCaptureDeviceByIndex(IN OUT FINDCAPTUREDEVICE* lpfcd, int nDeviceIndex);
  77. BOOL DCAPI FindNextCaptureDevice(IN OUT FINDCAPTUREDEVICE* lpfcd);
  78. HCAPDEV DCAPI OpenCaptureDevice(int nDeviceIndex);
  79. BOOL DCAPI CloseCaptureDevice(HCAPDEV hcd);
  80. DWORD DCAPI GetCaptureDeviceFormatHeaderSize(HCAPDEV hcd);
  81. BOOL DCAPI GetCaptureDeviceFormat(HCAPDEV hcd, OUT LPBITMAPINFOHEADER lpbmih);
  82. BOOL DCAPI SetCaptureDeviceFormat(HCAPDEV hcd, IN LPBITMAPINFOHEADER lpbmih,
  83. IN LONG srcwidth, IN LONG srcheight);
  84. BOOL DCAPI GetCaptureDevicePalette(HCAPDEV hcd, OUT CAPTUREPALETTE* lpcp);
  85. BOOL DCAPI InitializeStreaming(HCAPDEV hcd, IN OUT CAPSTREAM* lpcs, IN DWORD flags);
  86. BOOL DCAPI SetStreamFrameRate(HCAPDEV hcd, IN int nFPSx100);
  87. BOOL DCAPI UninitializeStreaming(HCAPDEV hcd);
  88. BOOL DCAPI StartStreaming(HCAPDEV hcd);
  89. BOOL DCAPI StopStreaming(HCAPDEV hcd);
  90. LPSTR DCAPI GetNextReadyBuffer(HCAPDEV hcd, OUT CAPFRAMEINFO* lpcfi);
  91. BOOL DCAPI PutBufferIntoStream(HCAPDEV hcd, IN BYTE* lpBits);
  92. BOOL DCAPI CaptureDeviceDialog(HCAPDEV hcd, HWND hwndParent, DWORD dwFlags,
  93. IN LPBITMAPINFOHEADER lpbmih);
  94. LPBYTE DCAPI CaptureFrame(HCAPDEV hcd, IN HFRAMEBUF hbuf);
  95. HFRAMEBUF DCAPI AllocFrameBuffer(HCAPDEV hcd);
  96. VOID DCAPI FreeFrameBuffer(HCAPDEV hcd, IN HFRAMEBUF hbuf);
  97. LPBYTE DCAPI GetFrameBufferPtr(HCAPDEV hcd, IN HFRAMEBUF hbuf);
  98. DWORD DCAPI DCAPGetThreadExecutionTimeService(HANDLE R0ThreadID );
  99. HANDLE DCAPI DCAPGetR0ThreadHandle(void);
  100. #ifdef __cplusplus
  101. } /* End of extern "C" { */
  102. #endif /* __cplusplus */
  103. #pragma pack() /* Revert to default packing */
  104. #endif // #ifndef _DCAP_H