- Timestamp:
- Nov 1, 2016 2:48:42 PM (8 years ago)
- svn:sync-xref-src-repo-rev:
- 111649
- Location:
- trunk/src/VBox
- Files:
-
- 4 edited
- 1 copied
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Devices/Audio/DrvHostValidationKit.cpp
r64378 r64508 1 1 /* $Id$ */ 2 2 /** @file 3 * Debug audio driver -- host backend for dumping and injecting audio data 4 * from/to the device emulation. 3 * Validation Kit audio driver. 5 4 */ 6 5 … … 33 32 * Structure for keeping a debug input/output stream. 34 33 */ 35 typedef struct DEBUGAUDIOSTREAM34 typedef struct VAKITAUDIOSTREAM 36 35 { 37 36 /** Note: Always must come first! */ … … 55 54 }; 56 55 57 } DEBUGAUDIOSTREAM, *PDEBUGAUDIOSTREAM;58 59 /** 60 * Debugaudio driver instance data.56 } VAKITAUDIOSTREAM, *PVAKITAUDIOSTREAM; 57 58 /** 59 * Validation Kit audio driver instance data. 61 60 * @implements PDMIAUDIOCONNECTOR 62 61 */ 63 typedef struct DRVHOST DEBUGAUDIO62 typedef struct DRVHOSTVAKITAUDIO 64 63 { 65 64 /** Pointer to the driver instance structure. */ … … 67 66 /** Pointer to host audio interface. */ 68 67 PDMIHOSTAUDIO IHostAudio; 69 } DRVHOST DEBUGAUDIO, *PDRVHOSTDEBUGAUDIO;68 } DRVHOSTVAKITAUDIO, *PDRVHOSTVAKITAUDIO; 70 69 71 70 /*******************************************PDM_AUDIO_DRIVER******************************/ … … 75 74 * @interface_method_impl{PDMIHOSTAUDIO,pfnGetConfig} 76 75 */ 77 static DECLCALLBACK(int) drvHost DebugAudioGetConfig(PPDMIHOSTAUDIO pInterface, PPDMAUDIOBACKENDCFG pBackendCfg)76 static DECLCALLBACK(int) drvHostVaKitAudioGetConfig(PPDMIHOSTAUDIO pInterface, PPDMAUDIOBACKENDCFG pBackendCfg) 78 77 { 79 78 NOREF(pInterface); 80 79 AssertPtrReturn(pBackendCfg, VERR_INVALID_POINTER); 81 80 82 pBackendCfg->cbStreamOut = sizeof( DEBUGAUDIOSTREAM);83 pBackendCfg->cbStreamIn = sizeof( DEBUGAUDIOSTREAM);81 pBackendCfg->cbStreamOut = sizeof(VAKITAUDIOSTREAM); 82 pBackendCfg->cbStreamIn = sizeof(VAKITAUDIOSTREAM); 84 83 85 84 pBackendCfg->cMaxStreamsOut = 1; /* Output */ … … 93 92 * @interface_method_impl{PDMIHOSTAUDIO,pfnInit} 94 93 */ 95 static DECLCALLBACK(int) drvHost DebugAudioInit(PPDMIHOSTAUDIO pInterface)94 static DECLCALLBACK(int) drvHostVaKitAudioInit(PPDMIHOSTAUDIO pInterface) 96 95 { 97 96 NOREF(pInterface); … … 105 104 * @interface_method_impl{PDMIHOSTAUDIO,pfnShutdown} 106 105 */ 107 static DECLCALLBACK(void) drvHost DebugAudioShutdown(PPDMIHOSTAUDIO pInterface)106 static DECLCALLBACK(void) drvHostVaKitAudioShutdown(PPDMIHOSTAUDIO pInterface) 108 107 { 109 108 NOREF(pInterface); … … 114 113 * @interface_method_impl{PDMIHOSTAUDIO,pfnGetStatus} 115 114 */ 116 static DECLCALLBACK(PDMAUDIOBACKENDSTS) drvHost DebugAudioGetStatus(PPDMIHOSTAUDIO pInterface, PDMAUDIODIR enmDir)115 static DECLCALLBACK(PDMAUDIOBACKENDSTS) drvHostVaKitAudioGetStatus(PPDMIHOSTAUDIO pInterface, PDMAUDIODIR enmDir) 117 116 { 118 117 RT_NOREF(enmDir); … … 147 146 NOREF(pInterface); 148 147 149 P DEBUGAUDIOSTREAM pDbgStream = (PDEBUGAUDIOSTREAM)pStream;148 PVAKITAUDIOSTREAM pDbgStream = (PVAKITAUDIOSTREAM)pStream; 150 149 151 150 /* Just adopt the wanted stream configuration. */ … … 199 198 * @interface_method_impl{PDMIHOSTAUDIO,pfnStreamCreate} 200 199 */ 201 static DECLCALLBACK(int) drvHost DebugAudioStreamCreate(PPDMIHOSTAUDIO pInterface,200 static DECLCALLBACK(int) drvHostVaKitAudioStreamCreate(PPDMIHOSTAUDIO pInterface, 202 201 PPDMAUDIOSTREAM pStream, 203 202 PPDMAUDIOSTREAMCFG pCfgReq, PPDMAUDIOSTREAMCFG pCfgAcq) … … 221 220 * @interface_method_impl{PDMIHOSTAUDIO,pfnStreamPlay} 222 221 */ 223 static DECLCALLBACK(int) drvHost DebugAudioStreamPlay(PPDMIHOSTAUDIO pInterface,222 static DECLCALLBACK(int) drvHostVaKitAudioStreamPlay(PPDMIHOSTAUDIO pInterface, 224 223 PPDMAUDIOSTREAM pStream, const void *pvBuf, uint32_t cbBuf, 225 224 uint32_t *pcbWritten) … … 227 226 RT_NOREF(pvBuf, cbBuf); 228 227 229 PDRVHOST DEBUGAUDIO pDrv = RT_FROM_MEMBER(pInterface, DRVHOSTDEBUGAUDIO, IHostAudio);230 P DEBUGAUDIOSTREAM pDbgStream = (PDEBUGAUDIOSTREAM)pStream;228 PDRVHOSTVAKITAUDIO pDrv = RT_FROM_MEMBER(pInterface, DRVHOSTVAKITAUDIO, IHostAudio); 229 PVAKITAUDIOSTREAM pDbgStream = (PVAKITAUDIOSTREAM)pStream; 231 230 232 231 /* Consume as many samples as would be played at the current frequency since last call. */ … … 294 293 * @interface_method_impl{PDMIHOSTAUDIO,pfnStreamCapture} 295 294 */ 296 static DECLCALLBACK(int) drvHost DebugAudioStreamCapture(PPDMIHOSTAUDIO pInterface,295 static DECLCALLBACK(int) drvHostVaKitAudioStreamCapture(PPDMIHOSTAUDIO pInterface, 297 296 PPDMAUDIOSTREAM pStream, void *pvBuf, uint32_t cbBuf, uint32_t *pcbRead) 298 297 { … … 318 317 { 319 318 RT_NOREF(pInterface); 320 P DEBUGAUDIOSTREAM pDbgStream = (PDEBUGAUDIOSTREAM)pStream;319 PVAKITAUDIOSTREAM pDbgStream = (PVAKITAUDIOSTREAM)pStream; 321 320 if ( pDbgStream 322 321 && pDbgStream->Out.pu8PlayBuffer) … … 348 347 349 348 350 static DECLCALLBACK(int) drvHost DebugAudioStreamDestroy(PPDMIHOSTAUDIO pInterface, PPDMAUDIOSTREAM pStream)349 static DECLCALLBACK(int) drvHostVaKitAudioStreamDestroy(PPDMIHOSTAUDIO pInterface, PPDMAUDIOSTREAM pStream) 351 350 { 352 351 AssertPtrReturn(pInterface, VERR_INVALID_POINTER); … … 362 361 } 363 362 364 static DECLCALLBACK(int) drvHost DebugAudioStreamControl(PPDMIHOSTAUDIO pInterface,363 static DECLCALLBACK(int) drvHostVaKitAudioStreamControl(PPDMIHOSTAUDIO pInterface, 365 364 PPDMAUDIOSTREAM pStream, PDMAUDIOSTREAMCMD enmStreamCmd) 366 365 { 367 366 RT_NOREF(enmStreamCmd); 367 368 368 AssertPtrReturn(pInterface, VERR_INVALID_POINTER); 369 369 AssertPtrReturn(pStream, VERR_INVALID_POINTER); … … 374 374 } 375 375 376 static DECLCALLBACK(PDMAUDIOSTRMSTS) drvHost DebugAudioStreamGetStatus(PPDMIHOSTAUDIO pInterface, PPDMAUDIOSTREAM pStream)376 static DECLCALLBACK(PDMAUDIOSTRMSTS) drvHostVaKitAudioStreamGetStatus(PPDMIHOSTAUDIO pInterface, PPDMAUDIOSTREAM pStream) 377 377 { 378 378 NOREF(pInterface); … … 383 383 } 384 384 385 static DECLCALLBACK(int) drvHost DebugAudioStreamIterate(PPDMIHOSTAUDIO pInterface, PPDMAUDIOSTREAM pStream)385 static DECLCALLBACK(int) drvHostVaKitAudioStreamIterate(PPDMIHOSTAUDIO pInterface, PPDMAUDIOSTREAM pStream) 386 386 { 387 387 NOREF(pInterface); … … 395 395 * @interface_method_impl{PDMIBASE,pfnQueryInterface} 396 396 */ 397 static DECLCALLBACK(void *) drvHost DebugAudioQueryInterface(PPDMIBASE pInterface, const char *pszIID)397 static DECLCALLBACK(void *) drvHostVaKitAudioQueryInterface(PPDMIBASE pInterface, const char *pszIID) 398 398 { 399 399 PPDMDRVINS pDrvIns = PDMIBASE_2_PDMDRV(pInterface); 400 PDRVHOST DEBUGAUDIO pThis = PDMINS_2_DATA(pDrvIns, PDRVHOSTDEBUGAUDIO);400 PDRVHOSTVAKITAUDIO pThis = PDMINS_2_DATA(pDrvIns, PDRVHOSTVAKITAUDIO); 401 401 402 402 PDMIBASE_RETURN_INTERFACE(pszIID, PDMIBASE, &pDrvIns->IBase); … … 411 411 * @copydoc FNPDMDRVCONSTRUCT 412 412 */ 413 static DECLCALLBACK(int) drvHost DebugAudioConstruct(PPDMDRVINS pDrvIns, PCFGMNODE pCfg, uint32_t fFlags)413 static DECLCALLBACK(int) drvHostVaKitAudioConstruct(PPDMDRVINS pDrvIns, PCFGMNODE pCfg, uint32_t fFlags) 414 414 { 415 415 RT_NOREF(pCfg, fFlags); 416 416 PDMDRV_CHECK_VERSIONS_RETURN(pDrvIns); 417 PDRVHOST DEBUGAUDIO pThis = PDMINS_2_DATA(pDrvIns, PDRVHOSTDEBUGAUDIO);418 LogRel(("Audio: Initializing DEBUGdriver\n"));417 PDRVHOSTVAKITAUDIO pThis = PDMINS_2_DATA(pDrvIns, PDRVHOSTVAKITAUDIO); 418 LogRel(("Audio: Initializing ValidationKit driver\n")); 419 419 420 420 /* … … 423 423 pThis->pDrvIns = pDrvIns; 424 424 /* IBase */ 425 pDrvIns->IBase.pfnQueryInterface = drvHost DebugAudioQueryInterface;425 pDrvIns->IBase.pfnQueryInterface = drvHostVaKitAudioQueryInterface; 426 426 /* IHostAudio */ 427 PDMAUDIO_IHOSTAUDIO_CALLBACKS(drvHost DebugAudio);427 PDMAUDIO_IHOSTAUDIO_CALLBACKS(drvHostVaKitAudio); 428 428 429 429 return VINF_SUCCESS; … … 433 433 * Char driver registration record. 434 434 */ 435 const PDMDRVREG g_DrvHost DebugAudio =435 const PDMDRVREG g_DrvHostValidationKitAudio = 436 436 { 437 437 /* u32Version */ 438 438 PDM_DRVREG_VERSION, 439 439 /* szName */ 440 " DebugAudio",440 "ValidationKit", 441 441 /* szRCMod */ 442 442 "", … … 444 444 "", 445 445 /* pszDescription */ 446 " Debugaudio host driver",446 "ValidationKit audio host driver", 447 447 /* fFlags */ 448 448 PDM_DRVREG_FLAGS_HOST_BITS_DEFAULT, … … 450 450 PDM_DRVREG_CLASS_AUDIO, 451 451 /* cMaxInstances */ 452 ~0U,452 1, 453 453 /* cbInstance */ 454 sizeof(DRVHOST DEBUGAUDIO),454 sizeof(DRVHOSTVAKITAUDIO), 455 455 /* pfnConstruct */ 456 drvHost DebugAudioConstruct,456 drvHostVaKitAudioConstruct, 457 457 /* pfnDestruct */ 458 458 NULL, -
trunk/src/VBox/Devices/Makefile.kmk
r64351 r64508 567 567 #VBoxDD_DEFS += VBOX_WITH_AUDIO_CALLBACKS 568 568 569 VBOX_WITH_AUDIO_VALIDATIONKIT := 1 570 569 571 # Enable Audio Queues implementation for macOS hosts (Core Audio backend). 570 572 VBoxDD_DEFS.darwin += VBOX_WITH_AUDIO_CA_QUEUES … … 602 604 VBoxDD_SOURCES += \ 603 605 Audio/DrvHostDebugAudio.cpp 606 endif 607 608 ifdef VBOX_WITH_AUDIO_VALIDATIONKIT 609 VBoxDD_DEFS += VBOX_WITH_AUDIO_VALIDATIONKIT 610 VBoxDD_SOURCES += \ 611 Audio/DrvHostValidationKit.cpp 604 612 endif 605 613 -
trunk/src/VBox/Devices/build/VBoxDD.cpp
r64351 r64508 280 280 return rc; 281 281 #endif 282 #ifdef VBOX_WITH_AUDIO_VALIDATIONKIT 283 rc = pCallbacks->pfnRegister(pCallbacks, &g_DrvHostValidationKitAudio); 284 if (RT_FAILURE(rc)) 285 return rc; 286 #endif 282 287 rc = pCallbacks->pfnRegister(pCallbacks, &g_DrvHostNullAudio); 283 288 if (RT_FAILURE(rc)) -
trunk/src/VBox/Devices/build/VBoxDD.h
r64351 r64508 121 121 extern const PDMDRVREG g_DrvHostDebugAudio; 122 122 #endif 123 #ifdef VBOX_WITH_AUDIO_VALIDATIONKIT 124 extern const PDMDRVREG g_DrvHostValidationKitAudio; 125 #endif 123 126 extern const PDMDRVREG g_DrvHostNullAudio; 124 127 #if defined(RT_OS_WINDOWS) -
trunk/src/VBox/Main/src-client/ConsoleImpl2.cpp
r64321 r64508 2852 2852 } 2853 2853 2854 /* The audio driver. */ 2855 InsertConfigNode(pInst, "LUN#0", &pLunL0); 2854 /* 2855 * The audio driver. 2856 */ 2857 uint8_t u8AudioLUN = 0; 2858 2859 CFGMR3InsertNodeF(pInst, &pLunL0, "LUN#%RU8", u8AudioLUN++); 2856 2860 InsertConfigString(pLunL0, "Driver", "AUDIO"); 2857 2861 InsertConfigNode(pLunL0, "Config", &pCfg); … … 2932 2936 #ifdef VBOX_WITH_VRDE_AUDIO 2933 2937 /* 2934 * The VRDE audio backend driver. This one always is there 2935 * and therefore is hardcoded here. 2938 * The VRDE audio backend driver. 2936 2939 */ 2937 InsertConfigNode(pInst, "LUN#1", &pLunL1);2940 CFGMR3InsertNodeF(pInst, &pLunL1, "LUN#%RU8", u8AudioLUN++); 2938 2941 InsertConfigString(pLunL1, "Driver", "AUDIO"); 2939 2942 … … 2946 2949 InsertConfigInteger(pCfg, "Object", (uintptr_t)mAudioVRDE); 2947 2950 InsertConfigInteger(pCfg, "ObjectVRDPServer", (uintptr_t)mConsoleVRDPServer); 2948 #endif 2951 #endif /* VBOX_WITH_VRDE_AUDIO */ 2949 2952 2950 2953 #ifdef VBOX_WITH_AUDIO_DEBUG 2951 InsertConfigNode(pInst, "LUN#2", &pLunL1); 2954 /* 2955 * The audio debug backend. Only can be used in debug builds. 2956 */ 2957 CFGMR3InsertNodeF(pInst, &pLunL1, "LUN#%RU8", u8AudioLUN++); 2952 2958 InsertConfigString(pLunL1, "Driver", "AUDIO"); 2953 2959 … … 2958 2964 InsertConfigString(pCfg, "AudioDriver", "DebugAudio"); 2959 2965 InsertConfigString(pCfg, "StreamName", bstr); 2960 #endif 2966 #endif /* VBOX_WITH_AUDIO_DEBUG */ 2967 2968 #ifdef VBOX_WITH_AUDIO_VALIDATIONKIT 2969 2970 /** @todo Make this a runtime-configurable entry! */ 2971 2972 /* 2973 * The ValidationKit backend. 2974 */ 2975 CFGMR3InsertNodeF(pInst, &pLunL1, "LUN#%RU8", u8AudioLUN++); 2976 InsertConfigString(pLunL1, "Driver", "AUDIO"); 2977 2978 InsertConfigNode(pLunL1, "AttachedDriver", &pLunL1); 2979 InsertConfigString(pLunL1, "Driver", "ValidationKit"); 2980 2981 InsertConfigNode(pLunL1, "Config", &pCfg); 2982 InsertConfigString(pCfg, "AudioDriver", "ValidationKit"); 2983 InsertConfigString(pCfg, "StreamName", bstr); 2984 #endif /* VBOX_WITH_AUDIO_VALIDATIONKIT */ 2985 2961 2986 /** @todo Add audio video recording driver here. */ 2962 2987 } … … 3064 3089 { 3065 3090 BOOL fSupports3D = VBoxOglIs3DAccelerationSupported(); 3091 fSupports3D = true; 3066 3092 if (!fSupports3D) 3067 3093 return VMR3SetError(pUVM, VERR_NOT_AVAILABLE, RT_SRC_POS,
Note:
See TracChangeset
for help on using the changeset viewer.