[gst-devel] gst-python and GstXOverlay
soto at informatik.uni-kl.de
Tue Nov 9 03:35:01 CET 2004
First, the general problem: I'm trying to write a Python application
that creates a video playing pipeline (gst-python rocks!) and displays
the video on a Gtk window (pygtk also rocks, by the way :-).
I already managed to access the GstXOverlay interface in the xvimagesink
element inside my pipeline, and can invoke the set_xwindow_id on it.
However, as soon as I do that, the program dies with the following
The program 'main.py' received an X Window System error.
This probably reflects a bug in the program.
The error was 'BadWindow (invalid Window parameter)'.
(Details: serial 32 error_code 3 request_code 3 minor_code 0)
(Note to programmers: normally, X errors are reported asynchronously;
that is, you will receive the error a while after causing it.
To debug your program, run it with the --sync command line
option to change this behavior. You can then get a meaningful
backtrace from your debugger if you break on the gdk_x_error()
I was able to trace the error to the following code in xvimagesink.c,
(end of the gst_xvimagesink_set_xwindow_id function, line 1633):
/* We get window geometry, set the event we want to receive,
and create a GC */
XGetWindowAttributes (xvimagesink->xcontext->disp, xwindow->win, &attr);
<<<Error happens here>>>
xwindow->width = attr.width;
xwindow->height = attr.height;
xwindow->internal = FALSE;
XSelectInput (xvimagesink->xcontext->disp, xwindow->win, ExposureMask |
StructureNotifyMask | PointerMotionMask | KeyPressMask |
xwindow->gc = XCreateGC (xvimagesink->xcontext->disp,
xwindow->win, 0, NULL);
As far as I can tell, XGetWindowAttributes only fails this way if it
gets an XID that doesn't correspond to a window. I checked the XID
directly before passing it to XGetWindowAttributes, and it actually
corresponds to the window, as xwininfo shows.
The python code I'm using to create the window is the following:
self.drawing = gtk.DrawingArea()
self.videoWin = gtk.gdk.Window (
set_xwindow_id will later be called with self.videoWin.xid as parameter.
I have no idea what else to check. I'd really appreciate some help with
Thanks a lot,
Martin Soto <soto at informatik.uni-kl.de>
More information about the gstreamer-devel