/usr/x86_64-w64-mingw32/include/usbcamdi.h is in mingw-w64-x86-64-dev 2.0.3-1.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 | /*
* usbcamdi.h
*
* USB Camera driver interface.
*
* This file is part of the ReactOS PSDK package.
*
* Contributors:
* Created by Casper S. Hornstrup <chorns@users.sourceforge.net>
*
* THIS SOFTWARE IS NOT COPYRIGHTED
*
* This source code is offered for use in the public domain. You may
* use, modify or distribute it freely.
*
* This code is distributed in the hope that it will be useful but
* WITHOUT ANY WARRANTY. ALL WARRANTIES, EXPRESS OR IMPLIED ARE HEREBY
* DISCLAIMED. This includes but is not limited to warranties of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
*
*/
#pragma once
#ifdef __cplusplus
extern "C" {
#endif
#if defined(_BATTERYCLASS_)
# define USBCAMAPI
#else
# define USBCAMAPI DECLSPEC_IMPORT
#endif
typedef struct _pipe_config_descriptor {
CHAR StreamAssociation;
UCHAR PipeConfigFlags;
} USBCAMD_Pipe_Config_Descriptor, *PUSBCAMD_Pipe_Config_Descriptor;
#define USBCAMD_DATA_PIPE 0x0001
#define USBCAMD_MULTIPLEX_PIPE 0x0002
#define USBCAMD_SYNC_PIPE 0x0004
#define USBCAMD_DONT_CARE_PIPE 0x0008
#define USBCAMD_VIDEO_STREAM 0x1
#define USBCAMD_STILL_STREAM 0x2
#define USBCAMD_VIDEO_STILL_STREAM (USBCAMD_VIDEO_STREAM | USBCAMD_STILL_STREAM)
#define USBCAMD_PROCESSPACKETEX_DropFrame 0x0002
#define USBCAMD_PROCESSPACKETEX_NextFrameIsStill 0x0004
#define USBCAMD_PROCESSPACKETEX_CurrentFrameIsStill 0x0008
#define USBCAMD_STOP_STREAM 0x00000001
#define USBCAMD_START_STREAM 0x00000000
typedef enum {
USBCAMD_CamControlFlag_NoVideoRawProcessing = 1,
USBCAMD_CamControlFlag_NoStillRawProcessing = 2,
USBCAMD_CamControlFlag_AssociatedFormat = 4,
USBCAMD_CamControlFlag_EnableDeviceEvents = 8
} USBCAMD_CamControlFlags;
typedef NTSTATUS
(NTAPI *PCOMMAND_COMPLETE_FUNCTION)(
PVOID DeviceContext,
PVOID CommandContext,
NTSTATUS NtStatus);
typedef VOID
(NTAPI *PSTREAM_RECEIVE_PACKET)(
PVOID Srb,
PVOID DeviceContext,
PBOOLEAN Completed);
typedef NTSTATUS
(NTAPI *PCAM_INITIALIZE_ROUTINE)(
PDEVICE_OBJECT BusDeviceObject,
PVOID DeviceContext);
typedef NTSTATUS
(NTAPI *PCAM_CONFIGURE_ROUTINE)(
PDEVICE_OBJECT BusDeviceObject,
PVOID DeviceContext,
PUSBD_INTERFACE_INFORMATION Interface,
PUSB_CONFIGURATION_DESCRIPTOR ConfigurationDescriptor,
PLONG DataPipeIndex,
PLONG SyncPipeIndex);
typedef NTSTATUS
(NTAPI *PCAM_CONFIGURE_ROUTINE_EX)(
PDEVICE_OBJECT BusDeviceObject,
PVOID DeviceContext,
PUSBD_INTERFACE_INFORMATION Interface,
PUSB_CONFIGURATION_DESCRIPTOR ConfigurationDescriptor,
ULONG PipeConfigListSize,
PUSBCAMD_Pipe_Config_Descriptor PipeConfig,
PUSB_DEVICE_DESCRIPTOR DeviceDescriptor);
typedef NTSTATUS
(NTAPI *PCAM_START_CAPTURE_ROUTINE)(
PDEVICE_OBJECT BusDeviceObject,
PVOID DeviceContext);
typedef NTSTATUS
(NTAPI *PCAM_START_CAPTURE_ROUTINE_EX)(
PDEVICE_OBJECT BusDeviceObject,
PVOID DeviceContext,
ULONG StreamNumber);
typedef NTSTATUS
(NTAPI *PCAM_ALLOCATE_BW_ROUTINE)(
PDEVICE_OBJECT BusDeviceObject,
PVOID DeviceContext,
PULONG RawFrameLength,
PVOID Format);
typedef NTSTATUS
(NTAPI *PCAM_ALLOCATE_BW_ROUTINE_EX)(
PDEVICE_OBJECT BusDeviceObject,
PVOID DeviceContext,
PULONG RawFrameLength,
PVOID Format,
ULONG StreamNumber);
typedef NTSTATUS
(NTAPI *PCAM_FREE_BW_ROUTINE)(
PDEVICE_OBJECT BusDeviceObject,
PVOID DeviceContext);
typedef NTSTATUS
(NTAPI *PCAM_FREE_BW_ROUTINE_EX)(
PDEVICE_OBJECT BusDeviceObject,
PVOID DeviceContext,
ULONG StreamNumber);
typedef VOID
(NTAPI *PADAPTER_RECEIVE_PACKET_ROUTINE)(
PHW_STREAM_REQUEST_BLOCK Srb);
typedef NTSTATUS
(NTAPI *PCAM_STOP_CAPTURE_ROUTINE)(
PDEVICE_OBJECT BusDeviceObject,
PVOID DeviceContext);
typedef NTSTATUS
(NTAPI *PCAM_STOP_CAPTURE_ROUTINE_EX)(
PDEVICE_OBJECT BusDeviceObject,
PVOID DeviceContext,
ULONG StreamNumber);
typedef ULONG
(NTAPI *PCAM_PROCESS_PACKET_ROUTINE)(
PDEVICE_OBJECT BusDeviceObject,
PVOID DeviceContext,
PVOID CurrentFrameContext,
PUSBD_ISO_PACKET_DESCRIPTOR SyncPacket,
PVOID SyncBuffer,
PUSBD_ISO_PACKET_DESCRIPTOR DataPacket,
PVOID DataBuffer,
PBOOLEAN FrameComplete,
PBOOLEAN NextFrameIsStill);
typedef ULONG
(NTAPI *PCAM_PROCESS_PACKET_ROUTINE_EX)(
PDEVICE_OBJECT BusDeviceObject,
PVOID DeviceContext,
PVOID CurrentFrameContext,
PUSBD_ISO_PACKET_DESCRIPTOR SyncPacket,
PVOID SyncBuffer,
PUSBD_ISO_PACKET_DESCRIPTOR DataPacket,
PVOID DataBuffer,
PBOOLEAN FrameComplete,
PULONG PacketFlag,
PULONG ValidDataOffset);
typedef VOID
(NTAPI *PCAM_NEW_FRAME_ROUTINE)(
PVOID DeviceContext,
PVOID FrameContext);
typedef VOID
(NTAPI *PCAM_NEW_FRAME_ROUTINE_EX)(
PVOID DeviceContext,
PVOID FrameContext,
ULONG StreamNumber,
PULONG FrameLength);
typedef NTSTATUS
(NTAPI *PCAM_PROCESS_RAW_FRAME_ROUTINE)(
PDEVICE_OBJECT BusDeviceObject,
PVOID DeviceContext,
PVOID FrameContext,
PVOID FrameBuffer,
ULONG FrameLength,
PVOID RawFrameBuffer,
ULONG RawFrameLength,
ULONG NumberOfPackets,
PULONG BytesReturned);
typedef NTSTATUS
(NTAPI *PCAM_PROCESS_RAW_FRAME_ROUTINE_EX)(
PDEVICE_OBJECT BusDeviceObject,
PVOID DeviceContext,
PVOID FrameContext,
PVOID FrameBuffer,
ULONG FrameLength,
PVOID RawFrameBuffer,
ULONG RawFrameLength,
ULONG NumberOfPackets,
PULONG BytesReturned,
ULONG ActualRawFrameLength,
ULONG StreamNumber);
typedef NTSTATUS
(NTAPI *PCAM_STATE_ROUTINE)(
PDEVICE_OBJECT BusDeviceObject,
PVOID DeviceContext);
#if defined(DEBUG_LOG)
USBCAMAPI
VOID
NTAPI
USBCAMD_Debug_LogEntry(
CHAR *Name,
ULONG Info1,
ULONG Info2,
ULONG Info3);
#define ILOGENTRY(sig, info1, info2, info3) \
USBCAMD_Debug_LogEntry(sig, (ULONG)info1, (ULONG)info2, (ULONG)info3)
#else
#define ILOGENTRY(sig, info1, info2, info3)
#endif /* DEBUG_LOG */
typedef struct _USBCAMD_DEVICE_DATA {
ULONG Sig;
PCAM_INITIALIZE_ROUTINE CamInitialize;
PCAM_INITIALIZE_ROUTINE CamUnInitialize;
PCAM_PROCESS_PACKET_ROUTINE CamProcessUSBPacket;
PCAM_NEW_FRAME_ROUTINE CamNewVideoFrame;
PCAM_PROCESS_RAW_FRAME_ROUTINE CamProcessRawVideoFrame;
PCAM_START_CAPTURE_ROUTINE CamStartCapture;
PCAM_STOP_CAPTURE_ROUTINE CamStopCapture;
PCAM_CONFIGURE_ROUTINE CamConfigure;
PCAM_STATE_ROUTINE CamSaveState;
PCAM_STATE_ROUTINE CamRestoreState;
PCAM_ALLOCATE_BW_ROUTINE CamAllocateBandwidth;
PCAM_FREE_BW_ROUTINE CamFreeBandwidth;
} USBCAMD_DEVICE_DATA, *PUSBCAMD_DEVICE_DATA;
typedef struct _USBCAMD_DEVICE_DATA2 {
ULONG Sig;
PCAM_INITIALIZE_ROUTINE CamInitialize;
PCAM_INITIALIZE_ROUTINE CamUnInitialize;
PCAM_PROCESS_PACKET_ROUTINE_EX CamProcessUSBPacketEx;
PCAM_NEW_FRAME_ROUTINE_EX CamNewVideoFrameEx;
PCAM_PROCESS_RAW_FRAME_ROUTINE_EX CamProcessRawVideoFrameEx;
PCAM_START_CAPTURE_ROUTINE_EX CamStartCaptureEx;
PCAM_STOP_CAPTURE_ROUTINE_EX CamStopCaptureEx;
PCAM_CONFIGURE_ROUTINE_EX CamConfigureEx;
PCAM_STATE_ROUTINE CamSaveState;
PCAM_STATE_ROUTINE CamRestoreState;
PCAM_ALLOCATE_BW_ROUTINE_EX CamAllocateBandwidthEx;
PCAM_FREE_BW_ROUTINE_EX CamFreeBandwidthEx;
} USBCAMD_DEVICE_DATA2, *PUSBCAMD_DEVICE_DATA2;
DEFINE_GUID(GUID_USBCAMD_INTERFACE,
0x2bcb75c0, 0xb27f, 0x11d1, 0xba, 0x41, 0x0, 0xa0, 0xc9, 0xd, 0x2b, 0x5);
typedef NTSTATUS
(NTAPI *PFNUSBCAMD_SetVideoFormat)(
PVOID DeviceContext,
PHW_STREAM_REQUEST_BLOCK pSrb);
typedef NTSTATUS
(NTAPI *PFNUSBCAMD_WaitOnDeviceEvent)(
PVOID DeviceContext,
ULONG PipeIndex,
PVOID Buffer,
ULONG BufferLength,
PCOMMAND_COMPLETE_FUNCTION EventComplete,
PVOID EventContext,
BOOLEAN LoopBack);
typedef NTSTATUS
(NTAPI *PFNUSBCAMD_CancelBulkReadWrite)(
PVOID DeviceContext,
ULONG PipeIndex);
typedef NTSTATUS
(NTAPI *PFNUSBCAMD_SetIsoPipeState)(
PVOID DeviceContext,
ULONG PipeStateFlags);
typedef NTSTATUS
(NTAPI *PFNUSBCAMD_BulkReadWrite)(
PVOID DeviceContext,
USHORT PipeIndex,
PVOID Buffer,
ULONG BufferLength,
PCOMMAND_COMPLETE_FUNCTION CommandComplete,
PVOID CommandContext);
#define USBCAMD_VERSION_200 0x200
typedef struct _USBCAMD_INTERFACE {
INTERFACE Interface;
PFNUSBCAMD_WaitOnDeviceEvent USBCAMD_WaitOnDeviceEvent;
PFNUSBCAMD_BulkReadWrite USBCAMD_BulkReadWrite;
PFNUSBCAMD_SetVideoFormat USBCAMD_SetVideoFormat;
PFNUSBCAMD_SetIsoPipeState USBCAMD_SetIsoPipeState;
PFNUSBCAMD_CancelBulkReadWrite USBCAMD_CancelBulkReadWrite;
} USBCAMD_INTERFACE, *PUSBCAMD_INTERFACE;
/* FIXME : Do we need USBCAMAPI here ? */
USBCAMAPI
ULONG
NTAPI
USBCAMD_DriverEntry(
PVOID Context1,
PVOID Context2,
ULONG DeviceContextSize,
ULONG FrameContextSize,
PADAPTER_RECEIVE_PACKET_ROUTINE ReceivePacket);
USBCAMAPI
PVOID
NTAPI
USBCAMD_AdapterReceivePacket(
PHW_STREAM_REQUEST_BLOCK Srb,
PUSBCAMD_DEVICE_DATA DeviceData,
PDEVICE_OBJECT *DeviceObject,
BOOLEAN NeedsCompletion);
USBCAMAPI
NTSTATUS
NTAPI
USBCAMD_ControlVendorCommand(
PVOID DeviceContext,
UCHAR Request,
USHORT Value,
USHORT Index,
PVOID Buffer,
PULONG BufferLength,
BOOLEAN GetData,
PCOMMAND_COMPLETE_FUNCTION CommandComplete,
PVOID CommandContext);
USBCAMAPI
NTSTATUS
NTAPI
USBCAMD_SelectAlternateInterface(
PVOID DeviceContext,
PUSBD_INTERFACE_INFORMATION RequestInterface);
USBCAMAPI
NTSTATUS
NTAPI
USBCAMD_GetRegistryKeyValue(
HANDLE Handle,
PWCHAR KeyNameString,
ULONG KeyNameStringLength,
PVOID Data,
ULONG DataLength);
USBCAMAPI
ULONG
NTAPI
USBCAMD_InitializeNewInterface(
PVOID DeviceContext,
PVOID DeviceData,
ULONG Version,
ULONG CamControlFlag);
#ifdef __cplusplus
}
#endif
#endif /* !defined(__USB_H) && !defined(__USBDI_H) */
|