Changeset 75499 in vbox for trunk/src/VBox/Main/src-client
- Timestamp:
- Nov 16, 2018 1:23:14 AM (6 years ago)
- Location:
- trunk/src/VBox/Main/src-client
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Main/src-client/Recording.cpp
r75488 r75499 484 484 * @returns @c true if the specified screen is ready, @c false if not. 485 485 * @param uScreen Screen ID. 486 * @param uTimeStampMs Current timestamp (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 */ 488 bool RecordingContext::IsReady(uint32_t uScreen, uint64_t msTimestamp) 489 { 490 RT_NOREF(msTimestamp); 491 491 492 492 lock(); … … 549 549 * @returns true if any limit has been reached. 550 550 * @param uScreen Screen ID. 551 * @param uTimeStampMsTimestamp (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 */ 553 bool RecordingContext::IsLimitReached(uint32_t uScreen, uint64_t msTimestamp) 554 554 { 555 555 lock(); … … 559 559 const RecordingStream *pStream = getStreamInternal(uScreen); 560 560 if ( !pStream 561 || pStream->IsLimitReached( uTimeStampMs))561 || pStream->IsLimitReached(msTimestamp)) 562 562 { 563 563 fLimitReached = true; … … 571 571 DECLCALLBACK(int) RecordingContext::OnLimitReached(uint32_t uScreen, int rc) 572 572 { 573 RT_NOREF(uScreen );573 RT_NOREF(uScreen, rc); 574 574 LogFlowThisFunc(("Stream %RU32 has reached its limit (%Rrc)\n", uScreen, rc)); 575 575 … … 594 594 * @param pvData Audio frame data to send. 595 595 * @param cbData Size (in bytes) of (encoded) audio frame data. 596 * @param uTimeStampMs Timestamp (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 */ 598 int RecordingContext::SendAudioFrame(const void *pvData, size_t cbData, uint64_t msTimestamp) 599 599 { 600 600 #ifdef VBOX_WITH_AUDIO_RECORDING … … 619 619 memcpy(pFrame->pvBuf, pvData, cbData); 620 620 621 pBlock->pvData 622 pBlock->cbData 623 pBlock->cRefs 624 pBlock-> uTimeStampMs = uTimeStampMs;621 pBlock->pvData = pFrame; 622 pBlock->cbData = sizeof(RECORDINGAUDIOFRAME) + cbData; 623 pBlock->cRefs = this->cStreamsEnabled; 624 pBlock->msTimestamp = msTimestamp; 625 625 626 626 int rc = RTCritSectEnter(&this->CritSect); … … 630 630 try 631 631 { 632 RecordingBlockMap::iterator itBlocks = this->mapBlocksCommon.find( uTimeStampMs);632 RecordingBlockMap::iterator itBlocks = this->mapBlocksCommon.find(msTimestamp); 633 633 if (itBlocks == this->mapBlocksCommon.end()) 634 634 { … … 636 636 pRecordingBlocks->List.push_back(pBlock); 637 637 638 this->mapBlocksCommon.insert(std::make_pair( uTimeStampMs, pRecordingBlocks));638 this->mapBlocksCommon.insert(std::make_pair(msTimestamp, pRecordingBlocks)); 639 639 } 640 640 else … … 655 655 return rc; 656 656 #else 657 RT_NOREF(pCtx, pvData, cbData, uTimeStampMs);657 RT_NOREF(pCtx, pvData, cbData, msTimestamp); 658 658 return VINF_SUCCESS; 659 659 #endif … … 676 676 * @param uSrcHeight Height of the video frame. 677 677 * @param puSrcData Pointer to video frame data. 678 * @param uTimeStampMs Timestamp (in ms).678 * @param msTimestamp Timestamp (in ms). 679 679 */ 680 680 int RecordingContext::SendVideoFrame(uint32_t uScreen, uint32_t x, uint32_t y, 681 681 uint32_t uPixelFormat, uint32_t uBPP, uint32_t uBytesPerLine, 682 682 uint32_t uSrcWidth, uint32_t uSrcHeight, uint8_t *puSrcData, 683 uint64_t uTimeStampMs)683 uint64_t msTimestamp) 684 684 { 685 685 AssertReturn(uSrcWidth, VERR_INVALID_PARAMETER); … … 700 700 } 701 701 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); 703 703 704 704 int rc2 = RTCritSectLeave(&this->CritSect); -
trunk/src/VBox/Main/src-client/RecordingStream.cpp
r75492 r75499 266 266 * 267 267 * @returns true if any limit has been reached. 268 * @param uTimeStampMsTimestamp (in ms) to check for.269 */ 270 bool RecordingStream::isLimitReachedInternal(uint64_t uTimeStampMs) const271 { 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 */ 270 bool RecordingStream::isLimitReachedInternal(uint64_t msTimestamp) const 271 { 272 LogFlowThisFunc(("msTimestamp=%RU64, ulMaxTimeS=%RU32, tsStartMs=%RU64\n", 273 msTimestamp, this->ScreenSettings.ulMaxTimeS, this->tsStartMs)); 274 274 275 275 if ( this->ScreenSettings.ulMaxTimeS 276 && uTimeStampMs>= this->tsStartMs + (this->ScreenSettings.ulMaxTimeS * RT_MS_1SEC))276 && msTimestamp >= this->tsStartMs + (this->ScreenSettings.ulMaxTimeS * RT_MS_1SEC)) 277 277 { 278 278 LogRel(("Recording: Time limit for stream #%RU16 has been reached (%RU32s)\n", … … 311 311 * 312 312 * @returns IPRT status code. 313 * @param uTimeStampMsCurrent timestamp (in ms).314 */ 315 int RecordingStream::iterateInternal(uint64_t uTimeStampMs)313 * @param msTimestamp Current timestamp (in ms). 314 */ 315 int RecordingStream::iterateInternal(uint64_t msTimestamp) 316 316 { 317 317 if (!this->fEnabled) … … 320 320 int rc; 321 321 322 if (isLimitReachedInternal( uTimeStampMs))322 if (isLimitReachedInternal(msTimestamp)) 323 323 { 324 324 rc = VINF_RECORDING_LIMIT_REACHED; … … 352 352 * 353 353 * @returns true if any limit has been reached. 354 * @param uTimeStampMsTimestamp (in ms) to check for.355 */ 356 bool RecordingStream::IsLimitReached(uint64_t uTimeStampMs) const354 * @param msTimestamp Timestamp (in ms) to check for. 355 */ 356 bool RecordingStream::IsLimitReached(uint64_t msTimestamp) const 357 357 { 358 358 if (!IsReady()) 359 359 return true; 360 360 361 return isLimitReachedInternal( uTimeStampMs);361 return isLimitReachedInternal(msTimestamp); 362 362 } 363 363 … … 397 397 while (itStreamBlocks != Blocks.Map.end()) 398 398 { 399 const uint64_t uTimeStampMs= itStreamBlocks->first;400 RecordingBlocks *pBlocks= itStreamBlocks->second;399 uint64_t const msTimestamp = itStreamBlocks->first; 400 RecordingBlocks *pBlocks = itStreamBlocks->second; 401 401 402 402 AssertPtr(pBlocks); … … 419 419 if (RT_SUCCESS(rc2)) 420 420 { 421 rc2 = writeVideoVPX( uTimeStampMs, pVideoFrame);421 rc2 = writeVideoVPX(msTimestamp, pVideoFrame); 422 422 AssertRC(rc2); 423 423 if (RT_SUCCESS(rc)) … … 459 459 460 460 WebMWriter::BlockData_Opus blockData = { pAudioFrame->pvBuf, pAudioFrame->cbBuf, 461 pBlockCommon-> uTimeStampMs};461 pBlockCommon->msTimestamp }; 462 462 AssertPtr(this->File.pWEBM); 463 463 int rc2 = this->File.pWEBM->WriteBlock(this->uTrackAudio, &blockData, sizeof(blockData)); … … 519 519 * @param uSrcHeight Height (in pixels) of the video frame. 520 520 * @param puSrcData Actual pixel data of the video frame. 521 * @param uTimeStampMsTimestamp (in ms) as PTS.521 * @param msTimestamp Timestamp (in ms) as PTS. 522 522 */ 523 523 int 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) 525 525 { 526 526 lock(); 527 527 528 LogFlowFunc((" uTimeStampMs=%RU64\n", uTimeStampMs));528 LogFlowFunc(("msTimestamp=%RU64\n", msTimestamp)); 529 529 530 530 PRECORDINGVIDEOFRAME pFrame = NULL; 531 531 532 int rc = iterateInternal( uTimeStampMs);532 int rc = iterateInternal(msTimestamp); 533 533 if (rc != VINF_SUCCESS) /* Can return VINF_RECORDING_LIMIT_REACHED. */ 534 534 { … … 539 539 do 540 540 { 541 if ( uTimeStampMs< this->Video.uLastTimeStampMs + this->Video.uDelayMs)541 if (msTimestamp < this->Video.uLastTimeStampMs + this->Video.uDelayMs) 542 542 { 543 543 rc = VINF_RECORDING_THROTTLED; /* Respect maximum frames per second. */ … … 545 545 } 546 546 547 this->Video.uLastTimeStampMs = uTimeStampMs;547 this->Video.uLastTimeStampMs = msTimestamp; 548 548 549 549 int xDiff = ((int)this->ScreenSettings.Video.ulWidth - (int)uSrcWidth) / 2; … … 718 718 pRecordingBlocks->List.push_back(pBlock); 719 719 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)); 722 722 } 723 723 catch (const std::exception &ex) … … 1155 1155 * 1156 1156 * @returns IPRT status code. 1157 * @param uTimeStampMsAbsolute timestamp (PTS) of frame (in ms) to encode.1157 * @param msTimestamp Absolute timestamp (PTS) of frame (in ms) to encode. 1158 1158 * @param pFrame Frame to encode and submit. 1159 1159 */ 1160 int RecordingStream::writeVideoVPX(uint64_t uTimeStampMs, PRECORDINGVIDEOFRAME pFrame)1160 int RecordingStream::writeVideoVPX(uint64_t msTimestamp, PRECORDINGVIDEOFRAME pFrame) 1161 1161 { 1162 1162 AssertPtrReturn(pFrame, VERR_INVALID_POINTER); … … 1166 1166 PRECORDINGVIDEOCODEC pCodec = &this->Video.Codec; 1167 1167 1168 /* Presentation Time 1169 vpx_codec_pts_t pts = uTimeStampMs;1168 /* Presentation TimeStamp (PTS). */ 1169 vpx_codec_pts_t pts = msTimestamp; 1170 1170 vpx_codec_err_t rcv = vpx_codec_encode(&pCodec->VPX.Ctx, 1171 1171 &pCodec->VPX.RawImage, 1172 pts /* Time 1172 pts /* Timestamp */, 1173 1173 this->Video.uDelayMs /* How long to show this frame */, 1174 1174 0 /* Flags */,
Note:
See TracChangeset
for help on using the changeset viewer.