mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2025-06-05 06:58:56 +00:00
plugin: chain up set_context() vmethod
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 <victorx.jaquez@intel.com> https://bugzilla.gnome.org/show_bug.cgi?id=757598
This commit is contained in:
parent
4fc8769761
commit
1e96fae94c
1 changed files with 8 additions and 0 deletions
|
@ -35,6 +35,8 @@
|
||||||
/* Default debug category is from the subclass */
|
/* Default debug category is from the subclass */
|
||||||
#define GST_CAT_DEFAULT (plugin->debug_category)
|
#define GST_CAT_DEFAULT (plugin->debug_category)
|
||||||
|
|
||||||
|
static gpointer plugin_parent_class = NULL;
|
||||||
|
|
||||||
/* GstVideoContext interface */
|
/* GstVideoContext interface */
|
||||||
static void
|
static void
|
||||||
plugin_set_display (GstVaapiPluginBase * plugin, GstVaapiDisplay * display)
|
plugin_set_display (GstVaapiPluginBase * plugin, GstVaapiDisplay * display)
|
||||||
|
@ -59,10 +61,14 @@ static void
|
||||||
plugin_set_context (GstElement * element, GstContext * context)
|
plugin_set_context (GstElement * element, GstContext * context)
|
||||||
{
|
{
|
||||||
GstVaapiPluginBase *const plugin = GST_VAAPI_PLUGIN_BASE (element);
|
GstVaapiPluginBase *const plugin = GST_VAAPI_PLUGIN_BASE (element);
|
||||||
|
GstElementClass *element_class = GST_ELEMENT_CLASS (plugin_parent_class);
|
||||||
GstVaapiDisplay *display = NULL;
|
GstVaapiDisplay *display = NULL;
|
||||||
|
|
||||||
if (gst_vaapi_video_context_get_display (context, &display))
|
if (gst_vaapi_video_context_get_display (context, &display))
|
||||||
plugin_set_display (plugin, display);
|
plugin_set_display (plugin, display);
|
||||||
|
|
||||||
|
if (element_class->set_context)
|
||||||
|
element_class->set_context (element, context);
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
|
@ -177,6 +183,8 @@ gst_vaapi_plugin_base_class_init (GstVaapiPluginBaseClass * klass)
|
||||||
klass->has_interface = default_has_interface;
|
klass->has_interface = default_has_interface;
|
||||||
klass->display_changed = default_display_changed;
|
klass->display_changed = default_display_changed;
|
||||||
|
|
||||||
|
plugin_parent_class = g_type_class_peek_parent (klass);
|
||||||
|
|
||||||
GstElementClass *const element_class = GST_ELEMENT_CLASS (klass);
|
GstElementClass *const element_class = GST_ELEMENT_CLASS (klass);
|
||||||
element_class->set_context = GST_DEBUG_FUNCPTR (plugin_set_context);
|
element_class->set_context = GST_DEBUG_FUNCPTR (plugin_set_context);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue