[gst-cvs] gst-plugins-good: videobalance: Emit "value-changed" signal of color balance interface when values change
Sebastian Dröge
slomo at kemper.freedesktop.org
Thu Apr 29 10:36:23 PDT 2010
Module: gst-plugins-good
Branch: master
Commit: ea06bd33f8eb28e355043318cc2526f8693224f2
URL: http://cgit.freedesktop.org/gstreamer/gst-plugins-good/commit/?id=ea06bd33f8eb28e355043318cc2526f8693224f2
Author: Sebastian Dröge <sebastian.droege at collabora.co.uk>
Date: Sun Apr 18 22:06:44 2010 +0200
videobalance: Emit "value-changed" signal of color balance interface when values change
---
gst/videofilter/gstvideobalance.c | 30 ++++++++++++++++++++++++++++++
1 files changed, 30 insertions(+), 0 deletions(-)
diff --git a/gst/videofilter/gstvideobalance.c b/gst/videofilter/gstvideobalance.c
index f69ce08..278727e 100644
--- a/gst/videofilter/gstvideobalance.c
+++ b/gst/videofilter/gstvideobalance.c
@@ -518,36 +518,59 @@ gst_video_balance_colorbalance_init (GstColorBalanceClass * iface)
iface->get_value = gst_video_balance_colorbalance_get_value;
}
+static GstColorBalanceChannel *
+gst_video_balance_find_channel (GstVideoBalance * balance, const gchar * label)
+{
+ GList *l;
+
+ for (l = balance->channels; l; l = l->next) {
+ GstColorBalanceChannel *channel = l->data;
+
+ if (g_ascii_strcasecmp (channel->label, label) == 0)
+ return channel;
+ }
+ return NULL;
+}
+
static void
gst_video_balance_set_property (GObject * object, guint prop_id,
const GValue * value, GParamSpec * pspec)
{
GstVideoBalance *balance = GST_VIDEO_BALANCE (object);
gdouble d;
+ const gchar *label = NULL;
switch (prop_id) {
case PROP_CONTRAST:
d = g_value_get_double (value);
GST_DEBUG_OBJECT (balance, "Changing contrast from %lf to %lf",
balance->contrast, d);
+ if (d != balance->contrast)
+ label = "CONTRAST";
balance->contrast = d;
break;
case PROP_BRIGHTNESS:
d = g_value_get_double (value);
GST_DEBUG_OBJECT (balance, "Changing brightness from %lf to %lf",
balance->brightness, d);
+ if (d != balance->brightness)
+ label = "BRIGHTNESS";
balance->brightness = d;
break;
case PROP_HUE:
d = g_value_get_double (value);
GST_DEBUG_OBJECT (balance, "Changing hue from %lf to %lf", balance->hue,
d);
+ if (d != balance->hue)
+ label = "HUE";
balance->hue = d;
break;
case PROP_SATURATION:
d = g_value_get_double (value);
GST_DEBUG_OBJECT (balance, "Changing saturation from %lf to %lf",
balance->saturation, d);
+ if (d != balance->saturation)
+ label = "SATURATION";
balance->saturation = d;
break;
default:
@@ -556,6 +579,13 @@ gst_video_balance_set_property (GObject * object, guint prop_id,
}
gst_video_balance_update_properties (balance);
+
+ if (label) {
+ GstColorBalanceChannel *channel =
+ gst_video_balance_find_channel (balance, label);
+ gst_color_balance_value_changed (GST_COLOR_BALANCE (balance), channel,
+ gst_color_balance_get_value (GST_COLOR_BALANCE (balance), channel));
+ }
}
static void
More information about the Gstreamer-commits
mailing list