plugin: Always make sure we have Gdk display

Give up creating GL context in an unlikely situation that there is no default display
This commit is contained in:
Rafał Dzięgiel
2022-05-24 16:48:00 +02:00
parent 51619cbd2a
commit 3c248250f3

View File

@@ -109,6 +109,11 @@ retrieve_gl_context_on_main (GstClapperGLBaseImporter *self)
gdk_display = gdk_display_get_default ();
if (G_UNLIKELY (!gdk_display)) {
GST_ERROR_OBJECT (self, "Could not retrieve Gdk display");
return FALSE;
}
if (!(gdk_context = gdk_display_create_gl_context (gdk_display, &error))) {
GST_ERROR_OBJECT (self, "Error creating Gdk GL context: %s",
error ? error->message : "No error set by Gdk");