[0.11] gst-plugins-base: pango: Create a new pango context for every subclass
Sebastian Dröge
slomo at kemper.freedesktop.org
Mon Apr 18 04:25:40 PDT 2011
Module: gst-plugins-base
Branch: 0.11
Commit: 9ee7398faeb48221dacaabf48990444dd96d4211
URL: http://cgit.freedesktop.org/gstreamer/gst-plugins-base/commit/?id=9ee7398faeb48221dacaabf48990444dd96d4211
Author: Sebastian Dröge <sebastian.droege at collabora.co.uk>
Date: Sat Apr 16 16:18:40 2011 +0200
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 files 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 <ds at schleef.org>, " "Zeeshan Ali <zeeshan.ali at nokia.com>");
+
+ 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",
More information about the gstreamer-commits
mailing list