summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorvboxsync <vboxsync@cfe28804-0f27-0410-a406-dd0f0b0b656f>2021-05-10 07:19:31 +0000
committervboxsync <vboxsync@cfe28804-0f27-0410-a406-dd0f0b0b656f>2021-05-10 07:19:31 +0000
commit9f6d9a5534b3f9a94dc7cbd854a6429274223fb0 (patch)
treeb015accef10494ca38eadde6029654b06ada4de9 /src
parentb6a5d4b244ef8735600e52f8ad0f25eaae467b8a (diff)
downloadVirtualBox-svn-9f6d9a5534b3f9a94dc7cbd854a6429274223fb0.tar.gz
Audio/VaKit: Added driver backends for MacOS and Windows. bugref:10008
git-svn-id: https://www.virtualbox.org/svn/vbox/trunk@88959 cfe28804-0f27-0410-a406-dd0f0b0b656f
Diffstat (limited to 'src')
-rw-r--r--src/VBox/Devices/Audio/DrvHostAudioCoreAudio.cpp6
-rw-r--r--src/VBox/Devices/Audio/DrvHostAudioDSound.cpp7
-rw-r--r--src/VBox/Devices/Audio/DrvHostAudioWasApi.cpp6
-rw-r--r--src/VBox/Devices/Audio/VBoxDDVKAT.h7
-rw-r--r--src/VBox/ValidationKit/utils/audio/vkat.cpp23
5 files changed, 43 insertions, 6 deletions
diff --git a/src/VBox/Devices/Audio/DrvHostAudioCoreAudio.cpp b/src/VBox/Devices/Audio/DrvHostAudioCoreAudio.cpp
index 37bf49ded6b..9836e08414f 100644
--- a/src/VBox/Devices/Audio/DrvHostAudioCoreAudio.cpp
+++ b/src/VBox/Devices/Audio/DrvHostAudioCoreAudio.cpp
@@ -24,7 +24,11 @@
#include <VBox/vmm/pdmaudioinline.h>
#include <VBox/vmm/pdmaudiohostenuminline.h>
-#include "VBoxDD.h"
+#ifdef VBOX_AUDIO_VKAT
+# include "VBoxDDVKAT.h"
+#else
+# include "VBoxDD.h"
+#endif
#include <iprt/asm.h>
#include <iprt/cdefs.h>
diff --git a/src/VBox/Devices/Audio/DrvHostAudioDSound.cpp b/src/VBox/Devices/Audio/DrvHostAudioDSound.cpp
index 9e5db508785..be273940304 100644
--- a/src/VBox/Devices/Audio/DrvHostAudioDSound.cpp
+++ b/src/VBox/Devices/Audio/DrvHostAudioDSound.cpp
@@ -35,7 +35,12 @@
#include <VBox/vmm/pdmaudioinline.h>
#include <VBox/vmm/pdmaudiohostenuminline.h>
-#include "VBoxDD.h"
+#ifdef VBOX_AUDIO_VKAT
+# include "VBoxDDVKAT.h"
+#else
+# include "VBoxDD.h"
+#endif
+
#ifdef VBOX_WITH_AUDIO_MMNOTIFICATION_CLIENT
# include <new> /* For bad_alloc. */
# include "DrvHostAudioDSoundMMNotifClient.h"
diff --git a/src/VBox/Devices/Audio/DrvHostAudioWasApi.cpp b/src/VBox/Devices/Audio/DrvHostAudioWasApi.cpp
index c806a912ff2..bc2f760232f 100644
--- a/src/VBox/Devices/Audio/DrvHostAudioWasApi.cpp
+++ b/src/VBox/Devices/Audio/DrvHostAudioWasApi.cpp
@@ -44,7 +44,11 @@
#include <new> /* std::bad_alloc */
-#include "VBoxDD.h"
+#ifdef VBOX_AUDIO_VKAT
+# include "VBoxDDVKAT.h"
+#else
+# include "VBoxDD.h"
+#endif
/*********************************************************************************************************************************
diff --git a/src/VBox/Devices/Audio/VBoxDDVKAT.h b/src/VBox/Devices/Audio/VBoxDDVKAT.h
index ca6d3be71ff..d6e4b75811f 100644
--- a/src/VBox/Devices/Audio/VBoxDDVKAT.h
+++ b/src/VBox/Devices/Audio/VBoxDDVKAT.h
@@ -149,5 +149,12 @@ extern const PDMDRVREG g_DrvHostALSAAudio;
#ifdef VBOX_WITH_AUDIO_OSS
extern const PDMDRVREG g_DrvHostOSSAudio;
#endif
+#if defined(RT_OS_WINDOWS)
+extern const PDMDRVREG g_DrvHostAudioWas;
+extern const PDMDRVREG g_DrvHostDSound;
+#endif
+#if defined(RT_OS_DARWIN)
+extern const PDMDRVREG g_DrvHostCoreAudio;
+#endif
#endif /* !VBOX_INCLUDED_SRC_Audio_VBoxDDVKAT_h */
diff --git a/src/VBox/ValidationKit/utils/audio/vkat.cpp b/src/VBox/ValidationKit/utils/audio/vkat.cpp
index c8b3ec70262..5bd5af82db1 100644
--- a/src/VBox/ValidationKit/utils/audio/vkat.cpp
+++ b/src/VBox/ValidationKit/utils/audio/vkat.cpp
@@ -502,8 +502,17 @@ int mainTest(int argc, char **argv)
if ( !RTStrICmp(ValueUnion.psz, "oss"))
pDrvReg = &g_DrvHostOSSAudio;
#endif
- /** @todo Add more backends here. */
-
+#if defined(RT_OS_DARWIN)
+ if ( !RTStrICmp(ValueUnion.psz, "coreaudio"))
+ pDrvReg = &g_DrvHostCoreAudio;
+#endif
+#if defined(RT_OS_WINDOWS)
+ if ( !RTStrICmp(ValueUnion.psz, "wasapi"))
+ pDrvReg = &g_DrvHostAudioWas;
+ else if ( !RTStrICmp(ValueUnion.psz, "directsound")
+ || !RTStrICmp(ValueUnion.psz, "dsound")
+ pDrvReg = &g_DrvHostDSound;
+#endif
if (pDrvReg == NULL)
return RTMsgErrorExit(RTEXITCODE_SYNTAX, "Invalid / unsupported backend '%s' specified\n", ValueUnion.psz);
break;
@@ -584,9 +593,17 @@ int mainTest(int argc, char **argv)
*/
RTTestBanner(g_hTest);
- /* If no backend is specified, go with the ALSA one by default. */
+ /* If no backend is specified, go with the default backend for that OS. */
if (pDrvReg == NULL)
+#if defined(RT_OS_WINDOWS)
+ pDrvReg = &g_DrvHostAudioWas;
+#elif defined(RT_OS_DARWIN)
+ pDrvReg = &g_DrvHostCoreAudio;
+#elif defined(RT_OS_SOLARIS)
+ pDrvReg = &g_DrvHostOSSAudio;
+#else
pDrvReg = &g_DrvHostALSAAudio;
+#endif
PPDMIHOSTAUDIO pDrvAudio;
rc = audioTestDrvConstruct(pDrvReg, &g_DrvIns, &pDrvAudio);