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
This commit is contained in:
Víctor Manuel Jáquez Leal 2017-10-02 18:53:21 +02:00
parent 68aca503ce
commit c7d712a932

View file

@ -65,6 +65,18 @@ gst_vaapi_err (void *data, const char *message)
GST_ERROR ("%s", msg); GST_ERROR ("%s", msg);
g_free (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 #endif
static void static void
@ -91,13 +103,18 @@ vaapi_initialize (VADisplay dpy)
VAStatus status; VAStatus status;
#if VA_CHECK_VERSION (1,0,0) #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); vaSetInfoCallback (dpy, gst_vaapi_log, NULL);
#elif VA_CHECK_VERSION (0,40,0) #elif VA_CHECK_VERSION (0,40,0)
vaSetInfoCallback (gst_vaapi_log); vaSetInfoCallback (gst_vaapi_log);
#endif #endif
status = vaInitialize (dpy, &major_version, &minor_version); 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()")) if (!vaapi_check_status (status, "vaInitialize()"))
return FALSE; return FALSE;