Dev:IOAudio2Transformer

IOAudio2Transformer is a kernel-extension for encoding/decoding audio.

It's interacted with exclusively by CoreAudio, so it can't be used directly if CoreAudio is in the picture.

The service has two child services - both of class IOAudio2TransformerStream. One is input and the other is output.

Service Properties
IOAudio2Transformer:

IOAudio2TransformerStream:

Format dictionary argument:

(For more info, see ioreg of IOAudio2Device)

Methods
IOAudio2Transformer:

IOAudio2TransformerStream:

Traps
IOAudio2TransformerStream:

Mapped Memory
The following memory can be mapped via IOConnectMapMemory into each of the IOAudio2TransformerStream-s:

where

Operation
The IOAudio2Transformer's startSetup method is called, then the "input format" and "output format" service properties are set.

Once endSetup is called and the streams are started:
 * The queues of both streams are cleared.
 * The output queue of the input stream is filled with entry for each buffer (representing a free buffer)
 * The input queue of the output stream is filled with entry for each buffer (representing a free buffer)

Now, user-land simultaneously:
 * Dequeues any free buffers from the output queue of the input stream, fills them with input data, and enqueues them to the input queue of the input stream.
 * Dequeues any buffers from the output queue of the output stream, reads the output data from them, and enqueues them to the input queue of the output stream.

While the driver:
 * Dequeues a buffer from the input queue of the input stream, this contains the input data.
 * Dequeues a free buffer from the input queue of the output stream.
 * Transformers the input data to output data according to the input/output formats. The output data is placed in the free buffer dequeued above.
 * Enqueues the previously-free buffer in the output queue of the output stream.

Notes:
 * For each buffer, its data can be accessed/modified by mapping its data buffer and reading/writing to it.
 * For each buffer, its packet information can be accessed/modified by mapping its control buffer and reading/writing to it.