OLD | NEW |
1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 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 "content/browser/media/capture/desktop_capture_device.h" | 5 #include "content/browser/media/capture/desktop_capture_device.h" |
6 | 6 |
7 #include "base/bind.h" | 7 #include "base/bind.h" |
8 #include "base/location.h" | 8 #include "base/location.h" |
9 #include "base/logging.h" | 9 #include "base/logging.h" |
10 #include "base/metrics/histogram.h" | 10 #include "base/metrics/histogram.h" |
(...skipping 156 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
167 DCHECK(!client_.get()); | 167 DCHECK(!client_.get()); |
168 | 168 |
169 client_ = client.Pass(); | 169 client_ = client.Pass(); |
170 requested_params_ = params; | 170 requested_params_ = params; |
171 | 171 |
172 capture_format_ = requested_params_.requested_format; | 172 capture_format_ = requested_params_.requested_format; |
173 | 173 |
174 // This capturer always outputs ARGB, non-interlaced. | 174 // This capturer always outputs ARGB, non-interlaced. |
175 capture_format_.pixel_format = media::PIXEL_FORMAT_ARGB; | 175 capture_format_.pixel_format = media::PIXEL_FORMAT_ARGB; |
176 | 176 |
177 power_save_blocker_.reset(PowerSaveBlocker::Create( | 177 power_save_blocker_.reset( |
178 PowerSaveBlocker::kPowerSaveBlockPreventDisplaySleep, | 178 PowerSaveBlocker::Create( |
179 "DesktopCaptureDevice is running").release()); | 179 PowerSaveBlocker::kPowerSaveBlockPreventDisplaySleep, |
| 180 PowerSaveBlocker::kReasonOther, |
| 181 "DesktopCaptureDevice is running").release()); |
180 | 182 |
181 desktop_capturer_->Start(this); | 183 desktop_capturer_->Start(this); |
182 | 184 |
183 CaptureFrameAndScheduleNext(); | 185 CaptureFrameAndScheduleNext(); |
184 } | 186 } |
185 | 187 |
186 void DesktopCaptureDevice::Core::SetNotificationWindowId( | 188 void DesktopCaptureDevice::Core::SetNotificationWindowId( |
187 gfx::NativeViewId window_id) { | 189 gfx::NativeViewId window_id) { |
188 DCHECK(task_runner_->BelongsToCurrentThread()); | 190 DCHECK(task_runner_->BelongsToCurrentThread()); |
189 DCHECK(window_id); | 191 DCHECK(window_id); |
(...skipping 296 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
486 #else | 488 #else |
487 base::MessageLoop::Type thread_type = base::MessageLoop::TYPE_DEFAULT; | 489 base::MessageLoop::Type thread_type = base::MessageLoop::TYPE_DEFAULT; |
488 #endif | 490 #endif |
489 | 491 |
490 thread_.StartWithOptions(base::Thread::Options(thread_type, 0)); | 492 thread_.StartWithOptions(base::Thread::Options(thread_type, 0)); |
491 | 493 |
492 core_.reset(new Core(thread_.task_runner(), capturer.Pass(), type)); | 494 core_.reset(new Core(thread_.task_runner(), capturer.Pass(), type)); |
493 } | 495 } |
494 | 496 |
495 } // namespace content | 497 } // namespace content |
OLD | NEW |