mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2024-11-18 07:47:17 +00:00
sys/: add 'handle-expose' property. Useful for video widgets which may want to be in control of Expose behaviour. Fix...
Original commit message from CVS: Patch by: Jorn Baayen <jorn at openedhand dot com> * 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
This commit is contained in:
parent
c82275a51d
commit
877fa6035a
5 changed files with 45 additions and 6 deletions
15
ChangeLog
15
ChangeLog
|
@ -1,3 +1,18 @@
|
|||
2007-07-14 Wim Taymans <wim.taymans@gmail.com>
|
||||
|
||||
Patch by: Jorn Baayen <jorn at openedhand dot com>
|
||||
|
||||
* 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 <wim.taymans@gmail.com>
|
||||
|
||||
* gst-libs/gst/rtp/gstbasertppayload.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;
|
||||
|
||||
|
|
|
@ -213,6 +213,7 @@ struct _GstXImageSink {
|
|||
gboolean synchronous;
|
||||
gboolean keep_aspect;
|
||||
gboolean handle_events;
|
||||
gboolean handle_expose;
|
||||
};
|
||||
|
||||
struct _GstXImageSinkClass {
|
||||
|
|
|
@ -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;
|
||||
|
||||
|
|
|
@ -254,6 +254,7 @@ struct _GstXvImageSink {
|
|||
gboolean keep_aspect;
|
||||
gboolean draw_border;
|
||||
gboolean handle_events;
|
||||
gboolean handle_expose;
|
||||
|
||||
gint brightness;
|
||||
gint contrast;
|
||||
|
|
Loading…
Reference in a new issue