Using GstVideoOverlay on Mac

doon don-prog at mail.ru
Thu Mar 10 00:35:29 UTC 2016


Sebastian Dröge-3 wrote
> On Di, 2016-03-08 at 17:35 -0800, doon wrote:
>> Sorry, some things is not obvious for me. 
>> So, I added «-x objective-c++» in «Other C++ Flags» and
>> «/usr/local/Cellar/gtk+/2.24.29/lib/gtk-2.0/include» in «Header
>> Search
>> Paths».
>> Now I try to compile:  
>> guintptr window_handle =
>> (guintptr)gdk_quartz_window_get_nsview(gdkWin);
>> 
>> but get: 
>> Undefined symbols for architecture x86_64:
>>   "_gdk_quartz_window_get_nsview", referenced from:
>>       GstAPI::play_file(char*, void*) in gstLib.o
>> ld: symbol(s) not found for architecture x86_64
>> clang: error: linker command failed with exit code 1 (use -v to see
>> invocation)
>> 
>> How can I solve this?
> 
> Link against the gdk-quartz-2.0 library.
> 
> -- 
> Sebastian Dröge, Centricular Ltd · http://www.centricular.com
> 
> 
> _______________________________________________
> gstreamer-devel mailing list

> gstreamer-devel at .freedesktop

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

Ok, thanks! I got it! Now I linked this .dylib with
libgdk-quartz-2.0.0.dylib. But when I try to use this library with my GTK#
project I get this exception:

Stack overflow in unmanaged: IP: 0x10fbf6a29, fault addr: 0x7fff53024fa8
Stack overflow in unmanaged: IP: 0x10fbf6a29, fault addr: 0x7fff53022fa8
Stack overflow in unmanaged: IP: 0x10fbf6a29, fault addr: 0x7fff53021fa8
Stack overflow in unmanaged: IP: 0x10fbf6a29, fault addr: 0x7fff53020fa8
Stack overflow in unmanaged: IP: 0x10fbf6a29, fault addr: 0x7fff5301ffa8
Stack overflow in unmanaged: IP: 0x10fbf6a29, fault addr: 0x7fff5301efa8
Stack overflow in unmanaged: IP: 0x10fbf6a29, fault addr: 0x7fff5301dfa8
Stack overflow: IP: 0x10fbf6a29, fault addr: 0x7fff5301bfa8
Stacktrace:
  at <unknown> <0xffffffff>
  at Gtk.Application.Run () [0x00001] in
/private/tmp/source-mono-mac-4.2.0-branch-64/bockbuild-mono-4.2.0-branch/profiles/mono-mac-xamarin/build-root/gtk-sharp-2.12.21/gtk/Application.cs:135
  <...>
  at GTKSharpDLLTest.MainClass.Main (string[]) [0x00012] in
/Users/user/Documents/XamarinStudioProjects/GTKSharpDLLTest/GTKSharpDLLTest/Program.cs:13
  at (wrapper runtime-invoke) <Module>.runtime_invoke_void_object
(object,intptr,intptr,intptr) <IL 0x00051, 0x0030a>

It's interesting that I get that exception only when I trying to move my
cursor over the video rendering area in the GTK# app.
_________________________________________________
GTK# code:
[DllImport("libgstLibrary.dylib", EntryPoint="play_file", CharSet =
CharSet.Ansi, CallingConvention = CallingConvention.Cdecl)]
public extern static void play_file (StringBuilder path, IntPtr win);
…
play_file (new StringBuilder ().Append
("file:///Users/user/Downloads/test.mp4"), drawingarea1.GdkWindow.Handle);
_________________________________________________
libgstLibrary.dylib .h:
…
#include <gst/gst.h>
#include <gst/video/videooverlay.h>
#include <gdk/gdkquartz.h>
#define DLL_PUBLIC __attribute__ ((visibility ("default")))


namespace GstAPI
{
    extern "C" DLL_PUBLIC void play_file(char* path, void* hwnd_ptr);
}
…
_________________________________________________
libgstLibrary.dylib .cpp:
#include "gstLibrary.h"

namespace GstAPI{
    GstElement *pipeline;

    void play_file(char* path, void* hwnd_ptr){
        gst_init(NULL, NULL);

        GdkWindow* gdkWin = (GdkWindow*)hwnd_ptr;
        pipeline = gst_element_factory_make("playbin", "player");
        g_object_set (G_OBJECT (pipeline), "uri", path, NULL);
        
        gst_element_set_state(pipeline, GST_STATE_NULL);
        
        guintptr window_handle =
(guintptr)gdk_quartz_window_get_nsview(gdkWin);
        gst_video_overlay_set_window_handle(GST_VIDEO_OVERLAY(pipeline),
window_handle);

        gst_element_set_state(pipeline, GST_STATE_PLAYING);

    }
}
_________________________________________________
Can it be due to I use Hackintosh without any video kext?
Maybe you can suggest some solutions to this problem?
Many thanks!



--
View this message in context: http://gstreamer-devel.966125.n4.nabble.com/Using-GstVideoOverlay-on-Mac-tp4675141p4676263.html
Sent from the GStreamer-devel mailing list archive at Nabble.com.


More information about the gstreamer-devel mailing list