ACMDM_STREAM_CONVERT

The ACMDM_STREAM_CONVERT message requests a ACM driver to perform a conversion operation on a specified conversion stream.

Parameters

dwDriverID

Driver instance identifier. This is the value returned by the driver in response to the DRV_OPEN message.

hDriver

Driver handle.

uMsg

ACMDM_STREAM_CONVERT

lParam1

Pointer to an ACMDRVSTREAMINSTANCE structure.

lParam2

Pointer to an ACMDRVSTREAMHEADER structure.

Return Value

The driver should return MMSYSERR_NOERROR if the operation succeeds. Otherwise it should return one of the MMSYSERR error codes defined in mmsystem.h, or one of the ACMERR error codes defined in msacm.h.

Comments

A client sends the ACMDM_STREAM_CONVERT message by calling the driver's DriverProc entry point, passing the specified parameters. The ACM sends this message when an application calls the acmStreamConvert function, which is described in the Win32 SDK.

All ACM drivers that provide stream conversions must support this message. For more information about stream conversions, see Converting Data Streams.

The ACMDRVSTREAMINSTANCE structure received with this message is the same structure that was received with a previous ACMDM_STREAM_OPEN message. The driver does not need to validate the structure's contents again.

The ACMDRVSTREAMHEADER structure identifies the source and destination data buffers. The source buffer contains the data to be converted. The driver places converted data into the destination buffer.

The driver must check the flags in the ACMDRVSTREAMHEADER structure's fdwConvert member. These flags indicate how converted data should be returned.

Because stream conversions are time-critical operations, ACMDM_STREAM_CONVERT messages must be processed efficiently. The driver should perform as much processing as possible in response to the ACMDM_STREAM_OPEN message.

If the driver supports asynchronous operations, and if the client has specified the ACM_STREAMOPENF_ASYNC flag (contained in the ACMDRVSTREAMINSTANCE structure's fdwOpen member), then the driver must do the following when it has finished converting the data in the source buffer:

·Set the ACMDRVSTREAMHEADER structure's ACMSTREAMHEADER_STATUSF_DONE flag.

·Send the client an MM_ACM_DONE callback message, by calling the DriverCallback function.

Asynchronous drivers can make use of the ACMDRVSTREAMHEADER structure's ACMSTREAMHEADER_STATUSF_INQUEUE flag, along with the structure's padshNext member, to maintain a conversion queue of stream header structures.

Before calling the driver's DriverProc function, the ACM verifies that:

·The ACMDRVSTREAMHEADER structure is readable and writeable, and of the proper size.

·The ACMDRVSTREAMHEADER structure's fdwConvert member contains valid flag values.

·The ACMDRVSTREAMHEADER structure's buffers have been prepared (see ACMDM_STREAM_PREPARE), and the specified buffer sizes are not larger than their prepared sizes.

·The ACMDRVSTREAMHEADER structure is not currently in an asynchronous driver's conversion queue. (That is, the structure's ACMSTREAMHEADER_STATUSF_INQUEUE flag is not set.)