diff options
author | hclam@chromium.org <hclam@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2011-05-06 21:19:29 +0000 |
---|---|---|
committer | hclam@chromium.org <hclam@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2011-05-06 21:19:29 +0000 |
commit | c0f7082fdc8b239027b196a777180899bf7f5ce3 (patch) | |
tree | 1b4ff8c2ca9049ef75b80f5f7c1bb7f0762de1c7 /remoting/base | |
parent | 9d85fa39bdf901eea6dc70f804e3d2a1001d07ab (diff) | |
download | chromium_src-c0f7082fdc8b239027b196a777180899bf7f5ce3.zip chromium_src-c0f7082fdc8b239027b196a777180899bf7f5ce3.tar.gz chromium_src-c0f7082fdc8b239027b196a777180899bf7f5ce3.tar.bz2 |
Chromoting to report roundtrip latency
Doing so by sending a sequence number, essentially the timestamp in every
envet message. Capturer at the host will pick up the latest sequence number
and pass it through the pipeline. Client will then receive it and determine
the latency.
This roundtrip latency number however doesn't include time in decoding and
rendering.
BUG=None
TEST=None
Review URL: http://codereview.chromium.org/6792038
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@84504 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'remoting/base')
-rw-r--r-- | remoting/base/capture_data.h | 9 | ||||
-rw-r--r-- | remoting/base/encoder_row_based.cc | 2 | ||||
-rw-r--r-- | remoting/base/encoder_vp8.cc | 1 |
3 files changed, 12 insertions, 0 deletions
diff --git a/remoting/base/capture_data.h b/remoting/base/capture_data.h index 43909db..b8592fa 100644 --- a/remoting/base/capture_data.h +++ b/remoting/base/capture_data.h @@ -54,6 +54,12 @@ class CaptureData : public base::RefCountedThreadSafe<CaptureData> { capture_time_ms_ = capture_time_ms; } + int64 client_sequence_number() const { return client_sequence_number_; } + + void set_client_sequence_number(int64 client_sequence_number) { + client_sequence_number_ = client_sequence_number; + } + private: const DataPlanes data_planes_; InvalidRects dirty_rects_; @@ -63,6 +69,9 @@ class CaptureData : public base::RefCountedThreadSafe<CaptureData> { // Time spent in capture. Unit is in milliseconds. int capture_time_ms_; + // Sequence number supplied by client for performance tracking. + int64 client_sequence_number_; + friend class base::RefCountedThreadSafe<CaptureData>; virtual ~CaptureData(); }; diff --git a/remoting/base/encoder_row_based.cc b/remoting/base/encoder_row_based.cc index 790463f..8039869 100644 --- a/remoting/base/encoder_row_based.cc +++ b/remoting/base/encoder_row_based.cc @@ -118,6 +118,8 @@ void EncoderRowBased::EncodeRect(const gfx::Rect& rect, bool last) { if (!compress_again) { packet->set_flags(packet->flags() | VideoPacket::LAST_PACKET); packet->set_capture_time_ms(capture_data_->capture_time_ms()); + packet->set_client_sequence_number( + capture_data_->client_sequence_number()); if (last) packet->set_flags(packet->flags() | VideoPacket::LAST_PARTITION); DCHECK(row_pos == row_size); diff --git a/remoting/base/encoder_vp8.cc b/remoting/base/encoder_vp8.cc index 0d24f7d..84a0bc6 100644 --- a/remoting/base/encoder_vp8.cc +++ b/remoting/base/encoder_vp8.cc @@ -268,6 +268,7 @@ void EncoderVp8::Encode(scoped_refptr<CaptureData> capture_data, message->mutable_format()->set_screen_width(capture_data->size().width()); message->mutable_format()->set_screen_height(capture_data->size().height()); message->set_capture_time_ms(capture_data->capture_time_ms()); + message->set_client_sequence_number(capture_data->client_sequence_number()); for (size_t i = 0; i < updated_rects.size(); ++i) { Rect* rect = message->add_dirty_rects(); rect->set_x(updated_rects[i].x()); |