in reply to Re: How to pass a Wx::Panel handle to GStreamer to render a video.
in thread How to pass a Wx::Panel handle to GStreamer to render a video.

Hi Anon,

Thanks for the comment.

Well, as it says about the object:

Cast it to an appropriate handle, such as HWND for Windows, Widget for Motif or GtkWidget for GTK. wxPerl Note: This method will return an integer in wxPerl. but I don't know what "cast it" means, nor do I know what the approriate object is. I think it is asking for the Gtk pointer of the wxWindows object, but I don't know how to "cast" an integer into a meaningful Gtk handle Id.

In the c++ it says:

wxASSERT(window);

But again I have no idea what that means in Perl.

$message is a GstMessage from http://gstreamer.freedesktop.org/data/doc/gstreamer/head/gstreamer/html/gstreamer-GstMessage.html#GstMessage

from which $src is derived. GetHandle comes from http://gstreamer.freedesktop.org/data/doc/gstreamer/head/gst-plugins-base-libs/html/gst-plugins-base-libs-gstvideooverlay.html#GstVideoOverlay

I've made liberal use of Glib::Object::Introspection; to do the wrapping, which for the most part does a nice job (baring this unkown).

If you didn't run the code, it gives you a Gtk panel running a test video, and a separate panel with buttons and a space for the video. The two panels are supposed to be superimposed.

Regards

Steve

Replies are listed 'Best First'.
Re^3: How to pass a Wx::Panel handle to GStreamer to render a video.
by Anonymous Monk on May 11, 2014 at 09:57 UTC

    ... wx ... In the c++ it says: ...

    Look at the source of the accepting end, the source of the GStreamer end :)

    Interesting things I found , I think they're related :)

    The latest GstreamerSDK and gst_x_overlay_set_window_handle (ubuntu)

    https://www.linuxquestions.org/questions/linux-desktop-74/how-can-i-fix-error-badwindow-invalid-window-parameter-575745/

    http://gstreamer.freedesktop.org/data/doc/gstreamer/head/gst-plugins-base-libs/html/gst-plugins-base-libs-gstvideooverlay.html has stuff like

    static guintptr video_window_handle = 0; ... if (video_window_handle != 0) { GstVideoOverlay *overlay; // GST_MESSAGE_SRC (message) will be the video sink element overlay = GST_VIDEO_OVERLAY (GST_MESSAGE_SRC (message)); gst_video_overlay_set_window_handle (overlay, video_window_handle); } else { g_warning ("Should have obtained video_window_handle by now!"); } ... #ifdef GDK_WINDOWING_X11 { gulong xid = GDK_WINDOW_XID (gtk_widget_get_window (video_window)) +; video_window_handle = xid; } #endif #ifdef GDK_WINDOWING_WIN32 { HWND wnd = GDK_WINDOW_HWND (gtk_widget_get_window (video_window)); video_window_handle = (guintptr) wnd; } #endif }

    So the possibilities are, get newer version of gstreamer .... call set handle at different time (different signal ... do some "casting"

    So I think you're calling set handle at the correct time ... so get latest gstreamer if not have it? call realize something? Or try "casting" result of GetHandle into whatever "guintptr" means to Glib::Object::Introspection (or Glib)

    I'd also try this --sync backtrace debugging option mentioned in the error message ... could be Glib... is truncating this integer somehow or something stupid that... a better error message might be better :)

    last thing thing I'd try is to do the call with Inline::C :)

    If you didn't run the code, ....

    Yup, on win32, sorry :)

      Hi Anon,

      You are a code warrier without equal.

      Inline C maybe the answer. Look at this: https://developer.gnome.org/glib/2.30/glib-Basic-Types.html#guintptr

      It says:

      guintptr

      typedef unsigned long guintptr;

      Corresponds to the C99 type uintptr_t, an unsigned integer type that can hold any pointer.

      To print or scan values of this type, use G_GINTPTR_MODIFIER and/or G_GUINTPTR_FORMAT.

      Since: 2.18

      So it's just a c-pointer. I'll try it out next week.

      Regards

      Steve.