From: Víctor Manuel Jáquez Leal Date: Mon, 2 Oct 2017 16:53:21 +0000 (+0200) Subject: libs: utils: log warn if display fail X-Git-Tag: 1.19.3~503^2~815 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=c7d712a93247d07c32591d2006cb8f1185a0b1c0;p=platform%2Fupstream%2Fgstreamer.git 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 --- 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;