Compressing Video Data

When used to compress video data, your driver receives a series of messages, similar to decompressing data. The client application sends messages to your driver to coordinate the following activities:

·Obtaining the driver state

·Specifying the input format and determining the compression format

·Preparing to compress video

·Compressing the video

·Ending compression

The following messages are used by video compression drivers.

Message Description
ICM_COMPRESS Compresses a frame of data into the buffer provided by the client application.
ICM_COMPRESS_BEGIN Prepares for compressing data.
ICM_COMPRESS_END Cleans up after compressing.
ICM_COMPRESS_GET_FORMAT Obtains the driver’s suggested output format of the compressed data.
ICM_COMPRESS_GET_SIZE Obtains the maximum size of one frame of data when it is compressed in the output format.
ICM_COMPRESS_QUERY Determines if a driver can compress a specific input format.

The video compressed with these messages is returned to the client application. When compressing data, your driver can use either software or hardware to do the compression.

Note When MSVideo recompresses a file, each frame is decompressed to a full frame before it is passed to the compressor.