| 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 <stddef.h> | 7 #include <stddef.h> |
| 8 #include <stdint.h> | 8 #include <stdint.h> |
| 9 #include <string.h> | 9 #include <string.h> |
| 10 #include <utility> | 10 #include <utility> |
| (...skipping 154 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 165 DCHECK(desktop_capturer_); | 165 DCHECK(desktop_capturer_); |
| 166 DCHECK(client); | 166 DCHECK(client); |
| 167 DCHECK(!client_); | 167 DCHECK(!client_); |
| 168 | 168 |
| 169 client_ = std::move(client); | 169 client_ = std::move(client); |
| 170 requested_frame_rate_ = params.requested_format.frame_rate; | 170 requested_frame_rate_ = params.requested_format.frame_rate; |
| 171 resolution_chooser_.reset(new media::CaptureResolutionChooser( | 171 resolution_chooser_.reset(new media::CaptureResolutionChooser( |
| 172 params.requested_format.frame_size, | 172 params.requested_format.frame_size, |
| 173 params.resolution_change_policy)); | 173 params.resolution_change_policy)); |
| 174 | 174 |
| 175 power_save_blocker_.reset( | 175 power_save_blocker_.reset(new device::PowerSaveBlocker( |
| 176 device::PowerSaveBlocker::CreateWithTaskRunners( | 176 device::PowerSaveBlocker::kPowerSaveBlockPreventDisplaySleep, |
| 177 device::PowerSaveBlocker::kPowerSaveBlockPreventDisplaySleep, | 177 device::PowerSaveBlocker::kReasonOther, "DesktopCaptureDevice is running", |
| 178 device::PowerSaveBlocker::kReasonOther, | 178 BrowserThread::GetMessageLoopProxyForThread(BrowserThread::UI), |
| 179 "DesktopCaptureDevice is running", | 179 BrowserThread::GetMessageLoopProxyForThread(BrowserThread::FILE))); |
| 180 BrowserThread::GetMessageLoopProxyForThread(BrowserThread::UI), | |
| 181 BrowserThread::GetMessageLoopProxyForThread(BrowserThread::FILE)) | |
| 182 .release()); | |
| 183 | 180 |
| 184 desktop_capturer_->Start(this); | 181 desktop_capturer_->Start(this); |
| 185 | 182 |
| 186 CaptureFrameAndScheduleNext(); | 183 CaptureFrameAndScheduleNext(); |
| 187 } | 184 } |
| 188 | 185 |
| 189 void DesktopCaptureDevice::Core::SetNotificationWindowId( | 186 void DesktopCaptureDevice::Core::SetNotificationWindowId( |
| 190 gfx::NativeViewId window_id) { | 187 gfx::NativeViewId window_id) { |
| 191 DCHECK(task_runner_->BelongsToCurrentThread()); | 188 DCHECK(task_runner_->BelongsToCurrentThread()); |
| 192 DCHECK(window_id); | 189 DCHECK(window_id); |
| (...skipping 265 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 458 #else | 455 #else |
| 459 base::MessageLoop::Type thread_type = base::MessageLoop::TYPE_DEFAULT; | 456 base::MessageLoop::Type thread_type = base::MessageLoop::TYPE_DEFAULT; |
| 460 #endif | 457 #endif |
| 461 | 458 |
| 462 thread_.StartWithOptions(base::Thread::Options(thread_type, 0)); | 459 thread_.StartWithOptions(base::Thread::Options(thread_type, 0)); |
| 463 | 460 |
| 464 core_.reset(new Core(thread_.task_runner(), std::move(capturer), type)); | 461 core_.reset(new Core(thread_.task_runner(), std::move(capturer), type)); |
| 465 } | 462 } |
| 466 | 463 |
| 467 } // namespace content | 464 } // namespace content |
| OLD | NEW |