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

Unified Diff: remoting/host/chromeos/aura_desktop_capturer.h

Issue 543243003: Remote Assistance on Chrome OS Part I - Aura Desktop Capturer (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 years, 3 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 side-by-side diff with in-line comments
Download patch
Index: remoting/host/chromeos/aura_desktop_capturer.h
diff --git a/remoting/host/chromeos/aura_desktop_capturer.h b/remoting/host/chromeos/aura_desktop_capturer.h
new file mode 100644
index 0000000000000000000000000000000000000000..7658e1c3271b6fbe9fa3707af10c4cd8f3ce53c7
--- /dev/null
+++ b/remoting/host/chromeos/aura_desktop_capturer.h
@@ -0,0 +1,56 @@
+// Copyright 2014 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_CHROMEOS_AURA_DESKTOP_CAPTURER_H_
+#define REMOTING_HOST_CHROMEOS_AURA_DESKTOP_CAPTURER_H_
+
+#include "third_party/webrtc/modules/desktop_capture/screen_capturer.h"
+#include "ui/aura/window.h"
+
+namespace cc {
+class CopyOutputResult;
+} // namespace
+
+namespace remoting {
+
+// A webrtc desktop capturer that captures pixels from the root window of the
Sergey Ulanov 2014/09/06 02:03:25 s/webrtc desktop capturer/webrtc::DesktopCapturer/
kelvinp 2014/09/09 21:19:46 Done.
+// Aura Shell.
+class AuraDesktopCapturer : public webrtc::DesktopCapturer {
+ public:
+ AuraDesktopCapturer();
+ virtual ~AuraDesktopCapturer();
+
+ // Called at the beginning of a capturing session. |callback| must remain
Sergey Ulanov 2014/09/06 02:03:25 This duplicates comments from the interface defini
kelvinp 2014/09/09 21:19:46 Done.
+ // valid until capturer is destroyed. Must be called on the browser UI
Sergey Ulanov 2014/09/06 02:03:25 This doesn't look right. normally we use DesktopCa
kelvinp 2014/09/09 21:19:46 Yes, the capturer thread will be mapped to the UI
+ // thread.
+ virtual void Start(webrtc::DesktopCapturer::Callback* callback) OVERRIDE;
+
+ // Captures the next frame. In Aura, this is implemented by requesting the
+ // layer and its substree to be rendered to a given data structure. |region|
+ // specifies region of the capture target that should be fresh in the
+ // resulting frame. Since Aura doesn't support partial capturing, the entire
+ // region of the captured frame will always be fresh. Pending capture
+ // operations are cancelled when DesktopCapturer is deleted.
+ virtual void Capture(const webrtc::DesktopRegion& region) OVERRIDE;
+
+ // Sets the window to be excluded from the captured image in the future
+ // Capture calls. Not supported in Aura.
+ virtual void SetExcludedWindow(webrtc::WindowId window) OVERRIDE {}
+
+ private:
+ // Called when a copy of the layer is captured.
+ void OnFrameCaptured(scoped_ptr<cc::CopyOutputResult> result);
+
+ // Points to the callback passed to webrtc::DesktopCapturer::Start().
+ webrtc::DesktopCapturer::Callback* callback_;
+
+ // The root window of the Aura Shell.
+ aura::Window* desktop_window_;
+
+ base::WeakPtrFactory<AuraDesktopCapturer> weak_factory_;
+};
+
+} // namespace remoting
+
+#endif // REMOTING_HOST_CHROMEOS_AURA_DESKTOP_CAPTURER_H_

Powered by Google App Engine
This is Rietveld 408576698