[gst-devel] What could cause the error in xvimagesink (XGetWindowAttributes): X Error of failed request?

Tristan Matthews tristan at sat.qc.ca
Tue Mar 2 21:24:34 CET 2010


2010/3/2 Jan Schmidt <thaytan at noraisin.net>

>
> You should ensure in Application A, that you call XSync, or
> gdk_display_sync (gdk_display_get_default()) - otherwise by the time
> Application B accesses the Window XID, it might not yet actually exist
> in the X server, leading to the crash.
>
>
I'm working on the same kind of problem but I've noticed that Application B
will sometimes create a window for a split second, i'm guessing right before
the set_xwindow_id call. Can this be avoided? I know this API has changed
recently. I'm using Ubunty 8.04, with glib1.2.10 and the following gstreamer
releases installed:

gstreamer 0.10.25
gstreamer-plugin-base 0.10.25
gst-plugin-good 0.10.17
gst-plugin-bad 0.10.17
gst-plugin-ugly 0.10.13
gst-ffmpeg 0.10.10.9

Here's my code:

bool handleBusMsg(GstMessage *message)
{
 if (!gst_structure_has_name(message->structure, "prepare-xwindow-id"))
        return false;

    gdk_threads_enter();
    gst_x_overlay_set_xwindow_id(GST_X_OVERLAY(GST_MESSAGE_SRC(message)),
getXWindow());
    gdk_threads_leave();
}

 Thanks,
 Tristan

- Jan.
>
> On Sat, 2010-02-27 at 17:23 -0800, yiliang wrote:
> > Hi,
> >
> > I have 2 applications. One application (application A) creates a window,
> and
> > sends the window ID to another application (application B). application B
> > has a gstreamer video pipeline that uses xvimagesink to display the video
> as
> > overlay in the window using the window ID provided by application A. I am
> > sorry if it sounds a little confusing. This is to separate UI from
> pipeline.
> >
> > Following function is used to configure xvimagesink with window ID:
> >
> >     gst_x_overlay_set_xwindow_id(GST_X_OVERLAY(xvimagesink), winId);
> >
> > Most of time it works fine, but sometimes I encounter the following
> problem,
> > and the application B is terminated:
> >
> > X Error of failed request:  BadWindow (invalid Window parameter)
> >   Major opcode of failed request:  3 (X_GetWindowAttributes)
> >   Resource id in failed request:  0x400016f
> >   Serial number of failed request:  32
> >   Current serial number in output stream:  33
> >
> > After some debugging, I found the error was generated in function
> > gst_xvimagesink_set_xwindow_id() when it called the following function:
> >
> > XGetWindowAttributes
> >
> > Could anyone give some hint how to fix this problem?
> >
> > Thanks,
> > Yiliang
> >
>
>
> --
> Jan Schmidt <thaytan at noraisin.net>
>
>
>
> ------------------------------------------------------------------------------
> Download Intel&#174; Parallel Studio Eval
> Try the new software tools for yourself. Speed compiling, find bugs
> proactively, and fine-tune applications for parallel performance.
> See why Intel Parallel Studio got high marks during beta.
> http://p.sf.net/sfu/intel-sw-dev
> _______________________________________________
> gstreamer-devel mailing list
> gstreamer-devel at lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/gstreamer-devel
>



-- 
Tristan Matthews
email: tristan at sat.qc.ca
web: http://tristanswork.blogspot.com
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.freedesktop.org/archives/gstreamer-devel/attachments/20100302/26b1756d/attachment.htm>


More information about the gstreamer-devel mailing list