Drawing the Data

The client application sends ICM_DRAW each time it has data to decompress. (Your driver should use this message to decompress data. It should wait for the ICM_DRAW_START message before it begins to render the data.) The client application uses the flags in the file index to ensure the first frame in a series of decompressed frames starts with a key-frame boundary. Your driver must allocate the memory it needs for the decompressed data.

The ICDRAW data structure specified in dwParam1 contains the decompression parameters. The value specified in dwParam2 specifies the size of the structure. The format of the input data is specified in a BITMAPINFOHEADER structure pointed to by lpFormat. The input data is in a buffer specified by lpData. The number of bytes in the input buffer is specified by cbData.

The client application sets the ICDRAW_HURRYUP flag in the dwFlags member to direct your driver to decompress data at a faster rate. For example, the client application might use this flag when the video is starting to lag behind the audio. If your driver cannot speed up its decompression and rendering performance, it might be necessary to avoid rendering a frame of data. The client application sets the ICDRAW_UPDATE flag and sets lpData to NULL to have your driver update the screen based on data previously received.

The client application sets the ICDRAW_PREROLL flag if it is sending data in advance of the data to be rendered. For example, if the client application will display frame 10 of a compressed sequence, it sets this flag for the first 9 frames. This sends the key frame and other intermediate frames to the driver so it can decompress the tenth frame.

The client application sets the ICDRAW_UPDATE flag to have the driver refresh the screen.

The ICDRAW_NOTKEYFRAME flag indicates the data is not a key frame.

The ICDRAW_NULLFRAME flag indicates the previous frame should be repeated.

When your driver has finished decompressing the data, it returns ICERR_OK. After the driver returns from this message, the client application deallocates or reuses the memory containing the format and image data. If your driver needs the format or image data for future use, it should copy the data it needs before it returns from the message.