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.
This commit is contained in:
MrMahgu 2024-04-19 16:01:06 -04:00 committed by Ryan Foster
parent 5f1d60b1a0
commit 130be55973
3 changed files with 4 additions and 15 deletions

View file

@ -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>)

View file

@ -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>)

View file

@ -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()));