[0.11] gstreamer: controller: add logging and fix array functions

Stefan Kost ensonic at kemper.freedesktop.org
Sun Jan 1 07:08:52 PST 2012


Module: gstreamer
Branch: 0.11
Commit: 757822a90601a21a31429132723ee1e354d61a8f
URL:    http://cgit.freedesktop.org/gstreamer/gstreamer/commit/?id=757822a90601a21a31429132723ee1e354d61a8f

Author: Stefan Sauer <ensonic at users.sf.net>
Date:   Sun Jan  1 15:01:22 2012 +0100

controller: add logging and fix array functions

---

 .../gst/controller/gstinterpolationcontrolsource.c |   35 ++++++++++++++------
 1 files changed, 25 insertions(+), 10 deletions(-)

diff --git a/libs/gst/controller/gstinterpolationcontrolsource.c b/libs/gst/controller/gstinterpolationcontrolsource.c
index ecc5f5e..f806f20 100644
--- a/libs/gst/controller/gstinterpolationcontrolsource.c
+++ b/libs/gst/controller/gstinterpolationcontrolsource.c
@@ -88,7 +88,10 @@ interpolate_none_get_value_array (GstTimedValueControlSource * self,
   GSequenceIter *iter1 = NULL, *iter2 = NULL;
 
   g_mutex_lock (self->lock);
+
   for (i = 0; i < n_values; i++) {
+    GST_LOG ("values[%3d] : ts=%" GST_TIME_FORMAT ", next_ts=%" GST_TIME_FORMAT,
+        i, GST_TIME_ARGS (ts), GST_TIME_ARGS (next_ts));
     val = NAN;
     if (ts >= next_ts) {
       iter1 = gst_timed_value_control_source_find_control_point_iter (self, ts);
@@ -109,11 +112,13 @@ interpolate_none_get_value_array (GstTimedValueControlSource * self,
       } else {
         next_ts = GST_CLOCK_TIME_NONE;
       }
-
-      if (iter1) {
-        val = _interpolate_none (self, iter1);
-        ret = TRUE;
-      }
+    }
+    if (iter1) {
+      val = _interpolate_none (self, iter1);
+      ret = TRUE;
+      GST_LOG ("values[%3d]=%lf", i, val);
+    } else {
+      GST_LOG ("values[%3d]=-", i);
     }
     *values = val;
     ts += interval;
@@ -188,6 +193,8 @@ interpolate_linear_get_value_array (GstTimedValueControlSource * self,
   g_mutex_lock (self->lock);
 
   for (i = 0; i < n_values; i++) {
+    GST_LOG ("values[%3d] : ts=%" GST_TIME_FORMAT ", next_ts=%" GST_TIME_FORMAT,
+        i, GST_TIME_ARGS (ts), GST_TIME_ARGS (next_ts));
     val = NAN;
     if (ts >= next_ts) {
       cp1 = cp2 = NULL;
@@ -214,6 +221,9 @@ interpolate_linear_get_value_array (GstTimedValueControlSource * self,
           (cp2 ? cp2->timestamp : GST_CLOCK_TIME_NONE),
           (cp2 ? cp2->value : 0.0), ts);
       ret = TRUE;
+      GST_LOG ("values[%3d]=%lf", i, val);
+    } else {
+      GST_LOG ("values[%3d]=-", i);
     }
     *values = val;
     ts += interval;
@@ -402,6 +412,8 @@ interpolate_cubic_get_value_array (GstTimedValueControlSource * self,
   g_mutex_lock (self->lock);
 
   for (i = 0; i < n_values; i++) {
+    GST_LOG ("values[%3d] : ts=%" GST_TIME_FORMAT ", next_ts=%" GST_TIME_FORMAT,
+        i, GST_TIME_ARGS (ts), GST_TIME_ARGS (next_ts));
     val = NAN;
     if (ts >= next_ts) {
       cp1 = cp2 = NULL;
@@ -422,11 +434,14 @@ interpolate_cubic_get_value_array (GstTimedValueControlSource * self,
       } else {
         next_ts = GST_CLOCK_TIME_NONE;
       }
-      if (cp1) {
-        val = _interpolate_cubic (self, cp1, cp1->value, cp2,
-            (cp2 ? cp2->value : 0.0), timestamp);
-        ret = TRUE;
-      }
+    }
+    if (cp1) {
+      val = _interpolate_cubic (self, cp1, cp1->value, cp2,
+          (cp2 ? cp2->value : 0.0), timestamp);
+      ret = TRUE;
+      GST_LOG ("values[%3d]=%lf", i, val);
+    } else {
+      GST_LOG ("values[%3d]=-", i);
     }
     *values = val;
     ts += interval;



More information about the gstreamer-commits mailing list