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 ACM_Open function.
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

The ACM (WAVEAPI.DLL) sends the ACMDM_STREAM_CONVERT message by calling the ACM driver's ACM_IOControl() entry point via DeviceIoControl(). 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 in the Windows NT DDK.

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 PostThreadMessage 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 ACM_IOControl function, the ACM verifies that: