diff options
author | David Schleef <ds@schleef.org> | 2004-01-16 23:52:53 +0000 |
---|---|---|
committer | David Schleef <ds@schleef.org> | 2004-01-16 23:52:53 +0000 |
commit | 4ac1a134ec275406f72ab4660d793e1cd387ded7 (patch) | |
tree | 6b542e9573ec43c949c0b6d835683285b391946f /gst/videofilter/gstvideobalance.c | |
parent | a62547cfe32fba11f69da8218cdd1aac14688131 (diff) |
gst/videofilter/gstvideobalance.c: Fix regression; changing a property affects the video stream.
Original commit message from CVS:
* gst/videofilter/gstvideobalance.c: Fix regression; changing a
property affects the video stream.
* sys/xvimage/xvimagesink.c:
* sys/xvimage/xvimagesink.h:
Add synchronous property for debugging. Should probably be
disabled in non-CVS builds. Make sure that the Xv attribute
exists before we set it (crash!). Fix a silly float bug that
caused colorbalance to just not work.
Diffstat (limited to 'gst/videofilter/gstvideobalance.c')
-rw-r--r-- | gst/videofilter/gstvideobalance.c | 26 |
1 files changed, 15 insertions, 11 deletions
diff --git a/gst/videofilter/gstvideobalance.c b/gst/videofilter/gstvideobalance.c index 5a863184..029d7d3e 100644 --- a/gst/videofilter/gstvideobalance.c +++ b/gst/videofilter/gstvideobalance.c @@ -65,6 +65,7 @@ static void gst_videobalance_interface_init (GstImplementsInterfaceClass *klass) static void gst_videobalance_colorbalance_init (GstColorBalanceClass *iface); static void gst_videobalance_dispose (GObject *object); +static void gst_videobalance_update_properties (GstVideobalance *videobalance); GType gst_videobalance_get_type (void) @@ -275,17 +276,7 @@ gst_videobalance_colorbalance_set_value (GstColorBalance *balance, else if (!g_ascii_strcasecmp (channel->label, "CONTRAST")) vb->contrast = (value + 1000.0) * 2.0 / 2000.0; - /* Maybe we should narrow values which are around median to trigger passthru - more often */ - if (vb->contrast == 1 && vb->brightness == 0 && - vb->hue == 0 && vb->saturation == 1) - { - vf->passthru = TRUE; - } - else - { - vf->passthru = FALSE; - } + gst_videobalance_update_properties (vb); } static gint @@ -321,6 +312,17 @@ gst_videobalance_colorbalance_init (GstColorBalanceClass *iface) } static void +gst_videobalance_update_properties (GstVideobalance *videobalance) +{ + if (videobalance->contrast == 1.0 && videobalance->brightness == 0.0 && + videobalance->hue == 0.0 && videobalance->saturation == 1.0) { + GST_VIDEOFILTER (videobalance)->passthru = TRUE; + } else { + GST_VIDEOFILTER (videobalance)->passthru = FALSE; + } +} + +static void gst_videobalance_set_property (GObject *object, guint prop_id, const GValue *value, GParamSpec *pspec) { GstVideobalance *src; @@ -346,6 +348,8 @@ gst_videobalance_set_property (GObject *object, guint prop_id, const GValue *val default: break; } + + gst_videobalance_update_properties (src); } static void |