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

Side by Side Diff: remoting/capturer/video_frame_capturer_fake.cc

Issue 11781003: Connect to DesktopEnvironment's stubs only when audio/video schedulers are about to be created. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: CR feedback #2 Created 7 years, 11 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 | Annotate | Revision Log
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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/capturer/video_frame_capturer_fake.h" 5 #include "remoting/capturer/video_frame_capturer_fake.h"
6 6
7 #include "base/time.h" 7 #include "base/time.h"
8 #include "remoting/capturer/capture_data.h" 8 #include "remoting/capturer/capture_data.h"
9 9
10 namespace remoting { 10 namespace remoting {
11 11
12 // VideoFrameCapturerFake generates a white picture of size kWidth x kHeight 12 // VideoFrameCapturerFake generates a white picture of size kWidth x kHeight
13 // with a rectangle of size kBoxWidth x kBoxHeight. The rectangle moves kSpeed 13 // with a rectangle of size kBoxWidth x kBoxHeight. The rectangle moves kSpeed
14 // pixels per frame along both axes, and bounces off the sides of the screen. 14 // pixels per frame along both axes, and bounces off the sides of the screen.
15 static const int kWidth = 800; 15 static const int kWidth = VideoFrameCapturerFake::kWidth;
16 static const int kHeight = 600; 16 static const int kHeight = VideoFrameCapturerFake::kHeight;
17 static const int kBoxWidth = 140; 17 static const int kBoxWidth = 140;
18 static const int kBoxHeight = 140; 18 static const int kBoxHeight = 140;
19 static const int kSpeed = 20; 19 static const int kSpeed = 20;
20 20
21 COMPILE_ASSERT(kBoxWidth < kWidth && kBoxHeight < kHeight, bad_box_size); 21 COMPILE_ASSERT(kBoxWidth < kWidth && kBoxHeight < kHeight, bad_box_size);
22 COMPILE_ASSERT((kBoxWidth % kSpeed == 0) && (kWidth % kSpeed == 0) && 22 COMPILE_ASSERT((kBoxWidth % kSpeed == 0) && (kWidth % kSpeed == 0) &&
23 (kBoxHeight % kSpeed == 0) && (kHeight % kSpeed == 0), 23 (kBoxHeight % kSpeed == 0) && (kHeight % kSpeed == 0),
24 sizes_must_be_multiple_of_kSpeed); 24 sizes_must_be_multiple_of_kSpeed);
25 25
26 VideoFrameCapturerFake::VideoFrameCapturerFake() 26 VideoFrameCapturerFake::VideoFrameCapturerFake()
(...skipping 85 matching lines...) Expand 10 before | Expand all | Expand 10 after
112 bytes_per_row_ = size_.width() * CaptureData::kBytesPerPixel; 112 bytes_per_row_ = size_.width() * CaptureData::kBytesPerPixel;
113 113
114 // Create memory for the buffers. 114 // Create memory for the buffers.
115 int buffer_size = size_.height() * bytes_per_row_; 115 int buffer_size = size_.height() * bytes_per_row_;
116 for (int i = 0; i < kNumBuffers; i++) { 116 for (int i = 0; i < kNumBuffers; i++) {
117 buffers_[i].reset(new uint8[buffer_size]); 117 buffers_[i].reset(new uint8[buffer_size]);
118 } 118 }
119 } 119 }
120 120
121 } // namespace remoting 121 } // namespace remoting
OLDNEW
« no previous file with comments | « remoting/capturer/video_frame_capturer_fake.h ('k') | remoting/host/chromoting_host_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698