textoverlay: make some properties controllable
authorLane Brooks <dirjud@gmail.com>
Thu, 6 Jan 2011 23:01:20 +0000 (23:01 +0000)
committerTim-Philipp Müller <tim.muller@collabora.co.uk>
Thu, 6 Jan 2011 23:02:23 +0000 (23:02 +0000)
https://bugzilla.gnome.org/show_bug.cgi?id=638859

ext/pango/Makefile.am
ext/pango/gsttextoverlay.c
ext/pango/gsttextoverlay.h

index 197ed33..2ffea22 100644 (file)
@@ -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)
index fa9cf8f..4d5f52d 100644 (file)
@@ -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,
index 8031478..5fddf3a 100644 (file)
@@ -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