1

I'm developing for a program that uses DirectFB and GStreamer-0.10. I'm using gst_x_overlay_set_xwindow_id() from the gstxoverlay library of GStreamer to tell GStreamer to render to the window created by DirectFB. gst_x_overlay_set_xwindow_id() requires that I give it the ID of the X Window I want to render to, but I can't seem to find a way to get that from DirectFB.

Is there any way to get the X Window ID of the window created by DirectFB? If there isn't any easy way, is there a way to do some hackery with DirectFB's source files to accomplish this?

Alex
  • 109
  • 11

1 Answers1

0

There must be Window window; like line somewhere in your code of directfb. Try to expose it to the gstreamer code.

Take the window handle from there and then you can use the below function

gst_x_overlay_set_window_handle(GST_X_OVERLAY(yoursinkvariable), (guintptr) windowhandle);

Not exactly in the way you were asking, but this might also resolve the problem.

Moreover, gst_x_overlay_set_xwindow_id() is deprecated.

From the documentation,
Warning

gst_x_overlay_set_xwindow_id is deprecated and should not be used in newly-written code. Use gst_x_overlay_set_window_handle() instead.

user2618142
  • 1,035
  • 2
  • 18
  • 35
  • Thank you for the tip with the deprecated function. As for the how to get the handle on the window, there isn't anything like `Window window;` in my DirectFB code. I believe I may have found a way to get it using the `IDirectFB` that's created, though. It looks a little something like [this](http://hastebin.com/xavitaxola.coffee). With that, I now get this error: **`X11/Core: Error! BadDrawable (invalid Pixmap or Window parameter)`**. Does this mean I have the wrong handle, or is it because both GStreamer and DirectFB are trying to render to the same window at the same time? – Alex Sep 20 '13 at 21:23