summaryrefslogtreecommitdiffstats
path: root/remoting/codec
diff options
context:
space:
mode:
authorsergeyu <sergeyu@chromium.org>2015-09-29 23:40:27 -0700
committerCommit bot <commit-bot@chromium.org>2015-09-30 06:41:15 +0000
commit752c6e600df859a34cedae1b9aa2ce26c198a77b (patch)
tree37c5cade6d92766f6c7e977cc4d50d835eebedbd /remoting/codec
parent995781750a4654d81f7d4ff0e59194f00f951c95 (diff)
downloadchromium_src-752c6e600df859a34cedae1b9aa2ce26c198a77b.zip
chromium_src-752c6e600df859a34cedae1b9aa2ce26c198a77b.tar.gz
chromium_src-752c6e600df859a34cedae1b9aa2ce26c198a77b.tar.bz2
Add UMA histograms for more detailed latency tracking on the CRD host.
Previously only two delays in CRD hosts were tracked: capture time and encode time. This CL adds 4 other values that are now measured on the host, sent to the client and logged to UMA: - capture_pending_time: time between input event being received and when the next frame starts capturing. - capture_overhead_time: extra latency for the capturer caused by IPC and threading. - encode_pending_time: delay between capturer and encoder. - send_pending_time: time encoded packets wait in the send queue. VideoFramePump is responsible for measuring all latency values sent to the client except for capture_time_ms which is still measured by the capturer. Review URL: https://codereview.chromium.org/1365663003 Cr-Commit-Position: refs/heads/master@{#351504}
Diffstat (limited to 'remoting/codec')
-rw-r--r--remoting/codec/video_encoder_helper.cc3
-rw-r--r--remoting/codec/video_encoder_helper_unittest.cc1
-rw-r--r--remoting/codec/video_encoder_verbatim.cc7
-rw-r--r--remoting/codec/video_encoder_vpx.cc8
4 files changed, 2 insertions, 17 deletions
diff --git a/remoting/codec/video_encoder_helper.cc b/remoting/codec/video_encoder_helper.cc
index 5310d01..288ec72a 100644
--- a/remoting/codec/video_encoder_helper.cc
+++ b/remoting/codec/video_encoder_helper.cc
@@ -57,8 +57,7 @@ VideoEncoderHelper::CreateVideoPacketWithUpdatedRegion(
}
}
- // Store the capture time and frame DPI.
- packet->set_capture_time_ms(frame.capture_time_ms());
+ // Store frame DPI.
if (!frame.dpi().is_zero()) {
packet->mutable_format()->set_x_dpi(frame.dpi().x());
packet->mutable_format()->set_y_dpi(frame.dpi().y());
diff --git a/remoting/codec/video_encoder_helper_unittest.cc b/remoting/codec/video_encoder_helper_unittest.cc
index e464802..569ecac 100644
--- a/remoting/codec/video_encoder_helper_unittest.cc
+++ b/remoting/codec/video_encoder_helper_unittest.cc
@@ -36,7 +36,6 @@ TEST(VideoEncoderHelperTest, PropagatesCommonFields) {
EXPECT_TRUE(packet->format().has_x_dpi());
EXPECT_TRUE(packet->format().has_y_dpi());
- EXPECT_TRUE(packet->has_capture_time_ms());
EXPECT_EQ(1, packet->dirty_rects().size());
ASSERT_TRUE(packet->has_use_desktop_shape());
diff --git a/remoting/codec/video_encoder_verbatim.cc b/remoting/codec/video_encoder_verbatim.cc
index 2948e3e..8d1befb 100644
--- a/remoting/codec/video_encoder_verbatim.cc
+++ b/remoting/codec/video_encoder_verbatim.cc
@@ -6,7 +6,6 @@
#include "base/logging.h"
#include "base/stl_util.h"
-#include "base/time/time.h"
#include "remoting/base/util.h"
#include "remoting/proto/video.pb.h"
#include "third_party/webrtc/modules/desktop_capture/desktop_frame.h"
@@ -32,8 +31,6 @@ scoped_ptr<VideoPacket> VideoEncoderVerbatim::Encode(
if (frame.updated_region().is_empty())
return nullptr;
- base::Time encode_start_time = base::Time::Now();
-
// Create a VideoPacket with common fields (e.g. DPI, rects, shape) set.
scoped_ptr<VideoPacket> packet(helper_.CreateVideoPacket(frame));
packet->mutable_format()->set_encoding(VideoPacketFormat::ENCODING_VERBATIM);
@@ -64,10 +61,6 @@ scoped_ptr<VideoPacket> VideoEncoderVerbatim::Encode(
}
}
- // Note the time taken to encode the pixel data.
- packet->set_encode_time_ms(
- (base::Time::Now() - encode_start_time).InMillisecondsRoundedUp());
-
return packet.Pass();
}
diff --git a/remoting/codec/video_encoder_vpx.cc b/remoting/codec/video_encoder_vpx.cc
index 1fa19a4..0dcd456 100644
--- a/remoting/codec/video_encoder_vpx.cc
+++ b/remoting/codec/video_encoder_vpx.cc
@@ -270,8 +270,6 @@ scoped_ptr<VideoPacket> VideoEncoderVpx::Encode(
if (frame.updated_region().is_empty() && !encode_unchanged_frame_)
return nullptr;
- base::TimeTicks encode_start_time = base::TimeTicks::Now();
-
// Create or reconfigure the codec to match the size of |frame|.
if (!codec_ ||
(image_ &&
@@ -296,7 +294,7 @@ scoped_ptr<VideoPacket> VideoEncoderVpx::Encode(
}
// Do the actual encoding.
- int timestamp = (encode_start_time - timestamp_base_).InMilliseconds();
+ int timestamp = (base::TimeTicks::Now() - timestamp_base_).InMilliseconds();
vpx_codec_err_t ret = vpx_codec_encode(
codec_.get(), image_.get(), timestamp, 1, 0, VPX_DL_REALTIME);
DCHECK_EQ(ret, VPX_CODEC_OK)
@@ -341,10 +339,6 @@ scoped_ptr<VideoPacket> VideoEncoderVpx::Encode(
}
}
- // Note the time taken to encode the pixel data.
- packet->set_encode_time_ms(
- (base::TimeTicks::Now() - encode_start_time).InMillisecondsRoundedUp());
-
return packet.Pass();
}