[vlc-devel] [PATCH 2/3] contrib: d3d11: add dxgi 1.6 to read IDXGIOutput6

Steve Lhomme robux4 at videolabs.io
Thu Sep 14 15:04:17 CEST 2017


---
 contrib/src/d3d11/dxgi1_6.idl | 72 +++++++++++++++++++++++++++++++++++++++++++
 contrib/src/d3d11/rules.mak   | 10 +++++-
 2 files changed, 81 insertions(+), 1 deletion(-)
 create mode 100644 contrib/src/d3d11/dxgi1_6.idl

diff --git a/contrib/src/d3d11/dxgi1_6.idl b/contrib/src/d3d11/dxgi1_6.idl
new file mode 100644
index 0000000000..5db720305e
--- /dev/null
+++ b/contrib/src/d3d11/dxgi1_6.idl
@@ -0,0 +1,72 @@
+/*
+ * Copyright 2017 Steve Lhomme
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
+ */
+
+import "dxgi1_4.idl";
+
+cpp_quote("/* HACK as widl segfaults with too many imports */")
+cpp_quote("#include <dxgi1_5.h>")
+cpp_quote("#ifndef __dxgi1_5_h__")
+
+[
+    object,
+    local,
+    uuid(80A07424-AB52-42EB-833C-0C42FD282D98)
+]
+interface IDXGIOutput5 : IDXGIOutput4
+{
+    HRESULT DuplicateOutput1(
+        [in]        IUnknown               *pDevice,
+                    UINT                   Flags,
+        [in]        UINT                   SupportedFormatsCount,
+        [in]  const DXGI_FORMAT            *pSupportedFormats,
+        [out]       IDXGIOutputDuplication **ppOutputDuplication
+    );
+}
+
+cpp_quote("#endif /* __dxgi1_5_h__ */")
+
+typedef struct DXGI_OUTPUT_DESC1
+{
+    WCHAR                 DeviceName[32];
+    RECT                  DesktopCoordinates;
+    BOOL                  AttachedToDesktop;
+    DXGI_MODE_ROTATION    Rotation;
+    HMONITOR              Monitor;
+    UINT                  BitsPerColor;
+    DXGI_COLOR_SPACE_TYPE ColorSpace;
+    FLOAT                 RedPrimary[2];
+    FLOAT                 GreenPrimary[2];
+    FLOAT                 BluePrimary[2];
+    FLOAT                 WhitePoint[2];
+    FLOAT                 MinLuminance;
+    FLOAT                 MaxLuminance;
+    FLOAT                 MaxFullFrameLuminance;
+    BOOL                  InternalOutput;
+} DXGI_OUTPUT_DESC1;
+
+[
+    object,
+    local,
+    uuid(068346e8-aaec-4b84-add7-137f513f77a1)
+]
+interface IDXGIOutput6 : IDXGIOutput5
+{
+    HRESULT GetDesc1(
+        [out] DXGI_OUTPUT_DESC1 *pDesc
+    );
+}
diff --git a/contrib/src/d3d11/rules.mak b/contrib/src/d3d11/rules.mak
index fffc59fb95..a91ede4f35 100644
--- a/contrib/src/d3d11/rules.mak
+++ b/contrib/src/d3d11/rules.mak
@@ -20,6 +20,7 @@ DST_DXGI12_H = $(PREFIX)/include/dxgi1_2.h
 DST_DXGI13_H = $(PREFIX)/include/dxgi1_3.h
 DST_DXGI14_H = $(PREFIX)/include/dxgi1_4.h
 DST_DXGI15_H = $(PREFIX)/include/dxgi1_5.h
+DST_DXGI16_H = $(PREFIX)/include/dxgi1_6.h
 
 
 ifdef HAVE_WIN32
@@ -76,6 +77,10 @@ $(DST_DXGI15_H): $(SRC)/d3d11/dxgi1_5.idl $(DST_DXGI14_H)
 	mkdir -p -- "$(PREFIX)/include/"
 	$(WIDL) -DBOOL=WINBOOL -Idxgi12 -I$(IDL_INC_PATH) -h -o $@ $<
 
+$(DST_DXGI16_H): $(SRC)/d3d11/dxgi1_6.idl $(DST_DXGI15_H)
+	mkdir -p -- "$(PREFIX)/include/"
+	$(WIDL) -DBOOL=WINBOOL -Idxgi12 -I$(IDL_INC_PATH) -h -o $@ $<
+
 .dxgitype: $(DST_DXGITYPE_H)
 	touch $@
 
@@ -91,5 +96,8 @@ $(DST_DXGI15_H): $(SRC)/d3d11/dxgi1_5.idl $(DST_DXGI14_H)
 .dxgi15: .dxgi14 $(DST_DXGI15_H)
 	touch $@
 
-.d3d11: $(DST_D3D11_H) $(DST_DXGIDEBUG_H) .dxgi15
+.dxgi16: .dxgi15 $(DST_DXGI16_H)
+	touch $@
+
+.d3d11: $(DST_D3D11_H) $(DST_DXGIDEBUG_H) .dxgi16
 	touch $@
-- 
2.12.1



More information about the vlc-devel mailing list