ICAddBuffer(3mms) — Subroutines
Name
ICAddBuffer --- Add bitstream and frame buffers to a bitstreaming CODEC’s buffer queues (Software H.261 CODEC)
Syntax
#include <mme/mme_api.h>
MMRESULT ICAddBuffer(HIC hic,
ICCALLBACKINFO ∗lpCallbackInfo);
Arguments
HIC hic
Specifies a handle to a compressor or decompressor.
ICCALLBACKINFO ∗lpCallbackInfo
Specifies a pointer to a data structure describing the buffer.
Description
This function adds two types of buffers to the bitstreaming CODEC’s buffer queues: bitstream (for compressed data) and frame (to hold decompressed images or audio). Each image buffer contains one full frame. Each bitstream buffer contains a portion of a compressed bitstream and will generally not correspond to any frame boundary. The data in a bitstream buffer generally corresponds to the contents of a system stream packet (MPEG) or a network packet (Software H.261 CODEC).
On decompression, the application calls the ICAddBuffer function to add bitstream buffers that have been filled with compressed data. The application also calls the ICAddBuffer function to pass empty image or audio buffers for the software CODEC to fill. When an image or audio frame is reconstructed, the CODEC will call back to the application to inform it that a frame is ready, using the CB_IMAGE_READY flag.
On compression, the application adds filled image and audio buffers, as well as empty bitstream buffers.
The ICAddBuffer function is also used after the opening of a bitstreaming CODEC to pass the initial ICCALLBACKINFO data structure. This initial data structure may contain a buffer or have the dwDataType field set to ICM_CB_DATA_NONE. The callback structure passed in the first call to ICAddBuffer is used in subsequent calls back to the application’s callback routine. The memory of this structure should not be freed until the CODEC is closed.
Note: You cannot execute the ICAddBuffer function from a callback function.
Extensions
This function is a Digital extension to the Microsoft multimedia API specification.
Return Values
Returns ICERR_OK if the function is successful; otherwise, it returns one of the following error codes:
ICERR_BADHANDLE@T{ The hic argument is invalid. T} ICERR_MEMORY@T{ The buffer specified is not valid. Allocate it first with the mmeAllocBuffer or mmeAllocBufferGetShminfo function. T} ICERR_BADPARAM@T{ The buffer specified is NULL. T}
See Also
ICCallbackProc