[gst-cvs] gst-plugins-base: xvimagesink: init geometry when setting new xid

Tim Müller tpm at kemper.freedesktop.org
Wed Apr 14 07:32:28 PDT 2010


Module: gst-plugins-base
Branch: master
Commit: 3ec87ee221582ccf7a7f45de611016e840c81643
URL:    http://cgit.freedesktop.org/gstreamer/gst-plugins-base/commit/?id=3ec87ee221582ccf7a7f45de611016e840c81643

Author: Stefan Kost <ensonic at users.sf.net>
Date:   Tue Apr 13 16:20:10 2010 +0300

xvimagesink: init geometry when setting new xid

Don't rely on expose event to query geomentry after new xid is set.

Fixes #615647.

---

 sys/xvimage/xvimagesink.c |   12 ++++++++++++
 1 files changed, 12 insertions(+), 0 deletions(-)

diff --git a/sys/xvimage/xvimagesink.c b/sys/xvimage/xvimagesink.c
index 6b0383c..8298a9a 100644
--- a/sys/xvimage/xvimagesink.c
+++ b/sys/xvimage/xvimagesink.c
@@ -2789,12 +2789,24 @@ gst_xvimagesink_set_xwindow_id (GstXOverlay * overlay, XID xwindow_id)
           GST_VIDEO_SINK_HEIGHT (xvimagesink));
     }
   } else {
+    XWindowAttributes attr;
+
     xwindow = g_new0 (GstXWindow, 1);
     xwindow->win = xwindow_id;
 
     /* Set the event we want to receive and create a GC */
     g_mutex_lock (xvimagesink->x_lock);
+
+    XGetWindowAttributes (xvimagesink->xcontext->disp, xwindow->win, &attr);
+
+    xwindow->width = attr.width;
+    xwindow->height = attr.height;
     xwindow->internal = FALSE;
+    if (!xvimagesink->have_render_rect) {
+      xvimagesink->render_rect.x = xvimagesink->render_rect.y = 0;
+      xvimagesink->render_rect.w = attr.width;
+      xvimagesink->render_rect.h = attr.height;
+    }
     if (xvimagesink->handle_events) {
       XSelectInput (xvimagesink->xcontext->disp, xwindow->win, ExposureMask |
           StructureNotifyMask | PointerMotionMask | KeyPressMask |





More information about the Gstreamer-commits mailing list