VirtualBox

Changeset 88009 in vbox for trunk


Ignore:
Timestamp:
Mar 8, 2021 12:35:54 PM (4 years ago)
Author:
vboxsync
svn:sync-xref-src-repo-rev:
143137
Message:

Audio: DrvAudioHlpPCMPropsBytesPerFrame -> DrvAudioHlpBytesPerFrame as it's related to DrvAudioHlpFramesToBytes and friends. bugref:9890

Location:
trunk/src/VBox/Devices/Audio
Files:
5 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Devices/Audio/DevIchAc97.cpp

    r88002 r88009  
    28122812
    28132813#ifdef VBOX_STRICT
    2814     const unsigned cbFrame = DrvAudioHlpPCMPropsBytesPerFrame(&pStreamCC->State.Cfg.Props);
     2814    const unsigned cbFrame = DrvAudioHlpBytesPerFrame(&pStreamCC->State.Cfg.Props);
    28152815#endif
    28162816
  • trunk/src/VBox/Devices/Audio/DrvAudio.h

    r88007 r88009  
    204204uint32_t DrvAudioHlpFloorBytesToFrame(PCPDMAUDIOPCMPROPS pProps, uint32_t cb);
    205205bool     DrvAudioHlpIsBytesAligned(PCPDMAUDIOPCMPROPS pProps, uint32_t cb);
     206uint32_t DrvAudioHlpBytesPerFrame(PCPDMAUDIOPCMPROPS pProps);
    206207uint32_t DrvAudioHlpBytesToFrames(PCPDMAUDIOPCMPROPS pProps, uint32_t cb);
    207208uint64_t DrvAudioHlpBytesToMilli(PCPDMAUDIOPCMPROPS pProps, uint32_t cb);
     
    219220bool     DrvAudioHlpPCMPropsAreEqual(PCPDMAUDIOPCMPROPS pPCMProps, PCPDMAUDIOSTREAMCFG pCfg);
    220221bool     DrvAudioHlpPCMPropsAreValid(PCPDMAUDIOPCMPROPS pProps);
    221 uint32_t DrvAudioHlpPCMPropsBytesPerFrame(PCPDMAUDIOPCMPROPS pProps);
    222222void     DrvAudioHlpPCMPropsPrint(PCPDMAUDIOPCMPROPS pProps);
    223223int      DrvAudioHlpPCMPropsToStreamCfg(PCPDMAUDIOPCMPROPS pPCMProps, PPDMAUDIOSTREAMCFG pCfg);
  • trunk/src/VBox/Devices/Audio/DrvAudioCommon.cpp

    r88008 r88009  
    11161116 * Converts frames to bytes.
    11171117 *
    1118  * @return Number of bytes.
     1118 * @returns Number of bytes.
    11191119 * @param   pProps      The PCM properties to use.
    11201120 * @param   cFrames     Number of audio frames to convert.
     1121 * @sa      PDMAUDIOPCMPROPS_F2B
    11211122 */
    11221123uint32_t DrvAudioHlpFramesToBytes(PCPDMAUDIOPCMPROPS pProps, uint32_t cFrames)
     
    13951396
    13961397/**
    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 */
     1404uint32_t DrvAudioHlpBytesPerFrame(PCPDMAUDIOPCMPROPS pProps)
     1405{
     1406    return PDMAUDIOPCMPROPS_F2B(pProps, 1 /*cFrames*/);
    14051407}
    14061408
  • trunk/src/VBox/Devices/Audio/DrvHostALSAAudio.cpp

    r88002 r88009  
    999999        pCfgAcq->Backend.cFramesPreBuffering     = obt.threshold;
    10001000
    1001         pStreamALSA->cbBuf = pCfgAcq->Backend.cFramesBufferSize * DrvAudioHlpPCMPropsBytesPerFrame(&pCfgAcq->Props);
     1001        pStreamALSA->cbBuf = pCfgAcq->Backend.cFramesBufferSize * DrvAudioHlpBytesPerFrame(&pCfgAcq->Props);
    10021002        pStreamALSA->pvBuf = RTMemAllocZ(pStreamALSA->cbBuf);
    10031003        if (!pStreamALSA->pvBuf)
     
    10591059        /* No pre-buffering. */
    10601060
    1061         pStreamALSA->cbBuf = pCfgAcq->Backend.cFramesBufferSize * DrvAudioHlpPCMPropsBytesPerFrame(&pCfgAcq->Props);
     1061        pStreamALSA->cbBuf = pCfgAcq->Backend.cFramesBufferSize * DrvAudioHlpBytesPerFrame(&pCfgAcq->Props);
    10621062        pStreamALSA->pvBuf = RTMemAlloc(pStreamALSA->cbBuf);
    10631063        if (!pStreamALSA->pvBuf)
  • trunk/src/VBox/Devices/Audio/testcase/tstAudioMixBuffer.cpp

    r88007 r88009  
    7171    RTTESTI_CHECK_MSG(PDMAUDIOPCMPROPS_F2B(&s_Cfg441StereoU32, 1) == 8,
    7272                      ("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)));
    7380
    7481    uint32_t u32;
Note: See TracChangeset for help on using the changeset viewer.

© 2025 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette