Application developers sometimes need to transfer single frames of video information. For instance, a developer might want to record animated sequences that are generated one frame at a time, or to display a single image, such as a photograph.
Clients can transfer single frames of video information by sending the DVM_FRAME message, along with the address of a VIDEOHDR structure. Clients specify the VIDEO_IN channel to obtain a frame from the device’s frame buffer, or the VIDEO_OUT channel to send a frame to the frame buffer.
If the channel is VIDEO_IN, the client includes the address of an empty data buffer. By calling the kernel-mode driver, the user-mode driver transfers the contents of the device’s frame buffer into the data buffer. If the channel is VIDEO_OUT, the client includes the address of a filled data buffer. The user-mode driver sends the data buffer’s contents to the kernel-mode driver, which in turn transfers the contents to the device’s frame buffer. The sample video capture drivers support single frame transfers only on the VIDEO_IN channel.
When handling single-frame transfers, drivers must take into account current settings for video format, source or destination rectangles, and color palettes.