#include "gstmfvideobuffer.h"
#include <string.h>
+#if GST_MF_HAVE_D3D11
+#include <d3d10.h>
+#endif
+
using namespace Microsoft::WRL;
G_BEGIN_DECLS
if (device_caps->d3d11_aware) {
HRESULT hr;
ID3D11Device *device_handle;
+ ComPtr<ID3D10Multithread> multi_thread;
GstD3D11Device *device;
if (!gst_d3d11_ensure_element_data (GST_ELEMENT_CAST (self),
}
device_handle = gst_d3d11_device_get_device_handle (device);
+ /* Enable multi thread protection as this device will be shared with
+ * MFT */
+ hr = device_handle->QueryInterface (IID_PPV_ARGS (&multi_thread));
+ if (!gst_d3d11_result (hr, device)) {
+ GST_WARNING_OBJECT (self,
+ "device doesn't suport ID3D10Multithread interface");
+ gst_clear_object (&self->other_d3d11_device);
+ gst_clear_object (&self->d3d11_device);
+ }
+
+ multi_thread->SetMultithreadProtected (TRUE);
+
hr = self->device_manager->ResetDevice ((IUnknown *) device_handle,
self->reset_token);
if (!gst_mf_result (hr)) {
# Since MFTEnum2 is desktop only we don't support d3d11 interop for UWP build
# And because MFTEnum2 is Windows 10 API, we will load MFTEnum2 symbol
# by using g_module_open() so that keep supporting old OS versions
- if gstd3d11_dep.found() and cc.has_header('d3d11_4.h')
+ if gstd3d11_dep.found() and cc.has_header('d3d11_4.h') and cc.has_header('d3d10.h')
have_mf_d3d11 = true
mf_lib_deps += [gstd3d11_dep, gmodule_dep]
extra_c_args += ['-DGST_USE_UNSTABLE_API']