- Timestamp:
- May 15, 2021 4:03:07 PM (4 years ago)
- svn:sync-xref-src-repo-rev:
- 144395
- Location:
- trunk/src/VBox
- Files:
-
- 1 deleted
- 7 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Devices/Audio/DrvHostAudioAlsa.cpp
r88991 r89055 59 59 #include "DrvHostAudioAlsaStubs.h" 60 60 61 #ifdef VBOX_AUDIO_VKAT 62 # include "VBoxDDVKAT.h" 63 #else 64 # include "VBoxDD.h" 65 #endif 61 #include "VBoxDD.h" 66 62 67 63 -
trunk/src/VBox/Devices/Audio/DrvHostAudioCoreAudio.cpp
r89027 r89055 39 39 #include <VBox/vmm/pdmaudiohostenuminline.h> 40 40 41 #ifdef VBOX_AUDIO_VKAT 42 # include "VBoxDDVKAT.h" 43 #else 44 # include "VBoxDD.h" 45 #endif 41 #include "VBoxDD.h" 46 42 47 43 #include <iprt/asm.h> -
trunk/src/VBox/Devices/Audio/DrvHostAudioDSound.cpp
r88991 r89055 36 36 #include <VBox/vmm/pdmaudiohostenuminline.h> 37 37 38 #ifdef VBOX_AUDIO_VKAT 39 # include "VBoxDDVKAT.h" 40 #else 41 # include "VBoxDD.h" 42 #endif 38 #include "VBoxDDVKAT.h" 43 39 44 40 #ifdef VBOX_WITH_AUDIO_MMNOTIFICATION_CLIENT -
trunk/src/VBox/Devices/Audio/DrvHostAudioOss.cpp
r88995 r89055 36 36 #include <VBox/vmm/pdmaudioinline.h> 37 37 38 #ifdef VBOX_AUDIO_VKAT 39 # include "VBoxDDVKAT.h" 40 #else 41 # include "VBoxDD.h" 42 #endif 38 #include "VBoxDD.h" 43 39 44 40 -
trunk/src/VBox/Devices/Audio/DrvHostAudioPulseAudio.cpp
r88992 r89055 44 44 #endif 45 45 46 #ifdef VBOX_AUDIO_VKAT 47 # include "VBoxDDVKAT.h" 48 #else 49 # include "VBoxDD.h" 50 #endif 46 #include "VBoxDD.h" 51 47 52 48 -
trunk/src/VBox/ValidationKit/utils/audio/Makefile.kmk
r88928 r89055 42 42 # The Validation Kit Audio Test (VKAT) utility. 43 43 # 44 VKAT_PATH_AUDIO =$(PATH_ROOT)/src/VBox/Devices/Audio44 VKAT_PATH_AUDIO = $(PATH_ROOT)/src/VBox/Devices/Audio 45 45 46 46 PROGRAMS += AudioTest 47 47 AudioTest_TEMPLATE = VBoxValidationKitR3 48 AudioTest_DEFS += VBOX_AUDIO_VKAT 48 AudioTest_DEFS = VBOX_AUDIO_VKAT 49 AudioTest_INCS = \ 50 $(PATH_ROOT)/src/VBox/Devices/build 49 51 AudioTest_SOURCES = \ 50 52 vkat.cpp \ -
trunk/src/VBox/ValidationKit/utils/audio/vkat.cpp
r89054 r89055 51 51 #include "../../../Devices/Audio/AudioHlp.h" 52 52 #include "../../../Devices/Audio/AudioTest.h" 53 #include " ../../../Devices/Audio/VBoxDDVKAT.h"53 #include "VBoxDD.h" 54 54 55 55 … … 231 231 /** The current verbosity level. */ 232 232 static unsigned g_uVerbosity = 0; 233 /** The driver instance data. */234 static PDMDRVINS g_DrvIns;235 233 236 234 … … 402 400 } 403 401 402 /** @name Driver Helper Fakes / Stubs 403 * @{ */ 404 405 VMMR3DECL(int) CFGMR3QueryString(PCFGMNODE pNode, const char *pszName, char *pszString, size_t cchString) 406 { 407 if (pNode != NULL) 408 { 409 PCPDMDRVREG pDrvReg = (PCPDMDRVREG)pNode; 410 if (g_uVerbosity > 2) 411 RTPrintf("debug: CFGMR3QueryString([%s], %s, %p, %#x)\n", pDrvReg->szName, pszName, pszString, cchString); 412 413 if ( ( strcmp(pDrvReg->szName, "PulseAudio") == 0 414 || strcmp(pDrvReg->szName, "HostAudioWas") == 0) 415 && strcmp(pszName, "VmName") == 0) 416 return RTStrCopy(pszString, cchString, "vkat"); 417 418 if ( strcmp(pDrvReg->szName, "HostAudioWas") == 0 419 && strcmp(pszName, "VmUuid") == 0) 420 return RTStrCopy(pszString, cchString, "794c9192-d045-4f28-91ed-46253ac9998e"); 421 } 422 else if (g_uVerbosity > 2) 423 RTPrintf("debug: CFGMR3QueryString(%p, %s, %p, %#x)\n", pNode, pszName, pszString, cchString); 424 425 return VERR_CFGM_VALUE_NOT_FOUND; 426 } 427 428 /* Fake stub. Will be removed when this moves into the driver helpers. */ 429 VMMR3DECL(int) CFGMR3QueryStringDef(PCFGMNODE pNode, const char *pszName, char *pszString, size_t cchString, const char *pszDef) 430 { 431 if (g_uVerbosity > 2) 432 RTPrintf("debug: CFGMR3QueryStringDef(%p, %s, %p, %#x, %s)\n", pNode, pszName, pszString, cchString, pszDef); 433 return RTStrCopy(pszString, cchString, pszDef); 434 } 435 436 /* Fake stub. Will be removed when this moves into the driver helpers. */ 437 VMMR3DECL(int) CFGMR3ValidateConfig(PCFGMNODE pNode, const char *pszNode, 438 const char *pszValidValues, const char *pszValidNodes, 439 const char *pszWho, uint32_t uInstance) 440 { 441 RT_NOREF(pNode, pszNode, pszValidValues, pszValidNodes, pszWho, uInstance); 442 return VINF_SUCCESS; 443 } 444 445 /** @} */ 446 447 404 448 /** 405 449 * Constructs a PDM audio driver instance. 406 450 * 407 451 * @returns VBox status code. 408 * @param pDrvReg PDM driver registration record to use for construction. 409 * @param pDrvIns Driver instance to use for construction. 410 * @param ppDrvAudio Where to return the audio driver interface of type IHOSTAUDIO. 411 */ 412 static int audioTestDrvConstruct(const PDMDRVREG *pDrvReg, PPDMDRVINS pDrvIns, PPDMIHOSTAUDIO *ppDrvAudio) 413 { 414 AssertReturn(pDrvReg->cbInstance, VERR_INVALID_PARAMETER); /** @todo Very crude; improve. */ 415 452 * @param pDrvReg PDM driver registration record to use for construction. 453 * @param ppDrvIns Where to return the driver instance structure. 454 * @param ppDrvAudio Where to return the audio driver interface of type IHOSTAUDIO. 455 */ 456 static int audioTestDrvConstruct(PCPDMDRVREG pDrvReg, PPPDMDRVINS ppDrvIns, PPDMIHOSTAUDIO *ppDrvAudio) 457 { 458 /* The destruct function must have valid data to work with. */ 459 *ppDrvIns = NULL; 460 *ppDrvAudio = NULL; 461 462 /* 463 * Check registration structure validation (doesn't need to be too 464 * thorough, PDM check it in detail on every VM startup). 465 */ 466 AssertPtrReturn(pDrvReg, VERR_INVALID_POINTER); 416 467 RTTestPrintf(g_hTest, RTTESTLVL_ALWAYS, "Initializing backend '%s' ...\n", pDrvReg->szName); 417 418 pDrvIns->pvInstanceData = RTMemAllocZ(pDrvReg->cbInstance); 419 AssertPtrReturn(pDrvIns->pvInstanceData, VERR_NO_MEMORY); 420 421 int rc = pDrvReg->pfnConstruct(pDrvIns, NULL /* PCFGMNODE */, 0 /* fFlags */); 468 AssertPtrReturn(pDrvReg->pfnConstruct, VERR_INVALID_PARAMETER); 469 470 /* 471 * Initialize the driver helper the first time thru. 472 */ 473 static PDMDRVHLPR3 s_DrvHlp; 474 if (s_DrvHlp.u32Version == 0) 475 { 476 s_DrvHlp.u32Version = PDM_DRVHLPR3_VERSION; 477 s_DrvHlp.u32TheEnd = PDM_DRVHLPR3_VERSION; 478 } 479 480 /* 481 * Create the instance data structure. 482 */ 483 PPDMDRVINS pDrvIns = (PPDMDRVINS)RTMemAllocZVar(RT_UOFFSETOF_DYN(PDMDRVINS, achInstanceData[pDrvReg->cbInstance])); 484 RTTEST_CHECK_RET(g_hTest, pDrvIns, VERR_NO_MEMORY); 485 486 pDrvIns->u32Version = PDM_DRVINS_VERSION; 487 pDrvIns->iInstance = 0; 488 pDrvIns->pHlpR3 = &s_DrvHlp; 489 pDrvIns->pvInstanceDataR3 = &pDrvIns->achInstanceData[0]; 490 pDrvIns->pReg = pDrvReg; 491 pDrvIns->pCfg = (PCFGMNODE)pDrvReg; 492 //pDrvIns->pUpBase = NULL; 493 //pDrvIns->pDownBase = NULL; 494 495 /* 496 * Invoke the constructor. 497 */ 498 int rc = pDrvReg->pfnConstruct(pDrvIns, pDrvIns->pCfg, 0 /*fFlags*/); 422 499 if (RT_SUCCESS(rc)) 423 500 { 424 501 PPDMIHOSTAUDIO pDrvAudio = (PPDMIHOSTAUDIO)pDrvIns->IBase.pfnQueryInterface(&pDrvIns->IBase, PDMIHOSTAUDIO_IID); 425 426 pDrvAudio->pfnGetStatus(pDrvAudio, PDMAUDIODIR_OUT); 427 428 *ppDrvAudio = pDrvAudio; 429 } 430 502 if (pDrvAudio) 503 { 504 PDMAUDIOBACKENDSTS enmStatus = pDrvAudio->pfnGetStatus(pDrvAudio, PDMAUDIODIR_OUT); 505 if (enmStatus == PDMAUDIOBACKENDSTS_RUNNING) 506 { 507 *ppDrvAudio = pDrvAudio; 508 *ppDrvIns = pDrvIns; 509 return VINF_SUCCESS; 510 } 511 RTTestFailed(g_hTest, "Expected backend status RUNNING, got %d instead", enmStatus); 512 } 513 else 514 RTTestFailed(g_hTest, "Failed to query PDMIHOSTAUDIO for '%s'", pDrvReg->szName); 515 } 516 else 517 RTTestFailed(g_hTest, "Failed to construct audio driver '%s': %Rrc", pDrvReg->szName, rc); 518 if (pDrvReg->pfnDestruct) 519 pDrvReg->pfnDestruct(pDrvIns); 520 RTMemFree(pDrvIns); 431 521 return rc; 432 522 } … … 439 529 * @param pDrvIns Driver instance to destruct. 440 530 */ 441 static int audioTestDrvDestruct( const PDMDRVREG *pDrvReg, PPDMDRVINS pDrvIns)531 static int audioTestDrvDestruct(PCPDMDRVREG pDrvReg, PPDMDRVINS pDrvIns) 442 532 { 443 533 if (!pDrvIns) … … 447 537 pDrvReg->pfnDestruct(pDrvIns); 448 538 449 if (pDrvIns->pvInstanceData) 450 { 451 RTMemFree(pDrvIns->pvInstanceData); 452 pDrvIns->pvInstanceData = NULL; 453 } 539 pDrvIns->u32Version = 0; 540 RTMemFree(pDrvIns); 454 541 455 542 return VINF_SUCCESS; … … 896 983 897 984 /* The backend: */ 898 P DMDRVREG const *pDrvReg;985 PCPDMDRVREG pDrvReg; 899 986 #if defined(RT_OS_WINDOWS) 900 987 pDrvReg = &g_DrvHostAudioWas; … … 1031 1118 RTTestBanner(g_hTest); 1032 1119 1033 PPDMIHOSTAUDIO pDrvAudio ;1034 RT_ZERO(g_DrvIns);1035 rc = audioTestDrvConstruct(pDrvReg, & g_DrvIns, &pDrvAudio);1120 PPDMIHOSTAUDIO pDrvAudio = NULL; 1121 PPDMDRVINS pDrvIns = NULL; 1122 rc = audioTestDrvConstruct(pDrvReg, &pDrvIns, &pDrvAudio); 1036 1123 if (RT_SUCCESS(rc)) 1037 1124 { … … 1057 1144 audioTestEnvDestroy(&TstEnv); 1058 1145 } 1059 audioTestDrvDestruct(pDrvReg, &g_DrvIns);1060 }1146 } 1147 audioTestDrvDestruct(pDrvReg, pDrvIns); 1061 1148 1062 1149 audioTestParmsDestroy(&TstCust);
Note:
See TracChangeset
for help on using the changeset viewer.