VirtualBox

Changeset 63534 in vbox for trunk/src/VBox/Main/src-client


Ignore:
Timestamp:
Aug 16, 2016 10:14:46 AM (8 years ago)
Author:
vboxsync
Message:

Audio: Renaming.

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

Legend:

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

    r63529 r63534  
    102102    {
    103103        if (pCfgAcq)
    104             pCfgAcq->cSamples = _4K; /** @todo Make this configurable. */
     104            pCfgAcq->cSampleBufferSize = _4K; /** @todo Make this configurable. */
    105105    }
    106106
     
    125125    {
    126126        if (pCfgAcq)
    127             pCfgAcq->cSamples = _4K; /** @todo Make this configurable. */
     127            pCfgAcq->cSampleBufferSize = _4K; /** @todo Make this configurable. */
    128128    }
    129129
  • trunk/src/VBox/Main/src-client/DrvAudioVideoRec.cpp

    r63362 r63534  
    212212        int live = smin;
    213213
    214         if (live < 0 || live > hw->cSamples)
     214        if (live < 0 || live > hw->cSampleBufferSize)
    215215        {
    216             LogFlowFunc(("Error: live=%d hw->samples=%d\n", live, hw->cSamples));
     216            LogFlowFunc(("Error: live=%d hw->samples=%d\n", live, hw->cSampleBufferSize));
    217217            return 0;
    218218        }
     
    228228
    229229    live = audio_pcm_hw_get_live_out2 (hw, &nb_live);
    230     if (live < 0 || live > hw->cSamples)
    231     {
    232         LogFlowFunc(("Error: live=%d hw->samples=%d\n", live, hw->cSamples));
     230    if (live < 0 || live > hw->cSampleBufferSize)
     231    {
     232        LogFlowFunc(("Error: live=%d hw->samples=%d\n", live, hw->cSampleBufferSize));
    233233        return 0;
    234234    }
     
    257257{
    258258    int live = hw->cTotalSamplesCaptured - audio_pcm_hw_find_min_in (hw);
    259     if (live < 0 || live > hw->cSamples)
    260     {
    261         LogFlowFunc(("Error: live=%d hw->samples=%d\n", live, hw->cSamples));
     259    if (live < 0 || live > hw->cSampleBufferSize)
     260    {
     261        LogFlowFunc(("Error: live=%d hw->samples=%d\n", live, hw->cSampleBufferSize));
    262262        return 0;
    263263    }
     
    383383
    384384    PVIDEORECAUDIOOUT pVRDEVoiceOut = (PVIDEORECAUDIOOUT)pHostVoiceOut;
    385     pHostVoiceOut->cSamples = _4K; /* 4096 samples * 4 = 16K bytes total. */
     385    pHostVoiceOut->cSampleBufferSize = _4K; /* 4096 samples * 4 = 16K bytes total. */
    386386
    387387    return drvAudioVideoRecPcmInitInfo(&pVRDEVoiceOut->pHostVoiceOut.Props, pCfg);
     
    394394
    395395    PVIDEORECAUDIOIN pVRDEVoice = (PVIDEORECAUDIOIN)pHostVoiceIn;
    396     pHostVoiceIn->cSamples = _4K; /* 4096 samples * 4 = 16K bytes total. */
     396    pHostVoiceIn->cSampleBufferSize = _4K; /* 4096 samples * 4 = 16K bytes total. */
    397397
    398398    return drvAudioVideoRecPcmInitInfo(&pVRDEVoice->pHostVoiceIn.Props, pCfg);
     
    418418
    419419    /* How much space is available in the mix buffer. Use the smaller size of the too. */
    420     cSamplesRingBuffer = RT_MIN(cSamplesRingBuffer, (uint32_t)(pVRDEVoice->pHostVoiceIn.cSamples -
     420    cSamplesRingBuffer = RT_MIN(cSamplesRingBuffer, (uint32_t)(pVRDEVoice->pHostVoiceIn.cSampleBufferSize -
    421421                                audio_pcm_hw_get_live_in (&pVRDEVoice->pHostVoiceIn)));
    422422
     
    430430        /* How much is left? Split request at the end of our samples buffer. */
    431431        size_t cSamplesToRead = RT_MIN(cSamplesRingBuffer - cSamplesRead,
    432                                        (uint32_t)(pVRDEVoice->pHostVoiceIn.cSamples - pVRDEVoice->pHostVoiceIn.offSamplesWritten));
     432                                       (uint32_t)(pVRDEVoice->pHostVoiceIn.cSampleBufferSize - pVRDEVoice->pHostVoiceIn.offSamplesWritten));
    433433        size_t cbToRead = cSamplesToRead * sizeof(PDMAUDIOSAMPLE);
    434434        LogFlowFunc(("Try reading %zu samples (%zu bytes)\n", cSamplesToRead, cbToRead));
     
    462462
    463463        pVRDEVoice->pHostVoiceIn.offSamplesWritten = (pVRDEVoice->pHostVoiceIn.offSamplesWritten + cSamplesToRead)
    464                                               % pVRDEVoice->pHostVoiceIn.cSamples;
     464                                              % pVRDEVoice->pHostVoiceIn.cSampleBufferSize;
    465465
    466466        /* How much have we reads so far. */
     
    502502                 pHostVoiceOut->Props.uHz, pHostVoiceOut->Props.cChannels,
    503503                 pHostVoiceOut->Props.cBits, pHostVoiceOut->Props.fSigned,
    504                  pHostVoiceOut->cSamples, format));
     504                 pHostVoiceOut->cSampleBufferSize, format));
    505505
    506506    pVRDEVoiceOut->old_ticks = now;
    507507    int cSamplesToSend = RT_MIN(live, cSamplesPlayed);
    508508
    509     if (pHostVoiceOut->cOffSamplesRead + cSamplesToSend > pHostVoiceOut->cSamples)
     509    if (pHostVoiceOut->cOffSamplesRead + cSamplesToSend > pHostVoiceOut->cSampleBufferSize)
    510510    {
    511511        /* send the samples till the end of pHostStereoSampleBuf */
    512512        pDrv->pConsoleVRDPServer->SendAudioSamples(&pHostVoiceOut->paSamples[pHostVoiceOut->cOffSamplesRead],
    513                                                    (pHostVoiceOut->cSamples - pHostVoiceOut->cOffSamplesRead), format);
     513                                                   (pHostVoiceOut->cSampleBufferSize - pHostVoiceOut->cOffSamplesRead), format);
    514514        /*pHostStereoSampleBuff already has the samples which exceeded its space. They have overwriten the old
    515515         * played sampled starting from offset 0. So based on the number of samples that we had to play,
     
    517517         */
    518518        pDrv->pConsoleVRDPServer->SendAudioSamples(&pHostVoiceOut->paSamples[0],
    519                                                    (cSamplesToSend - (pHostVoiceOut->cSamples -
     519                                                   (cSamplesToSend - (pHostVoiceOut->cSampleBufferSize -
    520520                                                                      pHostVoiceOut->cOffSamplesRead)),
    521521                                                   format);
     
    527527    }
    528528
    529     pHostVoiceOut->cOffSamplesRead = (pHostVoiceOut->cOffSamplesRead + cSamplesToSend) % pHostVoiceOut->cSamples;
     529    pHostVoiceOut->cOffSamplesRead = (pHostVoiceOut->cOffSamplesRead + cSamplesToSend) % pHostVoiceOut->cSampleBufferSize;
    530530
    531531    *pcSamplesPlayed = cSamplesToSend;
     
    584584        pVRDEVoice->cbRateBufferAllocated = 0;
    585585
    586         pVRDEVoice->pHostVoiceIn.cSamples = 2048;
     586        pVRDEVoice->pHostVoiceIn.cSampleBufferSize = 2048;
    587587        /* Initialize the hardware info section with the audio settings */
    588588
     
    591591        /* Create the internal ring buffer. */
    592592        RTCircBufCreate(&pVRDEVoice->pRecordedVoiceBuf,
    593                         pVRDEVoice->pHostVoiceIn.cSamples * sizeof(PDMAUDIOSAMPLE));
     593                        pVRDEVoice->pHostVoiceIn.cSampleBufferSize * sizeof(PDMAUDIOSAMPLE));
    594594
    595595        if (!RT_VALID_PTR(pVRDEVoice->pRecordedVoiceBuf))
     
    600600
    601601        ASMAtomicWriteU32(&pVRDEVoice->status, CA_STATUS_INIT);
    602         return pDrv->pConsoleVRDPServer->SendAudioInputBegin(NULL, pVRDEVoice, pHostVoiceIn->cSamples,
     602        return pDrv->pConsoleVRDPServer->SendAudioInputBegin(NULL, pVRDEVoice, pHostVoiceIn->cSampleBufferSize,
    603603                                                             pHostVoiceIn->Props.uHz,
    604604                                                             pHostVoiceIn->Props.cChannels, pHostVoiceIn->Props.cBits);
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