瀏覽代碼

libobs-winrt: Remove interop code now provided by Windows SDK

Remove the custom declarations of the external functions
CreateDirect3D11DeviceFromDXGIDevice and
CreateDirect3D11SurfaceFromDXGISurface, as well as the
IDirect3DDxgiInterfaceAccess interface.
MrMahgu 1 年之前
父節點
當前提交
130be55973
共有 3 個文件被更改,包括 4 次插入15 次删除
  1. 1 0
      libobs-winrt/CMakeLists.txt
  2. 1 0
      libobs-winrt/cmake/legacy.cmake
  3. 2 15
      libobs-winrt/winrt-capture.cpp

+ 1 - 0
libobs-winrt/CMakeLists.txt

@@ -22,6 +22,7 @@ target_precompile_headers(
   <obs-module.h>
   <util/windows/ComPtr.hpp>
   <Windows.Graphics.Capture.Interop.h>
+  <windows.graphics.directx.direct3d11.interop.h>
   <winrt/Windows.Foundation.Metadata.h>
   <winrt/Windows.Graphics.Capture.h>
   <winrt/Windows.System.h>)

+ 1 - 0
libobs-winrt/cmake/legacy.cmake

@@ -14,6 +14,7 @@ target_precompile_headers(
   <DispatcherQueue.h>
   <dwmapi.h>
   <Windows.Graphics.Capture.Interop.h>
+  <windows.graphics.directx.direct3d11.interop.h>
   <winrt/Windows.Foundation.Metadata.h>
   <winrt/Windows.Graphics.Capture.h>
   <winrt/Windows.System.h>)

+ 2 - 15
libobs-winrt/winrt-capture.cpp

@@ -1,19 +1,5 @@
 #include "winrt-capture.h"
 
-extern "C" {
-HRESULT __stdcall CreateDirect3D11DeviceFromDXGIDevice(
-	::IDXGIDevice *dxgiDevice, ::IInspectable **graphicsDevice);
-
-HRESULT __stdcall CreateDirect3D11SurfaceFromDXGISurface(
-	::IDXGISurface *dgxiSurface, ::IInspectable **graphicsSurface);
-}
-
-struct __declspec(uuid("A9B3D012-3DF2-4EE3-B8D1-8695F457D3C1"))
-	IDirect3DDxgiInterfaceAccess : ::IUnknown {
-	virtual HRESULT __stdcall GetInterface(GUID const &id,
-					       void **object) = 0;
-};
-
 extern "C" EXPORT BOOL winrt_capture_supported()
 try {
 	/* no contract for IGraphicsCaptureItemInterop, verify 10.0.18362.0 */
@@ -50,7 +36,8 @@ template<typename T>
 static winrt::com_ptr<T> GetDXGIInterfaceFromObject(
 	winrt::Windows::Foundation::IInspectable const &object)
 {
-	auto access = object.as<IDirect3DDxgiInterfaceAccess>();
+	auto access = object.as<Windows::Graphics::DirectX::Direct3D11::
+					IDirect3DDxgiInterfaceAccess>();
 	winrt::com_ptr<T> result;
 	winrt::check_hresult(
 		access->GetInterface(winrt::guid_of<T>(), result.put_void()));