in reply to Re^2: 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.

... 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 :)

  • Comment on Re^3: How to pass a Wx::Panel handle to GStreamer to render a video.
  • Download Code

Replies are listed 'Best First'.
Re^4: How to pass a Wx::Panel handle to GStreamer to render a video.
by Steve_BZ (Chaplain) on May 17, 2014 at 16:06 UTC

    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.