int error = hw_SetAudioAdapter(hwPluginBase *self, ULONG flags, struct hwTagList *tags);
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:
HWSAAFLAGS_PERMANENT:
HWSAAFLAGS_PERMANENT
is set, all subsequent calls to hw_SetAudioAdapter()
will fail and your audio adapter
will persist.
HWSAAFLAGS_UPDATE:
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:
HWSAATAG_BUFFERSIZE:
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.
HWSAATAG_CHANNELS:
See Audio adapter plugins for information on how to write audio adapter plugins.
hwPluginBase
pointer passed to InitPlugin()