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

Side by Side Diff: remoting/host/fake_desktop_capturer.cc

Issue 1150163002: Update VideoFramePump to pass un-changed frames to encoders. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Add basic tests for unchanged frames Created 5 years, 6 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 unified diff | Download patch
OLDNEW
1 // Copyright 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "remoting/host/fake_desktop_capturer.h" 5 #include "remoting/host/fake_desktop_capturer.h"
6 6
7 #include "base/bind.h" 7 #include "base/bind.h"
8 #include "base/logging.h" 8 #include "base/logging.h"
9 #include "base/memory/ref_counted.h" 9 #include "base/memory/ref_counted.h"
10 #include "base/time/time.h" 10 #include "base/time/time.h"
(...skipping 125 matching lines...) Expand 10 before | Expand all | Expand 10 after
136 136
137 void FakeDesktopCapturer::Start(Callback* callback) { 137 void FakeDesktopCapturer::Start(Callback* callback) {
138 DCHECK(!callback_); 138 DCHECK(!callback_);
139 DCHECK(callback); 139 DCHECK(callback);
140 callback_ = callback; 140 callback_ = callback;
141 } 141 }
142 142
143 void FakeDesktopCapturer::Capture(const webrtc::DesktopRegion& region) { 143 void FakeDesktopCapturer::Capture(const webrtc::DesktopRegion& region) {
144 base::Time capture_start_time = base::Time::Now(); 144 base::Time capture_start_time = base::Time::Now();
145 scoped_ptr<webrtc::DesktopFrame> frame = frame_generator_.Run(callback_); 145 scoped_ptr<webrtc::DesktopFrame> frame = frame_generator_.Run(callback_);
146 frame->set_capture_time_ms( 146 if (frame) {
147 (base::Time::Now() - capture_start_time).InMillisecondsRoundedUp()); 147 frame->set_capture_time_ms(
148 (base::Time::Now() - capture_start_time).InMillisecondsRoundedUp());
149 }
148 callback_->OnCaptureCompleted(frame.release()); 150 callback_->OnCaptureCompleted(frame.release());
149 } 151 }
150 152
151 } // namespace remoting 153 } // namespace remoting
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698