Changeset 82252 in vbox for trunk/src/VBox/Main
- Timestamp:
- Nov 27, 2019 9:31:53 PM (5 years ago)
- Location:
- trunk/src/VBox/Main/src-client
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Main/src-client/ConsoleImpl2.cpp
r82132 r82252 391 391 if (RT_FAILURE(vrc)) 392 392 throw ConfigError("CFGMR3InsertNode", vrc, pcszName); 393 } 394 395 /** 396 * Helper that calls CFGMR3InsertNodeF and throws an RTCError if that fails. 397 * 398 * @param pNode See CFGMR3InsertNodeF. 399 * @param ppChild See CFGMR3InsertNodeF. 400 * @param pszNameFormat Name format string, see CFGMR3InsertNodeF. 401 * @param ... Format arguments. 402 */ 403 static void InsertConfigNodeF(PCFGMNODE pNode, 404 PCFGMNODE *ppChild, 405 const char *pszNameFormat, 406 ...) 407 { 408 va_list va; 409 va_start(va, pszNameFormat); 410 int vrc = CFGMR3InsertNodeF(pNode, ppChild, "%N", pszNameFormat, &va); 411 va_end(va); 412 if (RT_FAILURE(vrc)) 413 throw ConfigError("CFGMR3InsertNodeF", vrc, pszNameFormat); 393 414 } 394 415 … … 2986 3007 unsigned uAudioLUN = 0; 2987 3008 2988 CFGMR3InsertNodeF(pInst, &pLunL0, "LUN#%RU8", uAudioLUN); 2989 rc = i_configAudioDriver(audioAdapter, virtualBox, pMachine, pLunL0, 2990 strAudioDriver.c_str()); 3009 InsertConfigNodeF(pInst, &pLunL0, "LUN#%u", uAudioLUN); 3010 rc = i_configAudioDriver(audioAdapter, virtualBox, pMachine, pLunL0, strAudioDriver.c_str()); 2991 3011 if (RT_SUCCESS(rc)) 2992 3012 uAudioLUN++; … … 2994 3014 #ifdef VBOX_WITH_AUDIO_VRDE 2995 3015 /* Insert dummy audio driver to have the LUN configured. */ 2996 CFGMR3InsertNodeF(pInst, &pLunL0, "LUN#%RU8", uAudioLUN);2997 3016 InsertConfigNodeF(pInst, &pLunL0, "LUN#%u", uAudioLUN); 3017 InsertConfigString(pLunL0, "Driver", "AUDIO"); 2998 3018 AudioDriverCfg DrvCfgVRDE(strAudioDevice, 0 /* Instance */, uAudioLUN, "AudioVRDE"); 2999 3019 rc = mAudioVRDE->InitializeConfig(&DrvCfgVRDE); … … 3004 3024 #ifdef VBOX_WITH_AUDIO_RECORDING 3005 3025 /* Insert dummy audio driver to have the LUN configured. */ 3006 CFGMR3InsertNodeF(pInst, &pLunL0, "LUN#%RU8", uAudioLUN);3007 3026 InsertConfigNodeF(pInst, &pLunL0, "LUN#%u", uAudioLUN); 3027 InsertConfigString(pLunL0, "Driver", "AUDIO"); 3008 3028 AudioDriverCfg DrvCfgVideoRec(strAudioDevice, 0 /* Instance */, uAudioLUN, "AudioVideoRec"); 3009 3029 rc = Recording.mAudioRec->InitializeConfig(&DrvCfgVideoRec); … … 3015 3035 { 3016 3036 #ifdef VBOX_WITH_AUDIO_DEBUG 3017 CFGMR3InsertNodeF(pInst, &pLunL0, "LUN#%RU8", uAudioLUN); 3018 rc = i_configAudioDriver(audioAdapter, virtualBox, pMachine, pLunL0, 3019 "DebugAudio"); 3037 InsertConfigNodeF(pInst, &pLunL0, "LUN#%u", uAudioLUN); 3038 rc = i_configAudioDriver(audioAdapter, virtualBox, pMachine, pLunL0, "DebugAudio"); 3020 3039 if (RT_SUCCESS(rc)) 3021 3040 uAudioLUN++; … … 3044 3063 * The ValidationKit backend. 3045 3064 */ 3046 CFGMR3InsertNodeF(pInst, &pLunL0, "LUN#%RU8", uAudioLUN); 3047 rc = i_configAudioDriver(audioAdapter, virtualBox, pMachine, pLunL0, 3048 "ValidationKitAudio"); 3065 InsertConfigNodeF(pInst, &pLunL0, "LUN#%u", uAudioLUN); 3066 rc = i_configAudioDriver(audioAdapter, virtualBox, pMachine, pLunL0, "ValidationKitAudio"); 3049 3067 if (RT_SUCCESS(rc)) 3050 3068 uAudioLUN++; … … 5033 5051 5034 5052 AssertMsg(uLun == 0, ("Network attachments with LUN > 0 are not supported yet\n")); 5035 CFGMR3InsertNodeF(pInst, &pLunL0, "LUN#%u", uLun);5053 InsertConfigNodeF(pInst, &pLunL0, "LUN#%u", uLun); 5036 5054 5037 5055 #ifdef VBOX_WITH_NETSHAPER -
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; -
trunk/src/VBox/Main/src-client/DrvAudioVRDE.cpp
r76553 r82252 87 87 pCfgAcq->Props.uHz = 22050; /* The VRDP server's internal frequency. */ 88 88 pCfgAcq->Props.cChannels = 2; 89 pCfgAcq->Props.c Bytes= 2; /* 16 bit. */89 pCfgAcq->Props.cbSample = 2; /* 16 bit. */ 90 90 pCfgAcq->Props.fSigned = true; 91 91 pCfgAcq->Props.fSwapEndian = false; 92 pCfgAcq->Props.cShift = PDMAUDIOPCMPROPS_MAKE_SHIFT_PARMS(pCfgAcq->Props.c Bytes, pCfgAcq->Props.cChannels);92 pCfgAcq->Props.cShift = PDMAUDIOPCMPROPS_MAKE_SHIFT_PARMS(pCfgAcq->Props.cbSample, pCfgAcq->Props.cChannels); 93 93 94 94 /* According to the VRDP docs, the VRDP server stores audio in 200ms chunks. */ … … 133 133 pCfgAcq->Props.uHz = 22050; /* The VRDP server's internal frequency. */ 134 134 pCfgAcq->Props.cChannels = 2; 135 pCfgAcq->Props.c Bytes= 2; /* 16 bit. */135 pCfgAcq->Props.cbSample = 2; /* 16 bit. */ 136 136 pCfgAcq->Props.fSigned = true; 137 pCfgAcq->Props.cShift = PDMAUDIOPCMPROPS_MAKE_SHIFT_PARMS(pCfgAcq->Props.c Bytes, pCfgAcq->Props.cChannels);137 pCfgAcq->Props.cShift = PDMAUDIOPCMPROPS_MAKE_SHIFT_PARMS(pCfgAcq->Props.cbSample, pCfgAcq->Props.cChannels); 138 138 139 139 /* According to the VRDP docs, the VRDP server stores audio in 200ms chunks. */ … … 174 174 DrvAudioHlpMilliToFrames(200 /* ms */, &pStreamVRDE->pCfg->Props), 175 175 pStreamVRDE->pCfg->Props.uHz, pStreamVRDE->pCfg->Props.cChannels, 176 pStreamVRDE->pCfg->Props.c Bytes* 8 /* Bit */);176 pStreamVRDE->pCfg->Props.cbSample * 8 /* Bit */); 177 177 if (rc == VERR_NOT_SUPPORTED) 178 178 { … … 291 291 VRDEAUDIOFORMAT format = VRDE_AUDIO_FMT_MAKE(pProps->uHz, 292 292 pProps->cChannels, 293 pProps->c Bytes* 8 /* Bit */,293 pProps->cbSample * 8 /* Bit */, 294 294 pProps->fSigned); 295 295 … … 429 429 int rc; 430 430 if (pCfgReq->enmDir == PDMAUDIODIR_IN) 431 rc = vrdeCreateStreamIn (pStreamVRDE, pCfgReq, pCfgAcq);431 rc = vrdeCreateStreamIn( pStreamVRDE, pCfgReq, pCfgAcq); 432 432 else 433 433 rc = vrdeCreateStreamOut(pStreamVRDE, pCfgReq, pCfgAcq);
Note:
See TracChangeset
for help on using the changeset viewer.