{
GObjectClass *gobject_class;
GstTextOverlayClass *gsttextoverlay_class;
+ PangoContext *context;
+ PangoFontDescription *font_description;
gobject_class = (GObjectClass *) klass;
gsttextoverlay_class = (GstTextOverlayClass *) klass;
g_param_spec_string ("time-format", "Date/Time Format",
"Format to use for time and date value, as in strftime.",
DEFAULT_PROP_TIMEFORMAT, G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS));
+
+ context = GST_TEXT_OVERLAY_CLASS (klass)->pango_context;
+
+ pango_context_set_language (context, pango_language_from_string ("en_US"));
+ pango_context_set_base_dir (context, PANGO_DIRECTION_LTR);
+
+ font_description = pango_font_description_new ();
+ pango_font_description_set_family_static (font_description, "Monospace");
+ pango_font_description_set_style (font_description, PANGO_STYLE_NORMAL);
+ pango_font_description_set_variant (font_description, PANGO_VARIANT_NORMAL);
+ pango_font_description_set_weight (font_description, PANGO_WEIGHT_NORMAL);
+ pango_font_description_set_stretch (font_description, PANGO_STRETCH_NORMAL);
+ pango_font_description_set_size (font_description, 18 * PANGO_SCALE);
+ pango_context_set_font_description (context, font_description);
+ pango_font_description_free (font_description);
}
static void
gst_clock_overlay_init (GstClockOverlay * overlay, GstClockOverlayClass * klass)
{
- PangoFontDescription *font_description;
GstTextOverlay *textoverlay;
- PangoContext *context;
textoverlay = GST_TEXT_OVERLAY (overlay);
- context = GST_TEXT_OVERLAY_CLASS (klass)->pango_context;
-
- pango_context_set_language (context, pango_language_from_string ("en_US"));
- pango_context_set_base_dir (context, PANGO_DIRECTION_LTR);
-
- font_description = pango_font_description_new ();
- pango_font_description_set_family_static (font_description, "Monospace");
- pango_font_description_set_style (font_description, PANGO_STYLE_NORMAL);
- pango_font_description_set_variant (font_description, PANGO_VARIANT_NORMAL);
- pango_font_description_set_weight (font_description, PANGO_WEIGHT_NORMAL);
- pango_font_description_set_stretch (font_description, PANGO_STRETCH_NORMAL);
- pango_font_description_set_size (font_description, 18 * PANGO_SCALE);
- pango_context_set_font_description (context, font_description);
- pango_font_description_free (font_description);
-
textoverlay->valign = GST_TEXT_OVERLAY_VALIGN_TOP;
textoverlay->halign = GST_TEXT_OVERLAY_HALIGN_LEFT;
gst_time_overlay_class_init (GstTimeOverlayClass * klass)
{
GstTextOverlayClass *gsttextoverlay_class;
+ PangoContext *context;
+ PangoFontDescription *font_description;
gsttextoverlay_class = (GstTextOverlayClass *) klass;
gsttextoverlay_class->get_text = gst_time_overlay_get_text;
-}
-
-static void
-gst_time_overlay_init (GstTimeOverlay * overlay, GstTimeOverlayClass * klass)
-{
- PangoFontDescription *font_description;
- GstTextOverlay *textoverlay;
- PangoContext *context;
-
- textoverlay = GST_TEXT_OVERLAY (overlay);
context = GST_TEXT_OVERLAY_CLASS (klass)->pango_context;
pango_font_description_set_size (font_description, 18 * PANGO_SCALE);
pango_context_set_font_description (context, font_description);
pango_font_description_free (font_description);
+}
+
+static void
+gst_time_overlay_init (GstTimeOverlay * overlay, GstTimeOverlayClass * klass)
+{
+ GstTextOverlay *textoverlay;
+
+ textoverlay = GST_TEXT_OVERLAY (overlay);
textoverlay->valign = GST_TEXT_OVERLAY_VALIGN_TOP;
textoverlay->halign = GST_TEXT_OVERLAY_HALIGN_LEFT;