videoStreamPrepareHeader(3mms) — Subroutines
Name
videoStreamPrepareHeader -- Prepare a buffer for video streaming
Syntax
#include <mme/mme_api.h>
MMRESULT videoStreamPrepareHeader(HVIDEO hVideo,
LPVIDEOHDR lpvideoHdr,
DWORD dwSize);
Arguments
HVIDEO hVideo
Specifies a handle to a video device channel.
LPVIDEOHDR lpvideoHdr
Specifies a pointer to a VIDEOHDR data structure that identifies the buffer to be prepared.
The VIDEOHDR data structure must be allocated with the mmeAllocMem function. The data buffer pointed to by its lpData field or the data buffers pointed to by its lpData2 field must be allocated with the mmeAllocBuffer or mmeAllocBufferAndGetShminfo function.
See the mmeAllocMem(3mms) and the mmeAllocBuffer(3mms) or mmeAllocBufferAndGetShminfo(3mms) reference pages for more information about allocating memory for data structures and buffers.
DWORD dwSize
Specifies the size of the VIDEOHDR data structure.
Description
The videoStreamPrepareHeader function prepares a buffer for video streaming.
Use the videoStreamPrepareHeader function after the videoStreamInit function or after the videoStreamReset function to prepare the data buffers for streaming data.
To determine the size of the buffer needed for capturing or playing back data, use the videoConfigure function. Set the dwFlags argument to:
(VIDEO_CONFIGURE_GET | VIDEO_CONFIGURE_MIN)
The size is returned in the biSizeImage field of the BITMAPINFOHEADER data structure.
Preparing a header that has already been prepared has no effect and the function returns DV_ERR_OK.
Extensions
The VIDEOHDR data structure has been extended by three fields: lpData2, dwBufferLength2, and dwBytesUsed2, to support dual buffers for use with the Sound and Motion J300 option module.
Return Values
Returns DV_ERR_OK if the function is successful; otherwise, it returns one of the following error codes:
DV_ERR_BADFORMAT@T{ The specified format cannot be set. T} DV_ERR_INVALHANDLE@T{ The specified device handle is invalid. T} DV_ERR_NOMEM@T{ Unable to allocate or lock memory. T}