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

Side by Side Diff: content/browser/media/capture/desktop_capture_device_aura.cc

Issue 946643002: Use PowerSaveBlocker for audio and video on Chrome OS. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: apply nits Created 5 years, 9 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
OLDNEW
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 "content/browser/media/capture/desktop_capture_device_aura.h" 5 #include "content/browser/media/capture/desktop_capture_device_aura.h"
6 6
7 #include "base/logging.h" 7 #include "base/logging.h"
8 #include "base/metrics/histogram.h" 8 #include "base/metrics/histogram.h"
9 #include "base/timer/timer.h" 9 #include "base/timer/timer.h"
10 #include "cc/output/copy_output_request.h" 10 #include "cc/output/copy_output_request.h"
(...skipping 200 matching lines...) Expand 10 before | Expand all | Expand 10 after
211 // Update capture size. 211 // Update capture size.
212 UpdateCaptureSize(); 212 UpdateCaptureSize();
213 213
214 // Start observing window events. 214 // Start observing window events.
215 desktop_window_->AddObserver(this); 215 desktop_window_->AddObserver(this);
216 216
217 // Start observing compositor updates. 217 // Start observing compositor updates.
218 if (desktop_window_->GetHost()) 218 if (desktop_window_->GetHost())
219 desktop_window_->GetHost()->compositor()->AddObserver(this); 219 desktop_window_->GetHost()->compositor()->AddObserver(this);
220 220
221 power_save_blocker_.reset(PowerSaveBlocker::Create( 221 power_save_blocker_.reset(
222 PowerSaveBlocker::kPowerSaveBlockPreventDisplaySleep, 222 PowerSaveBlocker::Create(
223 "DesktopCaptureDevice is running").release()); 223 PowerSaveBlocker::kPowerSaveBlockPreventDisplaySleep,
224 PowerSaveBlocker::kReasonOther,
225 "DesktopCaptureDevice is running").release());
224 226
225 // Starts timer. 227 // Starts timer.
226 timer_.Start(FROM_HERE, oracle_proxy_->min_capture_period(), 228 timer_.Start(FROM_HERE, oracle_proxy_->min_capture_period(),
227 base::Bind(&DesktopVideoCaptureMachine::Capture, AsWeakPtr(), 229 base::Bind(&DesktopVideoCaptureMachine::Capture, AsWeakPtr(),
228 false)); 230 false));
229 231
230 return true; 232 return true;
231 } 233 }
232 234
233 void DesktopVideoCaptureMachine::Stop(const base::Closure& callback) { 235 void DesktopVideoCaptureMachine::Stop(const base::Closure& callback) {
(...skipping 298 matching lines...) Expand 10 before | Expand all | Expand 10 after
532 scoped_ptr<Client> client) { 534 scoped_ptr<Client> client) {
533 DVLOG(1) << "Allocating " << params.requested_format.frame_size.ToString(); 535 DVLOG(1) << "Allocating " << params.requested_format.frame_size.ToString();
534 core_->AllocateAndStart(params, client.Pass()); 536 core_->AllocateAndStart(params, client.Pass());
535 } 537 }
536 538
537 void DesktopCaptureDeviceAura::StopAndDeAllocate() { 539 void DesktopCaptureDeviceAura::StopAndDeAllocate() {
538 core_->StopAndDeAllocate(); 540 core_->StopAndDeAllocate();
539 } 541 }
540 542
541 } // namespace content 543 } // namespace content
OLDNEW
« no previous file with comments | « content/browser/media/capture/desktop_capture_device.cc ('k') | content/browser/media/webrtc_internals.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698