VirtualBox

Ignore:
Timestamp:
May 28, 2021 8:31:50 AM (4 years ago)
Author:
vboxsync
Message:

AudioMixer: Removed AudioMixBufWriteCirc. bugref:9890

File:
1 edited

Legend:

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

    r89332 r89333  
    272272    for (uint32_t i = 0; i < cToWrite; i++)
    273273    {
    274         RTTESTI_CHECK_RC_OK(AudioMixBufWriteCirc(&mb, &aFrames16, sizeof(aFrames16), &cFramesWritten));
     274        AudioMixBufWrite(&mb, &WrState, &aFrames16[0], sizeof(aFrames16), 0 /*offDstFrame*/, 1, &cFramesWritten);
    275275        RTTESTI_CHECK(cFramesWritten == 1);
     276        AudioMixBufCommit(&mb, cFramesWritten);
    276277    }
    277278    RTTESTI_CHECK(!AudioMixBufIsEmpty(&mb));
     
    280281    RTTESTI_CHECK(AudioMixBufUsed(&mb) == cToWrite + cFramesWrittenAbs /* + last absolute write */);
    281282
    282     RTTESTI_CHECK_RC_OK(AudioMixBufWriteCirc(&mb, &aFrames16, sizeof(aFrames16), &cFramesWritten));
     283    AudioMixBufWrite(&mb, &WrState, &aFrames16[0], sizeof(aFrames16), 0 /*offDstFrame*/, 1, &cFramesWritten);
    283284    RTTESTI_CHECK(cFramesWritten == 1);
     285    AudioMixBufCommit(&mb, cFramesWritten);
    284286    RTTESTI_CHECK(AudioMixBufFree(&mb) == 0);
    285287    RTTESTI_CHECK(AudioMixBufFreeBytes(&mb) == AUDIOMIXBUF_F2B(&mb, 0U));
     
    572574    RTTESTI_CHECK_RC_OK_RETV(AudioMixBufInit(&MixBuf, "NewPeekMixBuf", &CfgSrc, cFrames));
    573575
     576    /* Write state (source). */
     577    AUDIOMIXBUFWRITESTATE WriteState;
     578    RTTESTI_CHECK_RC_OK_RETV(AudioMixBufInitWriteState(&MixBuf, &WriteState, &CfgSrc));
     579
    574580    /* Peek state (destination) is uToHz 2ch S16 */
    575581    PDMAUDIOPCMPROPS const CfgDst = PDMAUDIOPCMPROPS_INITIALIZER(2 /*cbSample*/, true /*fSigned*/, 2 /*ch*/, uToHz, false /*fSwap*/);
     
    607613
    608614        uint32_t cSrcFramesWritten = UINT32_MAX / 2;
    609         RTTESTI_CHECK_RC_OK_BREAK(AudioMixBufWriteCirc(&MixBuf, &aSrcFrames, cSrcFrames * sizeof(aSrcFrames[0]), &cSrcFramesWritten));
     615        AudioMixBufWrite(&MixBuf, &WriteState, &aSrcFrames[0], cSrcFrames * sizeof(aSrcFrames[0]),
     616                         0 /*offDstFrame*/, cSrcFrames, &cSrcFramesWritten);
    610617        RTTESTI_CHECK_MSG_BREAK(cSrcFrames == cSrcFramesWritten,
    611618                                ("cSrcFrames=%RU32 vs cSrcFramesWritten=%RU32 cLiveFrames=%RU32\n",
    612619                                 cSrcFrames, cSrcFramesWritten, AudioMixBufLive(&MixBuf)));
     620        AudioMixBufCommit(&MixBuf, cSrcFrames);
    613621
    614622        /*
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