d3d11utils: Add a helper method for checking Xbox device

Required for some cases to work around device specific issue

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/1339>
This commit is contained in:
Seungha Yang 2020-06-12 19:07:07 +09:00 committed by GStreamer Merge Bot
parent b5c8889d4f
commit d12c0c4c7b
2 changed files with 23 additions and 0 deletions

View file

@ -342,6 +342,27 @@ gst_d3d11_is_windows_8_or_greater (void)
return ret;
}
gboolean
gst_d3d11_is_xbox_device (GstD3D11Device * device)
{
guint device_id = 0;
guint vendor_id = 0;
gchar *desc = NULL;
gboolean ret = FALSE;
g_return_val_if_fail (GST_IS_D3D11_DEVICE (device), FALSE);
g_object_get (device, "device-id", &device_id, "vendor-id", &vendor_id,
"description", &desc, NULL);
if (device_id == 0 && vendor_id == 0 && desc && g_strrstr (desc, "SraKmd"))
ret = TRUE;
g_free (desc);
return ret;
}
static gchar *
gst_d3d11_hres_to_string (HRESULT hr)
{

View file

@ -42,6 +42,8 @@ gboolean gst_d3d11_ensure_element_data (GstElement * element,
gboolean gst_d3d11_is_windows_8_or_greater (void);
gboolean gst_d3d11_is_xbox_device (GstD3D11Device * device);
gboolean _gst_d3d11_result (HRESULT hr,
GstD3D11Device * device,
GstDebugCategory * cat,