From 312c0bd5bab4d194ad64aabb524fe07c50e4de41 Mon Sep 17 00:00:00 2001 From: Bastien Nocera Date: Sat, 14 Jul 2007 18:33:15 +0000 Subject: [PATCH] sys/xvimage/xvimagesink.*: Add option to turn off double-buffering for debugging purposes. Original commit message from CVS: Patch by: Bastien Nocera * sys/xvimage/xvimagesink.c: (gst_xvimagesink_get_xv_support), (gst_xvimagesink_set_property), (gst_xvimagesink_get_property), (gst_xvimagesink_init), (gst_xvimagesink_class_init): * sys/xvimage/xvimagesink.h: Add option to turn off double-buffering for debugging purposes. Fixes #437169. --- ChangeLog | 11 +++++++++++ sys/xvimage/xvimagesink.c | 16 ++++++++++++++-- sys/xvimage/xvimagesink.h | 1 + 3 files changed, 26 insertions(+), 2 deletions(-) diff --git a/ChangeLog b/ChangeLog index 278c625..1c2a39c 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,16 @@ 2007-07-14 Wim Taymans + Patch by: Bastien Nocera + + * sys/xvimage/xvimagesink.c: (gst_xvimagesink_get_xv_support), + (gst_xvimagesink_set_property), (gst_xvimagesink_get_property), + (gst_xvimagesink_init), (gst_xvimagesink_class_init): + * sys/xvimage/xvimagesink.h: + Add option to turn off double-buffering for debugging purposes. + Fixes #437169. + +2007-07-14 Wim Taymans + Patch by: Jorn Baayen * sys/ximage/ximagesink.c: (gst_ximagesink_handle_xevents), diff --git a/sys/xvimage/xvimagesink.c b/sys/xvimage/xvimagesink.c index 2a784c4..4a5dff1 100644 --- a/sys/xvimage/xvimagesink.c +++ b/sys/xvimage/xvimagesink.c @@ -195,7 +195,8 @@ enum ARG_HANDLE_EVENTS, ARG_DEVICE, ARG_DEVICE_NAME, - ARG_HANDLE_EXPOSE + ARG_HANDLE_EXPOSE, + ARG_DOUBLE_BUFFER }; static GstVideoSinkClass *parent_class = NULL; @@ -1330,7 +1331,8 @@ gst_xvimagesink_get_xv_support (GstXvImageSink * xvimagesink, if (!strcmp (attr[i].name, dbl_buffer)) { const Atom atom = XInternAtom (xcontext->disp, dbl_buffer, False); - XvSetPortAttribute (xcontext->disp, xcontext->xv_port_id, atom, 1); + XvSetPortAttribute (xcontext->disp, xcontext->xv_port_id, atom, + (xvimagesink->double_buffer ? 1 : 0)); break; } @@ -2854,6 +2856,9 @@ gst_xvimagesink_set_property (GObject * object, guint prop_id, case ARG_HANDLE_EXPOSE: xvimagesink->handle_expose = g_value_get_boolean (value); break; + case ARG_DOUBLE_BUFFER: + xvimagesink->double_buffer = g_value_get_boolean (value); + break; default: G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec); break; @@ -2918,6 +2923,9 @@ gst_xvimagesink_get_property (GObject * object, guint prop_id, case ARG_HANDLE_EXPOSE: g_value_set_boolean (value, xvimagesink->handle_expose); break; + case ARG_DOUBLE_BUFFER: + g_value_set_boolean (value, xvimagesink->double_buffer); + break; default: G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec); break; @@ -3013,6 +3021,7 @@ gst_xvimagesink_init (GstXvImageSink * xvimagesink) xvimagesink->pool_lock = g_mutex_new (); xvimagesink->synchronous = FALSE; + xvimagesink->double_buffer = TRUE; xvimagesink->running = FALSE; xvimagesink->keep_aspect = FALSE; xvimagesink->handle_events = TRUE; @@ -3088,6 +3097,9 @@ gst_xvimagesink_class_init (GstXvImageSinkClass * klass) g_param_spec_boolean ("handle-expose", "Handle expose", "When enabled, " "the current frame will always be drawn in response to X Expose " "events", TRUE, G_PARAM_READWRITE)); + g_object_class_install_property (gobject_class, ARG_DOUBLE_BUFFER, + g_param_spec_boolean ("double-buffer", "Double-buffer", + "Whether to double-buffer the output", TRUE, G_PARAM_READWRITE)); gobject_class->finalize = gst_xvimagesink_finalize; diff --git a/sys/xvimage/xvimagesink.h b/sys/xvimage/xvimagesink.h index b1ea165..7142d2a 100644 --- a/sys/xvimage/xvimagesink.h +++ b/sys/xvimage/xvimagesink.h @@ -251,6 +251,7 @@ struct _GstXvImageSink { GSList *image_pool; gboolean synchronous; + gboolean double_buffer; gboolean keep_aspect; gboolean draw_border; gboolean handle_events; -- 2.7.4