gamma: Sync properties to the controller in before_transform
authorSebastian Dröge <sebastian.droege@collabora.co.uk>
Sun, 18 Apr 2010 13:00:36 +0000 (15:00 +0200)
committerSebastian Dröge <sebastian.droege@collabora.co.uk>
Thu, 29 Apr 2010 17:28:19 +0000 (19:28 +0200)
gst/videofilter/gstgamma.c

index 4f30de2..d4565f7 100644 (file)
@@ -105,6 +105,8 @@ static gboolean gst_gamma_set_caps (GstBaseTransform * base, GstCaps * incaps,
     GstCaps * outcaps);
 static GstFlowReturn gst_gamma_transform_ip (GstBaseTransform * transform,
     GstBuffer * buf);
+static void gst_gamma_before_transform (GstBaseTransform * transform,
+    GstBuffer * buf);
 
 static void gst_gamma_calculate_tables (GstGamma * gamma);
 
@@ -143,6 +145,8 @@ gst_gamma_class_init (GstGammaClass * g_class)
 
   trans_class->set_caps = GST_DEBUG_FUNCPTR (gst_gamma_set_caps);
   trans_class->transform_ip = GST_DEBUG_FUNCPTR (gst_gamma_transform_ip);
+  trans_class->before_transform =
+      GST_DEBUG_FUNCPTR (gst_gamma_before_transform);
 }
 
 static void
@@ -388,17 +392,12 @@ invalid_caps:
   return FALSE;
 }
 
-static GstFlowReturn
-gst_gamma_transform_ip (GstBaseTransform * base, GstBuffer * outbuf)
+static void
+gst_gamma_before_transform (GstBaseTransform * base, GstBuffer * outbuf)
 {
   GstGamma *gamma = GST_GAMMA (base);
-  guint8 *data;
-  guint size;
   GstClockTime timestamp, stream_time;
 
-  if (!gamma->process)
-    goto not_negotiated;
-
   timestamp = GST_BUFFER_TIMESTAMP (outbuf);
   stream_time =
       gst_segment_to_stream_time (&base->segment, GST_FORMAT_TIME, timestamp);
@@ -408,6 +407,17 @@ gst_gamma_transform_ip (GstBaseTransform * base, GstBuffer * outbuf)
 
   if (GST_CLOCK_TIME_IS_VALID (stream_time))
     gst_object_sync_values (G_OBJECT (gamma), stream_time);
+}
+
+static GstFlowReturn
+gst_gamma_transform_ip (GstBaseTransform * base, GstBuffer * outbuf)
+{
+  GstGamma *gamma = GST_GAMMA (base);
+  guint8 *data;
+  guint size;
+
+  if (!gamma->process)
+    goto not_negotiated;
 
   if (base->passthrough)
     goto done;