diff --git a/ChangeLog b/ChangeLog index 6ab7c8d370..278c625877 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,18 @@ +2007-07-14 Wim Taymans + + Patch by: Jorn Baayen + + * sys/ximage/ximagesink.c: (gst_ximagesink_handle_xevents), + (gst_ximagesink_set_property), (gst_ximagesink_get_property), + (gst_ximagesink_init), (gst_ximagesink_class_init): + * sys/ximage/ximagesink.h: + * sys/xvimage/xvimagesink.c: (gst_xvimagesink_handle_xevents), + (gst_xvimagesink_set_property), (gst_xvimagesink_get_property), + (gst_xvimagesink_init), (gst_xvimagesink_class_init): + * sys/xvimage/xvimagesink.h: + add 'handle-expose' property. Useful for video widgets which may want to + be in control of Expose behaviour. Fixes #380625 + 2007-07-14 Wim Taymans * gst-libs/gst/rtp/gstbasertppayload.c: diff --git a/sys/ximage/ximagesink.c b/sys/ximage/ximagesink.c index 6acc167864..a3612f8a2e 100644 --- a/sys/ximage/ximagesink.c +++ b/sys/ximage/ximagesink.c @@ -166,8 +166,8 @@ enum PROP_SYNCHRONOUS, PROP_PIXEL_ASPECT_RATIO, PROP_FORCE_ASPECT_RATIO, - PROP_HANDLE_EVENTS - /* FILL ME */ + PROP_HANDLE_EVENTS, + PROP_HANDLE_EXPOSE }; static GstVideoSinkClass *parent_class = NULL; @@ -1035,7 +1035,7 @@ gst_ximagesink_handle_xevents (GstXImageSink * ximagesink) } } - if (exposed || configured) { + if (ximagesink->handle_expose && (exposed || configured)) { g_mutex_unlock (ximagesink->x_lock); g_mutex_unlock (ximagesink->flow_lock); @@ -2041,6 +2041,9 @@ gst_ximagesink_set_property (GObject * object, guint prop_id, gst_ximagesink_set_event_handling (GST_X_OVERLAY (ximagesink), g_value_get_boolean (value)); break; + case PROP_HANDLE_EXPOSE: + ximagesink->handle_expose = g_value_get_boolean (value); + break; default: G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec); break; @@ -2074,6 +2077,9 @@ gst_ximagesink_get_property (GObject * object, guint prop_id, case PROP_HANDLE_EVENTS: g_value_set_boolean (value, ximagesink->handle_events); break; + case PROP_HANDLE_EXPOSE: + g_value_set_boolean (value, ximagesink->handle_expose); + break; default: G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec); break; @@ -2168,6 +2174,7 @@ gst_ximagesink_init (GstXImageSink * ximagesink) ximagesink->synchronous = FALSE; ximagesink->keep_aspect = FALSE; ximagesink->handle_events = TRUE; + ximagesink->handle_expose = TRUE; } static void @@ -2216,6 +2223,10 @@ gst_ximagesink_class_init (GstXImageSinkClass * klass) g_param_spec_boolean ("handle-events", "Handle XEvents", "When enabled, XEvents will be selected and handled", TRUE, G_PARAM_READWRITE)); + g_object_class_install_property (gobject_class, PROP_HANDLE_EXPOSE, + 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)); gstelement_class->change_state = gst_ximagesink_change_state; diff --git a/sys/ximage/ximagesink.h b/sys/ximage/ximagesink.h index 99c4f6fa09..a974b5e44e 100644 --- a/sys/ximage/ximagesink.h +++ b/sys/ximage/ximagesink.h @@ -213,6 +213,7 @@ struct _GstXImageSink { gboolean synchronous; gboolean keep_aspect; gboolean handle_events; + gboolean handle_expose; }; struct _GstXImageSinkClass { diff --git a/sys/xvimage/xvimagesink.c b/sys/xvimage/xvimagesink.c index 0ea4a0f4cf..2a784c41da 100644 --- a/sys/xvimage/xvimagesink.c +++ b/sys/xvimage/xvimagesink.c @@ -194,8 +194,8 @@ enum ARG_FORCE_ASPECT_RATIO, ARG_HANDLE_EVENTS, ARG_DEVICE, - ARG_DEVICE_NAME - /* FILL ME */ + ARG_DEVICE_NAME, + ARG_HANDLE_EXPOSE }; static GstVideoSinkClass *parent_class = NULL; @@ -1172,7 +1172,7 @@ gst_xvimagesink_handle_xevents (GstXvImageSink * xvimagesink) } } - if (exposed || configured) { + if (xvimagesink->handle_expose && (exposed || configured)) { g_mutex_unlock (xvimagesink->x_lock); g_mutex_unlock (xvimagesink->flow_lock); @@ -2851,6 +2851,9 @@ gst_xvimagesink_set_property (GObject * object, guint prop_id, case ARG_DEVICE: xvimagesink->adaptor_no = atoi (g_value_get_string (value)); break; + case ARG_HANDLE_EXPOSE: + xvimagesink->handle_expose = g_value_get_boolean (value); + break; default: G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec); break; @@ -2912,6 +2915,9 @@ gst_xvimagesink_get_property (GObject * object, guint prop_id, g_value_set_string (value, NULL); } break; + case ARG_HANDLE_EXPOSE: + g_value_set_boolean (value, xvimagesink->handle_expose); + break; default: G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec); break; @@ -3011,6 +3017,7 @@ gst_xvimagesink_init (GstXvImageSink * xvimagesink) xvimagesink->keep_aspect = FALSE; xvimagesink->handle_events = TRUE; xvimagesink->par = NULL; + xvimagesink->handle_expose = TRUE; } static void @@ -3077,6 +3084,10 @@ gst_xvimagesink_class_init (GstXvImageSinkClass * klass) g_object_class_install_property (gobject_class, ARG_DEVICE_NAME, g_param_spec_string ("device-name", "Adaptor name", "The name of the video adaptor", NULL, G_PARAM_READABLE)); + g_object_class_install_property (gobject_class, ARG_HANDLE_EXPOSE, + 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)); gobject_class->finalize = gst_xvimagesink_finalize; diff --git a/sys/xvimage/xvimagesink.h b/sys/xvimage/xvimagesink.h index 3ccbb370f9..b1ea165a63 100644 --- a/sys/xvimage/xvimagesink.h +++ b/sys/xvimage/xvimagesink.h @@ -254,6 +254,7 @@ struct _GstXvImageSink { gboolean keep_aspect; gboolean draw_border; gboolean handle_events; + gboolean handle_expose; gint brightness; gint contrast;