From 1e96fae94c28866ed6f3ed63e79d83932bf79f2d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?V=C3=ADctor=20Manuel=20J=C3=A1quez=20Leal?= Date: Mon, 2 Nov 2015 16:48:27 +0100 Subject: [PATCH] plugin: chain up set_context() vmethod MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Since Gstreamer 1.7, set_context() vmethod needs to be chained up with the parent class in order to broadcast all its contexts when the element is added into a bin: http://cgit.freedesktop.org/gstreamer/gstreamer/commit/?id=d5ded1588920c4471eefe055d09095d9e5e989b5 There is no need to guard the call, because before GStreamer 1.7, the set_context() vmethod was NULL in the element class, hence the conditional call make it safe. Signed-off-by: Víctor Manuel Jáquez Leal https://bugzilla.gnome.org/show_bug.cgi?id=757598 --- gst/vaapi/gstvaapipluginbase.c | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/gst/vaapi/gstvaapipluginbase.c b/gst/vaapi/gstvaapipluginbase.c index 05b816c62c..5acc807467 100644 --- a/gst/vaapi/gstvaapipluginbase.c +++ b/gst/vaapi/gstvaapipluginbase.c @@ -35,6 +35,8 @@ /* Default debug category is from the subclass */ #define GST_CAT_DEFAULT (plugin->debug_category) +static gpointer plugin_parent_class = NULL; + /* GstVideoContext interface */ static void plugin_set_display (GstVaapiPluginBase * plugin, GstVaapiDisplay * display) @@ -59,10 +61,14 @@ static void plugin_set_context (GstElement * element, GstContext * context) { GstVaapiPluginBase *const plugin = GST_VAAPI_PLUGIN_BASE (element); + GstElementClass *element_class = GST_ELEMENT_CLASS (plugin_parent_class); GstVaapiDisplay *display = NULL; if (gst_vaapi_video_context_get_display (context, &display)) plugin_set_display (plugin, display); + + if (element_class->set_context) + element_class->set_context (element, context); } void @@ -177,6 +183,8 @@ gst_vaapi_plugin_base_class_init (GstVaapiPluginBaseClass * klass) klass->has_interface = default_has_interface; klass->display_changed = default_display_changed; + plugin_parent_class = g_type_class_peek_parent (klass); + GstElementClass *const element_class = GST_ELEMENT_CLASS (klass); element_class->set_context = GST_DEBUG_FUNCPTR (plugin_set_context); }