docs: gst-launch -> gst-launch-1.0 and ffmpegcolorspace -> videoconvert
[platform/upstream/gstreamer.git] / gst / videofilter / gstvideobalance.c
index 1233378..4653b24 100644 (file)
@@ -32,7 +32,7 @@
  * <refsect2>
  * <title>Example launch line</title>
  * |[
- * gst-launch videotestsrc ! videobalance saturation=0.0 ! ffmpegcolorspace ! ximagesink
+ * gst-launch-1.0 videotestsrc ! videobalance saturation=0.0 ! videoconvert ! ximagesink
  * ]| This pipeline converts the image to black and white by setting the
  * saturation to 0.0.
  * </refsect2>
@@ -156,13 +156,16 @@ gst_video_balance_is_passthrough (GstVideoBalance * videobalance)
 static void
 gst_video_balance_update_properties (GstVideoBalance * videobalance)
 {
-  gboolean passthrough = gst_video_balance_is_passthrough (videobalance);
+  gboolean passthrough;
   GstBaseTransform *base = GST_BASE_TRANSFORM (videobalance);
 
-  gst_base_transform_set_passthrough (base, passthrough);
-
+  GST_OBJECT_LOCK (videobalance);
+  passthrough = gst_video_balance_is_passthrough (videobalance);
   if (!passthrough)
     gst_video_balance_update_tables (videobalance);
+  GST_OBJECT_UNLOCK (videobalance);
+
+  gst_base_transform_set_passthrough (base, passthrough);
 }
 
 static void
@@ -431,15 +434,10 @@ gst_video_balance_transform_frame_ip (GstVideoFilter * vfilter,
   if (!videobalance->process)
     goto not_negotiated;
 
-  /* if no change is needed, we are done */
-  if (gst_base_transform_is_passthrough (GST_BASE_TRANSFORM (vfilter)))
-    goto done;
-
   GST_OBJECT_LOCK (videobalance);
   videobalance->process (videobalance, frame);
   GST_OBJECT_UNLOCK (videobalance);
 
-done:
   return GST_FLOW_OK;
 
   /* ERRORS */
@@ -504,7 +502,7 @@ gst_video_balance_class_init (GstVideoBalanceClass * klass)
           DEFAULT_PROP_SATURATION,
           GST_PARAM_CONTROLLABLE | G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS));
 
-  gst_element_class_set_details_simple (gstelement_class, "Video balance",
+  gst_element_class_set_static_metadata (gstelement_class, "Video balance",
       "Filter/Effect/Video",
       "Adjusts brightness, contrast, hue, saturation on a video stream",
       "David Schleef <ds@schleef.org>");
@@ -516,6 +514,7 @@ gst_video_balance_class_init (GstVideoBalanceClass * klass)
 
   trans_class->before_transform =
       GST_DEBUG_FUNCPTR (gst_video_balance_before_transform);
+  trans_class->transform_ip_on_passthrough = FALSE;
 
   vfilter_class->set_info = GST_DEBUG_FUNCPTR (gst_video_balance_set_info);
   vfilter_class->transform_frame_ip =
@@ -713,8 +712,8 @@ gst_video_balance_set_property (GObject * object, guint prop_id,
       break;
   }
 
-  gst_video_balance_update_properties (balance);
   GST_OBJECT_UNLOCK (balance);
+  gst_video_balance_update_properties (balance);
 
   if (label) {
     GstColorBalanceChannel *channel =