Hi there,<br><br>I&#39;ve been struggling for the past couple of days trying to overlay video from an xvimagesink onto GTK+ Window and DrawingArea widgets. I&#39;m completely new to GTK+, Glib and GStreamer (and C to some extent) which has made it quite a steep learning curve!! I&#39;ve trawled through documentation, websites and the gst-devel archives and have almost done it...but I must be doing something wrong as the result is very very buggy and intermittent, with various different X Errors being displayed after exit, or causing the program not to execute at all. I am using Ubuntu 9.10 with the latest updates and relevant gstreamer packages installed from the Ubuntu archives.<br>
<br>I have attached a compressed archive with the source for the test program I have written (in the &quot;my-test&quot; folder in the archive) which creates a simple pipeline (videotestsrc -&gt; xvimagesink) and tries to overlay the video onto a DrawArea widget called &quot;vid1&quot;. The GTK window is described in a .ui file and I use the GtkBuilder function to build from this .ui file. <br>
<br>I have also attached the test program I have based it on (from <a href="http://tristanswork.blogspot.com/2008/09/fullscreen-video-in-gstreamer-with-gtk.html">http://tristanswork.blogspot.com/2008/09/fullscreen-video-in-gstreamer-with-gtk.html</a>) in the &quot;tristan-test&quot; folder, with a modified makefile as the one supplied wasn&#39;t working for me. The &quot;tristan-test&quot; only overlays to the Gtk Window widget and works fine except it throws an X error on exit with the messages in the console as follows:<br>
<br>####CONSOLE####<br>you hit f<br>you hit f<br>The program &#39;test&#39; received an X Window System error.<br>This probably reflects a bug in the program.<br>The error was &#39;BadWindow (invalid Window parameter)&#39;.<br>
  (Details: serial 14983 error_code 3 request_code 3 minor_code 0)<br>  (Note to programmers: normally, X errors are reported asynchronously;<br>   that is, you will receive the error a while after causing it.<br>   To debug your program, run it with the --sync command line<br>
   option to change this behavior. You can then get a meaningful<br>   backtrace from your debugger if you break on the gdk_x_error() function.)<br><br>####END CONSOLE####<br><br>When running my test program I get the following situations with the associated errors:<br>
<br>1. Window and video appears fine.<br>#################################<br>Now playing<br>The program &#39;test&#39; received an X Window System error.<br>This probably reflects a bug in the program.<br>The error was &#39;BadWindow (invalid Window parameter)&#39;.<br>
  (Details: serial 414 error_code 3 request_code 3 minor_code 0)<br>  (Note to programmers: normally, X errors are reported asynchronously;<br>   that is, you will receive the error a while after causing it.<br>   To debug your program, run it with the --sync command line<br>
   option to change this behavior. You can then get a meaningful<br>   backtrace from your debugger if you break on the gdk_x_error() function.)<br><br>2. Window and video appears fine.<br>#################################<br>
Now playing<br>The program &#39;test&#39; received an X Window System error.<br>This probably reflects a bug in the program.<br>The error was &#39;BadDrawable (invalid Pixmap or Window parameter)&#39;.<br>  (Details: serial 456 error_code 9 request_code 133 minor_code 19)<br>
  (Note to programmers: normally, X errors are reported asynchronously;<br>   that is, you will receive the error a while after causing it.<br>   To debug your program, run it with the --sync command line<br>   option to change this behavior. You can then get a meaningful<br>
   backtrace from your debugger if you break on the gdk_x_error() function.)<br><br>3. Window appears fine (draws button and drawing area) but doesn&#39;t display test video (drawing area is blank)<br>##########################################################################################################<br>
Now playing<br>test: Fatal IO error 11 (Resource temporarily unavailable) on X server :0.0.<br><br>4. Nothing appears<br>##################<br>Now playing<br>test: Fatal IO error 11 (Resource temporarily unavailable) on X server :0.0.<br>
<br>5. Blank Window which then becomes unresponsive and has to be killed (- there is a bit of a pause before the window loads aswell)<br>#########################################<br>Now playing<br>Killed<br><br>6. No window appears - program fails<br>
#################################<br>Now playing<br>The program &#39;test&#39; received an X Window System error.<br>This probably reflects a bug in the program.<br>The error was &#39;BadIDChoice (invalid resource ID chosen for this connection)&#39;.<br>
  (Details: serial 264 error_code 14 request_code 53 minor_code 0)<br>  (Note to programmers: normally, X errors are reported asynchronously;<br>   that is, you will receive the error a while after causing it.<br>   To debug your program, run it with the --sync command line<br>
   option to change this behavior. You can then get a meaningful<br>   backtrace from your debugger if you break on the gdk_x_error() function.)<br><br><br>I assume the X errors when the program works fine is due to me not exiting properly (as the console should print out &quot;Returned, stopping playback&quot; and &quot;Deleting Pipeline&quot; before it exits). The other errors I assume are due to me programming something wrong, but I just cannot find what!<br>
<br>Any help would be amazing and greatly appreciated!! When I have solved this problem I also plan on writing a newbie guide on using video from GStreamer with GTK+ as there seems to be a massive lack of any such guide!<br>
<br>Many thanks in advance,<br>Nick<br><br>