Per some friendly people in #winehackers on irc.libera.chat/6697 it's fine if we don't implement the not-implemented stubs since this is patch is for cross-compiling Windows software, not running Windows software that needs this functionality.
Edited
Designs
Child items 0
Show closed items
No child items are currently assigned. Use child items to break down this issue into smaller parts.
Linked items 0
Link issues together to show that they're related.
Learn more.
morganchanged title from Implement missing Windows headers requried for building WebRTC with mingw to Implement missing Windows headers required for building cross-compiling WebRTC with mingw
changed title from Implement missing Windows headers requried for building WebRTC with mingw to Implement missing Windows headers required for building cross-compiling WebRTC with mingw
The final error I had from my initial attempt was windows.graphics.directX.direct3d11.interop.h, which is still missing.
I had already had this problem last year, and I solved it by patching third_party/libwebrtc/rtc_base/win/create_direct3d_device.h. I remember writing this:
#ifndef __MINGW32__# include <windows.graphics.directX.direct3d11.interop.h>#else# include <dxgi.h># include <inspectable.h>extern"C"{// This function is only used in decltype(..)HRESULT__stdcallCreateDirect3D11DeviceFromDXGIDevice(::IDXGIDevice*dxgiDevice,::IInspectable**graphicsDevice);}#endif
However, we now have that problem also in third_party/libwebrtc/modules/desktop_capture/win/wgc_capture_session.cc, because it wants Windows::Graphics::DirectX::Direct3D11::IDirect3DDxgiInterfaceAccess (and it calls only to its GetInterface method).
MSDN has the code of this struct, but it seems it can't be legally used for proving wine the .idl file?
Now I'm curious to see if copying and pasting that struct is enough to fix WebRTC .
Speaking of GUIDs, I also had to comment out IID_IGraphicsCaptureSession2.
I tried to resolve some build errors because I wanted to check the default browser agent, but eventually I stopped at this link problem (and I couldn't get to the default browser agent).
I used these diffs to get there (we'll likely need some of them, but some others just comment stuff to make the build continue).
My diff (mullvad-browser.git)
diff --git a/third_party/libwebrtc/modules/desktop_capture/win/wgc_capture_session.cc b/third_party/libwebrtc/modules/desktop_capture/win/wgc_capture_session.ccindex 86afc5241196..3030c8d12f03 100644--- a/third_party/libwebrtc/modules/desktop_capture/win/wgc_capture_session.cc+++ b/third_party/libwebrtc/modules/desktop_capture/win/wgc_capture_session.cc@@ -10,12 +10,12 @@ #include "modules/desktop_capture/win/wgc_capture_session.h"-#include <DispatcherQueue.h>+#include <dispatcherqueue.h> #include <windows.graphics.capture.interop.h>-#include <windows.graphics.directX.direct3d11.interop.h>+// #include <windows.graphics.directX.direct3d11.interop.h> #include <windows.graphics.h> #include <wrl/client.h>-#include <wrl/event.h>+// #include <wrl/event.h> #include <algorithm> #include <memory>@@ -34,6 +34,15 @@ using Microsoft::WRL::ComPtr; namespace WGC = ABI::Windows::Graphics::Capture;+namespace Windows { namespace Graphics { namespace DirectX { namespace Direct3D11 {+struct IDirect3DDxgiInterfaceAccess : IUnknown {+ HRESULT GetInterface(+ REFIID iid,+ void **p+ );+};+}}}}+ namespace webrtc { namespace {@@ -126,7 +135,7 @@ HRESULT WgcCaptureSession::StartCapture(const DesktopCaptureOptions& options) { // Listen for the Closed event, to detect if the source we are capturing is // closed (e.g. application window is closed or monitor is disconnected). If // it is, we should abort the capture.- item_closed_token_ = std::make_unique<EventRegistrationToken>();+ /*item_closed_token_ = std::make_unique<EventRegistrationToken>(); auto closed_handler = Microsoft::WRL::Callback<ABI::Windows::Foundation::ITypedEventHandler< WGC::GraphicsCaptureItem*, IInspectable*>>(@@ -136,7 +145,8 @@ HRESULT WgcCaptureSession::StartCapture(const DesktopCaptureOptions& options) { if (FAILED(hr)) { RecordStartCaptureResult(StartCaptureResult::kAddClosedFailed); return hr;- }+ }*/+ HRESULT hr; ComPtr<IDXGIDevice> dxgi_device; hr = d3d11_device_->QueryInterface(IID_PPV_ARGS(&dxgi_device));@@ -179,14 +189,14 @@ HRESULT WgcCaptureSession::StartCapture(const DesktopCaptureOptions& options) { return hr; }- if (!options.prefer_cursor_embedded()) {+ /*if (!options.prefer_cursor_embedded()) { ComPtr<ABI::Windows::Graphics::Capture::IGraphicsCaptureSession2> session2; if (SUCCEEDED(session_->QueryInterface( ABI::Windows::Graphics::Capture::IID_IGraphicsCaptureSession2, &session2))) { session2->put_IsCursorCaptureEnabled(false); }- }+ }*/ // Until Mozilla builds with Win 10 SDK v10.0.20348.0 or newer, this // code will not build. Once we support the newer SDK, Bug 1868198diff --git a/third_party/libwebrtc/modules/desktop_capture/win/wgc_capturer_win.cc b/third_party/libwebrtc/modules/desktop_capture/win/wgc_capturer_win.ccindex 9c545597aa92..c7866df5714d 100644--- a/third_party/libwebrtc/modules/desktop_capture/win/wgc_capturer_win.cc+++ b/third_party/libwebrtc/modules/desktop_capture/win/wgc_capturer_win.cc@@ -10,7 +10,7 @@ #include "modules/desktop_capture/win/wgc_capturer_win.h"-#include <DispatcherQueue.h>+#include <dispatcherqueue.h> #include <windows.foundation.metadata.h> #include <windows.graphics.capture.h>diff --git a/third_party/libwebrtc/modules/desktop_capture/win/wgc_capturer_win.h b/third_party/libwebrtc/modules/desktop_capture/win/wgc_capturer_win.hindex 30253d9db62b..64c50e0cf003 100644--- a/third_party/libwebrtc/modules/desktop_capture/win/wgc_capturer_win.h+++ b/third_party/libwebrtc/modules/desktop_capture/win/wgc_capturer_win.h@@ -11,7 +11,7 @@ #ifndef MODULES_DESKTOP_CAPTURE_WIN_WGC_CAPTURER_WIN_H_ #define MODULES_DESKTOP_CAPTURE_WIN_WGC_CAPTURER_WIN_H_-#include <DispatcherQueue.h>+#include <dispatcherqueue.h> #include <d3d11.h> #include <wrl/client.h>
Mingw patches
I started from mingw-w64 85ca1edc5c95295aa201034da9dc26a10044031f.