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

Unified Diff: webrtc/video/vie_encoder.cc

Issue 2633493002: Delete VideoFrame::set_render_time_ms. (Closed)
Patch Set: Add deprecation comments. Created 3 years, 11 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/api/video/video_frame.h ('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 f78633d532f438f809dce7453fb57accfeff0dd7..be6d12bbd7b88bf0d14b7e76fddbcf81ada08047 100644
--- a/webrtc/video/vie_encoder.cc
+++ b/webrtc/video/vie_encoder.cc
@@ -459,8 +459,11 @@ void ViEEncoder::OnFrame(const VideoFrame& video_frame) {
VideoFrame incoming_frame = video_frame;
// Local time in webrtc time base.
- int64_t current_time = clock_->TimeInMilliseconds();
- incoming_frame.set_render_time_ms(current_time);
+ int64_t current_time_us = clock_->TimeInMicroseconds();
+ int64_t current_time_ms = current_time_us / rtc::kNumMicrosecsPerMillisec;
+ // TODO(nisse): This always overrides the incoming timestamp. Don't
+ // do that, trust the frame source.
+ 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;
@@ -469,7 +472,7 @@ void ViEEncoder::OnFrame(const VideoFrame& video_frame) {
} else if (video_frame.render_time_ms() != 0) {
capture_ntp_time_ms = video_frame.render_time_ms() + delta_ntp_internal_ms_;
} else {
- capture_ntp_time_ms = current_time + delta_ntp_internal_ms_;
+ capture_ntp_time_ms = current_time_ms + delta_ntp_internal_ms_;
}
incoming_frame.set_ntp_time_ms(capture_ntp_time_ms);
@@ -488,8 +491,8 @@ void ViEEncoder::OnFrame(const VideoFrame& video_frame) {
}
bool log_stats = false;
- if (current_time - last_frame_log_ms_ > kFrameLogIntervalMs) {
- last_frame_log_ms_ = current_time;
+ if (current_time_ms - last_frame_log_ms_ > kFrameLogIntervalMs) {
+ last_frame_log_ms_ = current_time_ms;
log_stats = true;
}
« webrtc/api/video/video_frame.h ('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