From 112f838c1881ec6e8b0fddb0fe5ab285c72173b2 Mon Sep 17 00:00:00 2001 From: David Schleef Date: Fri, 16 Jan 2004 23:52:53 +0000 Subject: [PATCH] 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. --- ChangeLog | 11 +++++++++++ sys/xvimage/xvimagesink.c | 35 ++++++++++++++++++++++++++--------- sys/xvimage/xvimagesink.h | 2 ++ 3 files changed, 39 insertions(+), 9 deletions(-) diff --git a/ChangeLog b/ChangeLog index 9ed47f9..6aab2c8 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,14 @@ +2004-01-16 David Schleef + + * 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. + 2004-01-17 Christian Schaller * tools/gst-launch-ext.in - update for new plugins diff --git a/sys/xvimage/xvimagesink.c b/sys/xvimage/xvimagesink.c index 7efa4f1..3c1ac29 100644 --- a/sys/xvimage/xvimagesink.c +++ b/sys/xvimage/xvimagesink.c @@ -64,7 +64,8 @@ enum { ARG_BRIGHTNESS, ARG_HUE, ARG_SATURATION, - ARG_DISPLAY + ARG_DISPLAY, + ARG_SYNCHRONOUS /* FILL ME */ }; @@ -338,7 +339,7 @@ gst_xvimagesink_update_colorbalance (GstXvImageSink *xvimagesink) g_object_ref (channel); /* Our range conversion coef */ - convert_coef = (channel->max_value - channel->min_value) / 2000; + convert_coef = (channel->max_value - channel->min_value) / 2000.0; if (g_ascii_strcasecmp (channel->label, "XV_HUE") == 0) { @@ -723,13 +724,15 @@ gst_xvimagesink_xcontext_get (GstXvImageSink *xvimagesink) matching_attr = xv_attr + j; } - channel = g_object_new (GST_TYPE_COLOR_BALANCE_CHANNEL, NULL); - channel->label = g_strdup (channels[i]); - channel->min_value = matching_attr ? matching_attr->min_value : -1000; - channel->max_value = matching_attr ? matching_attr->max_value : 1000; - - xcontext->channels_list = g_list_append (xcontext->channels_list, - channel); + if (matching_attr) { + channel = g_object_new (GST_TYPE_COLOR_BALANCE_CHANNEL, NULL); + channel->label = g_strdup (channels[i]); + channel->min_value = matching_attr ? matching_attr->min_value : -1000; + channel->max_value = matching_attr ? matching_attr->max_value : 1000; + + xcontext->channels_list = g_list_append (xcontext->channels_list, + channel); + } } if (xv_attr) @@ -1445,6 +1448,13 @@ gst_xvimagesink_set_property (GObject *object, guint prop_id, case ARG_DISPLAY: xvimagesink->display_name = g_strdup (g_value_get_string (value)); break; + case ARG_SYNCHRONOUS: + xvimagesink->synchronous = g_value_get_boolean (value); + if (xvimagesink->xcontext) { + XSynchronize (xvimagesink->xcontext->disp, + xvimagesink->synchronous); + } + break; default: G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec); break; @@ -1478,6 +1488,9 @@ gst_xvimagesink_get_property (GObject *object, guint prop_id, case ARG_DISPLAY: g_value_set_string (value, g_strdup (xvimagesink->display_name)); break; + case ARG_SYNCHRONOUS: + g_value_set_boolean (value, xvimagesink->synchronous); + break; default: G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec); break; @@ -1600,6 +1613,10 @@ gst_xvimagesink_class_init (GstXvImageSinkClass *klass) g_object_class_install_property (gobject_class, ARG_DISPLAY, g_param_spec_string ("display", "Display", "X Display name", NULL, G_PARAM_READWRITE)); + g_object_class_install_property (gobject_class, ARG_SYNCHRONOUS, + g_param_spec_boolean ("synchronous", "Synchronous", "When enabled, runs " + "the X display in synchronous mode. (used only for debugging)", FALSE, + G_PARAM_READWRITE)); gobject_class->dispose = gst_xvimagesink_dispose; gobject_class->set_property = gst_xvimagesink_set_property; diff --git a/sys/xvimage/xvimagesink.h b/sys/xvimage/xvimagesink.h index 7027fd5..6e6be5d 100644 --- a/sys/xvimage/xvimagesink.h +++ b/sys/xvimage/xvimagesink.h @@ -144,6 +144,8 @@ struct _GstXvImageSink { GMutex *pool_lock; GSList *image_pool; + + gboolean synchronous; }; struct _GstXvImageSinkClass { -- 2.7.4