From 36470772d630619cacc1d2e669acae42b7e56c56 Mon Sep 17 00:00:00 2001 From: Julien Moutte Date: Thu, 15 Jan 2004 17:16:37 +0000 Subject: gst/videofilter/gstvideobalance.c: Implement passthru if settings are in the middle. Original commit message from CVS: 2004-01-15 Julien MOUTTE * 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. --- ChangeLog | 7 +++++++ gst/videofilter/gstvideobalance.c | 16 ++++++++++++++++ tools/gst-launch-ext.in | 2 +- 3 files changed, 24 insertions(+), 1 deletion(-) diff --git a/ChangeLog b/ChangeLog index 2ea77c23..131c75f5 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,10 @@ +2004-01-15 Julien MOUTTE + + * 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. + 2004-01-15 Ronald Bultje * gst/videofilter/Makefile.am: 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 diff --git a/tools/gst-launch-ext.in b/tools/gst-launch-ext.in index add6e032..45093a8e 100755 --- a/tools/gst-launch-ext.in +++ b/tools/gst-launch-ext.in @@ -56,7 +56,7 @@ sub read_config print "This is not an error, just a friendly reminder... Check the man page.\n\n"; } if (!defined $cfg{AUDIOSINK}) { $cfg{AUDIOSINK} = "osssink"; } - if (!defined $cfg{VIDEOSINK}) { $cfg{VIDEOSINK} = "colorspace ! xvideosink"; } + if (!defined $cfg{VIDEOSINK}) { $cfg{VIDEOSINK} = "colorspace ! ximagesink"; } if (!defined $cfg{CVS_PATH}) { $cfg{CVS_PATH} = `echo -n ~`."/gst/cvs"; } if ($command =~ /(.+)\/gst-launch-ext$/) -- cgit