summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLane Brooks <dirjud@gmail.com>2011-01-06 23:01:20 +0000
committerTim-Philipp Müller <tim.muller@collabora.co.uk>2011-01-06 23:02:23 +0000
commite67417833164c0ddf27248047637efad8088a607 (patch)
tree54ad95a84fc5de08ebc03ca7ede42ffaad8101f1
parent1e80f70d7a3fcdce8898df72b0fa7770aaab77b1 (diff)
textoverlay: make some properties controllable
https://bugzilla.gnome.org/show_bug.cgi?id=638859
-rw-r--r--ext/pango/Makefile.am2
-rw-r--r--ext/pango/gsttextoverlay.c16
-rw-r--r--ext/pango/gsttextoverlay.h1
3 files changed, 15 insertions, 4 deletions
diff --git a/ext/pango/Makefile.am b/ext/pango/Makefile.am
index 197ed3384..2ffea2268 100644
--- a/ext/pango/Makefile.am
+++ b/ext/pango/Makefile.am
@@ -15,12 +15,14 @@ libgstpango_la_SOURCES = \
libgstpango_la_CFLAGS = \
$(GST_PLUGINS_BASE_CFLAGS) \
$(GST_BASE_CFLAGS) \
+ $(GST_CONTROLLER_CFLAGS) \
$(GST_CFLAGS) \
$(PANGO_CFLAGS)
libgstpango_la_LIBADD = \
$(GST_PLUGINS_BASE_LIBS) \
$(top_builddir)/gst-libs/gst/video/libgstvideo-$(GST_MAJORMINOR).la \
$(GST_BASE_LIBS) \
+ $(GST_CONTROLLER_LIBS) \
$(GST_LIBS) \
$(PANGO_LIBS)
libgstpango_la_LDFLAGS = $(GST_PLUGIN_LDFLAGS)
diff --git a/ext/pango/gsttextoverlay.c b/ext/pango/gsttextoverlay.c
index fa9cf8fd0..4d5f52dc1 100644
--- a/ext/pango/gsttextoverlay.c
+++ b/ext/pango/gsttextoverlay.c
@@ -430,7 +430,8 @@ gst_text_overlay_class_init (GstTextOverlayClass * klass)
g_object_class_install_property (G_OBJECT_CLASS (klass), PROP_XPOS,
g_param_spec_double ("xpos", "horizontal position",
"Horizontal position when using position alignment", 0, 1.0,
- DEFAULT_PROP_XPOS, G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS));
+ DEFAULT_PROP_XPOS,
+ G_PARAM_READWRITE | GST_PARAM_CONTROLLABLE | G_PARAM_STATIC_STRINGS));
/**
* GstTextOverlay:ypos
*
@@ -441,7 +442,8 @@ gst_text_overlay_class_init (GstTextOverlayClass * klass)
g_object_class_install_property (G_OBJECT_CLASS (klass), PROP_YPOS,
g_param_spec_double ("ypos", "vertical position",
"Vertical position when using position alignment", 0, 1.0,
- DEFAULT_PROP_YPOS, G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS));
+ DEFAULT_PROP_YPOS,
+ G_PARAM_READWRITE | GST_PARAM_CONTROLLABLE | G_PARAM_STATIC_STRINGS));
g_object_class_install_property (G_OBJECT_CLASS (klass), PROP_WRAP_MODE,
g_param_spec_enum ("wrap-mode", "wrap mode",
"Whether to wrap the text and if so how.",
@@ -463,7 +465,8 @@ gst_text_overlay_class_init (GstTextOverlayClass * klass)
g_object_class_install_property (G_OBJECT_CLASS (klass), PROP_COLOR,
g_param_spec_uint ("color", "Color",
"Color to use for text (big-endian ARGB).", 0, G_MAXUINT32,
- DEFAULT_PROP_COLOR, G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS));
+ DEFAULT_PROP_COLOR,
+ G_PARAM_READWRITE | GST_PARAM_CONTROLLABLE | G_PARAM_STATIC_STRINGS));
/**
* GstTextOverlay:line-alignment
@@ -489,7 +492,8 @@ gst_text_overlay_class_init (GstTextOverlayClass * klass)
g_object_class_install_property (G_OBJECT_CLASS (klass), PROP_SILENT,
g_param_spec_boolean ("silent", "silent",
"Whether to render the text string",
- DEFAULT_PROP_SILENT, G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS));
+ DEFAULT_PROP_SILENT,
+ G_PARAM_READWRITE | GST_PARAM_CONTROLLABLE | G_PARAM_STATIC_STRINGS));
/**
* GstTextOverlay:wait-text
*
@@ -2247,6 +2251,8 @@ gst_text_overlay_video_chain (GstPad * pad, GstBuffer * buffer)
}
}
+ gst_object_sync_values (G_OBJECT (overlay), GST_BUFFER_TIMESTAMP (buffer));
+
wait_for_text_buf:
GST_OBJECT_LOCK (overlay);
@@ -2531,6 +2537,8 @@ gst_text_overlay_change_state (GstElement * element, GstStateChange transition)
static gboolean
plugin_init (GstPlugin * plugin)
{
+ gst_controller_init (NULL, NULL);
+
if (!gst_element_register (plugin, "textoverlay", GST_RANK_NONE,
GST_TYPE_TEXT_OVERLAY) ||
!gst_element_register (plugin, "timeoverlay", GST_RANK_NONE,
diff --git a/ext/pango/gsttextoverlay.h b/ext/pango/gsttextoverlay.h
index 8031478b9..5fddf3ad0 100644
--- a/ext/pango/gsttextoverlay.h
+++ b/ext/pango/gsttextoverlay.h
@@ -3,6 +3,7 @@
#include <gst/gst.h>
#include <gst/video/video.h>
+#include <gst/controller/gstcontroller.h>
#include <pango/pangocairo.h>
G_BEGIN_DECLS