hw_SetAudioAdapter -- install an audio adapter (V6.0)
int error = hw_SetAudioAdapter(hwPluginBase *self, ULONG flags,
                struct hwTagList *tags);
This function can be used to activate a plugin that has the HWPLUG_CAPS_AUDIOADAPTER capability flag set. This function must only be called from inside your RequirePlugin() implementation. If this function succeeds, Hollywood's inbuilt audio driver will be completely replaced by the audio driver provided by your plugin and Hollywood will call into your plugin whenever it needs to output audio. In the first parameter, you have to pass a pointer to the hwPluginBase that Hollywood has passed to your plugin's InitPlugin() function. The second parameter must be set to a combination of flags. The following flags are currently defined:

If this flag is set, the audio adapter will be made permanent. This means that other plugins won't be able to overwrite this audio adapter with their own one. If HWSAAFLAGS_PERMANENT is set, all subsequent calls to hw_SetAudioAdapter() will fail and your audio adapter will persist.

If this flag is set, Hollywood won't install an audio adapter but update the parameters of an existing audio adapter. This is only supported if the hwPluginBase passed to hw_SetAudioAdapter() equals the currently installed audio adapter. The only parameter that can currently be updated is the HWSAATAG_BUFFERSIZE attribute. Many audio drivers might not know the optimal buffer size before actually opening the audio device so they might need to adjust the audio adapter's buffer size later. This is what the HWSAAFLAGS_UPDATE tag is here for.

Additionally, hw_SetAudioAdapter() accepts a tag list which recognizes the following tags:

This must be set to size of your audio adapter's playback buffer in bytes. This value should be really small for low latency audio. If your buffer size is too large, it will take a long time until changes in volume or pitch take effect and pause is not very accurate. If you don't know about the optimal buffer size for your audio device at the time you call hw_SetAudioAdapter(), you may also adjust the buffer size later on by calling hw_SetAudioAdapter() again, but this time with the HWSAAFLAGS_UPDATE flag set (see above). By default, Hollywood uses an audio buffer size of 2048 bytes.

This must be set to the number of channels your audio driver wants to offer. This defaults to 8.

See Audio adapter plugins for information on how to write audio adapter plugins.

Designer compatibility

hwPluginBase pointer passed to InitPlugin()
combination of flags (see above)
tag list specifying further parameters (see above)
error code or 0 for success

Show TOC