From 9ee7398faeb48221dacaabf48990444dd96d4211 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Sebastian=20Dr=C3=B6ge?= Date: Sat, 16 Apr 2011 16:18:40 +0200 Subject: [PATCH] pango: Create a new pango context for every subclass timeoverlay/clockoverlay are setting some global options on the context that shouldn't be used for the generic textoverlay. --- ext/pango/gsttextoverlay.c | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/ext/pango/gsttextoverlay.c b/ext/pango/gsttextoverlay.c index 914c216..0135900 100644 --- a/ext/pango/gsttextoverlay.c +++ b/ext/pango/gsttextoverlay.c @@ -352,6 +352,8 @@ static void gst_text_overlay_base_init (gpointer g_class) { GstElementClass *element_class = GST_ELEMENT_CLASS (g_class); + GstTextOverlayClass *klass = GST_TEXT_OVERLAY_CLASS (g_class); + PangoFontMap *fontmap; gst_element_class_add_pad_template (element_class, gst_static_pad_template_get (&src_template_factory)); @@ -369,6 +371,10 @@ gst_text_overlay_base_init (gpointer g_class) "Filter/Editor/Video", "Adds text strings on top of a video buffer", "David Schleef , " "Zeeshan Ali "); + + fontmap = pango_cairo_font_map_get_default (); + klass->pango_context = + pango_cairo_font_map_create_context (PANGO_CAIRO_FONT_MAP (fontmap)); } static gchar * @@ -382,7 +388,6 @@ gst_text_overlay_class_init (GstTextOverlayClass * klass) { GObjectClass *gobject_class; GstElementClass *gstelement_class; - PangoFontMap *fontmap; gobject_class = (GObjectClass *) klass; gstelement_class = (GstElementClass *) klass; @@ -397,9 +402,6 @@ gst_text_overlay_class_init (GstTextOverlayClass * klass) klass->pango_lock = g_mutex_new (); klass->get_text = gst_text_overlay_get_text; - fontmap = pango_cairo_font_map_get_default (); - klass->pango_context = - pango_cairo_font_map_create_context (PANGO_CAIRO_FONT_MAP (fontmap)); g_object_class_install_property (G_OBJECT_CLASS (klass), PROP_TEXT, g_param_spec_string ("text", "text", -- 2.7.4