mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2024-12-25 09:40:37 +00:00
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:
parent
68aca503ce
commit
c7d712a932
1 changed files with 18 additions and 1 deletions
|
@ -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;
|
||||
|
||||
|
|
Loading…
Reference in a new issue