| 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 10 matching lines...) Expand all Loading... |
| 21 #include "base/synchronization/lock.h" | 21 #include "base/synchronization/lock.h" |
| 22 #include "base/threading/thread.h" | 22 #include "base/threading/thread.h" |
| 23 #include "base/threading/thread_restrictions.h" | 23 #include "base/threading/thread_restrictions.h" |
| 24 #include "base/timer/timer.h" | 24 #include "base/timer/timer.h" |
| 25 #include "build/build_config.h" | 25 #include "build/build_config.h" |
| 26 #include "content/browser/media/capture/desktop_capture_device_uma_types.h" | 26 #include "content/browser/media/capture/desktop_capture_device_uma_types.h" |
| 27 #include "content/public/browser/browser_thread.h" | 27 #include "content/public/browser/browser_thread.h" |
| 28 #include "content/public/browser/desktop_media_id.h" | 28 #include "content/public/browser/desktop_media_id.h" |
| 29 #include "content/public/common/content_switches.h" | 29 #include "content/public/common/content_switches.h" |
| 30 #include "content/public/common/service_manager_connection.h" | 30 #include "content/public/common/service_manager_connection.h" |
| 31 #include "device/wake_lock/public/interfaces/wake_lock.mojom.h" |
| 31 #include "device/wake_lock/public/interfaces/wake_lock_provider.mojom.h" | 32 #include "device/wake_lock/public/interfaces/wake_lock_provider.mojom.h" |
| 32 #include "device/wake_lock/public/interfaces/wake_lock_service.mojom.h" | |
| 33 #include "media/base/video_util.h" | 33 #include "media/base/video_util.h" |
| 34 #include "media/capture/content/capture_resolution_chooser.h" | 34 #include "media/capture/content/capture_resolution_chooser.h" |
| 35 #include "services/device/public/interfaces/constants.mojom.h" | 35 #include "services/device/public/interfaces/constants.mojom.h" |
| 36 #include "services/service_manager/public/cpp/connector.h" | 36 #include "services/service_manager/public/cpp/connector.h" |
| 37 #include "third_party/libyuv/include/libyuv/scale_argb.h" | 37 #include "third_party/libyuv/include/libyuv/scale_argb.h" |
| 38 #include "third_party/webrtc/modules/desktop_capture/cropping_window_capturer.h" | 38 #include "third_party/webrtc/modules/desktop_capture/cropping_window_capturer.h" |
| 39 #include "third_party/webrtc/modules/desktop_capture/desktop_and_cursor_composer
.h" | 39 #include "third_party/webrtc/modules/desktop_capture/desktop_and_cursor_composer
.h" |
| 40 #include "third_party/webrtc/modules/desktop_capture/desktop_capture_options.h" | 40 #include "third_party/webrtc/modules/desktop_capture/desktop_capture_options.h" |
| 41 #include "third_party/webrtc/modules/desktop_capture/desktop_capturer.h" | 41 #include "third_party/webrtc/modules/desktop_capture/desktop_capturer.h" |
| 42 #include "third_party/webrtc/modules/desktop_capture/desktop_frame.h" | 42 #include "third_party/webrtc/modules/desktop_capture/desktop_frame.h" |
| (...skipping 109 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 152 // The type of the capturer. | 152 // The type of the capturer. |
| 153 DesktopMediaID::Type capturer_type_; | 153 DesktopMediaID::Type capturer_type_; |
| 154 | 154 |
| 155 // The system time when we receive the first frame. | 155 // The system time when we receive the first frame. |
| 156 base::TimeTicks first_ref_time_; | 156 base::TimeTicks first_ref_time_; |
| 157 | 157 |
| 158 std::unique_ptr<webrtc::BasicDesktopFrame> black_frame_; | 158 std::unique_ptr<webrtc::BasicDesktopFrame> black_frame_; |
| 159 | 159 |
| 160 // TODO(jiayl): Remove wake_lock_ when there is an API to keep the | 160 // TODO(jiayl): Remove wake_lock_ when there is an API to keep the |
| 161 // screen from sleeping for the drive-by web. | 161 // screen from sleeping for the drive-by web. |
| 162 device::mojom::WakeLockServicePtr wake_lock_; | 162 device::mojom::WakeLockPtr wake_lock_; |
| 163 | 163 |
| 164 base::WeakPtrFactory<Core> weak_factory_; | 164 base::WeakPtrFactory<Core> weak_factory_; |
| 165 | 165 |
| 166 DISALLOW_COPY_AND_ASSIGN(Core); | 166 DISALLOW_COPY_AND_ASSIGN(Core); |
| 167 }; | 167 }; |
| 168 | 168 |
| 169 DesktopCaptureDevice::Core::Core( | 169 DesktopCaptureDevice::Core::Core( |
| 170 scoped_refptr<base::SingleThreadTaskRunner> task_runner, | 170 scoped_refptr<base::SingleThreadTaskRunner> task_runner, |
| 171 std::unique_ptr<webrtc::DesktopCapturer> capturer, | 171 std::unique_ptr<webrtc::DesktopCapturer> capturer, |
| 172 DesktopMediaID::Type type) | 172 DesktopMediaID::Type type) |
| (...skipping 324 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 497 #else | 497 #else |
| 498 base::MessageLoop::Type thread_type = base::MessageLoop::TYPE_DEFAULT; | 498 base::MessageLoop::Type thread_type = base::MessageLoop::TYPE_DEFAULT; |
| 499 #endif | 499 #endif |
| 500 | 500 |
| 501 thread_.StartWithOptions(base::Thread::Options(thread_type, 0)); | 501 thread_.StartWithOptions(base::Thread::Options(thread_type, 0)); |
| 502 | 502 |
| 503 core_.reset(new Core(thread_.task_runner(), std::move(capturer), type)); | 503 core_.reset(new Core(thread_.task_runner(), std::move(capturer), type)); |
| 504 } | 504 } |
| 505 | 505 |
| 506 } // namespace content | 506 } // namespace content |
| OLD | NEW |