Changeset 88016 in vbox
- Timestamp:
- Mar 8, 2021 1:14:14 PM (4 years ago)
- Location:
- trunk/src/VBox
- Files:
-
- 9 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Devices/Audio/AudioMixer.cpp
r88015 r88016 614 614 * Always use the sink's PCM audio format as the host side when creating a stream for it. 615 615 */ 616 AssertMsg(DrvAudioHlpP CMPropsAreValid(&pSink->PCMProps),616 AssertMsg(DrvAudioHlpPcmPropsAreValid(&pSink->PCMProps), 617 617 ("%s: Does not (yet) have a format set when it must\n", pSink->pszName)); 618 618 … … 1469 1469 AssertPtrReturn(pSink, VERR_INVALID_POINTER); 1470 1470 AssertPtrReturn(pPCMProps, VERR_INVALID_POINTER); 1471 AssertReturn(DrvAudioHlpP CMPropsAreValid(pPCMProps), VERR_INVALID_PARAMETER);1471 AssertReturn(DrvAudioHlpPcmPropsAreValid(pPCMProps), VERR_INVALID_PARAMETER); 1472 1472 1473 1473 int rc = RTCritSectEnter(&pSink->CritSect); -
trunk/src/VBox/Devices/Audio/DrvAudio.cpp
r88006 r88016 3206 3206 3207 3207 /* Validate PCM properties. */ 3208 if (!DrvAudioHlpP CMPropsAreValid(&pCfgReq->Props))3208 if (!DrvAudioHlpPcmPropsAreValid(&pCfgReq->Props)) 3209 3209 { 3210 3210 LogRel(("Audio: Invalid custom PCM properties set for stream '%s', cannot create stream\n", pStream->szName)); -
trunk/src/VBox/Devices/Audio/DrvAudio.h
r88015 r88016 218 218 219 219 bool DrvAudioHlpPcmPropsAreEqual(PCPDMAUDIOPCMPROPS pPCMProps1, PCPDMAUDIOPCMPROPS pPCMProps2); 220 bool DrvAudioHlpP CMPropsAreValid(PCPDMAUDIOPCMPROPS pProps);220 bool DrvAudioHlpPcmPropsAreValid(PCPDMAUDIOPCMPROPS pProps); 221 221 void DrvAudioHlpPcmPropsLog(PCPDMAUDIOPCMPROPS pProps); 222 222 /** @} */ -
trunk/src/VBox/Devices/Audio/DrvAudioCommon.cpp
r88015 r88016 786 786 787 787 if (fValid) 788 fValid = DrvAudioHlpP CMPropsAreValid(&pCfg->Props);788 fValid = DrvAudioHlpPcmPropsAreValid(&pCfg->Props); 789 789 790 790 return fValid; … … 1342 1342 1343 1343 /** 1344 * C hecks whether two given PCM properties are equal.1345 * 1346 * @returns @c true if equal, @c false if not.1347 * @param pProps1 Firstproperties to compare.1348 * @param pProps2 Secondproperties to compare.1344 * Compares two sets of PCM properties. 1345 * 1346 * @returns @c true if the same, @c false if not. 1347 * @param pProps1 The first set of properties to compare. 1348 * @param pProps2 The second set of properties to compare. 1349 1349 */ 1350 1350 bool DrvAudioHlpPcmPropsAreEqual(PCPDMAUDIOPCMPROPS pProps1, PCPDMAUDIOPCMPROPS pProps2) … … 1356 1356 return true; 1357 1357 1358 return 1359 1360 1361 1362 1358 return pProps1->uHz == pProps2->uHz 1359 && pProps1->cChannels == pProps2->cChannels 1360 && pProps1->cbSample == pProps2->cbSample 1361 && pProps1->fSigned == pProps2->fSigned 1362 && pProps1->fSwapEndian == pProps2->fSwapEndian; 1363 1363 } 1364 1364 … … 1366 1366 * Checks whether given PCM properties are valid or not. 1367 1367 * 1368 * Returns @c true if properties are valid, @c false if not. 1369 * @param pProps PCM properties to check. 1370 */ 1371 bool DrvAudioHlpPCMPropsAreValid(PCPDMAUDIOPCMPROPS pProps) 1368 * @note This is more of a supported than valid check. There is code for 1369 * unsigned samples elsewhere (like DrvAudioHlpClearBuf()), but this 1370 * function will flag such properties as not valid. 1371 * 1372 * @todo r=bird: See note and explain properly. 1373 * 1374 * @returns @c true if the properties are valid, @c false if not. 1375 * @param pProps The PCM properties to check. 1376 */ 1377 bool DrvAudioHlpPcmPropsAreValid(PCPDMAUDIOPCMPROPS pProps) 1372 1378 { 1373 1379 AssertPtrReturn(pProps, false); 1380 1381 /** @todo r=bird: This code is cannot make up its mind whether to return on 1382 * false, or whether to return at the end. (hint: just return 1383 * immediately, duh.) */ 1374 1384 1375 1385 /* Minimum 1 channel (mono), maximum 7.1 (= 8) channels. */ -
trunk/src/VBox/Devices/Audio/HDAStream.cpp
r88006 r88016 868 868 && pStreamR3->Dbg.Runtime.fEnabled) 869 869 { 870 Assert(DrvAudioHlpP CMPropsAreValid(&pStreamShared->State.Cfg.Props));870 Assert(DrvAudioHlpPcmPropsAreValid(&pStreamShared->State.Cfg.Props)); 871 871 872 872 if (fEnable) -
trunk/src/VBox/Devices/Audio/HDAStreamMap.cpp
r87942 r88016 49 49 AssertPtrReturn(pProps, VERR_INVALID_POINTER); 50 50 51 if (!DrvAudioHlpP CMPropsAreValid(pProps))51 if (!DrvAudioHlpPcmPropsAreValid(pProps)) 52 52 return VERR_INVALID_PARAMETER; 53 53 -
trunk/src/VBox/Devices/Audio/HDAStreamPeriod.cpp
r87810 r88016 83 83 if ( !u16LVI 84 84 || !u32CBL 85 || !DrvAudioHlpP CMPropsAreValid(&pStreamCfg->Props))85 || !DrvAudioHlpPcmPropsAreValid(&pStreamCfg->Props)) 86 86 { 87 87 return VERR_INVALID_PARAMETER; -
trunk/src/VBox/Devices/Audio/testcase/tstAudioMixBuffer.cpp
r88009 r88016 63 63 64 64 RTTESTI_CHECK(DrvAudioHlpGetBitrate(&s_Cfg441StereoS16) == 44100*4*8); 65 RTTESTI_CHECK(DrvAudioHlpGetBitrate(&s_Cfg441StereoU16) == 44100*4*8); 65 66 RTTESTI_CHECK(DrvAudioHlpGetBitrate(&s_Cfg441StereoU32) == 44100*8*8); 67 68 RTTESTI_CHECK(DrvAudioHlpPcmPropsAreValid(&s_Cfg441StereoS16)); 69 RTTESTI_CHECK(DrvAudioHlpPcmPropsAreValid(&s_Cfg441StereoU16) == false); /* go figure */ 70 RTTESTI_CHECK(DrvAudioHlpPcmPropsAreValid(&s_Cfg441StereoU32) == false); /* go figure */ 71 66 72 67 73 RTTESTI_CHECK_MSG(PDMAUDIOPCMPROPS_F2B(&s_Cfg441StereoS16, 1) == 4, … … 193 199 ); 194 200 195 RTTESTI_CHECK(DrvAudioHlpP CMPropsAreValid(&config));201 RTTESTI_CHECK(DrvAudioHlpPcmPropsAreValid(&config)); 196 202 197 203 uint32_t cBufSize = _1K; … … 314 320 ); 315 321 316 RTTESTI_CHECK(DrvAudioHlpP CMPropsAreValid(&cfg_p));322 RTTESTI_CHECK(DrvAudioHlpPcmPropsAreValid(&cfg_p)); 317 323 318 324 PDMAUDIOMIXBUF parent; … … 329 335 ); 330 336 331 RTTESTI_CHECK(DrvAudioHlpP CMPropsAreValid(&cfg_c1));337 RTTESTI_CHECK(DrvAudioHlpPcmPropsAreValid(&cfg_c1)); 332 338 333 339 uint32_t cFrames = 16; … … 348 354 ); 349 355 350 RTTESTI_CHECK(DrvAudioHlpP CMPropsAreValid(&cfg_c2));356 RTTESTI_CHECK(DrvAudioHlpPcmPropsAreValid(&cfg_c2)); 351 357 352 358 PDMAUDIOMIXBUF child2; … … 462 468 ); 463 469 464 RTTESTI_CHECK(DrvAudioHlpP CMPropsAreValid(&cfg_p));470 RTTESTI_CHECK(DrvAudioHlpPcmPropsAreValid(&cfg_p)); 465 471 466 472 PDMAUDIOMIXBUF parent; … … 485 491 ); 486 492 487 RTTESTI_CHECK(DrvAudioHlpP CMPropsAreValid(&cfg_c));493 RTTESTI_CHECK(DrvAudioHlpPcmPropsAreValid(&cfg_c)); 488 494 489 495 PDMAUDIOMIXBUF child; … … 567 573 ); 568 574 569 RTTESTI_CHECK(DrvAudioHlpP CMPropsAreValid(&cfg_p));575 RTTESTI_CHECK(DrvAudioHlpPcmPropsAreValid(&cfg_p)); 570 576 571 577 PDMAUDIOMIXBUF parent; … … 582 588 ); 583 589 584 RTTESTI_CHECK(DrvAudioHlpP CMPropsAreValid(&cfg_c));590 RTTESTI_CHECK(DrvAudioHlpPcmPropsAreValid(&cfg_c)); 585 591 586 592 PDMAUDIOMIXBUF child; … … 664 670 ); 665 671 666 RTTESTI_CHECK(DrvAudioHlpP CMPropsAreValid(&cfg));672 RTTESTI_CHECK(DrvAudioHlpPcmPropsAreValid(&cfg)); 667 673 668 674 PDMAUDIOVOLUME vol = { false, 0, 0 }; /* Not muted. */ -
trunk/src/VBox/Main/src-client/DrvAudioRec.cpp
r88002 r88016 1232 1232 pPCMProps->fSwapEndian = false; 1233 1233 1234 AssertMsgReturn(DrvAudioHlpP CMPropsAreValid(pPCMProps),1234 AssertMsgReturn(DrvAudioHlpPcmPropsAreValid(pPCMProps), 1235 1235 ("Configuration error: Audio configuration is invalid!\n"), VERR_PDM_DRVINS_UNKNOWN_CFG_VALUES); 1236 1236
Note:
See TracChangeset
for help on using the changeset viewer.