VirtualBox

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


Ignore:
Timestamp:
Nov 16, 2018 1:23:14 AM (6 years ago)
Author:
vboxsync
Message:

Main/Recording: build fix. Time Stamp -> Timestamp; while at it also changing variables and members to use the 'ms' prefix to indicate milliseconds.

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

Legend:

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

    r75488 r75499  
    484484 * @returns @c true if the specified screen is ready, @c false if not.
    485485 * @param   uScreen             Screen ID.
    486  * @param   uTimeStampMs        Current time stamp (in ms). Currently not being used.
    487  */
    488 bool RecordingContext::IsReady(uint32_t uScreen, uint64_t uTimeStampMs)
    489 {
    490     RT_NOREF(uTimeStampMs);
     486 * @param   msTimestamp         Current timestamp (in ms). Currently not being used.
     487 */
     488bool RecordingContext::IsReady(uint32_t uScreen, uint64_t msTimestamp)
     489{
     490    RT_NOREF(msTimestamp);
    491491
    492492    lock();
     
    549549 * @returns true if any limit has been reached.
    550550 * @param   uScreen             Screen ID.
    551  * @param   uTimeStampMs        Timestamp (in ms) to check for.
    552  */
    553 bool RecordingContext::IsLimitReached(uint32_t uScreen, uint64_t uTimeStampMs)
     551 * @param   msTimestamp         Timestamp (in ms) to check for.
     552 */
     553bool RecordingContext::IsLimitReached(uint32_t uScreen, uint64_t msTimestamp)
    554554{
    555555    lock();
     
    559559    const RecordingStream *pStream = getStreamInternal(uScreen);
    560560    if (   !pStream
    561         || pStream->IsLimitReached(uTimeStampMs))
     561        || pStream->IsLimitReached(msTimestamp))
    562562    {
    563563        fLimitReached = true;
     
    571571DECLCALLBACK(int) RecordingContext::OnLimitReached(uint32_t uScreen, int rc)
    572572{
    573     RT_NOREF(uScreen);
     573    RT_NOREF(uScreen, rc);
    574574    LogFlowThisFunc(("Stream %RU32 has reached its limit (%Rrc)\n", uScreen, rc));
    575575
     
    594594 * @param   pvData              Audio frame data to send.
    595595 * @param   cbData              Size (in bytes) of (encoded) audio frame data.
    596  * @param   uTimeStampMs        Time stamp (in ms) of audio playback.
    597  */
    598 int RecordingContext::SendAudioFrame(const void *pvData, size_t cbData, uint64_t uTimeStampMs)
     596 * @param   msTimestamp         Timestamp (in ms) of audio playback.
     597 */
     598int RecordingContext::SendAudioFrame(const void *pvData, size_t cbData, uint64_t msTimestamp)
    599599{
    600600#ifdef VBOX_WITH_AUDIO_RECORDING
     
    619619    memcpy(pFrame->pvBuf, pvData, cbData);
    620620
    621     pBlock->pvData       = pFrame;
    622     pBlock->cbData       = sizeof(RECORDINGAUDIOFRAME) + cbData;
    623     pBlock->cRefs        = this->cStreamsEnabled;
    624     pBlock->uTimeStampMs = uTimeStampMs;
     621    pBlock->pvData      = pFrame;
     622    pBlock->cbData      = sizeof(RECORDINGAUDIOFRAME) + cbData;
     623    pBlock->cRefs       = this->cStreamsEnabled;
     624    pBlock->msTimestamp = msTimestamp;
    625625
    626626    int rc = RTCritSectEnter(&this->CritSect);
     
    630630    try
    631631    {
    632         RecordingBlockMap::iterator itBlocks = this->mapBlocksCommon.find(uTimeStampMs);
     632        RecordingBlockMap::iterator itBlocks = this->mapBlocksCommon.find(msTimestamp);
    633633        if (itBlocks == this->mapBlocksCommon.end())
    634634        {
     
    636636            pRecordingBlocks->List.push_back(pBlock);
    637637
    638             this->mapBlocksCommon.insert(std::make_pair(uTimeStampMs, pRecordingBlocks));
     638            this->mapBlocksCommon.insert(std::make_pair(msTimestamp, pRecordingBlocks));
    639639        }
    640640        else
     
    655655    return rc;
    656656#else
    657     RT_NOREF(pCtx, pvData, cbData, uTimeStampMs);
     657    RT_NOREF(pCtx, pvData, cbData, msTimestamp);
    658658    return VINF_SUCCESS;
    659659#endif
     
    676676 * @param   uSrcHeight         Height of the video frame.
    677677 * @param   puSrcData          Pointer to video frame data.
    678  * @param   uTimeStampMs       Time stamp (in ms).
     678 * @param   msTimestamp        Timestamp (in ms).
    679679 */
    680680int RecordingContext::SendVideoFrame(uint32_t uScreen, uint32_t x, uint32_t y,
    681681                                     uint32_t uPixelFormat, uint32_t uBPP, uint32_t uBytesPerLine,
    682682                                     uint32_t uSrcWidth, uint32_t uSrcHeight, uint8_t *puSrcData,
    683                                      uint64_t uTimeStampMs)
     683                                     uint64_t msTimestamp)
    684684{
    685685    AssertReturn(uSrcWidth,  VERR_INVALID_PARAMETER);
     
    700700    }
    701701
    702     rc = pStream->SendVideoFrame(x, y, uPixelFormat, uBPP, uBytesPerLine, uSrcWidth, uSrcHeight, puSrcData, uTimeStampMs);
     702    rc = pStream->SendVideoFrame(x, y, uPixelFormat, uBPP, uBytesPerLine, uSrcWidth, uSrcHeight, puSrcData, msTimestamp);
    703703
    704704    int rc2 = RTCritSectLeave(&this->CritSect);
  • trunk/src/VBox/Main/src-client/RecordingStream.cpp

    r75492 r75499  
    266266 *
    267267 * @returns true if any limit has been reached.
    268  * @param   uTimeStampMs        Timestamp (in ms) to check for.
    269  */
    270 bool RecordingStream::isLimitReachedInternal(uint64_t uTimeStampMs) const
    271 {
    272     LogFlowThisFunc(("uTimeStampMs=%RU64, ulMaxTimeS=%RU32, tsStartMs=%RU64\n",
    273                      uTimeStampMs, this->ScreenSettings.ulMaxTimeS, this->tsStartMs));
     268 * @param   msTimestamp     Timestamp (in ms) to check for.
     269 */
     270bool RecordingStream::isLimitReachedInternal(uint64_t msTimestamp) const
     271{
     272    LogFlowThisFunc(("msTimestamp=%RU64, ulMaxTimeS=%RU32, tsStartMs=%RU64\n",
     273                     msTimestamp, this->ScreenSettings.ulMaxTimeS, this->tsStartMs));
    274274
    275275    if (   this->ScreenSettings.ulMaxTimeS
    276         && uTimeStampMs >= this->tsStartMs + (this->ScreenSettings.ulMaxTimeS * RT_MS_1SEC))
     276        && msTimestamp >= this->tsStartMs + (this->ScreenSettings.ulMaxTimeS * RT_MS_1SEC))
    277277    {
    278278        LogRel(("Recording: Time limit for stream #%RU16 has been reached (%RU32s)\n",
     
    311311 *
    312312 * @returns IPRT status code.
    313  * @param   uTimeStampMs        Current timestamp (in ms).
    314  */
    315 int RecordingStream::iterateInternal(uint64_t uTimeStampMs)
     313 * @param   msTimestamp         Current timestamp (in ms).
     314 */
     315int RecordingStream::iterateInternal(uint64_t msTimestamp)
    316316{
    317317    if (!this->fEnabled)
     
    320320    int rc;
    321321
    322     if (isLimitReachedInternal(uTimeStampMs))
     322    if (isLimitReachedInternal(msTimestamp))
    323323    {
    324324        rc = VINF_RECORDING_LIMIT_REACHED;
     
    352352 *
    353353 * @returns true if any limit has been reached.
    354  * @param   uTimeStampMs        Timestamp (in ms) to check for.
    355  */
    356 bool RecordingStream::IsLimitReached(uint64_t uTimeStampMs) const
     354 * @param   msTimestamp         Timestamp (in ms) to check for.
     355 */
     356bool RecordingStream::IsLimitReached(uint64_t msTimestamp) const
    357357{
    358358    if (!IsReady())
    359359        return true;
    360360
    361     return isLimitReachedInternal(uTimeStampMs);
     361    return isLimitReachedInternal(msTimestamp);
    362362}
    363363
     
    397397    while (itStreamBlocks != Blocks.Map.end())
    398398    {
    399         const uint64_t         uTimeStampMs = itStreamBlocks->first;
    400               RecordingBlocks *pBlocks      = itStreamBlocks->second;
     399        uint64_t const   msTimestamp = itStreamBlocks->first;
     400        RecordingBlocks *pBlocks     = itStreamBlocks->second;
    401401
    402402        AssertPtr(pBlocks);
     
    419419                if (RT_SUCCESS(rc2))
    420420                {
    421                     rc2 = writeVideoVPX(uTimeStampMs, pVideoFrame);
     421                    rc2 = writeVideoVPX(msTimestamp, pVideoFrame);
    422422                    AssertRC(rc2);
    423423                    if (RT_SUCCESS(rc))
     
    459459
    460460                    WebMWriter::BlockData_Opus blockData = { pAudioFrame->pvBuf, pAudioFrame->cbBuf,
    461                                                              pBlockCommon->uTimeStampMs };
     461                                                             pBlockCommon->msTimestamp };
    462462                    AssertPtr(this->File.pWEBM);
    463463                    int rc2 = this->File.pWEBM->WriteBlock(this->uTrackAudio, &blockData, sizeof(blockData));
     
    519519 * @param   uSrcHeight          Height (in pixels) of the video frame.
    520520 * @param   puSrcData           Actual pixel data of the video frame.
    521  * @param   uTimeStampMs        Timestamp (in ms) as PTS.
     521 * @param   msTimestamp         Timestamp (in ms) as PTS.
    522522 */
    523523int RecordingStream::SendVideoFrame(uint32_t x, uint32_t y, uint32_t uPixelFormat, uint32_t uBPP, uint32_t uBytesPerLine,
    524                                     uint32_t uSrcWidth, uint32_t uSrcHeight, uint8_t *puSrcData, uint64_t uTimeStampMs)
     524                                    uint32_t uSrcWidth, uint32_t uSrcHeight, uint8_t *puSrcData, uint64_t msTimestamp)
    525525{
    526526    lock();
    527527
    528     LogFlowFunc(("uTimeStampMs=%RU64\n", uTimeStampMs));
     528    LogFlowFunc(("msTimestamp=%RU64\n", msTimestamp));
    529529
    530530    PRECORDINGVIDEOFRAME pFrame = NULL;
    531531
    532     int rc = iterateInternal(uTimeStampMs);
     532    int rc = iterateInternal(msTimestamp);
    533533    if (rc != VINF_SUCCESS) /* Can return VINF_RECORDING_LIMIT_REACHED. */
    534534    {
     
    539539    do
    540540    {
    541         if (uTimeStampMs < this->Video.uLastTimeStampMs + this->Video.uDelayMs)
     541        if (msTimestamp < this->Video.uLastTimeStampMs + this->Video.uDelayMs)
    542542        {
    543543            rc = VINF_RECORDING_THROTTLED; /* Respect maximum frames per second. */
     
    545545        }
    546546
    547         this->Video.uLastTimeStampMs = uTimeStampMs;
     547        this->Video.uLastTimeStampMs = msTimestamp;
    548548
    549549        int xDiff = ((int)this->ScreenSettings.Video.ulWidth - (int)uSrcWidth) / 2;
     
    718718                pRecordingBlocks->List.push_back(pBlock);
    719719
    720                 Assert(this->Blocks.Map.find(uTimeStampMs) == this->Blocks.Map.end());
    721                 this->Blocks.Map.insert(std::make_pair(uTimeStampMs, pRecordingBlocks));
     720                Assert(this->Blocks.Map.find(msTimestamp) == this->Blocks.Map.end());
     721                this->Blocks.Map.insert(std::make_pair(msTimestamp, pRecordingBlocks));
    722722            }
    723723            catch (const std::exception &ex)
     
    11551155 *
    11561156 * @returns IPRT status code.
    1157  * @param   uTimeStampMs        Absolute timestamp (PTS) of frame (in ms) to encode.
     1157 * @param   msTimestamp         Absolute timestamp (PTS) of frame (in ms) to encode.
    11581158 * @param   pFrame              Frame to encode and submit.
    11591159 */
    1160 int RecordingStream::writeVideoVPX(uint64_t uTimeStampMs, PRECORDINGVIDEOFRAME pFrame)
     1160int RecordingStream::writeVideoVPX(uint64_t msTimestamp, PRECORDINGVIDEOFRAME pFrame)
    11611161{
    11621162    AssertPtrReturn(pFrame, VERR_INVALID_POINTER);
     
    11661166    PRECORDINGVIDEOCODEC pCodec = &this->Video.Codec;
    11671167
    1168     /* Presentation Time Stamp (PTS). */
    1169     vpx_codec_pts_t pts = uTimeStampMs;
     1168    /* Presentation TimeStamp (PTS). */
     1169    vpx_codec_pts_t pts = msTimestamp;
    11701170    vpx_codec_err_t rcv = vpx_codec_encode(&pCodec->VPX.Ctx,
    11711171                                           &pCodec->VPX.RawImage,
    1172                                            pts                          /* Time stamp */,
     1172                                           pts                          /* Timestamp */,
    11731173                                           this->Video.uDelayMs         /* How long to show this frame */,
    11741174                                           0                            /* Flags */,
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