GESTrackVideoTitleSourceClass
ges_tl_title_src_get_type
ges_track_video_title_source_set_text
+ges_track_video_title_source_set_font_desc
<SUBSECTION Standard>
GES_TRACK_VIDEO_TITLE_SOURCE
GES_TRACK_VIDEO_TITLE_SOURCE_CLASS
</SECTION>
<SECTION>
+<FILE>ges-track-audio-title-source</FILE>
GESTrackAudioTitleSource
GESTrackAudioTitleSourceClass
ges_track_audio_title_source_new
ges_track_audio_title_src_get_type
+DEFAULT_FONT_DESC
<SUBSECTION Standard>
GES_IS_TRACK_AUDIO_TITLE_SOURCE
GES_IS_TRACK_AUDIO_TITLE_SOURCE_CLASS
ges_track_video_title_src_init (GESTrackVideoTitleSource * self)
{
self->text = NULL;
+ self->font_desc = g_strdup (DEFAULT_FONT_DESC);
self->text_el = NULL;
self->background_el = NULL;
}
g_free (self->text);
}
+ if (self->font_desc) {
+ g_free (self->font_desc);
+ }
+
if (self->text_el) {
g_object_unref (self->text_el);
self->text_el = NULL;
topbin = gst_bin_new ("titlesrc-bin");
background = gst_element_factory_make ("videotestsrc", "titlesrc-bg");
+
text = gst_element_factory_make ("textoverlay", "titlsrc-text");
if (self->text) {
g_object_set (text, "text", self->text, NULL);
}
+ if (self->font_desc) {
+ g_object_set (text, "font-desc", self->font_desc, NULL);
+ }
g_object_set (background, "pattern", (gint) GES_TRACK_VIDEO_BG_SRC_BLACK,
NULL);
g_object_set (self->text_el, "text", text, NULL);
}
+/**
+ * ges_track_video_title_source_set_font_desc:
+ * @self: the #GESTrackVideoTitleSource* to set text on
+ * @font_desc: the pango font description
+ *
+ * Sets the text this track object will render.
+ *
+ */
+
+void
+ges_track_video_title_source_set_font_desc (GESTrackVideoTitleSource * self,
+ const gchar * font_desc)
+{
+ self->font_desc = g_strdup (font_desc);
+ GST_LOG ("setting font-desc to '%s'", font_desc);
+ if (self->text_el)
+ g_object_set (self->text_el, "font-desc", font_desc, NULL);
+}
+
GESTrackVideoTitleSource *
ges_track_video_title_source_new (void)
{
#define GES_TRACK_VIDEO_TITLE_SOURCE_GET_CLASS(obj) \
(G_TYPE_INSTANCE_GET_CLASS ((obj), GES_TYPE_TRACK_VIDEO_TITLE_SOURCE, GESTrackVideoTitleSourceClass))
+#define DEFAULT_FONT_DESC "serif 36"
+
+
/**
* GESTrackVideoTitleSource:
* @parent: parent
/*< private >*/
gchar *text;
+ gchar *font_desc;
GstElement *text_el;
GstElement *background_el;
};
GType ges_track_video_title_src_get_type (void);
-void ges_track_video_title_source_set_text(GESTrackVideoTitleSource *, const gchar *);
+void ges_track_video_title_source_set_text(GESTrackVideoTitleSource *, const
+ gchar *);
+void ges_track_video_title_source_set_font_desc(GESTrackVideoTitleSource *,
+ const gchar *);
GESTrackVideoTitleSource* ges_track_video_title_source_new (void);
G_END_DECLS