VirtualBox

Ignore:
Timestamp:
Jul 2, 2021 9:41:02 AM (4 years ago)
Author:
vboxsync
Message:

Audio/ValKit: Cleaned up test object API + handling. bugref:10008

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/ValidationKit/utils/audio/vkatCommon.cpp

    r89992 r89994  
    258258
    259259    /** @todo Use .WAV here? */
    260     PAUDIOTESTOBJ pObj;
    261     int rc = AudioTestSetObjCreateAndRegister(&pTstEnv->Set, "guest-tone-play.pcm", &pObj);
     260    AUDIOTESTOBJ Obj;
     261    int rc = AudioTestSetObjCreateAndRegister(&pTstEnv->Set, "guest-tone-play.pcm", &Obj);
    262262    AssertRCReturn(rc, rc);
    263263
     
    273273        RTTestPrintf(g_hTest, RTTESTLVL_DEBUG, "Playing %RU32 bytes total\n", cbToPlayTotal);
    274274
    275         AudioTestSetObjAddMetadataStr(pObj, "stream_to_play_bytes=%RU32\n",      cbToPlayTotal);
    276         AudioTestSetObjAddMetadataStr(pObj, "stream_period_size_frames=%RU32\n", pStream->Cfg.Backend.cFramesPeriod);
    277         AudioTestSetObjAddMetadataStr(pObj, "stream_buffer_size_frames=%RU32\n", pStream->Cfg.Backend.cFramesBufferSize);
    278         AudioTestSetObjAddMetadataStr(pObj, "stream_prebuf_size_frames=%RU32\n", pStream->Cfg.Backend.cFramesPreBuffering);
     275        AudioTestObjAddMetadataStr(Obj, "stream_to_play_bytes=%RU32\n",      cbToPlayTotal);
     276        AudioTestObjAddMetadataStr(Obj, "stream_period_size_frames=%RU32\n", pStream->Cfg.Backend.cFramesPeriod);
     277        AudioTestObjAddMetadataStr(Obj, "stream_buffer_size_frames=%RU32\n", pStream->Cfg.Backend.cFramesBufferSize);
     278        AudioTestObjAddMetadataStr(Obj, "stream_prebuf_size_frames=%RU32\n", pStream->Cfg.Backend.cFramesPreBuffering);
    279279        /* Note: This mostly is provided by backend (e.g. PulseAudio / ALSA / ++) and
    280280         *       has nothing to do with the device emulation scheduling hint. */
    281         AudioTestSetObjAddMetadataStr(pObj, "device_scheduling_hint_ms=%RU32\n", pStream->Cfg.Device.cMsSchedulingHint);
     281        AudioTestObjAddMetadataStr(Obj, "device_scheduling_hint_ms=%RU32\n", pStream->Cfg.Device.cMsSchedulingHint);
    282282
    283283        PAUDIOTESTDRVMIXSTREAM pMix = &pStream->Mix;
     
    312312                {
    313313                    /* Write stuff to disk before trying to play it. Help analysis later. */
    314                     rc = AudioTestSetObjWrite(pObj, abBuf, cbToPlay);
     314                    rc = AudioTestObjWrite(Obj, abBuf, cbToPlay);
    315315                    if (RT_SUCCESS(rc))
    316316                    {
     
    344344        rc = VERR_AUDIO_STREAM_NOT_READY;
    345345
    346     int rc2 = AudioTestSetObjClose(pObj);
     346    int rc2 = AudioTestObjClose(Obj);
    347347    if (RT_SUCCESS(rc))
    348348        rc = rc2;
     
    372372
    373373    /** @todo Use .WAV here? */
    374     PAUDIOTESTOBJ pObj;
    375     int rc = AudioTestSetObjCreateAndRegister(&pTstEnv->Set, "guest-tone-rec.pcm", &pObj);
     374    AUDIOTESTOBJ Obj;
     375    int rc = AudioTestSetObjCreateAndRegister(&pTstEnv->Set, "guest-tone-rec.pcm", &Obj);
    376376    AssertRCReturn(rc, rc);
    377377
     
    385385        RTTestPrintf(g_hTest, RTTESTLVL_DEBUG, "Recording %RU32 bytes total\n", cbToRecTotal);
    386386
    387         AudioTestSetObjAddMetadataStr(pObj, "stream_to_record_bytes=%RU32\n", cbToRecTotal);
    388         AudioTestSetObjAddMetadataStr(pObj, "stream_buffer_size_ms=%RU32\n", pTstEnv->cMsBufferSize);
    389         AudioTestSetObjAddMetadataStr(pObj, "stream_prebuf_size_ms=%RU32\n", pTstEnv->cMsPreBuffer);
     387        AudioTestObjAddMetadataStr(Obj, "stream_to_record_bytes=%RU32\n", cbToRecTotal);
     388        AudioTestObjAddMetadataStr(Obj, "stream_buffer_size_ms=%RU32\n", pTstEnv->cMsBufferSize);
     389        AudioTestObjAddMetadataStr(Obj, "stream_prebuf_size_ms=%RU32\n", pTstEnv->cMsPreBuffer);
    390390        /* Note: This mostly is provided by backend (e.g. PulseAudio / ALSA / ++) and
    391391         *       has nothing to do with the device emulation scheduling hint. */
    392         AudioTestSetObjAddMetadataStr(pObj, "device_scheduling_hint_ms=%RU32\n", pTstEnv->cMsSchedulingHint);
     392        AudioTestObjAddMetadataStr(Obj, "device_scheduling_hint_ms=%RU32\n", pTstEnv->cMsSchedulingHint);
    393393
    394394        uint8_t         abSamples[16384];
     
    410410                    if (cbRecorded)
    411411                    {
    412                         rc = AudioTestSetObjWrite(pObj, abSamples, cbRecorded);
     412                        rc = AudioTestObjWrite(Obj, abSamples, cbRecorded);
    413413                        if (RT_SUCCESS(rc))
    414414                        {
     
    432432    }
    433433
    434     int rc2 = AudioTestSetObjClose(pObj);
     434    int rc2 = AudioTestObjClose(Obj);
    435435    if (RT_SUCCESS(rc))
    436436        rc = rc2;
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