VirtualBox

Changeset 63534 in vbox for trunk/src


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

Audio: Renaming.

Location:
trunk/src/VBox
Files:
10 edited

Legend:

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

    r63529 r63534  
    545545    AudioMixBufDestroy(&pHstStream->MixBuf);
    546546
    547     if (CfgHostAcq.cSamples)
    548     {
    549         LogFlowFunc(("[%s] cSamples=%RU32\n", pHstStream->szName, CfgHostAcq.cSamples * 4));
    550 
    551         rc2 = AudioMixBufInit(&pHstStream->MixBuf, pHstStream->szName, &PCMProps, CfgHostAcq.cSamples * 4);
     547    if (CfgHostAcq.cSampleBufferSize)
     548    {
     549        LogFlowFunc(("[%s] cSamples=%RU32\n", pHstStream->szName, CfgHostAcq.cSampleBufferSize * 4));
     550
     551        rc2 = AudioMixBufInit(&pHstStream->MixBuf, pHstStream->szName, &PCMProps, CfgHostAcq.cSampleBufferSize * 4);
    552552        AssertRC(rc2);
    553553    }
     
    567567    AudioMixBufDestroy(&pGstStream->MixBuf);
    568568
    569     if (CfgHostAcq.cSamples)
    570     {
    571         LogFlowFunc(("[%s] cSamples=%RU32\n", pGstStream->szName, CfgHostAcq.cSamples * 2));
    572 
    573         rc2 = AudioMixBufInit(&pGstStream->MixBuf, pGstStream->szName, &PCMProps, CfgHostAcq.cSamples * 2);
     569    if (CfgHostAcq.cSampleBufferSize)
     570    {
     571        LogFlowFunc(("[%s] cSamples=%RU32\n", pGstStream->szName, CfgHostAcq.cSampleBufferSize * 2));
     572
     573        rc2 = AudioMixBufInit(&pGstStream->MixBuf, pGstStream->szName, &PCMProps, CfgHostAcq.cSampleBufferSize * 2);
    574574        AssertRC(rc2);
    575575    }
     
    579579#endif
    580580
    581     if (CfgHostAcq.cSamples)
     581    if (CfgHostAcq.cSampleBufferSize)
    582582    {
    583583        if (pCfgGuest->enmDir == PDMAUDIODIR_IN)
  • trunk/src/VBox/Devices/Audio/DrvHostALSAAudio.cpp

    r63481 r63534  
    13591359            break;
    13601360
    1361         pCfgAcq->uHz           = obt.freq;
    1362         pCfgAcq->cChannels     = obt.nchannels;
    1363         pCfgAcq->enmFormat     = enmFormat;
    1364         pCfgAcq->enmEndianness = enmEnd;
    1365         pCfgAcq->cSamples      = obt.samples * 4;
     1361        pCfgAcq->uHz               = obt.freq;
     1362        pCfgAcq->cChannels         = obt.nchannels;
     1363        pCfgAcq->enmFormat         = enmFormat;
     1364        pCfgAcq->enmEndianness     = enmEnd;
     1365        pCfgAcq->cSampleBufferSize = obt.samples * 4;
    13661366
    13671367        PDMAUDIOPCMPROPS Props;
     
    14221422            break;
    14231423
    1424         pCfgAcq->uHz           = obt.freq;
    1425         pCfgAcq->cChannels     = obt.nchannels;
    1426         pCfgAcq->enmFormat     = enmFormat;
    1427         pCfgAcq->enmEndianness = enmEnd;
    1428         pCfgAcq->cSamples      = obt.samples;
     1424        pCfgAcq->uHz               = obt.freq;
     1425        pCfgAcq->cChannels         = obt.nchannels;
     1426        pCfgAcq->enmFormat         = enmFormat;
     1427        pCfgAcq->enmEndianness     = enmEnd;
     1428        pCfgAcq->cSampleBufferSize = obt.samples;
    14291429
    14301430        PDMAUDIOPCMPROPS Props;
  • trunk/src/VBox/Devices/Audio/DrvHostCoreAudio.cpp

    r63529 r63534  
    15621562
    15631563        if (pCfgAcq)
    1564             pCfgAcq->cSamples = cSamples;
     1564            pCfgAcq->cSampleBufferSize = cSamples;
    15651565    }
    15661566    else
     
    18821882
    18831883        if (pCfgAcq)
    1884             pCfgAcq->cSamples = cSamples;
     1884            pCfgAcq->cSampleBufferSize = cSamples;
    18851885    }
    18861886    else
  • trunk/src/VBox/Devices/Audio/DrvHostDSound.cpp

    r63532 r63534  
    14621462
    14631463        if (pCfgAcq)
    1464             pCfgAcq->cSamples = pThis->cfg.cbBufferOut >> pDSoundStream->Props.cShift;
     1464            pCfgAcq->cSampleBufferSize = pThis->cfg.cbBufferOut >> pDSoundStream->Props.cShift;
    14651465
    14661466        /* Try to open playback in case the device is already there. */
     
    17141714
    17151715        if (pCfgAcq)
    1716             pCfgAcq->cSamples = pThis->cfg.cbBufferIn >> pDSoundStream->Props.cShift;
     1716            pCfgAcq->cSampleBufferSize = pThis->cfg.cbBufferIn >> pDSoundStream->Props.cShift;
    17171717
    17181718        /* Try to open capture in case the device is already there. */
  • trunk/src/VBox/Devices/Audio/DrvHostDebugAudio.cpp

    r63532 r63534  
    138138    {
    139139        if (pCfgAcq)
    140             pCfgAcq->cSamples = _1K;
     140            pCfgAcq->cSampleBufferSize = _1K;
    141141    }
    142142
     
    183183    {
    184184        if (pCfgAcq)
    185             pCfgAcq->cSamples = pDbgStream->Out.cMaxSamplesInPlayBuffer;
     185            pCfgAcq->cSampleBufferSize = pDbgStream->Out.cMaxSamplesInPlayBuffer;
    186186    }
    187187
  • trunk/src/VBox/Devices/Audio/DrvHostNullAudio.cpp

    r63529 r63534  
    221221    {
    222222        if (pCfgAcq)
    223             pCfgAcq->cSamples = _1K;
     223            pCfgAcq->cSampleBufferSize = _1K;
    224224    }
    225225
     
    244244        {
    245245            if (pCfgAcq)
    246                 pCfgAcq->cSamples = pNullStream->cMaxSamplesInPlayBuffer;
     246                pCfgAcq->cSampleBufferSize = pNullStream->cMaxSamplesInPlayBuffer;
    247247        }
    248248        else
  • trunk/src/VBox/Devices/Audio/DrvHostOSSAudio.cpp

    r63529 r63534  
    711711                pStrm->cbBuf = cbBuf;
    712712
    713                 pCfgAcq->cSamples = cSamples;
     713                pCfgAcq->cSampleBufferSize = cSamples;
    714714            }
    715715        }
     
    833833            }
    834834#endif
    835             pCfgAcq->cSamples = cSamples;
     835            pCfgAcq->cSampleBufferSize = cSamples;
    836836        }
    837837
  • trunk/src/VBox/Devices/Audio/DrvHostPulseAudio.cpp

    r63529 r63534  
    684684                pStrm->pDrv     = pThis;
    685685
    686                 pCfgAcq->cSamples = cbBuf >> Props.cShift;
     686                pCfgAcq->cSampleBufferSize = cbBuf >> Props.cShift;
    687687            }
    688688            else
     
    733733        pPAStrm->pu8PeekBuf = NULL;
    734734
    735         pCfgAcq->uHz       = pPAStrm->SampleSpec.rate;
    736         pCfgAcq->cChannels = pPAStrm->SampleSpec.channels;
    737         pCfgAcq->cSamples = RT_MIN(pPAStrm->BufAttr.fragsize * 10, pPAStrm->BufAttr.maxlength) >> Props.cShift;
     735        pCfgAcq->uHz               = pPAStrm->SampleSpec.rate;
     736        pCfgAcq->cChannels         = pPAStrm->SampleSpec.channels;
     737        pCfgAcq->cSampleBufferSize = RT_MIN(pPAStrm->BufAttr.fragsize * 10, pPAStrm->BufAttr.maxlength) >> Props.cShift;
    738738    }
    739739
  • 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