window: make gst_vaapi_window_reconfigure() thread-safe.
authorGwenole Beauchesne <gwenole.beauchesne@intel.com>
Fri, 25 Jul 2014 15:29:40 +0000 (17:29 +0200)
committerGwenole Beauchesne <gwenole.beauchesne@intel.com>
Fri, 25 Jul 2014 15:36:12 +0000 (17:36 +0200)
Ensure the X11 implementation for GstVaapiWindow::get_geometry() is
thread-safe by default, so that upper layer users don't need to handle
that explicitly.

gst-libs/gst/vaapi/gstvaapiwindow_x11.c

index 20470ed..776c7d8 100644 (file)
@@ -295,8 +295,12 @@ gst_vaapi_window_x11_get_geometry (GstVaapiWindow * window,
 {
   Display *const dpy = GST_VAAPI_OBJECT_XDISPLAY (window);
   const Window xid = GST_VAAPI_OBJECT_ID (window);
+  gboolean success;
 
-  return x11_get_geometry (dpy, xid, px, py, pwidth, pheight, NULL);
+  GST_VAAPI_OBJECT_LOCK_DISPLAY (window);
+  success = x11_get_geometry (dpy, xid, px, py, pwidth, pheight, NULL);
+  GST_VAAPI_OBJECT_UNLOCK_DISPLAY (window);
+  return success;
 }
 
 static gboolean