StreamStartFunc

BOOLEAN
StreamStartFunc(
PDEVICE_INFO
pDevInfo
);

The StreamStartFunc function starts capturing frames for a capture stream. The function is provided by the kernel-mode driver, and the StreamStartFunc name is a placeholder for a driver-specified function name.

Parameters

pDevInfo

Pointer to the DEVICE_INFO structure returned by VC_Init.

Return Value

Returns TRUE if the operation succeeds. Otherwise returns FALSE. If FALSE, VCKernel.lib sets the Win32 error code value to STATUS_DRIVER_INTERNAL_ERROR.

Comments

The VCKernel.lib library calls a kernel-mode driver's StreamStartFunc function when the driver receives an IOCTL_VIDC_STREAM_START control code. User-mode drivers using VCUser.lib send this control code by calling VC_StreamStart. You can assume VCKernel.lib will not call the StreamStartFunc function unless the driver's StreamInitFunc function has been previously called.

The driver's StreamStartFunc function must reset the stream position to zero milliseconds. The function must also enable interrupts. Once interrupts are enabled, the following events occur:

·When the device interrupts, VCKernel.lib's generic ISR is called, which in turn calls the driver's InterruptAcknowledge function. If, based on the client-specified frame rate, it is time to capture a frame, then VCKernel.lib's generic DPC function is queued.

·The I/O manager calls the generic DPC function, which dequeues one of the IRPs that was queued when the user-mode driver called VC_StreamAddBuffer. Then the generic DPC function calls the driver's CaptureService function, passing the buffer address.

·After the CaptureService function returns, VCKernel.lib's generic DPC function calls IoCompleteRequest to return the buffer's IRP to the user-mode driver.

Support for a StreamStartFunc function is required, if the device and driver support capture streams. If a driver does support the function, it must place its address in the VC_CALLBACK structure supplied by VCKernel.lib. If a driver that does not provide a StreamStartFunc function receives an IOCTL_VIDC_STREAM_START control code, VCKernel.lib sets the Win32 error code value to STATUS_INVALID_DEVICE_REQUEST.