Hello, I want to use GStreamer for displaying video in a control within
a window. In fact it's a subclass of wxControl.
I'm using the documented method which works fine on Linux and Windows,
which is to determine the native window id of the wxControl like this:
#ifdef __WXGTK__
GdkWindow *gdk_window = gtk_widget_get_window(m_wxwindow);
m_video_window_handle = GDK_WINDOW_XID(gdk_window);
#endif
#ifdef __WXMSW__
m_video_window_handle = (gulong)GetHWND();
#endif
And then in the sync callback:
gst_video_overlay_set_window_handle(overlay, m_video_window_handle);
As I say, this works on Windows & Linux. But on Mac it doesn't and I'm
wondering whether I am using the wrong id. I'm using this:
#ifdef __WXMAC__
NSView *wxw = GetPeer()->GetWXWidget();
m_video_window_handle = (gulong)wxw;
#endif
But the result is, no video at all. If I omit the call to
gst_video_overlay_set_window_handle then the video displays, but in a
new window of its own, which is not what I want.
- maybe GetPeer()->GetWXWidget() is not really a NSView*
- maybe it's a pointer to the wrong NSView
- maybe gst_video_overlay_set_window_handle doesn't want a NSView* but
something else instead.
Has anyone out there done this? Ideas welcome. Of course I will ask the
GStreamer people if I don't solve it here. But the question of what
exactly is returned by GetPeer()->GetWXWidget() is a wxWidgets question.
Thanks,
Andy Robinson, Seventh String Software,
www.seventhstring.com