From 63c5053a287b88e152d73bddf36c7f89d1969b10 Mon Sep 17 00:00:00 2001 From: Julien Moutte Date: Sun, 18 Jan 2004 12:32:19 +0000 Subject: sys/ximage/ximagesink.c: Adding synchronous property for debugging. Original commit message from CVS: 2004-01-18 Julien MOUTTE * sys/ximage/ximagesink.c: (gst_ximagesink_set_property), (gst_ximagesink_get_property), (gst_ximagesink_class_init): Adding synchronous property for debugging. * sys/ximage/ximagesink.h: Adding the synchronous boolean flag. * sys/xvimage/xvimagesink.c: (gst_xvimagesink_xcontext_get), (gst_xvimagesink_set_property): Moving a pointer declaration to a smaller block, fixing indent. --- sys/ximage/ximagesink.c | 17 ++++++++++++++++- sys/ximage/ximagesink.h | 2 ++ sys/xvimage/xvimagesink.c | 4 ++-- 3 files changed, 20 insertions(+), 3 deletions(-) (limited to 'sys') diff --git a/sys/ximage/ximagesink.c b/sys/ximage/ximagesink.c index cdfc7316d..d491adffa 100644 --- a/sys/ximage/ximagesink.c +++ b/sys/ximage/ximagesink.c @@ -53,7 +53,8 @@ GST_STATIC_PAD_TEMPLATE ( enum { ARG_0, - ARG_DISPLAY + ARG_DISPLAY, + ARG_SYNCHRONOUS /* FILL ME */ }; @@ -1078,6 +1079,13 @@ gst_ximagesink_set_property (GObject *object, guint prop_id, case ARG_DISPLAY: ximagesink->display_name = g_strdup (g_value_get_string (value)); break; + case ARG_SYNCHRONOUS: + ximagesink->synchronous = g_value_get_boolean (value); + if (ximagesink->xcontext) { + XSynchronize (ximagesink->xcontext->disp, + ximagesink->synchronous); + } + break; default: G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec); break; @@ -1099,6 +1107,9 @@ gst_ximagesink_get_property (GObject *object, guint prop_id, case ARG_DISPLAY: g_value_set_string (value, g_strdup (ximagesink->display_name)); break; + case ARG_SYNCHRONOUS: + g_value_set_boolean (value, ximagesink->synchronous); + break; default: G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec); break; @@ -1206,6 +1217,10 @@ gst_ximagesink_class_init (GstXImageSinkClass *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_ximagesink_dispose; gobject_class->set_property = gst_ximagesink_set_property; diff --git a/sys/ximage/ximagesink.h b/sys/ximage/ximagesink.h index c26d8037c..fba3360f6 100644 --- a/sys/ximage/ximagesink.h +++ b/sys/ximage/ximagesink.h @@ -122,6 +122,8 @@ struct _GstXImageSink { GMutex *pool_lock; GSList *image_pool; + + gboolean synchronous; }; struct _GstXImageSinkClass { diff --git a/sys/xvimage/xvimagesink.c b/sys/xvimage/xvimagesink.c index 3c1ac29a2..00951d7b5 100644 --- a/sys/xvimage/xvimagesink.c +++ b/sys/xvimage/xvimagesink.c @@ -714,7 +714,6 @@ gst_xvimagesink_xcontext_get (GstXvImageSink *xvimagesink) /* Generate the channels list */ for (i = 0; i < (sizeof (channels) / sizeof (char *)); i++) { - GstColorBalanceChannel *channel; XvAttribute *matching_attr = NULL; if (xv_attr != NULL) @@ -725,6 +724,7 @@ gst_xvimagesink_xcontext_get (GstXvImageSink *xvimagesink) } if (matching_attr) { + GstColorBalanceChannel *channel; 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; @@ -1452,7 +1452,7 @@ gst_xvimagesink_set_property (GObject *object, guint prop_id, xvimagesink->synchronous = g_value_get_boolean (value); if (xvimagesink->xcontext) { XSynchronize (xvimagesink->xcontext->disp, - xvimagesink->synchronous); + xvimagesink->synchronous); } break; default: -- cgit v1.2.3