Changeset 53831 in vbox for trunk/src/VBox/Main/src-client
- Timestamp:
- Jan 15, 2015 4:15:21 PM (10 years ago)
- Location:
- trunk/src/VBox/Main/src-client
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Main/src-client/ConsoleImpl2.cpp
r53815 r53831 2688 2688 case AudioDriverType_WinMM: 2689 2689 { 2690 # ifdef VBOX_WITH_PDM_AUDIO_DRIVER2690 # ifdef VBOX_WITH_PDM_AUDIO_DRIVER 2691 2691 #error "Port WinMM audio backend!" /** @todo Still needed? */ 2692 # else2692 # else 2693 2693 InsertConfigString(pCfg, "AudioDriver", "winmm"); 2694 # endif2694 # endif 2695 2695 break; 2696 2696 } … … 2709 2709 case AudioDriverType_SolAudio: 2710 2710 { 2711 #ifdef VBOX_WITH_PDM_AUDIO_DRIVER 2712 #error "Port Solaris audio backend!" /** @todo Port Solaris driver. */ 2713 #else 2711 # ifdef VBOX_WITH_PDM_AUDIO_DRIVER 2712 /** @todo Hack alert: Find a better solution. */ 2713 LogRel(("Audio: WARNING: Solaris Audio is deprecated, please switch to OSS!\n")); 2714 LogRel(("Audio: Automatically setting host audio backend to OSS\n")); 2715 /* Manually set backend to OSS for now. */ 2716 InsertConfigString(pLunL1, "Driver", "OSSAudio"); 2717 # else 2714 2718 InsertConfigString(pCfg, "AudioDriver", "solaudio"); 2715 # endif2719 # endif 2716 2720 break; 2717 2721 } -
trunk/src/VBox/Main/src-client/DrvAudioVRDE.cpp
r53442 r53831 204 204 pHstStrmOut->Props.fSigned); 205 205 206 LogFlowFunc(("hz=%d, chan=%d, cBits=%d, fSigned=%RTbool, format=%ld\n", 206 pVRDEStrmOut->old_ticks = now; 207 208 int cSamplesToSend = live; 209 210 /* if (!cSamplesToSend) 211 { 212 if (pcSamplesPlayed) 213 pcSamplesPlayed = 0; 214 215 return 0; 216 }*/ 217 218 LogFlowFunc(("uFreq=%RU32, cChan=%RU8, cBits=%RU8, fSigned=%RTbool, enmFormat=%ld, cSamplesToSend=%RU32\n", 207 219 pHstStrmOut->Props.uHz, pHstStrmOut->Props.cChannels, 208 220 pHstStrmOut->Props.cBits, pHstStrmOut->Props.fSigned, 209 format)); 210 211 pVRDEStrmOut->old_ticks = now; 212 int cSamplesToSend = RT_MIN(live, cSamplesPlayed); 221 format, cSamplesToSend)); 213 222 214 223 uint32_t cReadTotal = 0; … … 218 227 int rc = audioMixBufAcquire(&pHstStrmOut->MixBuf, cSamplesToSend, 219 228 &pSamples, &cRead); 220 if (RT_SUCCESS(rc)) 229 if ( RT_SUCCESS(rc) 230 && cRead) 221 231 { 222 232 cReadTotal = cRead; … … 228 238 &pSamples, &cRead); 229 239 if (RT_SUCCESS(rc)) 230 {231 cReadTotal += cRead;232 240 pDrv->pConsoleVRDPServer->SendAudioSamples(pSamples, cRead, format); 233 } 241 242 cReadTotal += cRead; 234 243 } 235 244 } 236 245 237 audioMixBufFinish(&pHstStrmOut->MixBuf, cReadTotal); 238 246 audioMixBufFinish(&pHstStrmOut->MixBuf, cSamplesToSend); 247 248 /* 249 * Always report back all samples acquired, regardless of whether the 250 * VRDP server actually did process those. 251 */ 239 252 if (pcSamplesPlayed) 240 253 *pcSamplesPlayed = cReadTotal; 241 254 242 LogFlowFunc(("c SamplesToSend=%RU32, rc=%Rrc\n", cSamplesToSend, rc));255 LogFlowFunc(("cReadTotal=%RU32, rc=%Rrc\n", cReadTotal, rc)); 243 256 return rc; 244 257 } … … 269 282 AssertPtrReturn(pDrv, VERR_INVALID_POINTER); 270 283 284 PVRDESTREAMIN pVRDEStrmOut = (PVRDESTREAMIN)pHstStrmOut; 285 AssertPtrReturn(pVRDEStrmOut, VERR_INVALID_POINTER); 286 271 287 LogFlowFunc(("enmStreamCmd=%ld\n", enmStreamCmd)); 272 288 273 return VINF_SUCCESS; 274 } 275 276 static DECLCALLBACK(int) drvAudioVRDEControlIn(PPDMIHOSTAUDIO pInterface, PPDMAUDIOHSTSTRMIN pHstStrmIn2, /** @todo Fix param types! */ 289 audioMixBufReset(&pHstStrmOut->MixBuf); 290 291 return VINF_SUCCESS; 292 } 293 294 static DECLCALLBACK(int) drvAudioVRDEControlIn(PPDMIHOSTAUDIO pInterface, PPDMAUDIOHSTSTRMIN pHstStrmIn, 277 295 PDMAUDIOSTREAMCMD enmStreamCmd) 278 296 { … … 280 298 AssertPtrReturn(pDrv, VERR_INVALID_POINTER); 281 299 282 PVRDESTREAMIN pVRDEStrmIn = (PVRDESTREAMIN)pHstStrmIn 2;300 PVRDESTREAMIN pVRDEStrmIn = (PVRDESTREAMIN)pHstStrmIn; 283 301 AssertPtrReturn(pVRDEStrmIn, VERR_INVALID_POINTER); 284 302 285 PPDMAUDIOHSTSTRMIN p HstStrmIn = &pVRDEStrmIn->HstStrmIn;303 PPDMAUDIOHSTSTRMIN pThisStrmIn = &pVRDEStrmIn->HstStrmIn; 286 304 287 305 LogFlowFunc(("enmStreamCmd=%ld\n", enmStreamCmd)); 306 307 if (!pDrv->pConsoleVRDPServer) 308 return VINF_SUCCESS; 309 310 audioMixBufReset(&pThisStrmIn->MixBuf); 288 311 289 312 /* Initialize only if not already done. */ 290 313 if (enmStreamCmd == PDMAUDIOSTREAMCMD_ENABLE) 291 314 { 292 int rc2 = pDrv->pConsoleVRDPServer->SendAudioInputBegin(NULL, pVRDEStrmIn, audioMixBufSize(&p HstStrmIn->MixBuf),293 p HstStrmIn->Props.uHz,294 p HstStrmIn->Props.cChannels, pHstStrmIn->Props.cBits);315 int rc2 = pDrv->pConsoleVRDPServer->SendAudioInputBegin(NULL, pVRDEStrmIn, audioMixBufSize(&pThisStrmIn->MixBuf), 316 pThisStrmIn->Props.uHz, 317 pThisStrmIn->Props.cChannels, pThisStrmIn->Props.cBits); 295 318 #ifdef DEBUG 296 319 if (rc2 == VERR_NOT_SUPPORTED) … … 299 322 } 300 323 else if (enmStreamCmd == PDMAUDIOSTREAMCMD_DISABLE) 324 { 301 325 pDrv->pConsoleVRDPServer->SendAudioInputEnd(NULL /* pvUserCtx */); 326 } 302 327 303 328 return VINF_SUCCESS; … … 345 370 { 346 371 LogFlowThisFunc(("fIntercept=%RTbool\n", fIntercept)); 372 347 373 return VINF_SUCCESS; /* Never veto. */ 348 374 } … … 430 456 /* IBase */ 431 457 pDrvIns->IBase.pfnQueryInterface = drvAudioVRDEQueryInterface; 458 /* IHostAudioR3 */ 432 459 pThis->IHostAudioR3.pfnInitIn = drvAudioVRDEInitIn; 433 460 pThis->IHostAudioR3.pfnInitOut = drvAudioVRDEInitOut;
Note:
See TracChangeset
for help on using the changeset viewer.