wtay gstreamer: gstreamer/ gstreamer/libs/gst/base/

[email protected] Mon, 15 Dec 2008 04:48:14 -0800 (PST)
Newsgroups gmane.comp.video.gstreamer.cvs
Message-ID <[email protected]>
CVS Root:       /cvs/gstreamer
Module:         gstreamer
Changes by:     wtay
Date:           Mon Dec 15 2008  12:48:14 UTC

Log message:
* libs/gst/base/gstbasesink.c: (gst_base_sink_class_init),
(gst_base_sink_init), (gst_base_sink_set_property),
(gst_base_sink_get_property):
Expose the render-delay as a property so things like appsink can use it
to tweak the synchronisation.

Modified files:
    .               : ChangeLog
    libs/gst/base   : gstbasesink.c

Links:
http://freedesktop.org/cgi-bin/viewcvs.cgi/gstreamer/gstreamer/ChangeLog.diff?r1=1.4191&r2=1.4192
http://freedesktop.org/cgi-bin/viewcvs.cgi/gstreamer/gstreamer/libs/gst/base/gstbasesink.c.diff?r1=1.224&r2=1.225

====Begin Diffs====
Index: ChangeLog
===================================================================
RCS file: /cvs/gstreamer/gstreamer/ChangeLog,v
retrieving revision 1.4191
retrieving revision 1.4192
diff -u -d -r1.4191 -r1.4192
--- ChangeLog	10 Dec 2008 15:19:43 -0000	1.4191
+++ ChangeLog	15 Dec 2008 12:47:57 -0000	1.4192
@@ -1,3 +1,11 @@
+2008-12-15  Wim Taymans  <[email protected]>
+
+	* libs/gst/base/gstbasesink.c: (gst_base_sink_class_init),
+	(gst_base_sink_init), (gst_base_sink_set_property),
+	(gst_base_sink_get_property):
+	Expose the render-delay as a property so things like appsink can use it
+	to tweak the synchronisation.
 2008-12-10  Peter Kjellerstedt  <[email protected]>
 
 	* libs/gst/check/gstcheck.h: Allow check tests to use
Index: gstbasesink.c
RCS file: /cvs/gstreamer/gstreamer/libs/gst/base/gstbasesink.c,v
retrieving revision 1.224
retrieving revision 1.225
diff -u -d -r1.224 -r1.225
--- gstbasesink.c	24 Nov 2008 20:02:55 -0000	1.224
+++ gstbasesink.c	15 Dec 2008 12:47:59 -0000	1.225
@@ -247,6 +247,7 @@
 #define DEFAULT_ASYNC			TRUE
 #define DEFAULT_TS_OFFSET		0
 #define DEFAULT_BLOCKSIZE 		4096
+#define DEFAULT_RENDER_DELAY 		0
 enum
 {
@@ -259,6 +260,7 @@
   PROP_TS_OFFSET,
   PROP_LAST_BUFFER,
   PROP_BLOCKSIZE,
+  PROP_RENDER_DELAY,
   PROP_LAST
 };
@@ -403,7 +405,6 @@
       g_param_spec_int64 ("ts-offset", "TS Offset",
           "Timestamp offset in nanoseconds", G_MININT64, G_MAXINT64,
           DEFAULT_TS_OFFSET, G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS));
-
   /**
    * GstBaseSink:last-buffer
    *
@@ -417,7 +418,6 @@
       gst_param_spec_mini_object ("last-buffer", "Last Buffer",
           "The last buffer received in the sink", GST_TYPE_BUFFER,
           G_PARAM_READABLE | G_PARAM_STATIC_STRINGS));
    * GstBaseSink:blocksize
@@ -429,6 +429,19 @@
       g_param_spec_uint ("blocksize", "Block size",
           "Size in bytes to pull per buffer (0 = default)", 0, G_MAXUINT,
           DEFAULT_BLOCKSIZE, G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS));
+  /**
+   * GstBaseSink:render-delay
+   *
+   * The additional delay between synchronisation and actual rendering of the
+   * media. This property will add additional latency to the device in order to
+   * make other sinks compensate for the delay.
+   * Since: 0.10.22
+   */
+  g_object_class_install_property (gobject_class, PROP_RENDER_DELAY,
+      g_param_spec_uint64 ("render-delay", "Render Delay",
+          "Additional render delay of the sink in nanoseconds", 0, G_MAXUINT64,
+          DEFAULT_RENDER_DELAY, G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS));
   gstelement_class->change_state =
       GST_DEBUG_FUNCPTR (gst_base_sink_change_state);
@@ -581,7 +594,7 @@
   g_atomic_int_set (&priv->qos_enabled, DEFAULT_QOS);
   priv->async_enabled = DEFAULT_ASYNC;
   priv->ts_offset = DEFAULT_TS_OFFSET;
-  priv->render_delay = 0;
+  priv->render_delay = DEFAULT_RENDER_DELAY;
   priv->blocksize = DEFAULT_BLOCKSIZE;
   GST_OBJECT_FLAG_SET (basesink, GST_ELEMENT_IS_SINK);
@@ -1145,6 +1158,9 @@
     case PROP_BLOCKSIZE:
       gst_base_sink_set_blocksize (sink, g_value_get_uint (value));
       break;
+    case PROP_RENDER_DELAY:
+      gst_base_sink_set_render_delay (sink, g_value_get_uint64 (value));
+      break;
     default:
       G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
@@ -1184,6 +1200,9 @@
       g_value_set_uint (value, gst_base_sink_get_blocksize (sink));
+      g_value_set_uint64 (value, gst_base_sink_get_render_delay (sink));

------------------------------------------------------------------------------
SF.Net email is Sponsored by MIX09, March 18-20, 2009 in Las Vegas, Nevada.
The future of the web can't happen without you.  Join us at MIX09 to help
pave the way to the Next Web now. Learn more and register at
http://ad.doubleclick.net/clk;208669438;13503038;i?http://2009.visitmix.com/