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

Side by Side Diff: webrtc/modules/desktop_capture/win/d3d_device.h

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 unified diff | Download patch
OLDNEW
(Empty)
1 /*
2 * Copyright (c) 2016 The WebRTC project authors. All Rights Reserved.
3 *
4 * Use of this source code is governed by a BSD-style license
5 * that can be found in the LICENSE file in the root of the source
6 * tree. An additional intellectual property rights grant can be found
7 * in the file PATENTS. All contributing project authors may
8 * be found in the AUTHORS file in the root of the source tree.
9 */
10
11 #ifndef WEBRTC_MODULES_DESKTOP_CAPTURE_WIN_D3D_DEVICE_H_
12 #define WEBRTC_MODULES_DESKTOP_CAPTURE_WIN_D3D_DEVICE_H_
13
14 #include <comdef.h>
15 #include <wrl/client.h>
16 #include <D3D11.h>
17 #include <DXGI.h>
18
19 #include <vector>
20
21 namespace webrtc {
22
23 // A wrapper of ID3D11Device and its corresponding context and IDXGIAdapter.
24 // This class represents one video card in the system.
25 class D3dDevice {
26 public:
27 ~D3dDevice();
28
29 ID3D11Device* d3d_device() const { return d3d_device_.Get(); }
30
31 ID3D11DeviceContext* context() const { return context_.Get(); }
32
33 IDXGIDevice* dxgi_device() const { return dxgi_device_.Get(); }
34
35 IDXGIAdapter* dxgi_adapter() const { return dxgi_adapter_.Get(); }
36
37 // Returns all D3dDevice instances on the system. Returns an empty vector if
38 // anything wrong.
39 static std::vector<D3dDevice> EnumDevices();
40
41 private:
42 // Instances of D3dDevice should only be created by EnumDevices() static
43 // function.
44 D3dDevice();
45
46 // Initialize the D3dDevice from an IDXGIAdapter.
47 bool Initialize(const Microsoft::WRL::ComPtr<IDXGIAdapter>& adapter);
48
49 Microsoft::WRL::ComPtr<ID3D11Device> d3d_device_;
50 Microsoft::WRL::ComPtr<ID3D11DeviceContext> context_;
51 Microsoft::WRL::ComPtr<IDXGIDevice> dxgi_device_;
52 Microsoft::WRL::ComPtr<IDXGIAdapter> dxgi_adapter_;
53 };
54
55 } // namespace webrtc
56
57 #endif // WEBRTC_MODULES_DESKTOP_CAPTURE_WIN_D3D_DEVICE_H_
OLDNEW
« no previous file with comments | « webrtc/modules/desktop_capture/screen_capturer_win.cc ('k') | webrtc/modules/desktop_capture/win/d3d_device.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698