VirtualBox

Changeset 94950 in vbox


Ignore:
Timestamp:
May 9, 2022 11:49:03 AM (3 years ago)
Author:
vboxsync
svn:sync-xref-src-repo-rev:
151358
Message:

Main/src-client/Recording.cpp: Adjust to the new rules wrt. to rc -> hrc,vrc usage, ​bugref:10223

File:
1 edited

Legend:

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

    r93115 r94950  
    6363    , cStreamsEnabled(0)
    6464{
    65     int rc = RecordingContext::createInternal(a_Settings);
    66     if (RT_FAILURE(rc))
    67         throw rc;
     65    int vrc = RecordingContext::createInternal(a_Settings);
     66    if (RT_FAILURE(vrc))
     67        throw vrc;
    6868}
    6969
     
    8989    for (;;)
    9090    {
    91         int rc = RTSemEventWait(pThis->WaitEvent, RT_INDEFINITE_WAIT);
    92         AssertRCBreak(rc);
     91        int vrc = RTSemEventWait(pThis->WaitEvent, RT_INDEFINITE_WAIT);
     92        AssertRCBreak(vrc);
    9393
    9494        Log2Func(("Processing %zu streams\n", pThis->vecStreams.size()));
     
    102102            RecordingStream *pStream = (*itStream);
    103103
    104             rc = pStream->Process(pThis->mapBlocksCommon);
    105             if (RT_FAILURE(rc))
     104            vrc = pStream->Process(pThis->mapBlocksCommon);
     105            if (RT_FAILURE(vrc))
    106106            {
    107                 LogRel(("Recording: Processing stream #%RU16 failed (%Rrc)\n", pStream->GetID(), rc));
     107                LogRel(("Recording: Processing stream #%RU16 failed (%Rrc)\n", pStream->GetID(), vrc));
    108108                break;
    109109            }
     
    112112        }
    113113
    114         if (RT_FAILURE(rc))
    115             LogRel(("Recording: Encoding thread failed (%Rrc)\n", rc));
     114        if (RT_FAILURE(vrc))
     115            LogRel(("Recording: Encoding thread failed (%Rrc)\n", vrc));
    116116
    117117        /* Keep going in case of errors. */
     
    147147int RecordingContext::createInternal(const settings::RecordingSettings &a_Settings)
    148148{
    149     int rc = RTCritSectInit(&this->CritSect);
    150     if (RT_FAILURE(rc))
    151         return rc;
     149    int vrc = RTCritSectInit(&this->CritSect);
     150    if (RT_FAILURE(vrc))
     151        return vrc;
    152152
    153153    settings::RecordingScreenMap::const_iterator itScreen = a_Settings.mapScreens.begin();
     
    164164        catch (std::bad_alloc &)
    165165        {
    166             rc = VERR_NO_MEMORY;
     166            vrc = VERR_NO_MEMORY;
    167167            break;
    168168        }
     
    171171    }
    172172
    173     if (RT_SUCCESS(rc))
     173    if (RT_SUCCESS(vrc))
    174174    {
    175175        this->tsStartMs = RTTimeMilliTS();
     
    180180        this->Settings  = a_Settings;
    181181
    182         rc = RTSemEventCreate(&this->WaitEvent);
    183         AssertRCReturn(rc, rc);
    184     }
    185 
    186     if (RT_FAILURE(rc))
     182        vrc = RTSemEventCreate(&this->WaitEvent);
     183        AssertRCReturn(vrc, vrc);
     184    }
     185
     186    if (RT_FAILURE(vrc))
    187187        destroyInternal();
    188188
    189     return rc;
     189    return vrc;
    190190}
    191191
     
    202202    Assert(this->enmState == RECORDINGSTS_CREATED);
    203203
    204     int rc = RTThreadCreate(&this->Thread, RecordingContext::threadMain, (void *)this, 0,
    205                             RTTHREADTYPE_MAIN_WORKER, RTTHREADFLAGS_WAITABLE, "Record");
    206 
    207     if (RT_SUCCESS(rc)) /* Wait for the thread to start. */
    208         rc = RTThreadUserWait(this->Thread, 30 * RT_MS_1SEC /* 30s timeout */);
    209 
    210     if (RT_SUCCESS(rc))
     204    int vrc = RTThreadCreate(&this->Thread, RecordingContext::threadMain, (void *)this, 0,
     205                             RTTHREADTYPE_MAIN_WORKER, RTTHREADFLAGS_WAITABLE, "Record");
     206
     207    if (RT_SUCCESS(vrc)) /* Wait for the thread to start. */
     208        vrc = RTThreadUserWait(this->Thread, 30 * RT_MS_1SEC /* 30s timeout */);
     209
     210    if (RT_SUCCESS(vrc))
    211211    {
    212212        LogRel(("Recording: Started\n"));
     
    214214    }
    215215    else
    216         Log(("Recording: Failed to start (%Rrc)\n", rc));
    217 
    218     return rc;
     216        Log(("Recording: Failed to start (%Rrc)\n", vrc));
     217
     218    return vrc;
    219219}
    220220
     
    235235
    236236    /* Signal the thread and wait for it to shut down. */
    237     int rc = threadNotify();
    238     if (RT_SUCCESS(rc))
    239         rc = RTThreadWait(this->Thread, 30 * 1000 /* 10s timeout */, NULL);
    240 
    241     lock();
    242 
    243     if (RT_SUCCESS(rc))
     237    int vrc = threadNotify();
     238    if (RT_SUCCESS(vrc))
     239        vrc = RTThreadWait(this->Thread, 30 * 1000 /* 10s timeout */, NULL);
     240
     241    lock();
     242
     243    if (RT_SUCCESS(vrc))
    244244    {
    245245        LogRel(("Recording: Stopped\n"));
     
    247247    }
    248248    else
    249         Log(("Recording: Failed to stop (%Rrc)\n", rc));
    250 
    251     unlock();
    252 
    253     LogFlowThisFunc(("%Rrc\n", rc));
    254     return rc;
     249        Log(("Recording: Failed to stop (%Rrc)\n", vrc));
     250
     251    unlock();
     252
     253    LogFlowThisFunc(("%Rrc\n", vrc));
     254    return vrc;
    255255}
    256256
     
    263263        return;
    264264
    265     int rc = stopInternal();
    266     AssertRCReturnVoid(rc);
    267 
    268     lock();
    269 
    270     rc = RTSemEventDestroy(this->WaitEvent);
    271     AssertRCReturnVoid(rc);
     265    int vrc = stopInternal();
     266    AssertRCReturnVoid(vrc);
     267
     268    lock();
     269
     270    vrc = RTSemEventDestroy(this->WaitEvent);
     271    AssertRCReturnVoid(vrc);
    272272
    273273    this->WaitEvent = NIL_RTSEMEVENT;
     
    278278        RecordingStream *pStream = (*it);
    279279
    280         rc = pStream->Uninit();
    281         AssertRC(rc);
     280        vrc = pStream->Uninit();
     281        AssertRC(vrc);
    282282
    283283        delete pStream;
     
    337337int RecordingContext::lock(void)
    338338{
    339     int rc = RTCritSectEnter(&this->CritSect);
    340     AssertRC(rc);
    341     return rc;
     339    int vrc = RTCritSectEnter(&this->CritSect);
     340    AssertRC(vrc);
     341    return vrc;
    342342}
    343343
    344344int RecordingContext::unlock(void)
    345345{
    346     int rc = RTCritSectLeave(&this->CritSect);
    347     AssertRC(rc);
    348     return rc;
     346    int vrc = RTCritSectLeave(&this->CritSect);
     347    AssertRC(vrc);
     348    return vrc;
    349349}
    350350
     
    599599    lock();
    600600
    601     int rc;
     601    int vrc;
    602602
    603603    try
     
    614614            itBlocks->second->List.push_back(pBlock);
    615615
    616         rc = VINF_SUCCESS;
     616        vrc = VINF_SUCCESS;
    617617    }
    618618    catch (const std::exception &ex)
    619619    {
    620620        RT_NOREF(ex);
    621         rc = VERR_NO_MEMORY;
    622     }
    623 
    624     unlock();
    625 
    626     if (RT_SUCCESS(rc))
    627         rc = threadNotify();
    628 
    629     return rc;
     621        vrc = VERR_NO_MEMORY;
     622    }
     623
     624    unlock();
     625
     626    if (RT_SUCCESS(vrc))
     627        vrc = threadNotify();
     628
     629    return vrc;
    630630#else
    631631    RT_NOREF(pvData, cbData, msTimestamp);
     
    672672    }
    673673
    674     int rc = pStream->SendVideoFrame(x, y, uPixelFormat, uBPP, uBytesPerLine, uSrcWidth, uSrcHeight, puSrcData, msTimestamp);
    675 
    676     unlock();
    677 
    678     if (   RT_SUCCESS(rc)
    679         && rc != VINF_RECORDING_THROTTLED) /* Only signal the thread if operation was successful. */
     674    int vrc = pStream->SendVideoFrame(x, y, uPixelFormat, uBPP, uBytesPerLine, uSrcWidth, uSrcHeight, puSrcData, msTimestamp);
     675
     676    unlock();
     677
     678    if (   RT_SUCCESS(vrc)
     679        && vrc != VINF_RECORDING_THROTTLED) /* Only signal the thread if operation was successful. */
    680680    {
    681681        threadNotify();
    682682    }
    683683
    684     return rc;
    685 }
    686 
     684    return vrc;
     685}
     686
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