VirtualBox

Ignore:
Timestamp:
Mar 8, 2021 5:50:57 PM (4 years ago)
Author:
vboxsync
Message:

Audio: Preparing to move some of the DrvAudio.h stuff into PDM. bugref:9890

File:
1 edited

Legend:

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

    r87994 r88022  
    666666         */
    667667        bd.dwFlags       = DSBCAPS_GLOBALFOCUS | DSBCAPS_GETCURRENTPOSITION2 | DSBCAPS_LOCSOFTWARE;
    668         bd.dwBufferBytes = DrvAudioHlpFramesToBytes(&pCfgReq->Props, pCfgReq->Backend.cFramesBufferSize);
     668        bd.dwBufferBytes = PDMAudioPropsFramesToBytes(&pCfgReq->Props, pCfgReq->Backend.cFramesBufferSize);
    669669
    670670        DSLOG(("DSound: Requested playback buffer is %RU64ms (%ld bytes)\n",
    671                DrvAudioHlpBytesToMilli(&pCfgReq->Props, bd.dwBufferBytes), bd.dwBufferBytes));
     671               PDMAudioPropsBytesToMilli(&pCfgReq->Props, bd.dwBufferBytes), bd.dwBufferBytes));
    672672
    673673        hr = IDirectSound8_CreateSoundBuffer(pThis->pDS, &bd, &pDSB, NULL);
     
    711711
    712712        DSLOG(("DSound: Acquired playback buffer is %RU64ms (%ld bytes)\n",
    713                DrvAudioHlpBytesToMilli(&pCfgReq->Props, bc.dwBufferBytes), bc.dwBufferBytes));
     713               PDMAudioPropsBytesToMilli(&pCfgReq->Props, bc.dwBufferBytes), bc.dwBufferBytes));
    714714
    715715        DSLOG(("DSound: Acquired playback format:\n"
     
    779779    if (SUCCEEDED(hr))
    780780    {
    781         DrvAudioHlpClearBuf(pProps, pv1, pStreamDS->cbBufSize, PDMAUDIOPCMPROPS_B2F(pProps, pStreamDS->cbBufSize));
     781        PDMAudioPropsClearBuffer(pProps, pv1, pStreamDS->cbBufSize, PDMAUDIOPCMPROPS_B2F(pProps, pStreamDS->cbBufSize));
    782782
    783783        directSoundPlayUnlock(pThis, pStreamDS->Out.pDSB, pv1, NULL, 0, 0);
     
    895895
    896896    if (   pStreamDS->Out.fFirstTransfer
    897         && pStreamDS->Out.cbTransferred >= DrvAudioHlpFramesToBytes(&pStreamDS->Cfg.Props, pStreamDS->Cfg.Backend.cFramesPreBuffering))
     897        && pStreamDS->Out.cbTransferred >= PDMAudioPropsFramesToBytes(&pStreamDS->Cfg.Props, pStreamDS->Cfg.Backend.cFramesPreBuffering))
    898898    {
    899899        hr = directSoundPlayStart(pThis, pStreamDS);
     
    10411041            if (SUCCEEDED(hr))
    10421042            {
    1043                 DrvAudioHlpClearBuf(&pStreamDS->Cfg.Props, pv1, cb1, PDMAUDIOPCMPROPS_B2F(&pStreamDS->Cfg.Props, cb1));
     1043                PDMAudioPropsClearBuffer(&pStreamDS->Cfg.Props, pv1, cb1, PDMAUDIOPCMPROPS_B2F(&pStreamDS->Cfg.Props, cb1));
    10441044                if (pv2 && cb2)
    1045                     DrvAudioHlpClearBuf(&pStreamDS->Cfg.Props, pv2, cb2, PDMAUDIOPCMPROPS_B2F(&pStreamDS->Cfg.Props, cb2));
     1045                    PDMAudioPropsClearBuffer(&pStreamDS->Cfg.Props, pv2, cb2, PDMAUDIOPCMPROPS_B2F(&pStreamDS->Cfg.Props, cb2));
    10461046                directSoundCaptureUnlock(pStreamDS->In.pDSCB, pv1, pv2, cb1, cb2);
    10471047            }
     
    10761076                if (SUCCEEDED(hr))
    10771077                {
    1078                     DrvAudioHlpClearBuf(&pStreamDS->Cfg.Props, pv1, cb1, PDMAUDIOPCMPROPS_B2F(&pStreamDS->Cfg.Props, cb1));
     1078                    PDMAudioPropsClearBuffer(&pStreamDS->Cfg.Props, pv1, cb1, PDMAUDIOPCMPROPS_B2F(&pStreamDS->Cfg.Props, cb1));
    10791079                    if (pv2 && cb2)
    1080                         DrvAudioHlpClearBuf(&pStreamDS->Cfg.Props, pv2, cb2, PDMAUDIOPCMPROPS_B2F(&pStreamDS->Cfg.Props, cb2));
     1080                        PDMAudioPropsClearBuffer(&pStreamDS->Cfg.Props, pv2, cb2, PDMAUDIOPCMPROPS_B2F(&pStreamDS->Cfg.Props, cb2));
    10811081                    directSoundPlayUnlock(pThis, pStreamDS->Out.pDSB, pv1, pv2, cb1, cb2);
    10821082                }
     
    14011401        bd.dwSize        = sizeof(bd);
    14021402        bd.lpwfxFormat   = &wfx;
    1403         bd.dwBufferBytes = DrvAudioHlpFramesToBytes(&pCfgReq->Props, pCfgReq->Backend.cFramesBufferSize);
     1403        bd.dwBufferBytes = PDMAudioPropsFramesToBytes(&pCfgReq->Props, pCfgReq->Backend.cFramesBufferSize);
    14041404
    14051405        DSLOG(("DSound: Requested capture buffer is %RU64ms (%ld bytes)\n",
    1406                DrvAudioHlpBytesToMilli(&pCfgReq->Props, bd.dwBufferBytes), bd.dwBufferBytes));
     1406               PDMAudioPropsBytesToMilli(&pCfgReq->Props, bd.dwBufferBytes), bd.dwBufferBytes));
    14071407
    14081408        LPDIRECTSOUNDCAPTUREBUFFER pDSCB;
     
    14571457
    14581458        DSLOG(("DSound: Acquired capture buffer is %RU64ms (%ld bytes)\n",
    1459                DrvAudioHlpBytesToMilli(&pCfgReq->Props, bc.dwBufferBytes), bc.dwBufferBytes));
     1459               PDMAudioPropsBytesToMilli(&pCfgReq->Props, bc.dwBufferBytes), bc.dwBufferBytes));
    14601460
    14611461        DSLOG(("DSound: Capture format:\n"
     
    25002500        {
    25012501            const uint64_t diffLastTransferredMs  = RTTimeMilliTS() - pStreamDS->Out.tsLastTransferredMs;
    2502             const uint64_t uLastTranserredChunkMs = DrvAudioHlpBytesToMilli(&pStreamDS->Cfg.Props, pStreamDS->Out.cbLastTransferred);
     2502            const uint64_t uLastTranserredChunkMs = PDMAudioPropsBytesToMilli(&pStreamDS->Cfg.Props, pStreamDS->Out.cbLastTransferred);
    25032503            if (   uLastTranserredChunkMs
    25042504                && diffLastTransferredMs < uLastTranserredChunkMs)
Note: See TracChangeset for help on using the changeset viewer.

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