VIDEOHDR

Contains header information that identifies a video data buffer.


typedef struct {
    LPSTR lpData;            // address of video buffer
    DWORD dwBufferLength;    // size, in bytes, of the data buffer
    DWORD dwBytesUsed;       // see below
    DWORD dwTimeCaptured;    // see below
    DWORD dwUser;            // user-specific data
    DWORD dwFlags;           // see below
    DWORD dwReserved[4];     // reserved; do not use
} VIDEOHDR;

dwBytesUsed

Number of bytes used in the data buffer.

dwTimeCaptured

Time, in milliseconds, when the frame was captured relative to the first frame in the stream.

Synchronization of audio and video in the resulting AVI file depends solely on this parameter, which should be derived directly from a counter (VSYNC_Count) incremented by a vertical sync interrupt. When using NTSC frame rates and frame-based interrupts, the returned value would be:


dwTimeCaptured = VSYNC_Count * 1/29.97.

The capture driver must maintain VSYNC_Count accurately by allowing recursive entry into the interrupt service routine (if only for the purpose of incrementing VSYNC_Count) and by not disabling interrupts for long periods of time.

dwFlags

Flags giving information about the data buffer. The following flags are defined for this field:

VHDR_DONE

Set by the device driver to indicate it is finished with the data buffer and it is returning the buffer to the application.

VHDR_PREPARED

Set by the system to indicate the data buffer has been prepared with videoStreamPrepareHeader.

VHDR_INQUEUE

Set by the system to indicate the data buffer is queued for playback.

VHDR_KEYFRAME

Set by the device driver to indicate a key frame.