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

Unified Diff: webrtc/modules/desktop_capture/win/dxgi_texture.cc

Issue 2099123002: [Chromoting] Improve DirectX capturer to support multiple outputs (Closed) Base URL: https://chromium.googlesource.com/external/webrtc.git@master
Patch Set: Fix several lint errors Created 4 years, 4 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: webrtc/modules/desktop_capture/win/dxgi_texture.cc
diff --git a/webrtc/modules/desktop_capture/win/dxgi_texture.cc b/webrtc/modules/desktop_capture/win/dxgi_texture.cc
new file mode 100644
index 0000000000000000000000000000000000000000..96c98363a0264a36e26ae4da2d3bd49980a12be2
--- /dev/null
+++ b/webrtc/modules/desktop_capture/win/dxgi_texture.cc
@@ -0,0 +1,47 @@
+/*
+ * Copyright (c) 2016 The WebRTC project authors. All Rights Reserved.
+ *
+ * Use of this source code is governed by a BSD-style license
+ * that can be found in the LICENSE file in the root of the source
+ * tree. An additional intellectual property rights grant can be found
+ * in the file PATENTS. All contributing project authors may
+ * be found in the AUTHORS file in the root of the source tree.
+ */
+
+#include "webrtc/modules/desktop_capture/win/dxgi_texture.h"
+
+#include "webrtc/modules/desktop_capture/desktop_region.h"
+
+namespace webrtc {
+
+namespace {
+
+class DxgiDesktopFrame : public DesktopFrame {
+ public:
+ explicit DxgiDesktopFrame(const DxgiTexture& texture)
+ : DesktopFrame(texture.desktop_rect().size(),
+ texture.pitch(),
+ texture.bits(),
+ nullptr) {}
+
+ virtual ~DxgiDesktopFrame() = default;
+};
+
+} // namespace
+
+DxgiTexture::DxgiTexture(const DesktopRect& desktop_rect)
+ : desktop_rect_(desktop_rect) {}
+
+const DesktopFrame& DxgiTexture::AsDesktopFrame() {
+ if (!frame_) {
+ frame_.reset(new DxgiDesktopFrame(*this));
+ }
+ return *frame_;
+}
+
+bool DxgiTexture::Release() {
+ frame_.reset();
+ return DoRelease();
+}
+
+} // namespace webrtc
« no previous file with comments | « webrtc/modules/desktop_capture/win/dxgi_texture.h ('k') | webrtc/modules/desktop_capture/win/dxgi_texture_mapping.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698