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

Unified Diff: content/browser/media/capture/desktop_capture_device.cc

Issue 502103003: Prevent the screen from sleeping when the desktop is being captured. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 years, 4 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | content/browser/media/capture/desktop_capture_device_aura.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/browser/media/capture/desktop_capture_device.cc
diff --git a/content/browser/media/capture/desktop_capture_device.cc b/content/browser/media/capture/desktop_capture_device.cc
index 930b752159408de76259fbcd81318ccf0d4b872b..cf36eda9f2414a79be91034f667cf8f3e9b12c63 100644
--- a/content/browser/media/capture/desktop_capture_device.cc
+++ b/content/browser/media/capture/desktop_capture_device.cc
@@ -15,6 +15,7 @@
#include "content/browser/media/capture/desktop_capture_device_uma_types.h"
#include "content/public/browser/browser_thread.h"
#include "content/public/browser/desktop_media_id.h"
+#include "content/public/browser/power_save_blocker.h"
#include "media/base/video_util.h"
#include "third_party/libyuv/include/libyuv/scale_argb.h"
#include "third_party/webrtc/modules/desktop_capture/desktop_and_cursor_composer.h"
@@ -124,6 +125,8 @@ class DesktopCaptureDevice::Core : public webrtc::DesktopCapturer::Callback {
scoped_ptr<webrtc::BasicDesktopFrame> black_frame_;
+ scoped_ptr<PowerSaveBlocker> power_save_blocker_;
+
DISALLOW_COPY_AND_ASSIGN(Core);
};
@@ -164,6 +167,10 @@ void DesktopCaptureDevice::Core::AllocateAndStart(
// This capturer always outputs ARGB, non-interlaced.
capture_format_.pixel_format = media::PIXEL_FORMAT_ARGB;
+ power_save_blocker_.reset(PowerSaveBlocker::Create(
+ PowerSaveBlocker::kPowerSaveBlockPreventDisplaySleep,
+ "DesktopCatureDevice is running").release());
juberti2 2014/08/25 19:16:24 DesktopCatureDevice -> DesktopCaptureDevice (here
jiayl 2014/08/25 19:50:01 Done.
+
desktop_capturer_->Start(this);
CaptureFrameAndScheduleNext();
« no previous file with comments | « no previous file | content/browser/media/capture/desktop_capture_device_aura.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698