[vlc-devel] [PATCH 2/2] contrib:d3d11: build dxgi1_2.h and dxgi1_3.h
Steve Lhomme
robux4 at videolabs.io
Thu Mar 3 09:11:36 CET 2016
---
contrib/src/d3d11/SHA512SUMS | 1 +
contrib/src/d3d11/dxgi12.patch | 109 +++++++++++++++++++
contrib/src/d3d11/dxgi1_3.idl | 242 +++++++++++++++++++++++++++++++++++++++++
contrib/src/d3d11/rules.mak | 29 ++++-
4 files changed, 377 insertions(+), 4 deletions(-)
create mode 100644 contrib/src/d3d11/dxgi12.patch
create mode 100644 contrib/src/d3d11/dxgi1_3.idl
diff --git a/contrib/src/d3d11/SHA512SUMS b/contrib/src/d3d11/SHA512SUMS
index af11020..e9eca45 100644
--- a/contrib/src/d3d11/SHA512SUMS
+++ b/contrib/src/d3d11/SHA512SUMS
@@ -1,2 +1,3 @@
0d97a004acd9d99d685aef6ae3c41b9951b41170d197173838ad2dbad4db309debcc2dd6ab2cfaa849ab9ca9841ae80232739b113b3e72c35ec8a481066acff5 d3d11.idl
04b208ddf9c91f923d262ae68a5fb0588a3ef1a39ea450eaac9031e021bd5efdc7b30e3fb3e589b07bc88e41f8861caeb56934a2fa6cbf2efb7404f5f3453b70 dxgidebug.idl
+1bee79fcaf5db6e53510f49fb40009fe6291ffafe47e1aea46ae0068afd001b405b0d970a55af63e475fbb18108e1ca0f91d86a18b6598b922c454ed082e8941 dxgi1_2.idl
diff --git a/contrib/src/d3d11/dxgi12.patch b/contrib/src/d3d11/dxgi12.patch
new file mode 100644
index 0000000..5dde007
--- /dev/null
+++ b/contrib/src/d3d11/dxgi12.patch
@@ -0,0 +1,109 @@
+--- tarballs/dxgi1_2.idl.orig 2016-03-02 16:01:30.243405100 +0100
++++ tarballs/dxgi1_2.idl 2016-03-02 16:19:58.006959300 +0100
+@@ -232,3 +232,106 @@ interface IDXGIAdapter2 : IDXGIAdapter1
+ {
+ HRESULT GetDesc2([out] DXGI_ADAPTER_DESC2 *pDesc);
+ }
++
++typedef struct DXGI_OUTDUPL_DESC {
++ DXGI_MODE_DESC ModeDesc;
++ DXGI_MODE_ROTATION Rotation;
++ BOOL DesktopImageInSystemMemory;
++} DXGI_OUTDUPL_DESC;
++
++typedef struct DXGI_OUTDUPL_POINTER_POSITION {
++ POINT Position;
++ BOOL Visible;
++} DXGI_OUTDUPL_POINTER_POSITION;
++
++typedef struct DXGI_OUTDUPL_FRAME_INFO {
++ LARGE_INTEGER LastPresentTime;
++ LARGE_INTEGER LastMouseUpdateTime;
++ UINT AccumulatedFrames;
++ BOOL RectsCoalesced;
++ BOOL ProtectedContentMaskedOut;
++ DXGI_OUTDUPL_POINTER_POSITION PointerPosition;
++ UINT TotalMetadataBufferSize;
++ UINT PointerShapeBufferSize;
++} DXGI_OUTDUPL_FRAME_INFO;
++
++typedef struct DXGI_OUTDUPL_MOVE_RECT {
++ POINT SourcePoint;
++ RECT DestinationRect;
++} DXGI_OUTDUPL_MOVE_RECT;
++
++typedef struct DXGI_OUTDUPL_POINTER_SHAPE_INFO {
++ UINT Type;
++ UINT Width;
++ UINT Height;
++ UINT Pitch;
++ POINT HotSpot;
++} DXGI_OUTDUPL_POINTER_SHAPE_INFO;
++[
++ object,
++ uuid(191cfac3-a341-470d-b26e-a864f428319c),
++ local,
++ pointer_default(unique)
++]
++interface IDXGIOutputDuplication :
++ IDXGIObject
++{
++ void GetDesc(
++ [out] DXGI_OUTDUPL_DESC* pDesc);
++ HRESULT AcquireNextFrame(
++ [in] UINT TimeoutInMilliseconds,
++ [out] DXGI_OUTDUPL_FRAME_INFO* pFrameInfo,
++ [out] IDXGIResource** ppDesktopResource);
++ HRESULT GetFrameDirtyRects(
++ [in] UINT DirtyRectsBufferSize,
++ [out] RECT* pDirtyRectsBuffer,
++ [out] UINT* pDirtyRectsBufferSizeRequired);
++ HRESULT GetFrameMoveRects(
++ [in] UINT MoveRectsBufferSize,
++ [out] DXGI_OUTDUPL_MOVE_RECT* pMoveRectBuffer,
++ [out] UINT* pMoveRectsBufferSizeRequired);
++ HRESULT GetFramePointerShape(
++ [in] UINT PointerShapeBufferSize,
++ [out] void* pPointerShapeBuffer,
++ [out] UINT* pPointerShapeBufferSizeRequired,
++ [out] DXGI_OUTDUPL_POINTER_SHAPE_INFO* pPointerShapeInfo);
++ HRESULT MapDesktopSurface(
++ [out] DXGI_MAPPED_RECT* pLockedRect);
++ HRESULT UnMapDesktopSurface();
++ HRESULT ReleaseFrame();
++};
++
++typedef struct DXGI_MODE_DESC1
++{
++ UINT Width;
++ UINT Height;
++ DXGI_RATIONAL RefreshRate;
++ DXGI_FORMAT Format;
++ DXGI_MODE_SCANLINE_ORDER ScanlineOrdering;
++ DXGI_MODE_SCALING Scaling;
++ BOOL Stereo;
++} DXGI_MODE_DESC1;
++
++[
++ object,
++ uuid(00cddea8-939b-4b83-a340-a685226666cc),
++ local,
++ pointer_default(unique)
++]
++interface IDXGIOutput1 : IDXGIOutput
++{
++ HRESULT GetDisplayModeList1(
++ [in] DXGI_FORMAT EnumFormat,
++ [in] UINT Flags,
++ [in, out] UINT * pNumModes,
++ [out] DXGI_MODE_DESC1 *pDesc);
++ HRESULT FindClosestMatchingMode1(
++ [in] const DXGI_MODE_DESC1 *pModeToMatch,
++ [out] DXGI_MODE_DESC1 *pClosestMatch,
++ [in] IUnknown * pConcernedDevice);
++ HRESULT GetDisplaySurfaceData1(
++ [in] IDXGIResource *pDestination);
++ HRESULT DuplicateOutput(
++ [in] IUnknown *pDevice,
++ [out] IDXGIOutputDuplication **ppOutputDuplication);
++};
diff --git a/contrib/src/d3d11/dxgi1_3.idl b/contrib/src/d3d11/dxgi1_3.idl
new file mode 100644
index 0000000..da4b5fb
--- /dev/null
+++ b/contrib/src/d3d11/dxgi1_3.idl
@@ -0,0 +1,242 @@
+/*
+ * Copyright 2015 Martell Malone
+ *
+ * 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_2.idl";
+
+cpp_quote("#define DXGI_CREATE_FACTORY_DEBUG 0x1")
+
+typedef struct DXGI_DECODE_SWAP_CHAIN_DESC
+{
+ UINT Flags;
+} DXGI_DECODE_SWAP_CHAIN_DESC;
+
+typedef enum DXGI_MULTIPLANE_OVERLAY_YCbCr_FLAGS
+{
+ DXGI_MULTIPLANE_OVERLAY_YCbCr_FLAG_NOMINAL_RANGE = 0x1,
+ DXGI_MULTIPLANE_OVERLAY_YCbCr_FLAG_BT709 = 0x2,
+ DXGI_MULTIPLANE_OVERLAY_YCbCr_FLAG_xvYCC = 0x4,
+} DXGI_MULTIPLANE_OVERLAY_YCbCr_FLAGS;
+
+[
+ object,
+ local,
+ uuid(2633066b-4514-4c7a-8fd8-12ea98059d18)
+]
+interface IDXGIDecodeSwapChain : IUnknown
+{
+ HRESULT PresentBuffer(
+ UINT buffer,
+ UINT sync,
+ UINT flags
+ );
+
+ HRESULT SetSourceRect(
+ const RECT* rect
+ );
+
+ HRESULT SetTargetRect(
+ const RECT* rect
+ );
+
+ HRESULT SetDestSize(
+ UINT width,
+ UINT height
+ );
+
+ HRESULT GetSourceRect(
+ [out] RECT* rect
+ );
+
+ HRESULT GetTargetRect(
+ [out] RECT* rect
+ );
+
+ HRESULT GetDestSize(
+ [out] UINT* width,
+ [out] UINT* height
+ );
+
+ HRESULT SetColorSpace(
+ DXGI_MULTIPLANE_OVERLAY_YCbCr_FLAGS colorSpace
+ );
+
+ DXGI_MULTIPLANE_OVERLAY_YCbCr_FLAGS GetColorSpace();
+}
+
+[
+ object,
+ local,
+ uuid(41e7d1f2-a591-4f7b-a2e5-fa9c843e1c12)
+]
+interface IDXGIFactoryMedia :IUnknown
+{
+ HRESULT CreateSwapChainForCompositionSurfaceHandle(
+ [in] IUnknown* device,
+ [in] HANDLE surface,
+ [in] const DXGI_SWAP_CHAIN_DESC1* desc,
+ [in] IDXGIOutput* output,
+ [out] IDXGISwapChain1** swapchain
+ );
+
+ HRESULT CreateDecodeSwapChainForCompositionSurfaceHandle(
+ [in] IUnknown* device,
+ [in] HANDLE surface,
+ [in] DXGI_DECODE_SWAP_CHAIN_DESC* desc,
+ [in] IDXGIResource* buffer,
+ [in] IDXGIOutput* output,
+ [out] IDXGIDecodeSwapChain** swapchain
+ );
+}
+
+typedef enum DXGI_FRAME_PRESENTATION_MODE
+{
+ DXGI_FRAME_PRESENTATION_MODE_COMPOSED = 0,
+ DXGI_FRAME_PRESENTATION_MODE_OVERLAY = 1,
+ DXGI_FRAME_PRESENTATION_MODE_NONE = 2,
+} DXGI_FRAME_PRESENTATION_MODE;
+
+typedef struct DXGI_FRAME_STATISTICS_MEDIA
+{
+ UINT PresentCount;
+ UINT PresentRefreshCount;
+ UINT SyncRefreshCount;
+ LARGE_INTEGER SyncQPCTime;
+ LARGE_INTEGER SyncGPUTime;
+ DXGI_FRAME_PRESENTATION_MODE CompositionMode;
+ UINT ApprovedPresentDuration;
+} DXGI_FRAME_STATISTICS_MEDIA;
+
+[
+ object,
+ local,
+ uuid(dd95b90b-f05f-4f6a-bd65-25bfb264bd84)
+]
+interface IDXGISwapChainMedia : IUnknown
+{
+ HRESULT GetFrameStatisticsMedia(
+ [out] DXGI_FRAME_STATISTICS_MEDIA* pStats
+ );
+
+ HRESULT SetPresentDuration(
+ UINT duration
+ );
+
+ HRESULT CheckPresentDurationSupport(
+ UINT duration,
+ [out] UINT* smallerduration,
+ [out] UINT* largerduration
+ );
+};
+
+typedef enum DXGI_OVERLAY_SUPPORT_FLAG
+{
+ DXGI_OVERLAY_SUPPORT_FLAG_DIRECT = 0x1,
+ DXGI_OVERLAY_SUPPORT_FLAG_SCALING = 0x2
+} DXGI_OVERLAY_SUPPORT_FLAG;
+
+[
+ object,
+ local,
+ uuid(6007896c-3244-4afd-bf18-a6d3beda5023)
+]
+interface IDXGIDevice3 : IDXGIDevice2
+{
+ void Trim();
+}
+
+[
+ object,
+ local,
+ uuid(595e39d1-2724-4663-99b1-da969de28364)
+]
+interface IDXGIOutput2 : IDXGIOutput1
+{
+ BOOL SupportsOverlays();
+}
+
+[
+ object,
+ local,
+ uuid(8a6bb301-7e7e-41F4-a8e0-5b32f7f99b18)
+]
+interface IDXGIOutput3 : IDXGIOutput2
+{
+ HRESULT CheckOverlaySupport(
+ [in] DXGI_FORMAT format,
+ [out, in] IUnknown* device,
+ [out] UINT* flags
+ );
+}
+
+[local] HRESULT __stdcall CreateDXGIFactory2(UINT Flags, REFIID riid, void **factory);
+
+typedef struct DXGI_MATRIX_3X2_F
+{
+ float _11;
+ float _12;
+ float _21;
+ float _22;
+ float _31;
+ float _32;
+} DXGI_MATRIX_3X2_F;
+
+[
+ object,
+ local,
+ uuid(a8be2ac4-199f-4946-b331-79599fb98de7)
+]
+interface IDXGISwapChain2 : IDXGISwapChain1
+{
+ HRESULT SetSourceSize(
+ UINT width,
+ UINT height
+ );
+
+ HRESULT GetSourceSize(
+ [out] UINT* width,
+ [out] UINT* height
+ );
+
+ HRESULT SetMaximumFrameLatency(
+ UINT max_latency
+ );
+
+ HRESULT GetMaximumFrameLatency(
+ [out] UINT* max_latency
+ );
+
+ HANDLE GetFrameLatencyWaitableObject();
+
+ HRESULT SetMatrixTransform(
+ const DXGI_MATRIX_3X2_F* matrix
+ );
+
+ HRESULT GetMatrixTransform(
+ [out] DXGI_MATRIX_3X2_F* matrix
+ );
+}
+
+[
+ object,
+ local,
+ uuid(25483823-cd46-4c7d-86ca-47aa95b837bd)
+]
+interface IDXGIFactory3 : IDXGIFactory2
+{
+ UINT GetCreationFlags();
+}
diff --git a/contrib/src/d3d11/rules.mak b/contrib/src/d3d11/rules.mak
index 1cc1a46..66a296b 100644
--- a/contrib/src/d3d11/rules.mak
+++ b/contrib/src/d3d11/rules.mak
@@ -7,14 +7,18 @@ else
IDL_INC_PATH = /`echo $(MSYSTEM) | tr A-Z a-z`/$(BUILD)/include
endif
-COMMIT_ID := a0cd5afeb60be3be0860e9a203314c10485bb9b8
-D3D11_IDL_URL := http://sourceforge.net/p/mingw-w64/mingw-w64/ci/$(COMMIT_ID)/tree/mingw-w64-headers/direct-x/include/d3d11.idl?format=raw
+D3D11_COMMIT_ID := a0cd5afeb60be3be0860e9a203314c10485bb9b8
+DXGI12_COMMIT_ID := 790a6544347b53c314b9c6f1ea757a2d5504c67e
+D3D11_IDL_URL := http://sourceforge.net/p/mingw-w64/mingw-w64/ci/$(D3D11_COMMIT_ID)/tree/mingw-w64-headers/direct-x/include/d3d11.idl?format=raw
+DXGI12_IDL_URL := http://sourceforge.net/p/mingw-w64/mingw-w64/ci/$(DXGI12_COMMIT_ID)/tree/mingw-w64-headers/direct-x/include/dxgi1_2.idl?format=raw
DST_D3D11_H = $(PREFIX)/include/d3d11.h
DST_DXGIDEBUG_H = $(PREFIX)/include/dxgidebug.h
+DST_DXGI12_H = $(PREFIX)/include/dxgi1_2.h
+DST_DXGI13_H = $(PREFIX)/include/dxgi1_3.h
ifdef HAVE_WIN32
-PKGS += d3d11
+PKGS += d3d11 dxgi13
endif
$(TARBALLS)/d3d11.idl:
@@ -23,7 +27,13 @@ $(TARBALLS)/d3d11.idl:
$(TARBALLS)/dxgidebug.idl:
(cd $(TARBALLS) && patch -fp1) < $(SRC)/d3d11/dxgidebug.patch
-.sum-d3d11: $(TARBALLS)/d3d11.idl $(TARBALLS)/dxgidebug.idl
+$(TARBALLS)/dxgi1_2.idl:
+ $(call download,$(DXGI12_IDL_URL))
+
+.sum-d3d11: $(TARBALLS)/d3d11.idl $(TARBALLS)/dxgidebug.idl $(TARBALLS)/dxgi1_2.idl
+
+.sum-dxgi12: $(TARBALLS)/dxgi1_2.idl
+ (cd $(TARBALLS) && patch -fp1) < $(SRC)/d3d11/dxgi12.patch
$(DST_D3D11_H): $(TARBALLS)/d3d11.idl .sum-d3d11
(cd $(TARBALLS) && patch -fp1) < $(SRC)/d3d11/processor_format.patch
@@ -34,5 +44,16 @@ $(DST_DXGIDEBUG_H): $(TARBALLS)/dxgidebug.idl
mkdir -p -- "$(PREFIX)/include/"
$(WIDL) -DBOOL=WINBOOL -I$(IDL_INC_PATH) -h -o $@ $<
+$(DST_DXGI12_H): $(TARBALLS)/dxgi1_2.idl .sum-dxgi12
+ mkdir -p -- "$(PREFIX)/include/"
+ $(WIDL) -DBOOL=WINBOOL -I$(IDL_INC_PATH) -h -o $@ $<
+
+$(DST_DXGI13_H): $(SRC)/d3d11/dxgi1_3.idl $(DST_DXGI12_H)
+ mkdir -p -- "$(PREFIX)/include/"
+ $(WIDL) -DBOOL=WINBOOL -I$(TARBALLS) -I$(IDL_INC_PATH) -h -o $@ $<
+
+.dxgi13: $(DST_DXGI13_H)
+ touch $@
+
.d3d11: $(DST_D3D11_H) $(DST_DXGIDEBUG_H)
touch $@
--
2.7.2.windows.1
More information about the vlc-devel
mailing list