Chromium Code Reviews| Index: remoting/host/chromeos/aura_screen_capturer.cc |
| diff --git a/remoting/host/chromeos/aura_desktop_capturer.cc b/remoting/host/chromeos/aura_screen_capturer.cc |
| similarity index 77% |
| rename from remoting/host/chromeos/aura_desktop_capturer.cc |
| rename to remoting/host/chromeos/aura_screen_capturer.cc |
| index caf6837430d03df22dfc29824a13bc3bbc89ea1d..41de7da2a27038ea4b05ff1b89faea86dc25459b 100644 |
| --- a/remoting/host/chromeos/aura_desktop_capturer.cc |
| +++ b/remoting/host/chromeos/aura_screen_capturer.cc |
| @@ -2,7 +2,7 @@ |
| // Use of this source code is governed by a BSD-style license that can be |
| // found in the LICENSE file. |
| -#include "remoting/host/chromeos/aura_desktop_capturer.h" |
| +#include "remoting/host/chromeos/aura_screen_capturer.h" |
| #include "ash/shell.h" |
| #include "base/bind.h" |
| @@ -40,8 +40,8 @@ SkiaBitmapDesktopFrame* SkiaBitmapDesktopFrame::Create( |
| scoped_ptr<SkBitmap> bitmap) { |
| webrtc::DesktopSize size(bitmap->width(), bitmap->height()); |
| - DCHECK_EQ(kRGBA_8888_SkColorType, bitmap->info().colorType()) |
| - << "DesktopFrame objects always hold RGBA data."; |
| + DCHECK_EQ(kBGRA_8888_SkColorType, bitmap->info().colorType()) |
| + << "DesktopFrame objects always hold BGRA data."; |
| uint8_t* bitmap_data = reinterpret_cast<uint8_t*>(bitmap->getPixels()); |
| @@ -63,14 +63,14 @@ SkiaBitmapDesktopFrame::~SkiaBitmapDesktopFrame() { |
| } // namespace |
| -AuraDesktopCapturer::AuraDesktopCapturer() |
| +AuraScreenCapturer::AuraScreenCapturer() |
| : callback_(NULL), desktop_window_(NULL), weak_factory_(this) { |
| } |
| -AuraDesktopCapturer::~AuraDesktopCapturer() { |
| +AuraScreenCapturer::~AuraScreenCapturer() { |
| } |
| -void AuraDesktopCapturer::Start(webrtc::DesktopCapturer::Callback* callback) { |
| +void AuraScreenCapturer::Start(webrtc::DesktopCapturer::Callback* callback) { |
| if (ash::Shell::HasInstance()) { |
| // TODO(kelvinp): Use ash::Shell::GetAllRootWindows() when multiple monitor |
| // support is implemented. |
| @@ -83,11 +83,11 @@ void AuraDesktopCapturer::Start(webrtc::DesktopCapturer::Callback* callback) { |
| DCHECK(callback_); |
| } |
| -void AuraDesktopCapturer::Capture(const webrtc::DesktopRegion&) { |
| +void AuraScreenCapturer::Capture(const webrtc::DesktopRegion&) { |
| scoped_ptr<cc::CopyOutputRequest> request = |
| cc::CopyOutputRequest::CreateBitmapRequest( |
| base::Bind( |
| - &AuraDesktopCapturer::OnFrameCaptured, |
| + &AuraScreenCapturer::OnFrameCaptured, |
| weak_factory_.GetWeakPtr())); |
| gfx::Rect window_rect(desktop_window_->bounds().size()); |
| @@ -96,7 +96,7 @@ void AuraDesktopCapturer::Capture(const webrtc::DesktopRegion&) { |
| desktop_window_->layer()->RequestCopyOfOutput(request.Pass()); |
| } |
| -void AuraDesktopCapturer::OnFrameCaptured( |
| +void AuraScreenCapturer::OnFrameCaptured( |
| scoped_ptr<cc::CopyOutputResult> result) { |
| DCHECK(result->HasBitmap()); |
| @@ -116,4 +116,25 @@ void AuraDesktopCapturer::OnFrameCaptured( |
| callback_->OnCaptureCompleted(frame.release()); |
| } |
| +bool AuraScreenCapturer::GetScreenList(ScreenList* screens) { |
| + // Multiple monitors capturing are not supported on ChromeOS. |
|
Wez
2014/10/24 00:28:47
nit: Multi-monitor capturing is not supported yet.
kelvinp
2014/10/24 21:39:41
Revert to AuraDesktopCapturer
|
| + NOTIMPLEMENTED(); |
| + return false; |
| +} |
| + |
| +bool AuraScreenCapturer::SelectScreen(webrtc::ScreenId id) { |
| + // Multiple monitors capturing are not supported on ChromeOS. |
| + NOTIMPLEMENTED(); |
| + return false; |
| +}; |
| + |
| } // namespace remoting |
| + |
| +namespace webrtc { |
| + |
| +// static |
| +ScreenCapturer* ScreenCapturer::Create(const DesktopCaptureOptions& options) { |
| + return new remoting::AuraScreenCapturer(); |
| +} |
| + |
| +} // namespace webrtc |