Transferring Data From the Frame Buffer
The DVM_FRAME message lets an application obtain a single frame from the frame buffer.This message is the basis for the simplest form of video capture. Applications might use this to record animated sequences created frame-by-frame or to capture a single still image such as a photograph. The following sequence of operations occurs when a client-application requests the transfer of a single video frame:
- The client allocates the memory for the data buffer.
- The client sets a pointer to the empty data buffer in the VIDEOHDR data structure.
- The client sends the device driver a pointer to the VIDEOHDR data structure with the videoFrame function. (The destination channel must be a VIDEO_IN channel.)
- When the device driver receives the DVM_FRAME messages that Windows sends in response to videoFrame, it fills the data buffer with information from the frame buffer and updates the VIDEOHDR data structure. Note that the buffer might not have been prepared.
- When the device driver has filled a data buffer, it returns from the DVM_FRAME message. This returns control back to the client.
- After the client has finished with the data, it frees the memory used for the data.