summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNirbheek Chauhan <nirbheek@centricular.com>2022-11-09 23:41:33 +0530
committerNirbheek Chauhan <nirbheek@centricular.com>2022-11-10 01:40:14 +0530
commitb2e948b2196bcf025875e3ba8e399c3f05871e06 (patch)
tree452cb6b29aa2de77d77393875125a9fd0af3bfa0
parent5e7cc5dbb2b86e06c3efbb25ffadceaf35ffab9f (diff)
gst-plugins-bad: Fix build error on MSVC x861.21.2
``` FAILED: sys/d3d11/gstd3d11.dll.p/gstd3d11winrtcapture.cpp.obj ../sys/d3d11/gstd3d11winrtcapture.cpp(446): error C2672: 'Callback': no matching overloaded function found ../sys/d3d11/gstd3d11winrtcapture.cpp(447): error C2784: 'Microsoft::WRL::ComPtr<Details::DelegateArgTraitsHelper<TDelegateInterface,false>::Interface> Microsoft::WRL::Callback(TCallbackObject *,HRESULT (__thiscall TCallbackObject::* )(TA rgs...)) throw()': could not deduce template argument for 'HRESULT (__thiscall TCallbackObject::* )(TArgs...)' from 'HRESULT (__stdcall GstD3D11WinRTCaptureInner::* )(ABI::Windows::Graphics::Capture::IGraphicsCaptureItem *,IInspectable *) ' C:\Program Files (x86)\Windows Kits\10\include\10.0.20348.0\winrt\wrl\event.h(477): note: see declaration of 'Microsoft::WRL::Callback' ../sys/d3d11/gstd3d11winrtcapture.cpp(447): error C2780: 'Microsoft::WRL::ComPtr<Details::DelegateArgTraitsHelper<TDelegateInterface,false>::Interface> Microsoft::WRL::Callback(TFunc *) throw()': expects 1 arguments - 2 provided C:\Program Files (x86)\Windows Kits\10\include\10.0.20348.0\winrt\wrl\event.h(465): note: see declaration of 'Microsoft::WRL::Callback' ../sys/d3d11/gstd3d11winrtcapture.cpp(447): error C2780: 'Microsoft::WRL::ComPtr<Details::DelegateArgTraitsHelper<TDelegateInterface,false>::Interface> Microsoft::WRL::Callback(TLambda &&) throw()': expects 1 arguments - 2 provided C:\Program Files (x86)\Windows Kits\10\include\10.0.20348.0\winrt\wrl\event.h(457): note: see declaration of 'Microsoft::WRL::Callback' ../sys/d3d11/gstd3d11winrtcapture.cpp(448): error C3536: 'closed_handler': cannot be used before it is initialized ``` Part-of: <https://gitlab.freedesktop.org/gstreamer/cerbero/-/merge_requests/1006>
-rw-r--r--recipes/3375.patch53
-rw-r--r--recipes/gst-plugins-bad-1.0.recipe3
2 files changed, 56 insertions, 0 deletions
diff --git a/recipes/3375.patch b/recipes/3375.patch
new file mode 100644
index 00000000..2d62d9ed
--- /dev/null
+++ b/recipes/3375.patch
@@ -0,0 +1,53 @@
+From 71bfbbf598d060e0cbbc45c518c9c003f76b5334 Mon Sep 17 00:00:00 2001
+From: Seungha Yang <seungha@centricular.com>
+Date: Thu, 10 Nov 2022 02:49:38 +0900
+Subject: [PATCH] d3d11screencapturesrc: Fix build error with MSVC x86
+
+Delete the code for now. Note that the code block is unnecessary already
+---
+ .../sys/d3d11/gstd3d11winrtcapture.cpp | 15 ---------------
+ 1 file changed, 15 deletions(-)
+
+diff --git a/sys/d3d11/gstd3d11winrtcapture.cpp b/sys/d3d11/gstd3d11winrtcapture.cpp
+index 3c2c2cbd7eb..4c876f36cf0 100644
+--- a/sys/d3d11/gstd3d11winrtcapture.cpp
++++ b/sys/d3d11/gstd3d11winrtcapture.cpp
+@@ -122,9 +122,6 @@ struct GstD3D11WinRTCaptureInner
+ {
+ ~GstD3D11WinRTCaptureInner()
+ {
+- if (item)
+- item->remove_Closed (closed_token);
+-
+ CLOSE_COM (session);
+ CLOSE_COM (pool);
+ CLOSE_COM (item);
+@@ -144,7 +141,6 @@ struct GstD3D11WinRTCaptureInner
+ ComPtr < IGraphicsCaptureItem > item;
+ ComPtr < IDirect3D11CaptureFramePool > pool;
+ ComPtr < IGraphicsCaptureSession > session;
+- EventRegistrationToken closed_token;
+
+ bool closed = false;
+ };
+@@ -441,17 +437,6 @@ gst_d3d11_winrt_configure (GstD3D11WinRTCapture * self)
+ goto error;
+ }
+
+- {
+- /* FIXME: This callback does not work for some reasons */
+- auto closed_handler = Callback < ITypedEventHandler < GraphicsCaptureItem *,
+- IInspectable * >>(inner, &GstD3D11WinRTCaptureInner::OnClosed);
+- hr = inner->item->add_Closed (closed_handler.Get (), &inner->closed_token);
+- if (!gst_d3d11_result (hr, self->device)) {
+- GST_ERROR_OBJECT (self, "Could not install closed callback");
+- goto error;
+- }
+- }
+-
+ hr = device_handle->QueryInterface (IID_PPV_ARGS (&dxgi_device));
+ if (!gst_d3d11_result (hr, device)) {
+ GST_WARNING_OBJECT (self, "IDXGIDevice is not available");
+--
+GitLab
+
diff --git a/recipes/gst-plugins-bad-1.0.recipe b/recipes/gst-plugins-bad-1.0.recipe
index 201fe868..5bc36fa3 100644
--- a/recipes/gst-plugins-bad-1.0.recipe
+++ b/recipes/gst-plugins-bad-1.0.recipe
@@ -85,6 +85,9 @@ class Recipe(custom.GStreamer):
'srt', 'zbar']
use_system_libs = True
+ # https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/3375
+ patches = ['3375.patch']
+
files_lang = ['gst-plugins-bad-1.0']
files_libs = [