DVM_STREAM_ADDBUFFER

The DVM_STREAM_ADDBUFFER message requests a user-mode video capture driver to add an empty input buffer to its input buffer queue.

Parameters

dwDriverID

Video channel identifier. For this message, the driver should only accept VIDEO_IN. (For details, see Opening Video Channels.)

hDriver

Driver handle.

uMsg

DVM_STREAM_ADDBUFFER

lParam1

Pointer to a VIDEOHDR structure.

lParam2

Size of the VIDEOHDR structure.

Return Value

The driver should return DV_ERR_OK if the operation succeeds. Otherwise, it should return one of the DV_ERR error codes defined in msvideo.h. Custom error codes are also allowed (see DVM_GETERRORTEXT).

Comments

A client sends the DVM_STREAM_ADDBUFFER message by calling the driver's DriverProc entry point, passing the specified parameter values. Applications can send this message by calling the videoStreamAddBuffer function, which is described in the Video for Windows Development Kit.

The VIDEOHDR structure describes the buffer. Before a buffer can be added to the driver's queue, the client must prepare it by sending a DVM_STREAM_PREPAREHEADER message. Drivers can confirm that the buffer has been prepared by testing the VHDR_PREPARED flag in the VIDEOHDR structure's dwFlags member. Code in msvfw32.dll and avicap32.dll checks this flag before sending a DVM_STREAM_ADDBUFFER message.

Drivers assume that the VIDEOHDR structure and the data buffer pointed to by its lpData member have been allocated with GlobalAlloc, using the GMEM_MOVEABLE and GMEM_SHARE flags, and locked with GlobalLock. (For further information about GlobalAlloc and GlobalLock, see the Win32 SDK.)

For information about using data buffers with video capture streams, see Transferring streams of Captured Data.

User-mode video capture drivers using VCUser.lib can call VC_StreamAddBuffer when processing the DVM_STREAM_ADDBUFFER message.