Refreshing video after a zoom/unzoom like process using GTK

Jack D jackstuff3 at gmail.com
Tue Mar 15 20:22:01 UTC 2016


I'm having difficulty getting my head around how I can use the gtksink
widget. Matthew Waters spoke at what I believe was a Gnome programming
conference in May 2015 and one of the slides he presented had a piece of
code representing something that could be replaced with gtksink.  But then
he did not include any new code showing how it would replace the old code.
Would it be possible to get a sample of how it would look using gtksink?
Here is the code he presented:


GstElement *playbin = gst_element_factory_make ("playbin", NULL);
g_object_set (playbin, "uri", "file:///path/to/file.mp4", NULL);

GtkWdiget *window = gtk_window_new (GTK_WINDOW_TOPLEVEL);
GtkWidget *video_window = gtk_drawing_area_new ();
gtk_container_add (GTK_CONTAINER (window), video_window);

gtk_widget_show_all (window);

GdkWindow *video_window_xwindow = gtk_widget_get_window (video_window);
gulong embed_xid = gtk_window_get_xid (video_window_xwindow);
gst_video_overlay_set_window_handle (GST_VIDEO_OVERLAY (playbin),
embed_xid)'

gst_element_set_state (playbin, GST_STATE_PLAYING);

This would not be an exact representation of what I'm trying to accomplish,
but seeing how this would be done with gtksink should help tremendously.

Thanks,
Jack

On Sun, Mar 6, 2016 at 1:00 AM, Sebastian Dröge <sebastian at centricular.com>
wrote:

> On Sa, 2016-03-05 at 18:47 -0700, Jack Dickerson wrote:
> > Greetings,
> >
> > I have taken the tutorial sample
> > https://cgit.freedesktop.org/~slomo/gst-sdk-tutorials/tree/gst-sdk/tu
> > torials/basic-tutorial-5.c
> > and modified it by packing two videos in the horizontal box. I
> > actually started with four videos, but I get the same problem with
> > two.
> > Both videos play great with play/pause/stop buttons and a seek bar.I
> > also added a zoom and unzoom function.
> > For the zoom, I remove one of the videos from the horizontal box and
> > the other video fills the main box.
> > When I unzoom, I pack the previously removed video back in the box.
> > The problem is the newly repacked video does not appear
> > unless I stop and restart the videos from the beginning or if I
> > slightly modify the entire box by grabbing a corner or side and
> > adjust the size of the box.
> >
> > Is there any way to get that video to display after I have repacked
> > it without the methods I've described?
>
> The problem might be that the native X11 window is changing here, not
> entirely sure. That would at least explain why restarting makes things
> work again.
>
> A possible solution for you would be to use gtksink or gtkglsink. These
> provide you directly a GTK widget that you can put into your UI and
> should be robust for these things.
>
> --
> Sebastian Dröge, Centricular Ltd · http://www.centricular.com
>
>
> _______________________________________________
> gstreamer-devel mailing list
> gstreamer-devel at lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/gstreamer-devel
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.freedesktop.org/archives/gstreamer-devel/attachments/20160315/7e71cb41/attachment.html>


More information about the gstreamer-devel mailing list