<div dir="ltr">I&nbsp; wrote small example for testing gstreamer features. It based on examples from gstreamer tutorials:<br><i><br>#include &lt;gst/gst.h&gt;<br>#include &lt;gst/interfaces/xoverlay.h&gt;<br>#include &lt;X11/X.h&gt;<br>
#include &lt;X11/Xlib.h&gt;<br><br>static GstBusSyncReply create_window (GstBus * bus, GstMessage * message, GstPipeline * pipeline)<br>{<br>&nbsp;&nbsp;&nbsp; if (GST_MESSAGE_TYPE (message) != GST_MESSAGE_ELEMENT)<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; return GST_BUS_PASS;<br>
<br>&nbsp;&nbsp;&nbsp; if (!gst_structure_has_name (message-&gt;structure, &quot;prepare-xwindow-id&quot;))<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; return GST_BUS_PASS;<br><br>&nbsp;&nbsp;&nbsp; Display *disp = XOpenDisplay(NULL);<br>&nbsp;&nbsp;&nbsp; int snum = DefaultScreen(disp);<br><br>&nbsp;&nbsp;&nbsp; XID win = XCreateSimpleWindow (disp, RootWindow(disp, snum), 0, 0, 640, 480, 0, 0, 0);<br>
&nbsp;&nbsp;&nbsp; XSetWindowBackgroundPixmap (disp, win, None);<br>&nbsp;&nbsp;&nbsp; XMapRaised (disp, win);<br>&nbsp;&nbsp;&nbsp; XSync (disp, FALSE);<br><br>&nbsp;&nbsp;&nbsp; gst_x_overlay_set_xwindow_id (GST_X_OVERLAY (GST_MESSAGE_SRC (message)), win);<br><br>&nbsp;&nbsp;&nbsp; gst_message_unref (message);<br>
<br>&nbsp;&nbsp;&nbsp; return GST_BUS_DROP;<br>}<br><br>int<br>main (int&nbsp;&nbsp; argc,<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; char *argv[])<br>{<br>&nbsp;&nbsp;&nbsp; GMainLoop *loop;<br><br>&nbsp;&nbsp;&nbsp; GstElement *pipeline;<br>&nbsp;&nbsp;&nbsp; GstBus *bus;<br><br>&nbsp;&nbsp;&nbsp; gst_init (&amp;argc, &amp;argv);<br><br>
&nbsp;&nbsp;&nbsp; loop = g_main_loop_new (NULL, FALSE);<br><br>&nbsp;&nbsp;&nbsp; GstXML *xml;<br>&nbsp;&nbsp;&nbsp; xml = gst_xml_new();<br>&nbsp;&nbsp;&nbsp; unsigned char path[] = &quot;pipeline.xml&quot;;<br>&nbsp;&nbsp;&nbsp; gboolean ret = gst_xml_parse_file(xml, path, NULL);<br>&nbsp;&nbsp;&nbsp; g_assert(ret == TRUE);<br>
<br>&nbsp;&nbsp;&nbsp; unsigned char element[] = &quot;pipeline0&quot;;<br>&nbsp;&nbsp;&nbsp; pipeline = gst_xml_get_element (xml, element);<br>&nbsp;&nbsp;&nbsp; g_assert(pipeline != NULL);<br><br>&nbsp;&nbsp;&nbsp; bus = gst_pipeline_get_bus (GST_PIPELINE (pipeline));<br>&nbsp;&nbsp;&nbsp; gst_bus_set_sync_handler (bus, (GstBusSyncHandler) create_window, pipeline);<br>
<br>&nbsp;&nbsp;&nbsp; gst_element_set_state (pipeline, GST_STATE_PLAYING);<br><br>&nbsp;&nbsp;&nbsp; g_main_loop_run (loop);<br><br>&nbsp;&nbsp;&nbsp; gst_element_set_state (pipeline, GST_STATE_NULL);<br>&nbsp;&nbsp;&nbsp; gst_object_unref (GST_OBJECT (pipeline));<br><br>&nbsp;&nbsp;&nbsp; return 0;<br>
}<br></i><br>Where file &quot;pipeline.xml&quot; was generated by executing next command:<br>&nbsp;&nbsp;&nbsp; gst-launch-0.10 videotestsrc ! navigationtest ! xvimagesink -o pipeline.xml<br><br>It seems that this code not work because mouse clicks not handled but mouse moving and key pressing handled. Have you any suggestions?<br>
<br>P.S. I use Ubuntu 8.04 and gstreamer packages from it repository.<br></div>