Hi,<br><br>I'm developing an application, it'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'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("Start Playing (%s)...\n",g_file_get_uri ( m_gfile));<br>
<br> gst_init (NULL, NULL);<br><br> m_pipeline = gst_pipeline_new ("gst-player");<br> m_bin = gst_element_factory_make ("playbin", "m_bin");<br>
m_sink = gst_element_factory_make ("xvimagesink", "m_sink");<br> g_object_set ( G_OBJECT (m_bin), "video-sink", 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), "uri", g_file_get_uri( m_gfile), NULL );<br>
g_object_set (G_OBJECT (m_sink), "force-aspect-ratio", TRUE, NULL );<br> <br> <br> <br> if (GST_IS_X_OVERLAY (m_sink))<br> {<br> printf("Is Overlay (Win ID: %i)!!\n",GPOINTER_TO_INT(GDK_WINDOW_XWINDOW(m_drawable->window)));<br>
<br> gst_x_overlay_set_xwindow_id (GST_X_OVERLAY (m_sink), GPOINTER_TO_INT(GDK_WINDOW_XWINDOW(m_drawable->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>