- Timestamp:
- Mar 8, 2021 12:35:54 PM (4 years ago)
- svn:sync-xref-src-repo-rev:
- 143137
- Location:
- trunk/src/VBox/Devices/Audio
- Files:
-
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Devices/Audio/DevIchAc97.cpp
r88002 r88009 2812 2812 2813 2813 #ifdef VBOX_STRICT 2814 const unsigned cbFrame = DrvAudioHlp PCMPropsBytesPerFrame(&pStreamCC->State.Cfg.Props);2814 const unsigned cbFrame = DrvAudioHlpBytesPerFrame(&pStreamCC->State.Cfg.Props); 2815 2815 #endif 2816 2816 -
trunk/src/VBox/Devices/Audio/DrvAudio.h
r88007 r88009 204 204 uint32_t DrvAudioHlpFloorBytesToFrame(PCPDMAUDIOPCMPROPS pProps, uint32_t cb); 205 205 bool DrvAudioHlpIsBytesAligned(PCPDMAUDIOPCMPROPS pProps, uint32_t cb); 206 uint32_t DrvAudioHlpBytesPerFrame(PCPDMAUDIOPCMPROPS pProps); 206 207 uint32_t DrvAudioHlpBytesToFrames(PCPDMAUDIOPCMPROPS pProps, uint32_t cb); 207 208 uint64_t DrvAudioHlpBytesToMilli(PCPDMAUDIOPCMPROPS pProps, uint32_t cb); … … 219 220 bool DrvAudioHlpPCMPropsAreEqual(PCPDMAUDIOPCMPROPS pPCMProps, PCPDMAUDIOSTREAMCFG pCfg); 220 221 bool DrvAudioHlpPCMPropsAreValid(PCPDMAUDIOPCMPROPS pProps); 221 uint32_t DrvAudioHlpPCMPropsBytesPerFrame(PCPDMAUDIOPCMPROPS pProps);222 222 void DrvAudioHlpPCMPropsPrint(PCPDMAUDIOPCMPROPS pProps); 223 223 int DrvAudioHlpPCMPropsToStreamCfg(PCPDMAUDIOPCMPROPS pPCMProps, PPDMAUDIOSTREAMCFG pCfg); -
trunk/src/VBox/Devices/Audio/DrvAudioCommon.cpp
r88008 r88009 1116 1116 * Converts frames to bytes. 1117 1117 * 1118 * @return Number of bytes.1118 * @returns Number of bytes. 1119 1119 * @param pProps The PCM properties to use. 1120 1120 * @param cFrames Number of audio frames to convert. 1121 * @sa PDMAUDIOPCMPROPS_F2B 1121 1122 */ 1122 1123 uint32_t DrvAudioHlpFramesToBytes(PCPDMAUDIOPCMPROPS pProps, uint32_t cFrames) … … 1395 1396 1396 1397 /** 1397 * Returns the bytes per frame for given PCM properties. 1398 * 1399 * @return Bytes per (audio) frame. 1400 * @param pProps PCM properties to retrieve bytes per frame for. 1401 */ 1402 uint32_t DrvAudioHlpPCMPropsBytesPerFrame(PCPDMAUDIOPCMPROPS pProps) 1403 { 1404 return PDMAUDIOPCMPROPS_F2B(pProps, 1 /* Frame */); 1398 * Get number of bytes per frame. 1399 * 1400 * @returns Number of bytes per audio frame. 1401 * @param pProps PCM properties to use. 1402 * @sa PDMAUDIOPCMPROPS_F2B 1403 */ 1404 uint32_t DrvAudioHlpBytesPerFrame(PCPDMAUDIOPCMPROPS pProps) 1405 { 1406 return PDMAUDIOPCMPROPS_F2B(pProps, 1 /*cFrames*/); 1405 1407 } 1406 1408 -
trunk/src/VBox/Devices/Audio/DrvHostALSAAudio.cpp
r88002 r88009 999 999 pCfgAcq->Backend.cFramesPreBuffering = obt.threshold; 1000 1000 1001 pStreamALSA->cbBuf = pCfgAcq->Backend.cFramesBufferSize * DrvAudioHlp PCMPropsBytesPerFrame(&pCfgAcq->Props);1001 pStreamALSA->cbBuf = pCfgAcq->Backend.cFramesBufferSize * DrvAudioHlpBytesPerFrame(&pCfgAcq->Props); 1002 1002 pStreamALSA->pvBuf = RTMemAllocZ(pStreamALSA->cbBuf); 1003 1003 if (!pStreamALSA->pvBuf) … … 1059 1059 /* No pre-buffering. */ 1060 1060 1061 pStreamALSA->cbBuf = pCfgAcq->Backend.cFramesBufferSize * DrvAudioHlp PCMPropsBytesPerFrame(&pCfgAcq->Props);1061 pStreamALSA->cbBuf = pCfgAcq->Backend.cFramesBufferSize * DrvAudioHlpBytesPerFrame(&pCfgAcq->Props); 1062 1062 pStreamALSA->pvBuf = RTMemAlloc(pStreamALSA->cbBuf); 1063 1063 if (!pStreamALSA->pvBuf) -
trunk/src/VBox/Devices/Audio/testcase/tstAudioMixBuffer.cpp
r88007 r88009 71 71 RTTESTI_CHECK_MSG(PDMAUDIOPCMPROPS_F2B(&s_Cfg441StereoU32, 1) == 8, 72 72 ("got %x, expected 4\n", PDMAUDIOPCMPROPS_F2B(&s_Cfg441StereoU32, 1))); 73 74 RTTESTI_CHECK_MSG(DrvAudioHlpBytesPerFrame(&s_Cfg441StereoS16) == 4, 75 ("got %x, expected 4\n", DrvAudioHlpBytesPerFrame(&s_Cfg441StereoS16))); 76 RTTESTI_CHECK_MSG(DrvAudioHlpBytesPerFrame(&s_Cfg441StereoU16) == 4, 77 ("got %x, expected 4\n", DrvAudioHlpBytesPerFrame(&s_Cfg441StereoU16))); 78 RTTESTI_CHECK_MSG(DrvAudioHlpBytesPerFrame(&s_Cfg441StereoU32) == 8, 79 ("got %x, expected 4\n", DrvAudioHlpBytesPerFrame(&s_Cfg441StereoU32))); 73 80 74 81 uint32_t u32;
Note:
See TracChangeset
for help on using the changeset viewer.