d3d11: Suppress some warning logs

We uses gst_d3d11_device_new() for enumerating device which can
fail for some reason. Don't print warning log for the case.
And decoding capability check is the same case as well.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/2286>
This commit is contained in:
Seungha Yang 2021-05-28 23:21:19 +09:00 committed by GStreamer Marge Bot
parent 0b551382c4
commit b1541a7470
2 changed files with 32 additions and 6 deletions

View file

@ -765,7 +765,7 @@ gst_d3d11_device_constructed (GObject * object)
NULL, d3d11_flags, feature_levels, G_N_ELEMENTS (feature_levels),
D3D11_SDK_VERSION, &priv->device, &selected_level, &priv->device_context);
if (!gst_d3d11_result (hr, NULL)) {
if (FAILED (hr)) {
/* Retry if the system could not recognize D3D_FEATURE_LEVEL_11_1 */
hr = D3D11CreateDevice ((IDXGIAdapter *) adapter, D3D_DRIVER_TYPE_UNKNOWN,
NULL, d3d11_flags, &feature_levels[1],
@ -786,7 +786,7 @@ gst_d3d11_device_constructed (GObject * object)
D3D11_SDK_VERSION, &priv->device, &selected_level,
&priv->device_context);
if (!gst_d3d11_result (hr, NULL)) {
if (FAILED (hr)) {
/* Retry if the system could not recognize D3D_FEATURE_LEVEL_11_1 */
hr = D3D11CreateDevice ((IDXGIAdapter *) adapter, D3D_DRIVER_TYPE_UNKNOWN,
NULL, d3d11_flags, &feature_levels[1],
@ -795,11 +795,12 @@ gst_d3d11_device_constructed (GObject * object)
}
}
if (gst_d3d11_result (hr, NULL)) {
if (SUCCEEDED (hr)) {
GST_DEBUG_OBJECT (self, "Selected feature level 0x%x", selected_level);
} else {
GST_WARNING_OBJECT (self,
"cannot create d3d11 device, hr: 0x%x", (guint) hr);
GST_INFO_OBJECT (self,
"cannot create d3d11 device for adapter index %d with flags 0x%x, "
"hr: 0x%x", priv->adapter, d3d11_flags, (guint) hr);
goto error;
}

View file

@ -528,6 +528,30 @@ error:
return FALSE;
}
static const gchar *
gst_d3d11_codec_to_string (GstD3D11Codec codec)
{
switch (codec) {
case GST_D3D11_CODEC_NONE:
return "none";
case GST_D3D11_CODEC_H264:
return "H.264";
case GST_D3D11_CODEC_VP9:
return "VP9";
case GST_D3D11_CODEC_H265:
return "H.265";
case GST_D3D11_CODEC_VP8:
return "VP8";
case GST_D3D11_CODEC_MPEG2:
return "MPEG2";
default:
g_assert_not_reached ();
break;
}
return "Unknown";
}
gboolean
gst_d3d11_decoder_get_supported_decoder_profile (GstD3D11Decoder * decoder,
GstD3D11Codec codec, GstVideoFormat format, const GUID ** selected_profile)
@ -647,7 +671,8 @@ gst_d3d11_decoder_get_supported_decoder_profile (GstD3D11Decoder * decoder,
}
if (!profile) {
GST_WARNING_OBJECT (decoder, "No supported decoder profile");
GST_INFO_OBJECT (decoder, "No supported decoder profile for %s codec",
gst_d3d11_codec_to_string (codec));
return FALSE;
}