Museum

Home

Lab Overview

Retrotechnology Articles

Online Manuals

⇒ videoStreamAddBuffer(3mms) — Multimedia Services 2.4B

Media Vault

Software Library

Restoration Projects

Artifacts Sought

Related Articles

videoStreamPrepareHeader(3mms)

videoStreamReset(3mms)

videoStreamStart(3mms)

videoStreamAddBuffer(3mms)  —  Subroutines

 
 
 
 
 

Name

 
videoStreamAddBuffer --- Send a buffer to a video device channel
 
 

Syntax

 
 
 

 #include <mme/mme_api.h>
 MMRESULT videoStreamAddBuffer(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. 

 
The VIDEOHDR data structure must be allocated with the mmeAllocMem function before being passed to the videoStreamAddBuffer function. The data buffer pointed to by its lpData field or the data buffers pointed to by its lpData2 field must must be allocated using the mmeAllocBuffer or mmeAllocBufferAndGetShminfo function. Once the buffer is allocated, it must be prepared with the videoStreamPrepareHeader function. 

 
DWORD dwSize
Specifies the size of the VIDEOHDR data structure. 
 
 

Description

 
The videoStreamAddBuffer function sends a buffer to a video device channel. After the buffer is processed by the device, the device sends it back to the application by sending a callback message. 

 
To determine the size of the buffer needed for capturing or playing back data, use the videoConfigure function. If the buffer size is not large enough, the videoStreamAddBuffer function can fail. 
 
See the videoConfigure(3mms) reference page for detailed information about determining the size of the buffer required. 
 

 
For video playback, the dwBytesUsed field of the VIDEOHDR data structure is filled with the size of the buffer that was passed to the videoStreamAddBuffer function. 

 
If the input image data to be played back is in JPEG format, a dual buffers scheme can be used to simultaneously play back the input image and return an uncompressed image (8- or 24-bit X image, YUV, or BI_BITFIELDS format) to the application. The compressed image can be used to display to the screen the same image that is being played to the output device.
 

 
In Microsoft Video for Windows (VFW), the VIDEOHDR data structure fields dwFlags and dwBytesUsed are frequently updated to reflect the state of the buffer as it is processed by the driver. On UNIX systems, these fields are updated only once when the buffer has finished processing and returns to the client in the callback. 
 

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. 
 

 
The videoStreamAddBuffer function has been extended to recognize the flags VHDR_FIELD_EVEN and VHDR_FIELD_ODD in the dwFlags field of the data structure VIDEOHDR.  When the VIDEO_MODE_FIELD_BOTH field mode is used, the application tells the device which field to use by setting the <EMPHASIS>(dwFlags) field to either VHDR_FIELD_EVEN or VHDR_FIELD_ODD.  On capture, the device fills the buffer with the field from the next captured frame.  On playback, the device places the data in the buffer of the next frame’s field. 
 
 
 

Return Values

 
Returns DV_ERR_OK if the function is successful; otherwise, it returns one of the following error codes:
 
 

 
DV_ERR_CREATEPALETTE@T{ A PALETTE must have been set previous to this operation when the biCompression is BICOMP_DECXIMAGEDIB and the biBitCount is 8, otherwise this error is returned.  T} DV_ERR_INVALHANDLE@T{ The specified device handle is invalid. T} DV_ERR_UNPREPARED@T{ The VIDEOHDR data structure has not been prepared.  T}

 
 
 

See Also

 
 
 
 
 
videoStreamPrepareHeader(3mms), videoStreamReset(3mms),
 
videoStreamStart(3mms)
 
 
 
 

Typewritten Software • bear@typewritten.org • Edmonds, WA 98026