summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorHyunjun Ko <zzoon@igalia.com>2018-04-25 16:24:32 +0900
committerVíctor Manuel Jáquez Leal <vjaquez@igalia.com>2018-04-27 12:44:58 +0200
commita42ff804c77cbe7fa7ce79be86befce5fe6df49e (patch)
treecad7049028d412a21250547121462ec94eef8e50
parent56b63720b446141ada11d2d5e1a4e61a30faf375 (diff)
plugins: pass members as parameters of gst_gl_ensure_element_data()
The parameters of gst_gl_ensure_element_data() have to be not local variable since they are going to be used to see if they're set in gst_element_set_context() inside the API. This is basically a revert of commit 3d56306c https://bugzilla.gnome.org/show_bug.cgi?id=793643
-rw-r--r--gst/vaapi/gstvaapipluginbase.c13
1 files changed, 8 insertions, 5 deletions
diff --git a/gst/vaapi/gstvaapipluginbase.c b/gst/vaapi/gstvaapipluginbase.c
index 08f1e0da..5fde56c4 100644
--- a/gst/vaapi/gstvaapipluginbase.c
+++ b/gst/vaapi/gstvaapipluginbase.c
@@ -1235,11 +1235,15 @@ gst_vaapi_plugin_base_create_gl_context (GstVaapiPluginBase * plugin)
GstGLContext *gl_other_context = NULL, *gl_context = NULL;
GstGLDisplay *gl_display = NULL;
- if (!gst_gl_ensure_element_data (plugin, &gl_display, &gl_other_context))
+ if (!gst_gl_ensure_element_data (plugin,
+ (GstGLDisplay **) & plugin->gl_display,
+ (GstGLContext **) & plugin->gl_other_context))
goto no_valid_gl_display;
+ gl_display = (GstGLDisplay *) plugin->gl_display;
if (gst_gl_display_get_handle_type (gl_display) == GST_GL_DISPLAY_TYPE_ANY)
goto no_valid_gl_display;
+ gl_other_context = (GstGLContext *) plugin->gl_other_context;
GST_INFO_OBJECT (plugin, "creating a new GstGL context");
@@ -1256,15 +1260,14 @@ gst_vaapi_plugin_base_create_gl_context (GstVaapiPluginBase * plugin)
} while (!gst_gl_display_add_context (gl_display, gl_context));
GST_OBJECT_UNLOCK (gl_display);
- plugin_set_gst_gl (plugin, gl_display, gl_context, gl_other_context);
-
return GST_OBJECT_CAST (gl_context);
/* ERRORS */
no_valid_gl_display:
{
- gst_object_replace ((GstObject **) & gl_display, NULL);
- gst_object_replace ((GstObject **) & gl_other_context, NULL);
+ GST_INFO_OBJECT (plugin, "No valid GL display found");
+ gst_object_replace (&plugin->gl_display, NULL);
+ gst_object_replace (&plugin->gl_other_context, NULL);
return NULL;
}
#else