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

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

Issue 1462063004: Move VideoFramePump to remoting/protocol (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 1 month 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
« no previous file with comments | « remoting/protocol/fake_desktop_capturer.h ('k') | remoting/protocol/video_frame_pump.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2015 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/protocol/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"
10 #include "base/time/time.h" 9 #include "base/time/time.h"
11 #include "third_party/webrtc/modules/desktop_capture/desktop_frame.h" 10 #include "third_party/webrtc/modules/desktop_capture/desktop_frame.h"
12 11
13 namespace remoting { 12 namespace remoting {
13 namespace protocol {
14 14
15 // FakeDesktopCapturer generates a white picture of size kWidth x kHeight 15 // FakeDesktopCapturer generates a white picture of size kWidth x kHeight
16 // with a rectangle of size kBoxWidth x kBoxHeight. The rectangle moves kSpeed 16 // with a rectangle of size kBoxWidth x kBoxHeight. The rectangle moves kSpeed
17 // pixels per frame along both axes, and bounces off the sides of the screen. 17 // pixels per frame along both axes, and bounces off the sides of the screen.
18 static const int kWidth = FakeDesktopCapturer::kWidth; 18 static const int kWidth = FakeDesktopCapturer::kWidth;
19 static const int kHeight = FakeDesktopCapturer::kHeight; 19 static const int kHeight = FakeDesktopCapturer::kHeight;
20 static const int kBoxWidth = 140; 20 static const int kBoxWidth = 140;
21 static const int kBoxHeight = 140; 21 static const int kBoxHeight = 140;
22 static const int kSpeed = 20; 22 static const int kSpeed = 20;
23 23
(...skipping 119 matching lines...) Expand 10 before | Expand all | Expand 10 after
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 if (frame) { 146 if (frame) {
147 frame->set_capture_time_ms( 147 frame->set_capture_time_ms(
148 (base::Time::Now() - capture_start_time).InMillisecondsRoundedUp()); 148 (base::Time::Now() - capture_start_time).InMillisecondsRoundedUp());
149 } 149 }
150 callback_->OnCaptureCompleted(frame.release()); 150 callback_->OnCaptureCompleted(frame.release());
151 } 151 }
152 152
153 } // namespace protocol
153 } // namespace remoting 154 } // namespace remoting
OLDNEW
« no previous file with comments | « remoting/protocol/fake_desktop_capturer.h ('k') | remoting/protocol/video_frame_pump.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698