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

Unified Diff: webrtc/modules/desktop_capture/win/dxgi_context.h

Issue 2099123002: [Chromoting] Improve DirectX capturer to support multiple outputs (Closed) Base URL: https://chromium.googlesource.com/external/webrtc.git@master
Patch Set: Use a self-incremented integer to identify a DxgiDuplicatorContaienr::Initialize Created 4 years, 5 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_context.h
diff --git a/webrtc/modules/desktop_capture/win/dxgi_context.h b/webrtc/modules/desktop_capture/win/dxgi_context.h
new file mode 100644
index 0000000000000000000000000000000000000000..d21cb3cb94d23717224507bc60dda03f8b9ad0c4
--- /dev/null
+++ b/webrtc/modules/desktop_capture/win/dxgi_context.h
@@ -0,0 +1,52 @@
+/*
+ * 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.
+ */
+
+#ifndef MODULES_DESKTOP_CAPTURE_WIN_DXGI_CONTEXT_H_
+#define MODULES_DESKTOP_CAPTURE_WIN_DXGI_CONTEXT_H_
+
+#include <vector>
+
+#include "webrtc/modules/desktop_capture/desktop_region.h"
+
+namespace webrtc {
+
+// A context to store the status of a single consumer of
+// DxgiDuplicatorContainer. Consumers should create an instance of DxgiContext
+// and keep it through their lifetime, and send it as parameter to
+// DxgiDuplicatorContainer public functions. For details, please refer to
+// comments of DxgiDuplicatorContainer.
+class DxgiContext {
+ public:
+ // Unregister this DxgiContext instance from all Dxgi duplicators during
+ // destructing.
+ ~DxgiContext();
+
+ private:
+ friend class DxgiOutputDuplicator;
+ friend class DxgiAdapterDuplicator;
+ friend class DxgiDuplicatorContainer;
Sergey Ulanov 2016/07/28 22:15:32 I still don't think think hiding content of this c
Hzj_jie 2016/07/29 02:12:23 Not really, indeed a consumer need to create a con
Sergey Ulanov 2016/07/30 00:49:22 In either case this usage of friend goes against s
Hzj_jie 2016/07/31 22:04:42 What I can image is a screenshot function. But no
+
+ // A DxgiContext will have an exactly same |identity_| as
+ // DxgiDuplicatorContainer, to ensure it has been correctly setted up after
+ // each DxgiDuplicatorContainer::Initialize().
+ int identity_ = 0;
+
+ // Child DxgiContext belongs to this DxgiContext.
+ std::vector<DxgiContext> contexts_;
Sergey Ulanov 2016/07/28 22:15:32 I still think it's wrong (it's confusing and error
Hzj_jie 2016/07/29 02:12:23 I have no strong opinion on this. But I still pref
+
+ // The updated region DxgiOutputDuplicator::DetectUpdatedRegion() output
+ // during last Duplicate() function call. It's a DesktopRegion translated by
+ // offset of each DxgiOutputDuplicator instance.
+ DesktopRegion updated_region_;
+};
+
+} // namespace webrtc
+
+#endif // MODULES_DESKTOP_CAPTURE_WIN_DXGI_CONTEXT_H_

Powered by Google App Engine
This is Rietveld 408576698