VC_StreamInit

BOOL
VC_StreamInit(
VCUSER_HANDLE
vh,
PVCCALLBACK
pCallback,
ULONG
FrameRate
);

The VC_StreamInit function initializes a video capture stream.

Parameters

vh

Handle to the kernel-mode driver, obtained from VC_OpenDevice.

pCallback

Pointer to a client notification target (callback function or window handle) received as input with a DVM_STREAM_INIT message.

FrameRate

Capture rate (microseconds per frame) received as input with a DVM_STREAM_INIT message.

Return Value

Returns TRUE if the operation succeeds. Otherwise returns FALSE.

Comments

A user-mode video capture driver using VCUser.lib should call VC_StreamInit when its DriverProc function receives a DVM_STREAM_INIT message.

This function performs the following operations:

·Stores the pCallback value for use when notifying the client. For more information about notifying clients, see Notifying Clients from Video Capture Drivers.

·Creates a separate user-mode worker thread to handle stream operations.

The VC_StreamInit function calls DeviceIoControl (described in the Win32 SDK) to send an IOCTL_VIDC_STREAM_INIT control code to the specified kernel-mode driver. When a kernel-mode driver using VCKernel.lib receives this control code, its StreamInitFunc function is called. The FrameRate value is passed to the kernel-mode driver along with the IOCTL_VIDC_STREAM_INIT message.

When the initialization operation is complete, the worker thread sends the client an MM_DRVM_OPEN callback message.