Changeset 63534 in vbox for trunk/src/VBox/Main/src-client
- Timestamp:
- Aug 16, 2016 10:14:46 AM (8 years ago)
- Location:
- trunk/src/VBox/Main/src-client
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Main/src-client/DrvAudioVRDE.cpp
r63529 r63534 102 102 { 103 103 if (pCfgAcq) 104 pCfgAcq->cSample s= _4K; /** @todo Make this configurable. */104 pCfgAcq->cSampleBufferSize = _4K; /** @todo Make this configurable. */ 105 105 } 106 106 … … 125 125 { 126 126 if (pCfgAcq) 127 pCfgAcq->cSample s= _4K; /** @todo Make this configurable. */127 pCfgAcq->cSampleBufferSize = _4K; /** @todo Make this configurable. */ 128 128 } 129 129 -
trunk/src/VBox/Main/src-client/DrvAudioVideoRec.cpp
r63362 r63534 212 212 int live = smin; 213 213 214 if (live < 0 || live > hw->cSample s)214 if (live < 0 || live > hw->cSampleBufferSize) 215 215 { 216 LogFlowFunc(("Error: live=%d hw->samples=%d\n", live, hw->cSample s));216 LogFlowFunc(("Error: live=%d hw->samples=%d\n", live, hw->cSampleBufferSize)); 217 217 return 0; 218 218 } … … 228 228 229 229 live = audio_pcm_hw_get_live_out2 (hw, &nb_live); 230 if (live < 0 || live > hw->cSample s)231 { 232 LogFlowFunc(("Error: live=%d hw->samples=%d\n", live, hw->cSample s));230 if (live < 0 || live > hw->cSampleBufferSize) 231 { 232 LogFlowFunc(("Error: live=%d hw->samples=%d\n", live, hw->cSampleBufferSize)); 233 233 return 0; 234 234 } … … 257 257 { 258 258 int live = hw->cTotalSamplesCaptured - audio_pcm_hw_find_min_in (hw); 259 if (live < 0 || live > hw->cSample s)260 { 261 LogFlowFunc(("Error: live=%d hw->samples=%d\n", live, hw->cSample s));259 if (live < 0 || live > hw->cSampleBufferSize) 260 { 261 LogFlowFunc(("Error: live=%d hw->samples=%d\n", live, hw->cSampleBufferSize)); 262 262 return 0; 263 263 } … … 383 383 384 384 PVIDEORECAUDIOOUT pVRDEVoiceOut = (PVIDEORECAUDIOOUT)pHostVoiceOut; 385 pHostVoiceOut->cSample s= _4K; /* 4096 samples * 4 = 16K bytes total. */385 pHostVoiceOut->cSampleBufferSize = _4K; /* 4096 samples * 4 = 16K bytes total. */ 386 386 387 387 return drvAudioVideoRecPcmInitInfo(&pVRDEVoiceOut->pHostVoiceOut.Props, pCfg); … … 394 394 395 395 PVIDEORECAUDIOIN pVRDEVoice = (PVIDEORECAUDIOIN)pHostVoiceIn; 396 pHostVoiceIn->cSample s= _4K; /* 4096 samples * 4 = 16K bytes total. */396 pHostVoiceIn->cSampleBufferSize = _4K; /* 4096 samples * 4 = 16K bytes total. */ 397 397 398 398 return drvAudioVideoRecPcmInitInfo(&pVRDEVoice->pHostVoiceIn.Props, pCfg); … … 418 418 419 419 /* How much space is available in the mix buffer. Use the smaller size of the too. */ 420 cSamplesRingBuffer = RT_MIN(cSamplesRingBuffer, (uint32_t)(pVRDEVoice->pHostVoiceIn.cSample s-420 cSamplesRingBuffer = RT_MIN(cSamplesRingBuffer, (uint32_t)(pVRDEVoice->pHostVoiceIn.cSampleBufferSize - 421 421 audio_pcm_hw_get_live_in (&pVRDEVoice->pHostVoiceIn))); 422 422 … … 430 430 /* How much is left? Split request at the end of our samples buffer. */ 431 431 size_t cSamplesToRead = RT_MIN(cSamplesRingBuffer - cSamplesRead, 432 (uint32_t)(pVRDEVoice->pHostVoiceIn.cSample s- pVRDEVoice->pHostVoiceIn.offSamplesWritten));432 (uint32_t)(pVRDEVoice->pHostVoiceIn.cSampleBufferSize - pVRDEVoice->pHostVoiceIn.offSamplesWritten)); 433 433 size_t cbToRead = cSamplesToRead * sizeof(PDMAUDIOSAMPLE); 434 434 LogFlowFunc(("Try reading %zu samples (%zu bytes)\n", cSamplesToRead, cbToRead)); … … 462 462 463 463 pVRDEVoice->pHostVoiceIn.offSamplesWritten = (pVRDEVoice->pHostVoiceIn.offSamplesWritten + cSamplesToRead) 464 % pVRDEVoice->pHostVoiceIn.cSample s;464 % pVRDEVoice->pHostVoiceIn.cSampleBufferSize; 465 465 466 466 /* How much have we reads so far. */ … … 502 502 pHostVoiceOut->Props.uHz, pHostVoiceOut->Props.cChannels, 503 503 pHostVoiceOut->Props.cBits, pHostVoiceOut->Props.fSigned, 504 pHostVoiceOut->cSample s, format));504 pHostVoiceOut->cSampleBufferSize, format)); 505 505 506 506 pVRDEVoiceOut->old_ticks = now; 507 507 int cSamplesToSend = RT_MIN(live, cSamplesPlayed); 508 508 509 if (pHostVoiceOut->cOffSamplesRead + cSamplesToSend > pHostVoiceOut->cSample s)509 if (pHostVoiceOut->cOffSamplesRead + cSamplesToSend > pHostVoiceOut->cSampleBufferSize) 510 510 { 511 511 /* send the samples till the end of pHostStereoSampleBuf */ 512 512 pDrv->pConsoleVRDPServer->SendAudioSamples(&pHostVoiceOut->paSamples[pHostVoiceOut->cOffSamplesRead], 513 (pHostVoiceOut->cSample s- pHostVoiceOut->cOffSamplesRead), format);513 (pHostVoiceOut->cSampleBufferSize - pHostVoiceOut->cOffSamplesRead), format); 514 514 /*pHostStereoSampleBuff already has the samples which exceeded its space. They have overwriten the old 515 515 * played sampled starting from offset 0. So based on the number of samples that we had to play, … … 517 517 */ 518 518 pDrv->pConsoleVRDPServer->SendAudioSamples(&pHostVoiceOut->paSamples[0], 519 (cSamplesToSend - (pHostVoiceOut->cSample s-519 (cSamplesToSend - (pHostVoiceOut->cSampleBufferSize - 520 520 pHostVoiceOut->cOffSamplesRead)), 521 521 format); … … 527 527 } 528 528 529 pHostVoiceOut->cOffSamplesRead = (pHostVoiceOut->cOffSamplesRead + cSamplesToSend) % pHostVoiceOut->cSample s;529 pHostVoiceOut->cOffSamplesRead = (pHostVoiceOut->cOffSamplesRead + cSamplesToSend) % pHostVoiceOut->cSampleBufferSize; 530 530 531 531 *pcSamplesPlayed = cSamplesToSend; … … 584 584 pVRDEVoice->cbRateBufferAllocated = 0; 585 585 586 pVRDEVoice->pHostVoiceIn.cSample s= 2048;586 pVRDEVoice->pHostVoiceIn.cSampleBufferSize = 2048; 587 587 /* Initialize the hardware info section with the audio settings */ 588 588 … … 591 591 /* Create the internal ring buffer. */ 592 592 RTCircBufCreate(&pVRDEVoice->pRecordedVoiceBuf, 593 pVRDEVoice->pHostVoiceIn.cSample s* sizeof(PDMAUDIOSAMPLE));593 pVRDEVoice->pHostVoiceIn.cSampleBufferSize * sizeof(PDMAUDIOSAMPLE)); 594 594 595 595 if (!RT_VALID_PTR(pVRDEVoice->pRecordedVoiceBuf)) … … 600 600 601 601 ASMAtomicWriteU32(&pVRDEVoice->status, CA_STATUS_INIT); 602 return pDrv->pConsoleVRDPServer->SendAudioInputBegin(NULL, pVRDEVoice, pHostVoiceIn->cSample s,602 return pDrv->pConsoleVRDPServer->SendAudioInputBegin(NULL, pVRDEVoice, pHostVoiceIn->cSampleBufferSize, 603 603 pHostVoiceIn->Props.uHz, 604 604 pHostVoiceIn->Props.cChannels, pHostVoiceIn->Props.cBits);
Note:
See TracChangeset
for help on using the changeset viewer.