diff options
author | hclam@google.com <hclam@google.com@0039d316-1c4b-4281-b951-d872f2087c98> | 2011-04-05 20:13:47 +0000 |
---|---|---|
committer | hclam@google.com <hclam@google.com@0039d316-1c4b-4281-b951-d872f2087c98> | 2011-04-05 20:13:47 +0000 |
commit | 7f65131b89a9636a566b3b3280beab05a05c6699 (patch) | |
tree | 0bd0d00068d23e3e86388bdb1995af757474b968 /remoting/base | |
parent | 27e7d3cd9507411ab96bf43d3e5dd6dada53e105 (diff) | |
download | chromium_src-7f65131b89a9636a566b3b3280beab05a05c6699.zip chromium_src-7f65131b89a9636a566b3b3280beab05a05c6699.tar.gz chromium_src-7f65131b89a9636a566b3b3280beab05a05c6699.tar.bz2 |
Report capture and encode time for chromoting
Add hooks to record these numbers and report them in the client.
BUG=None
TEST=None
Review URL: http://codereview.chromium.org/6767009
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@80516 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'remoting/base')
-rw-r--r-- | remoting/base/capture_data.cc | 2 | ||||
-rw-r--r-- | remoting/base/capture_data.h | 11 | ||||
-rw-r--r-- | remoting/base/encoder_row_based.cc | 1 | ||||
-rw-r--r-- | remoting/base/encoder_vp8.cc | 1 |
4 files changed, 14 insertions, 1 deletions
diff --git a/remoting/base/capture_data.cc b/remoting/base/capture_data.cc index 15f312e..d8db73a 100644 --- a/remoting/base/capture_data.cc +++ b/remoting/base/capture_data.cc @@ -17,7 +17,7 @@ CaptureData::CaptureData(const DataPlanes &data_planes, const gfx::Size& size, media::VideoFrame::Format format) : data_planes_(data_planes), dirty_rects_(), size_(size), - pixel_format_(format) { + pixel_format_(format), capture_time_ms_(0) { } CaptureData::~CaptureData() {} diff --git a/remoting/base/capture_data.h b/remoting/base/capture_data.h index 7169914..43909db 100644 --- a/remoting/base/capture_data.h +++ b/remoting/base/capture_data.h @@ -46,12 +46,23 @@ class CaptureData : public base::RefCountedThreadSafe<CaptureData> { // Mutating methods. InvalidRects& mutable_dirty_rects() { return dirty_rects_; } + // Return the time spent on capturing. + int capture_time_ms() const { return capture_time_ms_; } + + // Set the time spent on capturing. + void set_capture_time_ms(int capture_time_ms) { + capture_time_ms_ = capture_time_ms; + } + private: const DataPlanes data_planes_; InvalidRects dirty_rects_; gfx::Size size_; media::VideoFrame::Format pixel_format_; + // Time spent in capture. Unit is in milliseconds. + int capture_time_ms_; + friend class base::RefCountedThreadSafe<CaptureData>; virtual ~CaptureData(); }; diff --git a/remoting/base/encoder_row_based.cc b/remoting/base/encoder_row_based.cc index d740e27..790463f 100644 --- a/remoting/base/encoder_row_based.cc +++ b/remoting/base/encoder_row_based.cc @@ -117,6 +117,7 @@ void EncoderRowBased::EncodeRect(const gfx::Rect& rect, bool last) { // We have reached the end of stream. if (!compress_again) { packet->set_flags(packet->flags() | VideoPacket::LAST_PACKET); + packet->set_capture_time_ms(capture_data_->capture_time_ms()); 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 6c10a2c..0d24f7d 100644 --- a/remoting/base/encoder_vp8.cc +++ b/remoting/base/encoder_vp8.cc @@ -267,6 +267,7 @@ void EncoderVp8::Encode(scoped_refptr<CaptureData> capture_data, VideoPacket::LAST_PARTITION); 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()); for (size_t i = 0; i < updated_rects.size(); ++i) { Rect* rect = message->add_dirty_rects(); rect->set_x(updated_rects[i].x()); |