summaryrefslogtreecommitdiffstats
path: root/gst/videofilter/gstvideobalance.c
diff options
context:
space:
mode:
authorJulien Moutte <julien@moutte.net>2004-01-15 17:16:37 +0000
committerJulien Moutte <julien@moutte.net>2004-01-15 17:16:37 +0000
commit36470772d630619cacc1d2e669acae42b7e56c56 (patch)
treed6f1e8f7ace584f2ac5c2ccae59027c7f9b33450 /gst/videofilter/gstvideobalance.c
parent13bee94964d97359e3f4bc383cefc278b2beb3aa (diff)
gst/videofilter/gstvideobalance.c: Implement passthru if settings are in the middle.
Original commit message from CVS: 2004-01-15 Julien MOUTTE <julien@moutte.net> * gst/videofilter/gstvideobalance.c: (gst_videobalance_init), (gst_videobalance_colorbalance_set_value): Implement passthru if settings are in the middle. * tools/gst-launch-ext.in: Stop using xvideosink, use ximagesink.
Diffstat (limited to 'gst/videofilter/gstvideobalance.c')
-rw-r--r--gst/videofilter/gstvideobalance.c16
1 files changed, 16 insertions, 0 deletions
diff --git a/gst/videofilter/gstvideobalance.c b/gst/videofilter/gstvideobalance.c
index 590f92ba..5a863184 100644
--- a/gst/videofilter/gstvideobalance.c
+++ b/gst/videofilter/gstvideobalance.c
@@ -207,6 +207,8 @@ gst_videobalance_init (GTypeInstance *instance, gpointer g_class)
videobalance->brightness = 0;
videobalance->saturation = 1;
videobalance->hue = 0;
+
+ videofilter->passthru = TRUE;
/* Generate the channels list */
for (i = 0; i < (sizeof (channels) / sizeof (char *)); i++)
@@ -257,9 +259,11 @@ gst_videobalance_colorbalance_set_value (GstColorBalance *balance,
gint value)
{
GstVideobalance *vb = GST_VIDEOBALANCE (balance);
+ GstVideofilter *vf = GST_VIDEOFILTER (vb);
g_return_if_fail (vb != NULL);
g_return_if_fail (GST_IS_VIDEOBALANCE (vb));
+ g_return_if_fail (GST_IS_VIDEOFILTER (vf));
g_return_if_fail (channel->label != NULL);
if (!g_ascii_strcasecmp (channel->label, "HUE"))
@@ -270,6 +274,18 @@ gst_videobalance_colorbalance_set_value (GstColorBalance *balance,
vb->brightness = (value + 1000.0) * 2.0 / 2000.0 - 1.0;
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;
+ }
}
static gint