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

Unified Diff: content/renderer/media/gpu/rtc_video_encoder.cc

Issue 2692853009: Set capture_time_ms using rtc::TimeMicros() (Closed)
Patch Set: Created 3 years, 10 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
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/renderer/media/gpu/rtc_video_encoder.cc
diff --git a/content/renderer/media/gpu/rtc_video_encoder.cc b/content/renderer/media/gpu/rtc_video_encoder.cc
index 4c42938e2a4bef07048703ba1fb759c6d4448135..db6eaa669ac77aa20fa6faf2ff265f2fd06b4c67 100644
--- a/content/renderer/media/gpu/rtc_video_encoder.cc
+++ b/content/renderer/media/gpu/rtc_video_encoder.cc
@@ -470,16 +470,13 @@ void RTCVideoEncoder::Impl::BitstreamBufferReady(int32_t bitstream_buffer_id,
output_buffers_free_count_--;
nisse-chromium (ooo August 14) 2017/02/15 07:53:18 I'd suggest reading system clock up front, int64_
Stefan 2017/02/15 12:31:24 You should then also make sure that two frames don
emircan 2017/02/15 19:35:34 Done.
emircan 2017/02/15 19:35:34 Done.
// Derive the capture time (in ms) and RTP timestamp (in 90KHz ticks).
- int64_t capture_time_us, capture_time_ms;
+ int64_t capture_time_us;
uint32_t rtp_timestamp;
-
if (!timestamp.is_zero()) {
- capture_time_us = timestamp.InMicroseconds();;
- capture_time_ms = timestamp.InMilliseconds();
+ capture_time_us = timestamp.InMicroseconds();
} else {
// Fallback to the current time if encoder does not provide timestamp.
capture_time_us = rtc::TimeMicros();
- capture_time_ms = capture_time_us / base::Time::kMicrosecondsPerMillisecond;
}
// RTP timestamp can wrap around. Get the lower 32 bits.
rtp_timestamp = static_cast<uint32_t>(
@@ -491,7 +488,9 @@ void RTCVideoEncoder::Impl::BitstreamBufferReady(int32_t bitstream_buffer_id,
image._encodedWidth = input_visible_size_.width();
image._encodedHeight = input_visible_size_.height();
image._timeStamp = rtp_timestamp;
- image.capture_time_ms_ = capture_time_ms;
+ // This should be always based on system clock, so leave setting this field to
+ // rtp code.
+ image.capture_time_ms_ = -1;
image._frameType =
(key_frame ? webrtc::kVideoFrameKey : webrtc::kVideoFrameDelta);
image._completeFrame = true;
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698