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

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

Issue 1917023003: ScreenCapture for Android phase1, part I (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: rebase to use the new CreatePowerSaveBlocker() and pass pixelStride to native Created 4 years, 6 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
(Empty)
1 // Copyright 2016 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
4
5 #include "content/browser/media/capture/screen_capture_device_android.h"
6
7 #include "base/logging.h"
8 #include "base/memory/ptr_util.h"
9 #include "media/capture/content/android/screen_capture_machine_android.h"
10
11 namespace content {
12
13 ScreenCaptureDeviceAndroid::ScreenCaptureDeviceAndroid()
14 : core_(base::WrapUnique(new media::ScreenCaptureMachineAndroid())) {}
15
16 ScreenCaptureDeviceAndroid::~ScreenCaptureDeviceAndroid() {
17 DVLOG(2) << "ScreenCaptureDeviceAndroid@" << this << " destroying.";
18 }
19
20 // static
21 std::unique_ptr<media::VideoCaptureDevice>
22 ScreenCaptureDeviceAndroid::Create() {
23 return base::WrapUnique(new ScreenCaptureDeviceAndroid());
24 }
25
26 void ScreenCaptureDeviceAndroid::AllocateAndStart(
27 const media::VideoCaptureParams& params,
28 std::unique_ptr<Client> client) {
29 DVLOG(1) << "Allocating " << params.requested_format.frame_size.ToString();
30 core_.AllocateAndStart(params, std::move(client));
31
32 power_save_blocker_ = CreatePowerSaveBlocker(
33 PowerSaveBlocker::kPowerSaveBlockPreventDisplaySleep,
34 PowerSaveBlocker::kReasonOther, "ScreenCaptureMachineAndroid is running");
35 }
36
37 void ScreenCaptureDeviceAndroid::StopAndDeAllocate() {
38 power_save_blocker_.reset();
39 core_.StopAndDeAllocate();
40 }
41
42 void ScreenCaptureDeviceAndroid::RequestRefreshFrame() {
43 core_.RequestRefreshFrame();
44 }
45 } // namespace content
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698