<div class="gmail_quote">2010/3/2 Jan Schmidt <span dir="ltr">&lt;<a href="mailto:thaytan@noraisin.net">thaytan@noraisin.net</a>&gt;</span><br><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
<br>
You should ensure in Application A, that you call XSync, or<br>
gdk_display_sync (gdk_display_get_default()) - otherwise by the time<br>
Application B accesses the Window XID, it might not yet actually exist<br>
in the X server, leading to the crash.<br>
<br></blockquote><div><br>I&#39;m working on the same kind of problem but I&#39;ve noticed that Application B will sometimes create a window for a split second, i&#39;m guessing right before the set_xwindow_id call. Can this be avoided? I know this API has changed recently. I&#39;m using Ubunty 8.04, with glib1.2.10 and the following gstreamer releases installed:<br>
<br>gstreamer 0.10.25<br>gstreamer-plugin-base 0.10.25<br>gst-plugin-good 0.10.17<br>gst-plugin-bad 0.10.17<br>gst-plugin-ugly 0.10.13<br>gst-ffmpeg 0.10.10.9<br><br>Here&#39;s my code:<br><br>bool handleBusMsg(GstMessage *message)<br>
{<br> if (!gst_structure_has_name(message-&gt;structure, &quot;prepare-xwindow-id&quot;))<br>        return false;<br><br>    gdk_threads_enter();<br>    gst_x_overlay_set_xwindow_id(GST_X_OVERLAY(GST_MESSAGE_SRC(message)), getXWindow());<br>
    gdk_threads_leave();<br>}<br><br> Thanks,<br> Tristan<br><br></div><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
- Jan.<br>
<div class="im"><br>
On Sat, 2010-02-27 at 17:23 -0800, yiliang wrote:<br>
</div><div class="im">&gt; Hi,<br>
&gt;<br>
&gt; I have 2 applications. One application (application A) creates a window, and<br>
&gt; sends the window ID to another application (application B). application B<br>
&gt; has a gstreamer video pipeline that uses xvimagesink to display the video as<br>
&gt; overlay in the window using the window ID provided by application A. I am<br>
&gt; sorry if it sounds a little confusing. This is to separate UI from pipeline.<br>
&gt;<br>
&gt; Following function is used to configure xvimagesink with window ID:<br>
&gt;<br>
&gt;     gst_x_overlay_set_xwindow_id(GST_X_OVERLAY(xvimagesink), winId);<br>
&gt;<br>
&gt; Most of time it works fine, but sometimes I encounter the following problem,<br>
&gt; and the application B is terminated:<br>
&gt;<br>
&gt; X Error of failed request:  BadWindow (invalid Window parameter)<br>
&gt;   Major opcode of failed request:  3 (X_GetWindowAttributes)<br>
&gt;   Resource id in failed request:  0x400016f<br>
&gt;   Serial number of failed request:  32<br>
&gt;   Current serial number in output stream:  33<br>
&gt;<br>
&gt; After some debugging, I found the error was generated in function<br>
&gt; gst_xvimagesink_set_xwindow_id() when it called the following function:<br>
&gt;<br>
&gt; XGetWindowAttributes<br>
&gt;<br>
&gt; Could anyone give some hint how to fix this problem?<br>
&gt;<br>
&gt; Thanks,<br>
&gt; Yiliang<br>
&gt;<br>
<br>
<br>
--<br>
</div><font color="#888888">Jan Schmidt &lt;<a href="mailto:thaytan@noraisin.net">thaytan@noraisin.net</a>&gt;<br>
</font><div><div></div><div class="h5"><br>
<br>
------------------------------------------------------------------------------<br>
Download Intel&amp;#174; Parallel Studio Eval<br>
Try the new software tools for yourself. Speed compiling, find bugs<br>
proactively, and fine-tune applications for parallel performance.<br>
See why Intel Parallel Studio got high marks during beta.<br>
<a href="http://p.sf.net/sfu/intel-sw-dev" target="_blank">http://p.sf.net/sfu/intel-sw-dev</a><br>
_______________________________________________<br>
gstreamer-devel mailing list<br>
<a href="mailto:gstreamer-devel@lists.sourceforge.net">gstreamer-devel@lists.sourceforge.net</a><br>
<a href="https://lists.sourceforge.net/lists/listinfo/gstreamer-devel" target="_blank">https://lists.sourceforge.net/lists/listinfo/gstreamer-devel</a><br>
</div></div></blockquote></div><br><br clear="all"><br>-- <br>Tristan Matthews<br>email: <a href="mailto:tristan@sat.qc.ca">tristan@sat.qc.ca</a><br>web: <a href="http://tristanswork.blogspot.com">http://tristanswork.blogspot.com</a><br>