From: Seungha Yang Date: Fri, 12 Jun 2020 10:07:07 +0000 (+0900) Subject: d3d11utils: Add a helper method for checking Xbox device X-Git-Tag: 1.19.3~507^2~1757 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=d12c0c4c7b0026633ae3966492be2daf3f497151;p=platform%2Fupstream%2Fgstreamer.git d3d11utils: Add a helper method for checking Xbox device Required for some cases to work around device specific issue Part-of: --- diff --git a/sys/d3d11/gstd3d11utils.c b/sys/d3d11/gstd3d11utils.c index 32a7018..7d33048 100644 --- a/sys/d3d11/gstd3d11utils.c +++ b/sys/d3d11/gstd3d11utils.c @@ -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) { diff --git a/sys/d3d11/gstd3d11utils.h b/sys/d3d11/gstd3d11utils.h index eb02945..ab3618f 100644 --- a/sys/d3d11/gstd3d11utils.h +++ b/sys/d3d11/gstd3d11utils.h @@ -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,