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/renderer_host/media/desktop_capture_device.h" | 5 #include "content/browser/renderer_host/media/desktop_capture_device.h" |
6 | 6 |
7 #include "base/bind.h" | 7 #include "base/bind.h" |
8 #include "base/location.h" | 8 #include "base/location.h" |
9 #include "base/logging.h" | 9 #include "base/logging.h" |
10 #include "base/sequenced_task_runner.h" | 10 #include "base/sequenced_task_runner.h" |
11 #include "base/strings/string_number_conversions.h" | 11 #include "base/strings/string_number_conversions.h" |
12 #include "base/synchronization/lock.h" | 12 #include "base/synchronization/lock.h" |
13 #include "base/threading/sequenced_worker_pool.h" | 13 #include "base/threading/sequenced_worker_pool.h" |
14 #include "content/public/browser/browser_thread.h" | 14 #include "content/public/browser/browser_thread.h" |
15 #include "content/public/common/desktop_media_id.h" | 15 #include "content/public/common/desktop_media_id.h" |
16 #include "media/base/video_util.h" | 16 #include "media/base/video_util.h" |
17 #include "third_party/libyuv/include/libyuv/scale_argb.h" | 17 #include "third_party/libyuv/include/libyuv/scale_argb.h" |
18 #include "third_party/webrtc/modules/desktop_capture/desktop_capturer.h" | 18 #include "third_party/webrtc/modules/desktop_capture/desktop_capturer.h" |
19 #include "third_party/webrtc/modules/desktop_capture/desktop_frame.h" | 19 #include "third_party/webrtc/modules/desktop_capture/desktop_frame.h" |
20 #include "third_party/webrtc/modules/desktop_capture/screen_capturer.h" | 20 #include "third_party/webrtc/modules/desktop_capture/screen_capturer.h" |
21 #include "third_party/webrtc/modules/desktop_capture/window_capturer.h" | 21 #include "third_party/webrtc/modules/desktop_capture/window_capturer.h" |
22 | 22 |
23 namespace content { | 23 namespace content { |
24 | 24 |
25 namespace { | 25 namespace { |
26 | 26 |
27 const int kBytesPerPixel = 4; | |
28 | |
29 webrtc::DesktopRect ComputeLetterboxRect( | 27 webrtc::DesktopRect ComputeLetterboxRect( |
30 const webrtc::DesktopSize& max_size, | 28 const webrtc::DesktopSize& max_size, |
31 const webrtc::DesktopSize& source_size) { | 29 const webrtc::DesktopSize& source_size) { |
32 gfx::Rect result = media::ComputeLetterboxRegion( | 30 gfx::Rect result = media::ComputeLetterboxRegion( |
33 gfx::Rect(0, 0, max_size.width(), max_size.height()), | 31 gfx::Rect(0, 0, max_size.width(), max_size.height()), |
34 gfx::Size(source_size.width(), source_size.height())); | 32 gfx::Size(source_size.width(), source_size.height())); |
35 return webrtc::DesktopRect::MakeLTRB( | 33 return webrtc::DesktopRect::MakeLTRB( |
36 result.x(), result.y(), result.right(), result.bottom()); | 34 result.x(), result.y(), result.right(), result.bottom()); |
37 } | 35 } |
38 | 36 |
(...skipping 413 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
452 | 450 |
453 void DesktopCaptureDevice::DeAllocate() { | 451 void DesktopCaptureDevice::DeAllocate() { |
454 core_->DeAllocate(); | 452 core_->DeAllocate(); |
455 } | 453 } |
456 | 454 |
457 const media::VideoCaptureDevice::Name& DesktopCaptureDevice::device_name() { | 455 const media::VideoCaptureDevice::Name& DesktopCaptureDevice::device_name() { |
458 return name_; | 456 return name_; |
459 } | 457 } |
460 | 458 |
461 } // namespace content | 459 } // namespace content |
OLD | NEW |