gst_video_overlay_set_window_handle from GTK#

doon don-prog at mail.ru
Sat Dec 26 07:59:53 PST 2015


Sebastian Dröge-3 wrote
> On Fr, 2015-12-25 at 19:53 -0800, doon wrote:
>> 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(pipelin
>> e),
>> 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? 
> 
> Here's an example using gstreamer-sharp:
> http://cgit.freedesktop.org/gstreamer/gstreamer-sharp/tree/samples/BasicTutorial5.cs#n57
> 
> Try reproducing what that does with your code :)
> 
> 
> Alternatively, how does the application "just close"? Some kind of
> crash or assertion that is hit, any warnings on the terminal?
> 
> -- 
> Sebastian Dröge, Centricular Ltd · http://www.centricular.com
> 
> 
> _______________________________________________
> gstreamer-devel mailing list

> gstreamer-devel at .freedesktop

> http://lists.freedesktop.org/mailman/listinfo/gstreamer-devel
> 
> 
> signature.asc (968 bytes)
> <http://gstreamer-devel.966125.n4.nabble.com/attachment/4675036/0/signature.asc>

I tried to use debug info and run my applications, CLion project(which
contains my Gstreamer code on C) output this:
/usr/bin/cli: symbol lookup error:
/home/user/MonoDevelopProjects/GTKSharpGstDllCaller/GTKSharpGstDllCaller/bin/Release/libgstTestDLL.so:
undefined symbol: gst_video_overlay_get_type



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


More information about the gstreamer-devel mailing list