Hi,<br><br>I&#39;m developing an application, it&#39;s called Gloobus and it wants to be a very fast previewer for any kind of file, you can see some screenhots and download it from here:<br><br><a href="http://gloobus.launchpad.net">http://gloobus.launchpad.net</a><br>
<br>Now, I can reproduce audio files with gstreamer without any problem, but when I try to do it for movies, they play in his own window.<br>I&#39;ve been trying a lot of thing with the xoverlay function that its supposed to be the one to make the video play in a gtk widget but I get an error<br>
<br>If I add the gtk_drawing_area into the GTK_FIXED before I call the xoverlay function, I get a BAD WINDOW error and the application stops.<br>If I add the gtk_drawing_area into the GTK_FIXED after I call the xoverlay function, I get that the gtk drawin has no window or pixmap and it plays in its own window.<br>
<br>Here you have the code, I hope you can see what fails here:<br><br>container is a gtk_fixed added into the main window!<br><br><br><br><br>void iMovie::play(GtkWidget * container)<br>{<br><br>         m_drawable = gtk_drawing_area_new();<br>
         gtk_widget_set_size_request (m_drawable, 600, 500);<br>         gtk_fixed_put(GTK_FIXED(container),m_drawable,SHADOW_WIDTH,SHADOW_WIDTH+HEADER_HEIGHT);<br>                   <br>         g_print(&quot;Start Playing (%s)...\n&quot;,g_file_get_uri ( m_gfile));<br>
<br>         gst_init (NULL, NULL);<br><br>         m_pipeline         = gst_pipeline_new             (&quot;gst-player&quot;);<br>         m_bin               = gst_element_factory_make (&quot;playbin&quot;,       &quot;m_bin&quot;);<br>
         m_sink          = gst_element_factory_make (&quot;xvimagesink&quot;,  &quot;m_sink&quot;);<br>         g_object_set ( G_OBJECT (m_bin), &quot;video-sink&quot;, m_sink, NULL );<br>         gst_bin_add  ( GST_BIN (m_pipeline), m_bin );<br>
<br><br>         {<br>                  GstBus *bus;<br>                  bus = gst_pipeline_get_bus (GST_PIPELINE (m_pipeline));<br>                  gst_object_unref (bus);<br>         }<br><br>         <br>         g_object_set (G_OBJECT (m_bin), &quot;uri&quot;, g_file_get_uri( m_gfile), NULL );<br>
         g_object_set (G_OBJECT (m_sink), &quot;force-aspect-ratio&quot;, TRUE, NULL  );<br>         <br>    <br>             <br>         if (GST_IS_X_OVERLAY (m_sink))<br>            {<br>                  printf(&quot;Is Overlay (Win ID: %i)!!\n&quot;,GPOINTER_TO_INT(GDK_WINDOW_XWINDOW(m_drawable-&gt;window)));<br>
<br>                  gst_x_overlay_set_xwindow_id (GST_X_OVERLAY (m_sink), GPOINTER_TO_INT(GDK_WINDOW_XWINDOW(m_drawable-&gt;window)));<br>                  gst_x_overlay_handle_events  (GST_X_OVERLAY (m_sink), FALSE);<br>
            }<br> <br>         gst_element_set_state (m_pipeline, GST_STATE_PLAYING);<br>          <br>         gtk_widget_show_all(container); <br>}<br clear="all"><br>-- <br>Jordi Hernández Puigdellívol<br>