OLD | NEW |
1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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/screen_capturer_fake.h" | 5 #include "remoting/host/screen_capturer_fake.h" |
6 | 6 |
7 #include "base/logging.h" | 7 #include "base/logging.h" |
8 #include "base/time/time.h" | 8 #include "base/time/time.h" |
9 #include "third_party/webrtc/modules/desktop_capture/desktop_frame.h" | 9 #include "third_party/webrtc/modules/desktop_capture/desktop_frame.h" |
10 | 10 |
(...skipping 64 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
75 callback_->OnCaptureCompleted(queue_.current_frame()->Share()); | 75 callback_->OnCaptureCompleted(queue_.current_frame()->Share()); |
76 } | 76 } |
77 | 77 |
78 void ScreenCapturerFake::SetMouseShapeObserver( | 78 void ScreenCapturerFake::SetMouseShapeObserver( |
79 MouseShapeObserver* mouse_shape_observer) { | 79 MouseShapeObserver* mouse_shape_observer) { |
80 DCHECK(!mouse_shape_observer_); | 80 DCHECK(!mouse_shape_observer_); |
81 DCHECK(mouse_shape_observer); | 81 DCHECK(mouse_shape_observer); |
82 mouse_shape_observer_ = mouse_shape_observer; | 82 mouse_shape_observer_ = mouse_shape_observer; |
83 } | 83 } |
84 | 84 |
| 85 bool ScreenCapturerFake::GetScreenList(ScreenList* screens) { |
| 86 NOTIMPLEMENTED(); |
| 87 return false; |
| 88 } |
| 89 |
| 90 bool ScreenCapturerFake::SelectScreen(webrtc::ScreenId id) { |
| 91 NOTIMPLEMENTED(); |
| 92 return false; |
| 93 } |
| 94 |
85 void ScreenCapturerFake::GenerateImage() { | 95 void ScreenCapturerFake::GenerateImage() { |
86 webrtc::DesktopFrame* frame = queue_.current_frame(); | 96 webrtc::DesktopFrame* frame = queue_.current_frame(); |
87 | 97 |
88 const int kBytesPerPixel = webrtc::DesktopFrame::kBytesPerPixel; | 98 const int kBytesPerPixel = webrtc::DesktopFrame::kBytesPerPixel; |
89 | 99 |
90 memset(frame->data(), 0xff, | 100 memset(frame->data(), 0xff, |
91 size_.width() * size_.height() * kBytesPerPixel); | 101 size_.width() * size_.height() * kBytesPerPixel); |
92 | 102 |
93 uint8* row = frame->data() + | 103 uint8* row = frame->data() + |
94 (box_pos_y_ * size_.width() + box_pos_x_) * kBytesPerPixel; | 104 (box_pos_y_ * size_.width() + box_pos_x_) * kBytesPerPixel; |
(...skipping 24 matching lines...) Expand all Loading... |
119 } | 129 } |
120 } | 130 } |
121 | 131 |
122 void ScreenCapturerFake::ScreenConfigurationChanged() { | 132 void ScreenCapturerFake::ScreenConfigurationChanged() { |
123 size_.set(kWidth, kHeight); | 133 size_.set(kWidth, kHeight); |
124 queue_.Reset(); | 134 queue_.Reset(); |
125 bytes_per_row_ = size_.width() * webrtc::DesktopFrame::kBytesPerPixel; | 135 bytes_per_row_ = size_.width() * webrtc::DesktopFrame::kBytesPerPixel; |
126 } | 136 } |
127 | 137 |
128 } // namespace remoting | 138 } // namespace remoting |
OLD | NEW |