From c7d712a93247d07c32591d2006cb8f1185a0b1c0 Mon Sep 17 00:00:00 2001 From: =?utf8?q?V=C3=ADctor=20Manuel=20J=C3=A1quez=20Leal?= Date: Mon, 2 Oct 2017 18:53:21 +0200 Subject: [PATCH] libs: utils: log warn if display fail gstreamer-vaapi initializes the display by trial-and-error, thus logging an error message if the display initialisation fails the user may be weary of the error message in the screen, if using VA-API 1.0 This commit set the VA error log handler to GStreamer warning level while calling vaInitialize() and set it to error after that. https://bugzilla.gnome.org/show_bug.cgi?id=783169 --- gst-libs/gst/vaapi/gstvaapiutils.c | 19 ++++++++++++++++++- 1 file changed, 18 insertions(+), 1 deletion(-) diff --git a/gst-libs/gst/vaapi/gstvaapiutils.c b/gst-libs/gst/vaapi/gstvaapiutils.c index 5d7ae62..493cc09 100644 --- a/gst-libs/gst/vaapi/gstvaapiutils.c +++ b/gst-libs/gst/vaapi/gstvaapiutils.c @@ -65,6 +65,18 @@ gst_vaapi_err (void *data, const char *message) GST_ERROR ("%s", msg); g_free (msg); } + +static void +gst_vaapi_warning (void *data, const char *message) +{ + gchar *msg; + + msg = strip_msg (message); + if (!msg) + return; + GST_WARNING ("%s", msg); + g_free (msg); +} #endif static void @@ -91,13 +103,18 @@ vaapi_initialize (VADisplay dpy) VAStatus status; #if VA_CHECK_VERSION (1,0,0) - vaSetErrorCallback (dpy, gst_vaapi_err, NULL); + vaSetErrorCallback (dpy, gst_vaapi_warning, NULL); vaSetInfoCallback (dpy, gst_vaapi_log, NULL); #elif VA_CHECK_VERSION (0,40,0) vaSetInfoCallback (gst_vaapi_log); #endif status = vaInitialize (dpy, &major_version, &minor_version); + +#if VA_CHECK_VERSION (1,0,0) + vaSetErrorCallback (dpy, gst_vaapi_err, NULL); +#endif + if (!vaapi_check_status (status, "vaInitialize()")) return FALSE; -- 2.7.4