[285/906] fix gl framerate in gst caps. Consider position in xoverlay. Fix inversion...
authorJulien Isorce <julien.isorce@gmail.com>
Sun, 7 Dec 2008 02:25:59 +0000 (03:25 +0100)
committerTim-Philipp Müller <tim@centricular.com>
Sat, 9 Dec 2017 19:31:20 +0000 (19:31 +0000)
gst-libs/gst/gl/gstglwindow_x11.c

index 9c5af6aa074056ced88ca0a36dc9c6c54e77bbd0..e728239fc532c0838f6e63be255a75afb46c3d55 100644 (file)
@@ -362,6 +362,8 @@ gst_gl_window_new (gint width, gint height)
 
   g_debug ("gl window id: %lld\n", (guint64) priv->internal_win_id);
 
+  g_debug ("gl window props: x:%d y:%d w:%d h:%d\n", x, y, width, height);
+
   wm_atoms[0] = XInternAtom (priv->device, "WM_DELETE_WINDOW", True);
   if (wm_atoms[0] == None)
     g_debug ("Cannot create WM_DELETE_WINDOW\n");
@@ -428,6 +430,8 @@ gst_gl_window_set_external_window_id (GstGLWindow *window, guint64 id)
 
     priv->parent = (Window) id;
 
+    g_debug ("set parent window id: %lld\n", id);
+
     XGetWindowAttributes (priv->disp_send, priv->parent, &attr);
 
     XResizeWindow (priv->disp_send, priv->internal_win_id, attr.width, attr.height);
@@ -541,13 +545,21 @@ gst_gl_window_draw (GstGLWindow *window)
         XWindowAttributes attr_parent;
         XGetWindowAttributes (priv->disp_send, priv->parent, &attr_parent);
 
-        if (attr.width != attr_parent.width || attr.height != attr_parent.height)
+        if (attr.x != attr_parent.x || attr.y != attr_parent.y ||
+            attr.width != attr_parent.width || attr.height != attr_parent.height)
         {
-          XResizeWindow (priv->disp_send, priv->internal_win_id, attr_parent.width, attr_parent.height);
+          XMoveResizeWindow (priv->disp_send, priv->internal_win_id, attr_parent.x, attr_parent.y,
+            attr_parent.width, attr_parent.height);
           XSync (priv->disp_send, FALSE);
 
+          attr.x = attr_parent.x;
+          attr.y = attr_parent.y;
+
           attr.width = attr_parent.width;
           attr.height = attr_parent.height;
+
+          g_debug ("parent resize:  %d, %d, %d, %d\n", attr_parent.x, attr_parent.y,
+            attr_parent.width, attr_parent.height);
         }
       }
 
@@ -624,8 +636,6 @@ gst_gl_window_run_loop (GstGLWindow *window)
             custom_cb (custom_data);
           }
 
-          g_debug("signal\n");
-
           g_cond_signal (priv->cond_send_message);
         }