Changeset 54230 in vbox for trunk/src/VBox/Main
- Timestamp:
- Feb 17, 2015 1:13:02 PM (10 years ago)
- Location:
- trunk/src/VBox/Main/src-client
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Main/src-client/ConsoleImpl.cpp
r54108 r54230 1450 1450 #ifdef VBOX_WITH_PDM_AUDIO_DRIVER 1451 1451 if (mAudioVRDE) 1452 mAudioVRDE->onVRDE InputIntercept(false /* fIntercept*/);1452 mAudioVRDE->onVRDEControl(false /* fEnable */, 0 /* uFlags */); 1453 1453 #else 1454 1454 mcAudioRefs--; … … 1501 1501 #ifdef VBOX_WITH_PDM_AUDIO_DRIVER 1502 1502 if (mAudioVRDE) 1503 mAudioVRDE->onVRDE InputIntercept(true /* fIntercept*/);1503 mAudioVRDE->onVRDEControl(true /* fEnable */, 0 /* uFlags */); 1504 1504 #else 1505 1505 ++mcAudioRefs; … … 2380 2380 (PFNRT)i_unplugCpu, 3, 2381 2381 this, pUVM, (VMCPUID)aCpu); 2382 2382 2383 2383 /* release the lock before a VMR3* call (EMT might wait for it, @bugref{7648})! */ 2384 2384 alock.release(); … … 4821 4821 */ 4822 4822 bool fResume = false; 4823 int rc= i_suspendBeforeConfigChange(pUVM, NULL, &fResume);4824 if (FAILED( rc))4825 return rc;4823 HRESULT hr = i_suspendBeforeConfigChange(pUVM, NULL, &fResume); 4824 if (FAILED(hr)) 4825 return hr; 4826 4826 4827 4827 /* … … 4830 4830 * here to make requests from under the lock in order to serialize them. 4831 4831 */ 4832 PVMREQ pReq; 4833 int vrc = VMR3ReqCallWaitU(pUVM, 0 /*idDstCpu*/, 4834 (PFNRT)i_changeNetworkAttachment, 6, 4835 this, pUVM, pszDevice, uInstance, uLun, aNetworkAdapter); 4832 int rc = VMR3ReqCallWaitU(pUVM, 0 /*idDstCpu*/, 4833 (PFNRT)i_changeNetworkAttachment, 6, 4834 this, pUVM, pszDevice, uInstance, uLun, aNetworkAdapter); 4836 4835 4837 4836 if (fResume) 4838 4837 i_resumeAfterConfigChange(pUVM); 4839 4838 4840 if (RT_SUCCESS(vrc)) 4841 { 4842 LogFlowThisFunc(("Returns S_OK\n")); 4839 if (RT_SUCCESS(rc)) 4843 4840 return S_OK; 4844 }4845 4841 4846 4842 return setError(E_FAIL, 4847 tr("Could not change the network adaptor attachement type (%Rrc)"), 4848 vrc); 4843 tr("Could not change the network adaptor attachement type (%Rrc)"), rc); 4849 4844 } 4850 4845 -
trunk/src/VBox/Main/src-client/ConsoleVRDPServer.cpp
r53442 r54230 1 1 /* $Id$ */ 2 2 /** @file 3 * VBox Console VRDP Helper class3 * VBox Console VRDP helper class. 4 4 */ 5 5 6 6 /* 7 * Copyright (C) 2006-201 4Oracle Corporation7 * Copyright (C) 2006-2015 Oracle Corporation 8 8 * 9 9 * This file is part of VirtualBox Open Source Edition (OSE), as … … 651 651 size_t cbPortRange = portRange.length() + 1; 652 652 653 if (cbPortRange >= 0x10000)654 { 655 /* More than 64K seems to be an 653 if (cbPortRange >= _64K) 654 { 655 /* More than 64K seems to be an invalid port range string. */ 656 656 rc = VERR_TOO_MUCH_DATA; 657 657 break; … … 797 797 798 798 HRESULT hrc = server->mConsole->i_machine()->GetExtraData(com::Bstr(extraData).raw(), 799 bstrValue.asOutParam());799 bstrValue.asOutParam()); 800 800 if (FAILED(hrc) || bstrValue.isEmpty()) 801 801 { … … 805 805 806 806 hrc = server->mConsole->i_machine()->GetExtraData(com::Bstr(extraData).raw(), 807 bstrValue.asOutParam());807 bstrValue.asOutParam()); 808 808 if (FAILED(hrc)) 809 809 { … … 817 817 const char *pszPropertyName = &pFeature->achInfo[9]; 818 818 HRESULT hrc = server->mConsole->i_getVRDEServer()->GetVRDEProperty(Bstr(pszPropertyName).raw(), 819 bstrValue.asOutParam());819 bstrValue.asOutParam()); 820 820 if (FAILED(hrc)) 821 821 { … … 957 957 958 958 #ifdef VBOX_WITH_PDM_AUDIO_DRIVER 959 pServer->mConsole->i_getAudioVRDE()->onVRDEInputIntercept(false); 959 AudioVRDE *pVRDE = pServer->mConsole->i_getAudioVRDE(); 960 if (pVRDE) 961 pVRDE->onVRDEInputIntercept(false /* fIntercept */); 960 962 #else 961 963 PPDMIAUDIOSNIFFERPORT pPort = pServer->mConsole->i_getAudioSniffer()->getAudioSnifferPort(); … … 983 985 { 984 986 ConsoleVRDPServer *pServer = static_cast<ConsoleVRDPServer*>(pvCallback); 987 AssertPtrReturn(pServer, VERR_INVALID_POINTER); 985 988 986 989 LogFlowFunc(("%x\n", fu32Intercept)); … … 1018 1021 case VRDE_CLIENT_INTERCEPT_AUDIO_INPUT: 1019 1022 { 1020 /* This request is processed internally by the ConsoleVRDPServer. 1023 /* 1024 * This request is processed internally by the ConsoleVRDPServer. 1021 1025 * Only one client is allowed to intercept audio input. 1022 1026 */ 1023 1027 if (ASMAtomicCmpXchgU32(&pServer->mu32AudioInputClientId, u32ClientId, 0) == true) 1024 1028 { 1025 LogFunc((" Connected client %u\n", u32ClientId));1029 LogFunc(("Intercepting audio input by client %RU32\n", u32ClientId)); 1026 1030 #ifdef VBOX_WITH_PDM_AUDIO_DRIVER 1027 pServer->mConsole->i_getAudioVRDE()->onVRDEInputIntercept(true); 1031 AudioVRDE *pVRDE = pServer->mConsole->i_getAudioVRDE(); 1032 if (pVRDE) 1033 pVRDE->onVRDEInputIntercept(true /* fIntercept */); 1028 1034 #else 1029 1035 PPDMIAUDIOSNIFFERPORT pPort = pServer->mConsole->i_getAudioSniffer()->getAudioSnifferPort(); … … 1044 1050 else 1045 1051 { 1046 Log(("AUDIOIN: ignored client % u, active client %u\n", u32ClientId, pServer->mu32AudioInputClientId));1052 Log(("AUDIOIN: ignored client %RU32, active client %RU32\n", u32ClientId, pServer->mu32AudioInputClientId)); 1047 1053 rc = VERR_NOT_SUPPORTED; 1048 1054 } … … 1311 1317 #endif 1312 1318 1319 AudioVRDE *pVRDE = pServer->mConsole->i_getAudioVRDE(); 1320 if (!pVRDE) /* Nothing to do, bail out early. */ 1321 return; 1322 1313 1323 switch (u32Event) 1314 1324 { … … 1316 1326 { 1317 1327 #ifdef VBOX_WITH_PDM_AUDIO_DRIVER 1318 p Server->mConsole->i_getAudioVRDE()->onVRDEInputBegin(pvCtx, (PVRDEAUDIOINBEGIN)pvData);1328 pVRDE->onVRDEInputBegin(pvCtx, (PVRDEAUDIOINBEGIN)pvData); 1319 1329 #else 1320 1330 const VRDEAUDIOINBEGIN *pParms = (const VRDEAUDIOINBEGIN *)pvData; … … 1331 1341 case VRDE_AUDIOIN_DATA: 1332 1342 #ifdef VBOX_WITH_PDM_AUDIO_DRIVER 1333 p Server->mConsole->i_getAudioVRDE()->onVRDEInputData(pvCtx, pvData, cbData);1343 pVRDE->onVRDEInputData(pvCtx, pvData, cbData); 1334 1344 #else 1335 1345 pPort->pfnAudioInputEventData (pPort, pvCtx, pvData, cbData); … … 1339 1349 case VRDE_AUDIOIN_END: 1340 1350 #ifdef VBOX_WITH_PDM_AUDIO_DRIVER 1341 p Server->mConsole->i_getAudioVRDE()->onVRDEInputEnd(pvCtx);1351 pVRDE->onVRDEInputEnd(pvCtx); 1342 1352 #else 1343 1353 pPort->pfnAudioInputEventEnd (pPort, pvCtx); -
trunk/src/VBox/Main/src-client/DrvAudioVRDE.cpp
r53831 r54230 5 5 6 6 /* 7 * Copyright (C) 2013-201 4Oracle Corporation7 * Copyright (C) 2013-2015 Oracle Corporation 8 8 * 9 9 * This file is part of VirtualBox Open Source Edition (OSE), as … … 50 50 /** Pointer to the driver instance structure. */ 51 51 PDMIHOSTAUDIO IHostAudioR3; 52 /** Pointer to the VRDP's console object. */ 52 53 ConsoleVRDPServer *pConsoleVRDPServer; 53 /** Pointer to the DrvAudio port interface that is above it. */54 /** Pointer to the DrvAudio port interface that is above us. */ 54 55 PPDMIAUDIOCONNECTOR pDrvAudio; 56 /** Whether this driver is enabled or not. */ 57 bool fEnabled; 55 58 } DRVAUDIOVRDE, *PDRVAUDIOVRDE; 56 59 … … 64 67 /** Critical section. */ 65 68 RTCRITSECT CritSect; 66 67 69 } VRDESTREAMIN, *PVRDESTREAMIN; 68 70 … … 82 84 } 83 85 84 static DECLCALLBACK(int) drvAudioVRDEInitOut(PPDMIHOSTAUDIO pInterface,85 PPDMAUDIOHSTSTRMOUT pHstStrmOut, PPDMAUDIOSTREAMCFG pCfg,86 uint32_t *pcSamples)87 {88 PDRVAUDIOVRDE pDrv = RT_FROM_MEMBER(pInterface, DRVAUDIOVRDE, IHostAudioR3);89 AssertPtrReturn(pDrv, VERR_INVALID_POINTER);90 91 LogFlowFunc(("pHstStrmOut=%p, pCfg=%p\n", pHstStrmOut, pCfg));92 93 PVRDESTREAMOUT pVRDEStrmOut = (PVRDESTREAMOUT)pHstStrmOut;94 AssertPtrReturn(pVRDEStrmOut, VERR_INVALID_POINTER);95 96 if (pcSamples)97 *pcSamples = _4K; /** @todo Make this configurable. */98 99 return drvAudioStreamCfgToProps(pCfg, &pVRDEStrmOut->HstStrmOut.Props);100 }101 102 86 static DECLCALLBACK(int) drvAudioVRDEInitIn(PPDMIHOSTAUDIO pInterface, 103 87 PPDMAUDIOHSTSTRMIN pHstStrmIn, PPDMAUDIOSTREAMCFG pCfg, … … 115 99 116 100 return drvAudioStreamCfgToProps(pCfg, &pVRDEStrmIn->HstStrmIn.Props); 101 } 102 103 static DECLCALLBACK(int) drvAudioVRDEInitOut(PPDMIHOSTAUDIO pInterface, 104 PPDMAUDIOHSTSTRMOUT pHstStrmOut, PPDMAUDIOSTREAMCFG pCfg, 105 uint32_t *pcSamples) 106 { 107 PDRVAUDIOVRDE pDrv = RT_FROM_MEMBER(pInterface, DRVAUDIOVRDE, IHostAudioR3); 108 AssertPtrReturn(pDrv, VERR_INVALID_POINTER); 109 110 LogFlowFunc(("pHstStrmOut=%p, pCfg=%p\n", pHstStrmOut, pCfg)); 111 112 PVRDESTREAMOUT pVRDEStrmOut = (PVRDESTREAMOUT)pHstStrmOut; 113 AssertPtrReturn(pVRDEStrmOut, VERR_INVALID_POINTER); 114 115 if (pcSamples) 116 *pcSamples = _4K; /** @todo Make this configurable. */ 117 118 return drvAudioStreamCfgToProps(pCfg, &pVRDEStrmOut->HstStrmOut.Props); 119 } 120 121 static DECLCALLBACK(bool) drvAudioVRDEIsEnabled(PPDMIHOSTAUDIO pInterface, PDMAUDIODIR enmDir) 122 { 123 PDRVAUDIOVRDE pDrv = RT_FROM_MEMBER(pInterface, DRVAUDIOVRDE, IHostAudioR3); 124 AssertPtrReturn(pDrv, false); 125 126 NOREF(enmDir); 127 128 if (!pDrv->fEnabled) 129 return false; 130 131 return true; 117 132 } 118 133 … … 184 199 PDRVAUDIOVRDE pDrv = RT_FROM_MEMBER(pInterface, DRVAUDIOVRDE, IHostAudioR3); 185 200 AssertPtrReturn(pDrv, VERR_INVALID_POINTER); 201 186 202 PVRDESTREAMOUT pVRDEStrmOut = (PVRDESTREAMOUT)pHstStrmOut; 187 203 AssertPtrReturn(pVRDEStrmOut, VERR_INVALID_POINTER); … … 311 327 312 328 /* Initialize only if not already done. */ 329 int rc; 313 330 if (enmStreamCmd == PDMAUDIOSTREAMCMD_ENABLE) 314 331 { 315 int rc2= pDrv->pConsoleVRDPServer->SendAudioInputBegin(NULL, pVRDEStrmIn, audioMixBufSize(&pThisStrmIn->MixBuf),316 317 318 #ifdef DEBUG 319 if (rc2 == VERR_NOT_SUPPORTED)332 rc = pDrv->pConsoleVRDPServer->SendAudioInputBegin(NULL, pVRDEStrmIn, audioMixBufSize(&pThisStrmIn->MixBuf), 333 pThisStrmIn->Props.uHz, 334 pThisStrmIn->Props.cChannels, pThisStrmIn->Props.cBits); 335 if (rc == VERR_NOT_SUPPORTED) 336 { 320 337 LogFlowFunc(("No RDP client connected, so no input recording supported\n")); 321 #endif 338 rc = VINF_SUCCESS; 339 } 322 340 } 323 341 else if (enmStreamCmd == PDMAUDIOSTREAMCMD_DISABLE) 324 342 { 325 343 pDrv->pConsoleVRDPServer->SendAudioInputEnd(NULL /* pvUserCtx */); 326 } 327 328 return VINF_SUCCESS; 344 rc = VINF_SUCCESS; 345 } 346 347 return rc; 329 348 } 330 349 … … 334 353 pCfg->cbStreamIn = sizeof(VRDESTREAMIN); 335 354 pCfg->cMaxHstStrmsOut = 1; 336 pCfg->cMaxHstStrmsIn = 2; /* Microphone in + line in. */355 pCfg->cMaxHstStrmsIn = 2; /* Microphone in + Line in. */ 337 356 338 357 return VINF_SUCCESS; … … 367 386 } 368 387 369 int AudioVRDE::onVRDEInputIntercept(bool fIntercept) 370 { 371 LogFlowThisFunc(("fIntercept=%RTbool\n", fIntercept)); 388 int AudioVRDE::onVRDEControl(bool fEnable, uint32_t uFlags) 389 { 390 LogFlowThisFunc(("fEnable=%RTbool, uFlags=0x%x\n", fEnable, uFlags)); 391 392 mpDrv->fEnabled = fEnable; 372 393 373 394 return VINF_SUCCESS; /* Never veto. */ … … 398 419 bool fUnsigned = VRDE_AUDIO_FMT_SIGNED(audioFmt); 399 420 400 /*pVRDEStrmIn->cbSample = VRDE_AUDIO_FMT_BYTES_PER_SAMPLE(audioFmt);401 pVRDEStrmIn->uHz = iSampleHz;*/402 403 421 LogFlowFunc(("cbSample=%RU32, iSampleHz=%d, cChannels=%d, cBits=%d, fUnsigned=%RTbool\n", 404 422 VRDE_AUDIO_FMT_BYTES_PER_SAMPLE(audioFmt), iSampleHz, cChannels, cBits, fUnsigned)); … … 434 452 } 435 453 454 int AudioVRDE::onVRDEInputIntercept(bool fEnabled) 455 { 456 return VINF_SUCCESS; /* Never veto. */ 457 } 458 436 459 /** 437 460 * Construct a VRDE audio driver instance. … … 442 465 DECLCALLBACK(int) AudioVRDE::drvConstruct(PPDMDRVINS pDrvIns, PCFGMNODE pCfg, uint32_t fFlags) 443 466 { 467 AssertPtrReturn(pDrvIns, VERR_INVALID_POINTER); 468 AssertPtrReturn(pCfg, VERR_INVALID_POINTER); 469 444 470 PDRVAUDIOVRDE pThis = PDMINS_2_DATA(pDrvIns, PDRVAUDIOVRDE); 471 445 472 LogRel(("Audio: Initializing VRDE driver\n")); 446 473 LogFlowFunc(("fFlags=0x%x\n", fFlags)); … … 453 480 * Init the static parts. 454 481 */ 455 pThis->pDrvIns 482 pThis->pDrvIns = pDrvIns; 456 483 /* IBase */ 457 pDrvIns->IBase.pfnQueryInterface 484 pDrvIns->IBase.pfnQueryInterface = drvAudioVRDEQueryInterface; 458 485 /* IHostAudioR3 */ 459 pThis->IHostAudioR3.pfnInitIn = drvAudioVRDEInitIn; 460 pThis->IHostAudioR3.pfnInitOut = drvAudioVRDEInitOut; 461 pThis->IHostAudioR3.pfnControlOut = drvAudioVRDEControlOut; 462 pThis->IHostAudioR3.pfnControlIn = drvAudioVRDEControlIn; 463 pThis->IHostAudioR3.pfnFiniIn = drvAudioVRDEFiniIn; 464 pThis->IHostAudioR3.pfnFiniOut = drvAudioVRDEFiniOut; 465 pThis->IHostAudioR3.pfnCaptureIn = drvAudioVRDECaptureIn; 466 pThis->IHostAudioR3.pfnPlayOut = drvAudioVRDEPlayOut; 467 pThis->IHostAudioR3.pfnGetConf = drvAudioVRDEGetConf; 468 pThis->IHostAudioR3.pfnInit = drvAudioVRDEInit; 469 470 /* Get VRDPServer pointer. */ 486 PDMAUDIO_IHOSTAUDIOR3_CALLBACKS(drvAudioVRDE); 487 488 /* Init defaults. */ 489 pThis->fEnabled = false; 490 491 /* 492 * Get the ConsoleVRDPServer object pointer. 493 */ 471 494 void *pvUser; 472 495 int rc = CFGMR3QueryPtr(pCfg, "ObjectVRDPServer", &pvUser); … … 480 503 pThis->pConsoleVRDPServer = (ConsoleVRDPServer *)pvUser; 481 504 505 /* 506 * Get the AudioVRDE object pointer. 507 */ 482 508 pvUser = NULL; 483 509 rc = CFGMR3QueryPtr(pCfg, "Object", &pvUser); -
trunk/src/VBox/Main/src-client/DrvAudioVideoRec.cpp
r53442 r54230 5 5 6 6 /* 7 * Copyright (C) 2014 Oracle Corporation7 * Copyright (C) 2014-2015 Oracle Corporation 8 8 * 9 9 * This file is part of VirtualBox Open Source Edition (OSE), as … … 808 808 * Init the static parts. 809 809 */ 810 pThis->pDrvIns 810 pThis->pDrvIns = pDrvIns; 811 811 /* IBase */ 812 pDrvIns->IBase.pfnQueryInterface = drvAudioVideoRecQueryInterface; 813 pThis->IHostAudioR3.pfnInitIn = drvAudioVideoRecInitIn; 814 pThis->IHostAudioR3.pfnInitOut = drvAudioVideoRecInitOut; 815 pThis->IHostAudioR3.pfnControlOut = drvAudioVideoRecControlOut; 816 pThis->IHostAudioR3.pfnControlIn = drvAudioVideoRecControlIn; 817 pThis->IHostAudioR3.pfnFiniIn = drvAudioVideoRecFiniIn; 818 pThis->IHostAudioR3.pfnFiniOut = drvAudioVideoRecFiniOut; 819 pThis->IHostAudioR3.pfnCaptureIn = drvAudioVideoRecCaptureIn; 820 pThis->IHostAudioR3.pfnPlayOut = drvAudioVideoRecPlayOut; 821 pThis->IHostAudioR3.pfnGetConf = drvAudioVideoRecGetConf; 822 pThis->IHostAudioR3.pfnInit = drvAudioVideoRecInit; 812 pDrvIns->IBase.pfnQueryInterface = drvAudioVideoRecQueryInterface; 813 /* IHostAudioR3 */ 814 PDMAUDIO_IHOSTAUDIOR3_CALLBACKS(drvAudioVideoRec); 823 815 824 816 /* Get VRDPServer pointer. */
Note:
See TracChangeset
for help on using the changeset viewer.