Bewerken

Delen via


PCAM_PROCESS_PACKET_ROUTINE callback function (usbcamdi.h)

[CamProcessUSBPacket is not supported and may be altered or unavailable in the future. Instead, use CamProcessUSBPacketEx. ]

A camera minidriver's CamProcessUSBPacket callback function processes a USB packet.

Syntax

PCAM_PROCESS_PACKET_ROUTINE PcamProcessPacketRoutine;

ULONG PcamProcessPacketRoutine(
  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
)
{...}

Parameters

BusDeviceObject

Pointer to the camera minidriver's device object created by the USB hub.

DeviceContext

Pointer to the camera minidriver's device context.

CurrentFrameContext

Pointer to the minidriver's frame context.

SyncPacket

Pointer to a USBD_ISO_PACKET_DESCRIPTOR structure from the sync pipe. This value is NULL if the interface has only one pipe.

SyncBuffer

Pointer to the data for the SyncPacket.

DataPacket

Pointer to a USBD_ISO_PACKET_DESCRIPTOR structure from the data pipe.

DataBuffer

Pointer to DataPacket.

FrameComplete

Pointer to a BOOLEAN value that the camera minidriver sets to indicate whether this is the first data packet for a new video frame. Set to TRUE if this is the first data packet for a new video frame.

NextFrameIsStill

Pointer to a BOOLEAN value that the camera minidriver sets to indicate whether the next frame is a still frame or not. This value should be set to FALSE if the video stream is providing a live image or TRUE if the next frame is a still image or an image capture stream.

Return value

This callback function returns a ULONG that indicates the number of bytes that should be copied into the buffer (RawFrameBuffer or FrameBuffer).

Remarks

Camera minidrivers that must maintain backward compatibility with the original USBCAMD must use the USBCAMD_DEVICE_DATA structure and its associated callback functions (that is, callback functions that do not contain the "Ex" suffix).

The minidriver should complete this function as quickly as possible. Image processing should be deferred to the CamProcessRawVideoFrame function.

This function is optional.

Requirements

Requirement Value
Target Platform Desktop
Header usbcamdi.h (include Usbcamdi.h)
IRQL DISPATCH_LEVEL

See also

CamProcessRawVideoFrame

CamProcessUSBPacketEx

USBD_ISO_PACKET_DESCRIPTOR