gst_video_overlay_set_window_handle from GTK#

doon don-prog at mail.ru
Fri Dec 25 19:53:39 PST 2015


I trying to display video in GTK# using Gstreamer via P/Invoke(on Ubuntu). I
tried to use many code samples but nothing is working. Here is one of them:
GTK# code:
	[DllImport("libgstTestDLL.so", CharSet = CharSet.Ansi, CallingConvention =
CallingConvention.Cdecl)]
	public extern static int play_file (StringBuilder path, IntPtr win);
...
play_file (new StringBuilder ().Append
("file:///home/user/Downloads/test.mp4"), screen.GdkWindow.Handle);	

C code:
void play_file(char* path, void* hwnd_ptr){
        GdkWindow* gdkWin = (GdkWindow*)hwnd_ptr;
        pipeline = gst_element_factory_make("playbin", "player");
        g_object_set (G_OBJECT (pipeline), "uri", path, NULL);
        gst_video_overlay_set_window_handle(GST_VIDEO_OVERLAY(pipeline),
GDK_WINDOW_XID(gdkWin));
        gst_element_set_state(pipeline, GST_STATE_PLAYING);
}
After executing play_file function my GTK# app just closes.
How can I correctly use play_file in GTK# and what I need to execute from
play_file function in C to display video in GTK# application? 



--
View this message in context: http://gstreamer-devel.966125.n4.nabble.com/gst-video-overlay-set-window-handle-from-GTK-tp4675032.html
Sent from the GStreamer-devel mailing list archive at Nabble.com.


More information about the gstreamer-devel mailing list