Re: Gstreamer inside Gtkmm window



On 05/07/10 11:25, Mattia Donna Bianco wrote:
> Hi,
> I'm trying to insert a gstreamer output inside a Gtk window. I managed
> to do that but I would to reserve to the gstreamer output just a portion
> of the entire window; in fact I associated the output with a
> Gtk::DrawingArea, but when the video plays the video frame acquires all
> the toplevel window area. How can I prevent that? I set the size of the
> Gtk::DrawingArea with the  function set_size_request(width,height). Here
> is my code:
> 
> GstElement *pipeline;
>     loop = g_main_loop_new (NULL, FALSE);
>     pipeline = gst_pipeline_new ("gst-player");
> 
>     bin = gst_element_factory_make ("playbin", "bin");
>     videosink = gst_element_factory_make ("directdrawsink", "videosink");
> 
>     g_object_set (G_OBJECT (bin), "video-sink", videosink, NULL);
> 
>     gst_bin_add (GST_BIN (pipeline), bin);
>     {
>         GstBus *bus;
>         bus = gst_pipeline_get_bus (GST_PIPELINE (pipeline));
>         gst_bus_add_watch (bus, bus_call, NULL);
>         gst_object_unref (bus);
>     }
> 
>     if (g->getUri()) {
>         g_object_set (G_OBJECT (bin), "uri", g->getUri(), NULL);
>         printf("primo passo.....\n");
>     }
> 
>     window=reinterpret_cast<unsigned
> long>GDK_WINDOW_HWND(g->getFrame()->get_window()->gobj());
> 
>     if (GST_IS_X_OVERLAY (videosink))
>     {
>         gst_x_overlay_set_xwindow_id (GST_X_OVERLAY (videosink), window);
>     }
>    gst_element_set_state (GST_ELEMENT (pipeline), GST_STATE_PLAYING);
> 
> Thank you in advanced,
> 
> Mattia Donna Bianco
> 
> 
> 
> _______________________________________________
> gtkmm-list mailing list
> gtkmm-list gnome org
> http://mail.gnome.org/mailman/listinfo/gtkmm-list

Why do you create a loop object? Doesn't the Gtkmm main loop function
handle that? I'm just asking because I'm trying to do the same thing,
but I'm having other problems. If you could send me your code I'd really
like to see it, and I'll send you anything if I can improve parts of it.

thanks.

-- 
My GnuPGP key at:
www.basementcode.com/public_key.txt


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]