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

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: relocate java files, support YUV format and improve JNI operation Created 4 years, 7 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_(new media::ScreenCaptureDeviceCore(
15 base::WrapUnique(new media::ScreenCaptureMachineAndroid()))) {}
16
17 ScreenCaptureDeviceAndroid::~ScreenCaptureDeviceAndroid() {
18 DVLOG(2) << "ScreenCaptureDeviceAndroid@" << this << " destroying.";
19 }
20
21 // static
22 std::unique_ptr<media::VideoCaptureDevice>
23 ScreenCaptureDeviceAndroid::Create() {
24 return std::unique_ptr<media::VideoCaptureDevice>(
mcasas 2016/05/19 19:11:39 Consider base::WrapUnique(), however see my next
braveyao 2016/05/20 22:27:24 Done.
25 new ScreenCaptureDeviceAndroid());
mcasas 2016/05/19 19:11:39 If we're just returning a new ScreenCaptureDeviceA
braveyao 2016/05/20 22:27:24 In video_capture_manager.cc, all other capture ins
26 }
27
28 void ScreenCaptureDeviceAndroid::AllocateAndStart(
29 const media::VideoCaptureParams& params,
30 std::unique_ptr<Client> client) {
31 DVLOG(1) << "Allocating " << params.requested_format.frame_size.ToString();
32 core_->AllocateAndStart(params, std::move(client));
33
34 power_save_blocker_.reset(
35 content::PowerSaveBlocker::Create(
36 content::PowerSaveBlocker::kPowerSaveBlockPreventDisplaySleep,
37 content::PowerSaveBlocker::kReasonOther,
38 "ScreenCaptureMachineAndroid is running")
39 .release());
mcasas 2016/05/19 19:11:39 Strange somersault? Consider: power_save_blocker_
braveyao 2016/05/20 22:27:24 Done. I see "power_save_blocker_ = PowerSaverBloc
mcasas 2016/05/23 18:19:55 I don't understand this response.
braveyao 2016/05/24 00:03:26 Some people use "power_save_blocker_.reset(PowerSa
40 }
41
42 void ScreenCaptureDeviceAndroid::StopAndDeAllocate() {
43 power_save_blocker_.reset();
44 core_->StopAndDeAllocate();
45 }
46
47 void ScreenCaptureDeviceAndroid::RequestRefreshFrame() {
48 core_->RequestRefreshFrame();
49 }
50 } // namespace content
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698