BOOLEAN
DrawFrameFunc(
PDEVICE_INFO pDevInfo,
PDRAWBUFFER pDraw
);
The DrawFrameFunc function copies bitmap data into the frame buffer. The function is provided by the kernel-mode driver, and the DrawFrameFunc name is a placeholder for a driver-specified function name.
Parameters
pDevInfo
Pointer to the DEVICE_INFO structure returned by VC_Init.
pDraw
Pointer to a DRAWBUFFER structure.
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 DrawFrameFunc function when the driver receives an IOCTL_VIDC_DRAW_FRAME control code. User-mode drivers using VCUser.lib send this control code by calling VC_DrawFrame.
The pDraw parameter points to a DRAWBUFFER structure describing the bitmap data to be copied into the frame buffer. The driver should read the structure's Format member to determine if the specified format is one that either the device accepts for playback, or that the driver can convert into one the device accepts. (You should use the driver's GetOverlayModeFunc function to indicate the supported formats.)
To protect the driver from access violations, you should place code that references the supplied bitmap in a routine that can be called by using VC_AccessData. To obtain the frame buffer's address, the driver should call VC_GetFrameBuffer.
The driver should read data from the bitmap, convert it if necessary, and place it in the frame buffer. Current settings for key color and overlay rectangle description should not be changed.
Support for a DrawFrameFunc function is required, if the device supports playback. 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 DrawFrameFunc function receives an IOCTL_VIDC_DRAW_FRAME control code, VCKernel.lib sets the Win32 error code value to STATUS_INVALID_DEVICE_REQUEST.
The sample kernel-mode driver, bravado.sys, supports video playback, but its companion user-mode driver, bravado.dll, does not. Instead, the msyuv.dll codec calls bravado.sys to play back YUV-formatted compressed data.