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

Unified Diff: content/browser/media/capture/virtual_display_capturer.h

Issue 615133002: Add support for a virtual display on ChromeOS (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Remove ash/ dep from content Created 5 years, 9 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
« no previous file with comments | « content/browser/media/capture/DEPS ('k') | content/browser/media/capture/virtual_display_capturer.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/browser/media/capture/virtual_display_capturer.h
diff --git a/content/browser/media/capture/virtual_display_capturer.h b/content/browser/media/capture/virtual_display_capturer.h
new file mode 100644
index 0000000000000000000000000000000000000000..a93a2487c47f2da15fe0b6efe7f629e4f8c1c426
--- /dev/null
+++ b/content/browser/media/capture/virtual_display_capturer.h
@@ -0,0 +1,63 @@
+// Copyright 2015 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 CONTENT_BROWSER_MEDIA_CAPTURE_VIRTUAL_DISPLAY_CAPTURER_H_
+#define CONTENT_BROWSER_MEDIA_CAPTURE_VIRTUAL_DISPLAY_CAPTURER_H_
+
+#include <string>
+
+#include "base/memory/scoped_ptr.h"
+#include "content/browser/media/capture/aura_window_capture_machine.h"
+#include "content/common/content_export.h"
+#include "content/public/browser/desktop_media_id.h"
+#include "media/video/capture/video_capture_device.h"
+#include "ui/gfx/display_observer.h"
+
+namespace aura {
+class Window;
+} // namespace aura
+
+namespace content {
+
+class ContentVideoCaptureDeviceCore;
+
+class CONTENT_EXPORT VirtualDisplayCapturer : public media::VideoCaptureDevice,
+ public gfx::DisplayObserver {
+ public:
+ // Creates a VideoCaptureDevice for a virtual desktop.
+ static media::VideoCaptureDevice* Create(
+ scoped_refptr<base::SingleThreadTaskRunner> task_runner,
+ const DesktopMediaID& source);
+
+ ~VirtualDisplayCapturer() override;
+
+ // VideoCaptureDevice implementation.
+ void AllocateAndStart(const media::VideoCaptureParams& params,
+ scoped_ptr<Client> client) override;
+ void StopAndDeAllocate() override;
+
+ // gfx::DisplayObserver overrides:
+ void OnDisplayAdded(const gfx::Display& display) override;
+ void OnDisplayRemoved(const gfx::Display& display) override {}
+ void OnDisplayMetricsChanged(const gfx::Display& display,
+ uint32_t metrics) override {}
+
+ private:
+ VirtualDisplayCapturer(
+ scoped_refptr<base::SingleThreadTaskRunner> task_runner,
+ const DesktopMediaID& source);
+
+ DesktopMediaID source_;
+ AuraWindowCaptureMachine* machine_;
+ scoped_ptr<class ContentVideoCaptureDeviceCore> core_;
+ media::VideoCaptureParams params_;
+ scoped_ptr<Client> client_;
+ scoped_refptr<base::SingleThreadTaskRunner> device_task_runner_;
+
+ DISALLOW_COPY_AND_ASSIGN(VirtualDisplayCapturer);
+};
+
+} // namespace content
+
+#endif // CONTENT_BROWSER_MEDIA_CAPTURE_VIRTUAL_DISPLAY_CAPTURER_H_
« no previous file with comments | « content/browser/media/capture/DEPS ('k') | content/browser/media/capture/virtual_display_capturer.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698