Hi all,<br><br>I&#39;m trying to make a small video player with Gstreamer and Gtk. I&#39;ve seen the blog post on <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> and it helped me a lot. But I need to show real videos, and after I did read the Gstreamer documentation, I figured out that I should use Playbin to display the videos the simpler way. I modified the example I found on the blog to use <br>
Playbin instead of a handmade pipeline. When I run the application I have made, it only displays the Gtk window, without the video that should be on it. No output, no error.<br><br>The code is as below:<br><br>#include &lt;stdio.h&gt;<br>
#include &lt;stdlib.h&gt;<br><br>#include &lt;gst/gst.h&gt;<br>#include &lt;gtk/gtk.h&gt;<br>#include &lt;gst/interfaces/xoverlay.h&gt;<br>#include &lt;gdk/gdk.h&gt;<br>#include &lt;gdk/gdkx.h&gt;<br><br>static gboolean expose_callback(GtkWidget *widget, GdkEventExpose *event, gpointer data){<br>
    gst_x_overlay_set_xwindow_id(GST_X_OVERLAY(data), GDK_WINDOW_XWINDOW(widget-&gt;window));<br>    return TRUE;<br>}<br><br>int main(int argc, char** argv) {<br>    GstStateChangeReturn ret;<br>    GMainLoop *loop;<br>    GstElement *play, *sink;<br>
    GtkWidget *window;<br><br>    /* init GStreamer */<br>    gst_init (&amp;argc, &amp;argv);<br>    gtk_init (&amp;argc, &amp;argv);<br>    loop = g_main_loop_new (NULL, FALSE);<br><br>    /* set up */<br>    play = gst_element_factory_make (&quot;playbin&quot;, &quot;play&quot;);<br>
<br>    sink = gst_element_factory_make(&quot;xvimagesink&quot;, &quot;videosink&quot;);<br>    if (!sink)<br>        g_print (&quot;output could not be found - check your install\n&quot;);<br><br>    g_object_set (G_OBJECT (play), &quot;video-sink&quot;, sink, NULL);<br>
    g_object_set (G_OBJECT (play), &quot;uri&quot;, &quot;file:///home/jp/SpiritOfUbuntu.ogv&quot;, NULL);<br><br>    window = gtk_window_new(GTK_WINDOW_TOPLEVEL);<br>    g_signal_connect(G_OBJECT(window), &quot;expose-event&quot;, G_CALLBACK(expose_callback), sink);<br>
<br>    gtk_widget_show_all(window);<br><br>    gst_element_set_state (play, GST_STATE_PLAYING);<br>    if (ret == GST_STATE_CHANGE_FAILURE) {<br>        g_print (&quot;Failed to start up pipeline!\n&quot;);<br>    }<br><br>
    /* now run */<br>    g_main_loop_run (loop);<br><br>    /* also clean up */<br>    gst_element_set_state (play, GST_STATE_NULL);<br>    gst_object_unref (GST_OBJECT (play));<br><br>    return (EXIT_SUCCESS);<br>}<br><br>
<br>Any help will be very apreciated.<br><br><br>Thanks a lot,<br><br>Joao Paulo<br>