Changeset 82252 in vbox for trunk/src/VBox/Main/src-client/DrvAudioRec.cpp
- Timestamp:
- Nov 27, 2019 9:31:53 PM (5 years ago)
- svn:sync-xref-src-repo-rev:
- 135070
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Main/src-client/DrvAudioRec.cpp
r76553 r82252 308 308 { 309 309 uint32_t uHz = pCodecParms->PCMProps.uHz; 310 uint8_t cBytes = pCodecParms->PCMProps.c Bytes;310 uint8_t cBytes = pCodecParms->PCMProps.cbSample; 311 311 uint8_t cChannels = pCodecParms->PCMProps.cChannels; 312 312 uint32_t uBitrate = pCodecParms->uBitrate; … … 427 427 pCodec->Parms.PCMProps.uHz = uHz; 428 428 pCodec->Parms.PCMProps.cChannels = cChannels; 429 pCodec->Parms.PCMProps.c Bytes= cBytes;430 pCodec->Parms.PCMProps.cShift = PDMAUDIOPCMPROPS_MAKE_SHIFT_PARMS(pSink->Codec.Parms.PCMProps.c Bytes,429 pCodec->Parms.PCMProps.cbSample = cBytes; 430 pCodec->Parms.PCMProps.cShift = PDMAUDIOPCMPROPS_MAKE_SHIFT_PARMS(pSink->Codec.Parms.PCMProps.cbSample, 431 431 pSink->Codec.Parms.PCMProps.cChannels); 432 432 pCodec->Parms.uBitrate = uBitrate; … … 522 522 AssertPtrReturn(pCfgAcq, VERR_INVALID_POINTER); 523 523 524 if (pCfgReq->DestSource.Dest != PDMAUDIOPLAYBACKDEST_FRONT) 525 { 524 if (pCfgReq->u.enmDst != PDMAUDIOPLAYBACKDST_FRONT) 525 { 526 LogRel2(("Recording: Support for surround audio not implemented yet\n")); 526 527 AssertFailed(); 527 528 LogRel2(("Recording: Support for surround audio not implemented yet\n"));529 528 return VERR_NOT_SUPPORTED; 530 529 } 531 530 532 int rc = VINF_SUCCESS;533 534 531 #ifdef VBOX_WITH_LIBOPUS 535 rc = RTCircBufCreate(&pStreamAV->pCircBuf, pSink->Codec.Opus.cbFrame * 2 /* Use "double buffering" */);532 int rc = RTCircBufCreate(&pStreamAV->pCircBuf, pSink->Codec.Opus.cbFrame * 2 /* Use "double buffering" */); 536 533 if (RT_SUCCESS(rc)) 537 534 { … … 554 551 * a specific sampling rate Opus is optimized for. */ 555 552 pCfgAcq->Props.uHz = pSink->Codec.Parms.PCMProps.uHz; 556 pCfgAcq->Props.cShift = PDMAUDIOPCMPROPS_MAKE_SHIFT_PARMS(pCfgAcq->Props.c Bytes, pCfgAcq->Props.cChannels);553 pCfgAcq->Props.cShift = PDMAUDIOPCMPROPS_MAKE_SHIFT_PARMS(pCfgAcq->Props.cbSample, pCfgAcq->Props.cChannels); 557 554 558 555 /* Every Opus frame marks a period for now. Optimize this later. */ … … 570 567 #else 571 568 RT_NOREF(pThis, pSink, pStreamAV, pCfgReq, pCfgAcq); 572 rc = VERR_NOT_SUPPORTED;569 int rc = VERR_NOT_SUPPORTED; 573 570 #endif /* VBOX_WITH_LIBOPUS */ 574 571 … … 599 596 Assert(pStreamAV->cbSrcBuf); 600 597 RTMemFree(pStreamAV->pvSrcBuf); 598 pStreamAV->pvSrcBuf = NULL; 601 599 pStreamAV->cbSrcBuf = 0; 602 600 } … … 606 604 Assert(pStreamAV->cbDstBuf); 607 605 RTMemFree(pStreamAV->pvDstBuf); 606 pStreamAV->pvDstBuf = NULL; 608 607 pStreamAV->cbDstBuf = 0; 609 608 } … … 657 656 658 657 LogRel(("Recording: Audio driver is using %RU32Hz, %RU16bit, %RU8 %s\n", 659 pThis->CodecParms.PCMProps.uHz, pThis->CodecParms.PCMProps.c Bytes* 8,658 pThis->CodecParms.PCMProps.uHz, pThis->CodecParms.PCMProps.cbSample * 8, 660 659 pThis->CodecParms.PCMProps.cChannels, pThis->CodecParms.PCMProps.cChannels == 1 ? "channel" : "channels")); 661 660 … … 1204 1203 rc = CFGMR3QueryU32(pCfg, "CodecHz", &pPCMProps->uHz); 1205 1204 AssertRCReturn(rc, rc); 1206 rc = CFGMR3QueryU8(pCfg, "CodecBits", &pPCMProps->c Bytes);1205 rc = CFGMR3QueryU8(pCfg, "CodecBits", &pPCMProps->cbSample); /** @todo CodecBits != CodecBytes */ 1207 1206 AssertRCReturn(rc, rc); 1207 pPCMProps->cbSample /= 8; /* Bits to bytes. */ 1208 1208 rc = CFGMR3QueryU8(pCfg, "CodecChannels", &pPCMProps->cChannels); 1209 1209 AssertRCReturn(rc, rc); … … 1211 1211 AssertRCReturn(rc, rc); 1212 1212 1213 pPCMProps->cBytes = pPCMProps->cBytes / 8; /* Bits to bytes. */ 1214 pPCMProps->cShift = PDMAUDIOPCMPROPS_MAKE_SHIFT_PARMS(pPCMProps->cBytes, pPCMProps->cChannels); 1213 pPCMProps->cShift = PDMAUDIOPCMPROPS_MAKE_SHIFT_PARMS(pPCMProps->cbSample, pPCMProps->cChannels); 1215 1214 pPCMProps->fSigned = true; 1216 1215 pPCMProps->fSwapEndian = false;
Note:
See TracChangeset
for help on using the changeset viewer.