VirtualBox

Changeset 88022 in vbox for trunk/src/VBox/Main


Ignore:
Timestamp:
Mar 8, 2021 5:50:57 PM (4 years ago)
Author:
vboxsync
svn:sync-xref-src-repo-rev:
143150
Message:

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

Location:
trunk/src/VBox/Main/src-client
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Main/src-client/DrvAudioRec.cpp

    r88016 r88022  
    437437            pCodec->Opus.msFrame = AVREC_OPUS_FRAME_MS_DEFAULT; /* 20ms by default; to prevent division by zero. */
    438438        pCodec->Opus.csFrame = pSink->Codec.Parms.PCMProps.uHz / (1000 /* s in ms */ / pSink->Codec.Opus.msFrame);
    439         pCodec->Opus.cbFrame = DrvAudioHlpFramesToBytes(&pSink->Codec.Parms.PCMProps, pCodec->Opus.csFrame);
     439        pCodec->Opus.cbFrame = PDMAudioPropsFramesToBytes(&pSink->Codec.Parms.PCMProps, pCodec->Opus.csFrame);
    440440
    441441#ifdef VBOX_WITH_STATISTICS
     
    553553
    554554                    /* Every Opus frame marks a period for now. Optimize this later. */
    555                     pCfgAcq->Backend.cFramesPeriod       = DrvAudioHlpMilliToFrames(&pCfgAcq->Props, pSink->Codec.Opus.msFrame);
    556                     pCfgAcq->Backend.cFramesBufferSize   = DrvAudioHlpMilliToFrames(&pCfgAcq->Props, 100 /*ms*/); /** @todo Make this configurable. */
     555                    pCfgAcq->Backend.cFramesPeriod       = PDMAudioPropsMilliToFrames(&pCfgAcq->Props, pSink->Codec.Opus.msFrame);
     556                    pCfgAcq->Backend.cFramesBufferSize   = PDMAudioPropsMilliToFrames(&pCfgAcq->Props, 100 /*ms*/); /** @todo Make this configurable. */
    557557                    pCfgAcq->Backend.cFramesPreBuffering = pCfgAcq->Backend.cFramesPeriod * 2;
    558558                }
  • trunk/src/VBox/Main/src-client/DrvAudioVRDE.cpp

    r88002 r88022  
    9393
    9494    /* According to the VRDP docs, the VRDP server stores audio in 200ms chunks. */
    95     const uint32_t cFramesVrdpServer = DrvAudioHlpMilliToFrames(&pCfgAcq->Props, 200 /*ms*/);
    96 
    97     int rc = RTCircBufCreate(&pStreamVRDE->In.pCircBuf, DrvAudioHlpFramesToBytes(&pCfgAcq->Props, cFramesVrdpServer));
     95    const uint32_t cFramesVrdpServer = PDMAudioPropsMilliToFrames(&pCfgAcq->Props, 200 /*ms*/);
     96
     97    int rc = RTCircBufCreate(&pStreamVRDE->In.pCircBuf, PDMAudioPropsFramesToBytes(&pCfgAcq->Props, cFramesVrdpServer));
    9898    if (RT_SUCCESS(rc))
    9999    {
     
    137137
    138138        /* According to the VRDP docs, the VRDP server stores audio in 200ms chunks. */
    139         pCfgAcq->Backend.cFramesPeriod       = DrvAudioHlpMilliToFrames(&pCfgAcq->Props, 20  /*ms*/);
    140         pCfgAcq->Backend.cFramesBufferSize   = DrvAudioHlpMilliToFrames(&pCfgAcq->Props, 100 /*ms*/);
     139        pCfgAcq->Backend.cFramesPeriod       = PDMAudioPropsMilliToFrames(&pCfgAcq->Props, 20  /*ms*/);
     140        pCfgAcq->Backend.cFramesBufferSize   = PDMAudioPropsMilliToFrames(&pCfgAcq->Props, 100 /*ms*/);
    141141        pCfgAcq->Backend.cFramesPreBuffering = pCfgAcq->Backend.cFramesPeriod * 2;
    142142    }
     
    174174        {
    175175            rc = pDrv->pConsoleVRDPServer->SendAudioInputBegin(NULL, pStreamVRDE,
    176                                                                DrvAudioHlpMilliToFrames(&pStreamVRDE->pCfg->Props, 200 /*ms*/),
     176                                                               PDMAudioPropsMilliToFrames(&pStreamVRDE->pCfg->Props, 200 /*ms*/),
    177177                                                               pStreamVRDE->pCfg->Props.uHz, pStreamVRDE->pCfg->Props.cChannels,
    178178                                                               pStreamVRDE->pCfg->Props.cbSample * 8 /* Bit */);
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