summaryrefslogtreecommitdiffstats
path: root/remoting
diff options
context:
space:
mode:
authornick@chromium.org <nick@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2013-12-18 19:44:43 +0000
committernick@chromium.org <nick@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2013-12-18 19:44:43 +0000
commit29a754150e5cb8f0d8e6c97eee6097c6fde8145d (patch)
tree2b3f72e045aa9d24bae709663d656719ff4d994f /remoting
parenta5f67b9425712543c66823903f3c9b284c0abcdb (diff)
downloadchromium_src-29a754150e5cb8f0d8e6c97eee6097c6fde8145d.zip
chromium_src-29a754150e5cb8f0d8e6c97eee6097c6fde8145d.tar.gz
chromium_src-29a754150e5cb8f0d8e6c97eee6097c6fde8145d.tar.bz2
Revert 241614 "Add ShapedScreenCapturer"
[Reason for revert: failed compile on Linux ASAN Builder.] > Add ShapedScreenCapturer > > ShapedScreenCapturer is a layer on top regular screen capturer that captures > desktop shape and attaches it to the generated frames. > > R=wez@chromium.org > > Review URL: https://codereview.chromium.org/93973006 TBR=sergeyu@chromium.org Review URL: https://codereview.chromium.org/103743005 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@241617 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'remoting')
-rw-r--r--remoting/host/shaped_screen_capturer.cc56
-rw-r--r--remoting/host/shaped_screen_capturer.h46
-rw-r--r--remoting/host/shaped_screen_capturer_unittest.cc95
-rw-r--r--remoting/remoting.gyp3
4 files changed, 0 insertions, 200 deletions
diff --git a/remoting/host/shaped_screen_capturer.cc b/remoting/host/shaped_screen_capturer.cc
deleted file mode 100644
index 0602524..0000000
--- a/remoting/host/shaped_screen_capturer.cc
+++ /dev/null
@@ -1,56 +0,0 @@
-// Copyright 2013 The Chromium Authors. All rights reserved.
-// Use of this source code is governed by a BSD-style license that can be
-// found in the LICENSE file.
-
-#include "remoting/host/shaped_screen_capturer.h"
-
-#include "remoting/host/desktop_shape_tracker.h"
-#include "third_party/webrtc/modules/desktop_capture/desktop_capture_options.h"
-#include "third_party/webrtc/modules/desktop_capture/desktop_frame.h"
-
-namespace remoting {
-
-// static
-scoped_ptr<ShapedScreenCapturer> ShapedScreenCapturer::Create(
- webrtc::DesktopCaptureOptions options) {
- return scoped_ptr<ShapedScreenCapturer>(
- new ShapedScreenCapturer(scoped_ptr<webrtc::ScreenCapturer>(
- webrtc::ScreenCapturer::Create(options)),
- DesktopShapeTracker::Create(options)));
-}
-
-ShapedScreenCapturer::ShapedScreenCapturer(
- scoped_ptr<webrtc::ScreenCapturer> screen_capturer,
- scoped_ptr<DesktopShapeTracker> shape_tracker)
- : screen_capturer_(screen_capturer.Pass()),
- shape_tracker_(shape_tracker.Pass()),
- callback_(NULL) {
-}
-
-ShapedScreenCapturer::~ShapedScreenCapturer() {}
-
-void ShapedScreenCapturer::Start(webrtc::ScreenCapturer::Callback* callback) {
- callback_ = callback;
- screen_capturer_->Start(this);
-}
-
-void ShapedScreenCapturer::Capture(const webrtc::DesktopRegion& region) {
- screen_capturer_->Capture(region);
-}
-
-void ShapedScreenCapturer::SetMouseShapeObserver(
- MouseShapeObserver* mouse_shape_observer) {
- screen_capturer_->SetMouseShapeObserver(mouse_shape_observer);
-}
-
-webrtc::SharedMemory* ShapedScreenCapturer::CreateSharedMemory(size_t size) {
- return callback_->CreateSharedMemory(size);
-}
-
-void ShapedScreenCapturer::OnCaptureCompleted(webrtc::DesktopFrame* frame) {
- shape_tracker_->RefreshDesktopShape();
- frame->set_shape(new webrtc::DesktopRegion(shape_tracker_->desktop_shape()));
- callback_->OnCaptureCompleted(frame);
-}
-
-} // namespace remoting
diff --git a/remoting/host/shaped_screen_capturer.h b/remoting/host/shaped_screen_capturer.h
deleted file mode 100644
index 9751086..0000000
--- a/remoting/host/shaped_screen_capturer.h
+++ /dev/null
@@ -1,46 +0,0 @@
-// Copyright 2013 The Chromium Authors. All rights reserved.
-// Use of this source code is governed by a BSD-style license that can be
-// found in the LICENSE file.
-
-#ifndef REMOTING_HOST_SHAPED_SCREEN_CAPTURER_H_
-#define REMOTING_HOST_SHAPED_SCREEN_CAPTURER_H_
-
-#include "base/memory/scoped_ptr.h"
-#include "third_party/webrtc/modules/desktop_capture/screen_capturer.h"
-
-namespace remoting {
-
-class DesktopShapeTracker;
-
-// Screen capturer that also captures desktop shape.
-class ShapedScreenCapturer : public webrtc::ScreenCapturer,
- public webrtc::DesktopCapturer::Callback {
- public:
- static scoped_ptr<ShapedScreenCapturer> Create(
- webrtc::DesktopCaptureOptions options);
-
- ShapedScreenCapturer(scoped_ptr<webrtc::ScreenCapturer> screen_capturer,
- scoped_ptr<DesktopShapeTracker> shape_tracker);
- virtual ~ShapedScreenCapturer();
-
- // webrtc::ScreenCapturer interface.
- virtual void Start(webrtc::ScreenCapturer::Callback* callback) OVERRIDE;
- virtual void Capture(const webrtc::DesktopRegion& region) OVERRIDE;
- virtual void SetMouseShapeObserver(
- MouseShapeObserver* mouse_shape_observer) OVERRIDE;
-
- private:
- // webrtc::ScreenCapturer::Callback interface.
- virtual webrtc::SharedMemory* CreateSharedMemory(size_t size) OVERRIDE;
- virtual void OnCaptureCompleted(webrtc::DesktopFrame* frame) OVERRIDE;
-
- scoped_ptr<webrtc::ScreenCapturer> screen_capturer_;
- scoped_ptr<DesktopShapeTracker> shape_tracker_;
- webrtc::ScreenCapturer::Callback* callback_;
-
- DISALLOW_COPY_AND_ASSIGN(ShapedScreenCapturer);
-};
-
-} // namespace remoting
-
-#endif // REMOTING_HOST_SHAPED_SCREEN_CAPTURER_H_
diff --git a/remoting/host/shaped_screen_capturer_unittest.cc b/remoting/host/shaped_screen_capturer_unittest.cc
deleted file mode 100644
index dfc6a80..0000000
--- a/remoting/host/shaped_screen_capturer_unittest.cc
+++ /dev/null
@@ -1,95 +0,0 @@
-// Copyright 2013 The Chromium Authors. All rights reserved.
-// Use of this source code is governed by a BSD-style license that can be
-// found in the LICENSE file.
-
-#include "remoting/host/shaped_screen_capturer.h"
-
-#include "remoting/host/desktop_shape_tracker.h"
-#include "testing/gtest/include/gtest/gtest.h"
-#include "third_party/webrtc/modules/desktop_capture/desktop_frame.h"
-#include "third_party/webrtc/modules/desktop_capture/desktop_geometry.h"
-#include "third_party/webrtc/modules/desktop_capture/desktop_region.h"
-
-namespace remoting {
-
-const int kScreenSize = 10;
-
-class FakeScreenCapturer : public webrtc::ScreenCapturer {
- public:
- FakeScreenCapturer() {}
- ~FakeScreenCapturer() {}
-
- virtual void Start(Callback* callback) OVERRIDE {
- callback_ = callback;
- }
-
- virtual void Capture(const webrtc::DesktopRegion& region) OVERRIDE {
- webrtc::DesktopFrame* frame = new webrtc::BasicDesktopFrame(
- webrtc::DesktopSize(kScreenSize, kScreenSize));
- memset(frame->data(), 0, frame->stride() * kScreenSize);
- callback_->OnCaptureCompleted(frame);
- }
-
- virtual void SetMouseShapeObserver(
- MouseShapeObserver* mouse_shape_observer) OVERRIDE {
- }
-
- private:
- Callback* callback_;
-};
-
-class FakeDesktopShapeTracker : public DesktopShapeTracker {
- public:
- FakeDesktopShapeTracker() {}
- ~FakeDesktopShapeTracker() {}
-
- static webrtc::DesktopRegion CreateShape() {
- webrtc::DesktopRegion result;
- result.AddRect(webrtc::DesktopRect::MakeXYWH(0, 0, 5, 5));
- result.AddRect(webrtc::DesktopRect::MakeXYWH(5, 5, 5, 5));
- return result;
- }
-
- virtual void RefreshDesktopShape() OVERRIDE {
- shape_ = CreateShape();
- }
-
- virtual const webrtc::DesktopRegion& desktop_shape() OVERRIDE {
- // desktop_shape() can't be called before RefreshDesktopShape().
- EXPECT_FALSE(shape_.is_empty());
- return shape_;
- }
-
- private:
- webrtc::DesktopRegion shape_;
-};
-
-class ShapedScreenCapturerTest : public testing::Test,
- public webrtc::DesktopCapturer::Callback {
- public:
- // webrtc::DesktopCapturer::Callback interface
- virtual webrtc::SharedMemory* CreateSharedMemory(size_t size) OVERRIDE {
- return NULL;
- }
-
- virtual void OnCaptureCompleted(webrtc::DesktopFrame* frame) OVERRIDE {
- last_frame_.reset(frame);
- }
-
- scoped_ptr<webrtc::DesktopFrame> last_frame_;
-};
-
-// Verify that captured frame have shape.
-TEST_F(ShapedScreenCapturerTest, Basic) {
- ShapedScreenCapturer capturer(
- scoped_ptr<webrtc::ScreenCapturer>(new FakeScreenCapturer()),
- scoped_ptr<DesktopShapeTracker>(new FakeDesktopShapeTracker()));
- capturer.Start(this);
- capturer.Capture(webrtc::DesktopRegion());
- ASSERT_TRUE(last_frame_.get());
- ASSERT_TRUE(last_frame_->shape());
- EXPECT_TRUE(
- FakeDesktopShapeTracker::CreateShape().Equals(*last_frame_->shape()));
-}
-
-} // namespace remoting
diff --git a/remoting/remoting.gyp b/remoting/remoting.gyp
index 5dac8ba..41cdf0d 100644
--- a/remoting/remoting.gyp
+++ b/remoting/remoting.gyp
@@ -434,8 +434,6 @@
'host/service_urls.h',
'host/session_manager_factory.cc',
'host/session_manager_factory.h',
- 'host/shaped_screen_capturer.cc',
- 'host/shaped_screen_capturer.h',
'host/signaling_connector.cc',
'host/signaling_connector.h',
'host/token_validator_factory_impl.cc',
@@ -2884,7 +2882,6 @@
'host/setup/me2me_native_messaging_host_unittest.cc',
'host/setup/oauth_helper_unittest.cc',
'host/setup/pin_validator_unittest.cc',
- 'host/shaped_screen_capturer_unittest.cc',
'host/token_validator_factory_impl_unittest.cc',
'host/video_scheduler_unittest.cc',
'host/win/rdp_client_unittest.cc',