<div dir="ltr">why don't you use gtksink for video rendering ? gtksink have a Gtk.Widget "widget" property. add this widget to your Gtk.Window</div><div class="gmail_extra"><br><div class="gmail_quote">2015-12-26 4:53 GMT+01:00 doon <span dir="ltr"><<a href="mailto:don-prog@mail.ru" target="_blank">don-prog@mail.ru</a>></span>:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">I trying to display video in GTK# using Gstreamer via P/Invoke(on Ubuntu). I<br>
tried to use many code samples but nothing is working. Here is one of them:<br>
GTK# code:<br>
        [DllImport("libgstTestDLL.so", CharSet = CharSet.Ansi, CallingConvention =<br>
CallingConvention.Cdecl)]<br>
        public extern static int play_file (StringBuilder path, IntPtr win);<br>
...<br>
play_file (new StringBuilder ().Append<br>
("file:///home/user/Downloads/test.mp4"), screen.GdkWindow.Handle);<br>
<br>
C code:<br>
void play_file(char* path, void* hwnd_ptr){<br>
        GdkWindow* gdkWin = (GdkWindow*)hwnd_ptr;<br>
        pipeline = gst_element_factory_make("playbin", "player");<br>
        g_object_set (G_OBJECT (pipeline), "uri", path, NULL);<br>
        gst_video_overlay_set_window_handle(GST_VIDEO_OVERLAY(pipeline),<br>
GDK_WINDOW_XID(gdkWin));<br>
        gst_element_set_state(pipeline, GST_STATE_PLAYING);<br>
}<br>
After executing play_file function my GTK# app just closes.<br>
How can I correctly use play_file in GTK# and what I need to execute from<br>
play_file function in C to display video in GTK# application?<br>
<br>
<br>
<br>
--<br>
View this message in context: <a href="http://gstreamer-devel.966125.n4.nabble.com/gst-video-overlay-set-window-handle-from-GTK-tp4675032.html" rel="noreferrer" target="_blank">http://gstreamer-devel.966125.n4.nabble.com/gst-video-overlay-set-window-handle-from-GTK-tp4675032.html</a><br>
Sent from the GStreamer-devel mailing list archive at Nabble.com.<br>
_______________________________________________<br>
gstreamer-devel mailing list<br>
<a href="mailto:gstreamer-devel@lists.freedesktop.org">gstreamer-devel@lists.freedesktop.org</a><br>
<a href="http://lists.freedesktop.org/mailman/listinfo/gstreamer-devel" rel="noreferrer" target="_blank">http://lists.freedesktop.org/mailman/listinfo/gstreamer-devel</a><br>
</blockquote></div><br></div>