Why this xvimagesink_handle_xevents() has two part of xevent monitoring?

tt ystoto at gmail.com
Sat Aug 1 06:36:59 PDT 2015


Hi, there


Does anybody know why this xvimagesink_handle_xevents() has  two part of
xevent monitoring?
all the xevents can be took by XNextEvents() , but I can't understand why
it needs XCheckWindowEvents above.
Please let me know about it.




3 XCheckWindowEvents
1 XNextEvent


gst_xvimagesink_handle_xevents (GstXvImageSink * xvimagesink) {
...
while (XCheckWindowEvent (xvimagesink->xcontext->disp,
xvimagesink->xwindow->win, ExposureMask | StructureNotifyMask, &e)) { switch
(e.type) { case Expose: exposed = TRUE; break; case ConfigureNotify:
g_mutex_unlock (&xvimagesink->x_lock);
gst_xvimagesink_xwindow_update_geometry (xvimagesink); g_mutex_lock
(&xvimagesink->x_lock); configured = TRUE; break; default: break; } } if
(xvimagesink->handle_expose && (exposed || configured)) { g_mutex_unlock
(&xvimagesink->x_lock); g_mutex_unlock (&xvimagesink->flow_lock);
gst_xvimagesink_expose (GST_VIDEO_OVERLAY (xvimagesink)); g_mutex_lock
(&xvimagesink->flow_lock); g_mutex_lock (&xvimagesink->x_lock); } /* Handle
Display events */ while (XPending (xvimagesink->xcontext->disp)) {
XNextEvent (xvimagesink->xcontext->disp, &e); switch (e.type) { case
ClientMessage:{ Atom wm_delete; wm_delete = XInternAtom
(xvimagesink->xcontext->disp, "WM_DELETE_WINDOW", True); if (wm_delete !=
None && wm_delete == (Atom) e.xclient.data.l[0]) { /* Handle window
deletion by posting an error on the bus */ GST_ELEMENT_ERROR (xvimagesink,
RESOURCE, NOT_FOUND, ("Output window was closed"), (NULL)); g_mutex_unlock
(&xvimagesink->x_lock); gst_xvimagesink_xwindow_destroy (xvimagesink,
xvimagesink->xwindow); xvimagesink->xwindow = NULL; ... }
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.freedesktop.org/archives/gstreamer-devel/attachments/20150801/f3326109/attachment-0001.html>


More information about the gstreamer-devel mailing list