Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(815)

Unified Diff: webrtc/video/vie_encoder.cc

Issue 2911193002: Implement timing frames. (Closed)
Patch Set: Implement Asapersson@ comments and foolproof generic encoder to be used in tests Created 3 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« webrtc/video/payload_router.cc ('K') | « webrtc/video/video_send_stream_tests.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: webrtc/video/vie_encoder.cc
diff --git a/webrtc/video/vie_encoder.cc b/webrtc/video/vie_encoder.cc
index 63b1c80fefbe9b0f0f8afaf95a83dd0f140a3540..5d75d907e9e63e0a09fe7f930ecadb28cffb5713 100644
--- a/webrtc/video/vie_encoder.cc
+++ b/webrtc/video/vie_encoder.cc
@@ -622,7 +622,14 @@ void ViEEncoder::OnFrame(const VideoFrame& video_frame) {
VideoFrame incoming_frame = video_frame;
// Local time in webrtc time base.
- int64_t current_time_ms = clock_->TimeInMilliseconds();
+ int64_t current_time_us = clock_->TimeInMicroseconds();
+ int64_t current_time_ms = current_time_us / rtc::kNumMicrosecsPerMillisec;
+ // In some cases, e.g. then the frame from decoder is fed to encoder,
holmer 2017/06/19 07:48:26 "e.g. when"?
nisse-webrtc 2017/06/19 08:08:39 To be *really* picky, it should be ", e.g., when".
ilnik 2017/06/19 08:41:51 Done.
ilnik 2017/06/19 08:41:51 Done.
+ // the timestamp may be set to the future. As the encoding pipeline assumes
holmer 2017/06/19 07:48:26 I don't understand why this would be the case. Can
nisse-webrtc 2017/06/19 08:08:39 Because the decoder doesn't even try to attach the
ilnik 2017/06/19 08:41:51 Yes, that's what happens.
holmer 2017/06/19 12:17:47 Acknowledged, and I agree with your preferences. :
+ // capture time to be less than present time, we should reset the capture
+ // timestamps here. Otherwise there may be issues with RTP send stream.
+ if (incoming_frame.timestamp_us() > current_time_us)
+ incoming_frame.set_timestamp_us(current_time_us);
// Capture time may come from clock with an offset and drift from clock_.
int64_t capture_ntp_time_ms;
« webrtc/video/payload_router.cc ('K') | « webrtc/video/video_send_stream_tests.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698