<div dir="ltr">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:<div><div><br></div><div><br></div><div>GstElement *playbin = gst_element_factory_make ("playbin", NULL);</div><div>g_object_set (playbin, "uri", "file:///path/to/file.mp4", NULL);</div><div><br></div><div>GtkWdiget *window = gtk_window_new (GTK_WINDOW_TOPLEVEL);</div><div>GtkWidget *video_window = gtk_drawing_area_new ();</div><div>gtk_container_add (GTK_CONTAINER (window), video_window);</div><div><br></div><div>gtk_widget_show_all (window);</div><div><br></div><div>GdkWindow *video_window_xwindow = gtk_widget_get_window (video_window);</div><div>gulong embed_xid = gtk_window_get_xid (video_window_xwindow);</div><div>gst_video_overlay_set_window_handle (GST_VIDEO_OVERLAY (playbin), embed_xid)'</div><div><br></div><div>gst_element_set_state (playbin, GST_STATE_PLAYING);</div></div><div><br></div><div>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.</div><div><br></div><div>Thanks,</div><div>Jack</div></div><div class="gmail_extra"><br><div class="gmail_quote">On Sun, Mar 6, 2016 at 1:00 AM, Sebastian Dröge <span dir="ltr"><<a href="mailto:sebastian@centricular.com" target="_blank">sebastian@centricular.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><span class="">On Sa, 2016-03-05 at 18:47 -0700, Jack Dickerson wrote:<br>
> Greetings,<br>
><br>
> I have taken the tutorial sample<br>
> <a href="https://cgit.freedesktop.org/~slomo/gst-sdk-tutorials/tree/gst-sdk/tu" rel="noreferrer" target="_blank">https://cgit.freedesktop.org/~slomo/gst-sdk-tutorials/tree/gst-sdk/tu</a><br>
> torials/basic-tutorial-5.c<br>
> and modified it by packing two videos in the horizontal box. I<br>
> actually started with four videos, but I get the same problem with<br>
> two.<br>
> Both videos play great with play/pause/stop buttons and a seek bar.I<br>
> also added a zoom and unzoom function.<br>
> For the zoom, I remove one of the videos from the horizontal box and<br>
> the other video fills the main box.<br>
> When I unzoom, I pack the previously removed video back in the box.<br>
> The problem is the newly repacked video does not appear<br>
> unless I stop and restart the videos from the beginning or if I<br>
> slightly modify the entire box by grabbing a corner or side and <br>
> adjust the size of the box.<br>
><br>
> Is there any way to get that video to display after I have repacked<br>
> it without the methods I've described?<br>
<br>
</span>The problem might be that the native X11 window is changing here, not<br>
entirely sure. That would at least explain why restarting makes things<br>
work again.<br>
<br>
A possible solution for you would be to use gtksink or gtkglsink. These<br>
provide you directly a GTK widget that you can put into your UI and<br>
should be robust for these things.<br>
<span class="HOEnZb"><font color="#888888"><br>
--<br>
Sebastian Dröge, Centricular Ltd · <a href="http://www.centricular.com" rel="noreferrer" target="_blank">http://www.centricular.com</a><br>
<br>
</font></span><br>_______________________________________________<br>
gstreamer-devel mailing list<br>
<a href="mailto:gstreamer-devel@lists.freedesktop.org">gstreamer-devel@lists.freedesktop.org</a><br>
<a href="https://lists.freedesktop.org/mailman/listinfo/gstreamer-devel" rel="noreferrer" target="_blank">https://lists.freedesktop.org/mailman/listinfo/gstreamer-devel</a><br>
<br></blockquote></div><br></div>