Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
[platform-swt-dev] Re: [platform-dev] obtain a X11 Display handle from a swt widget in linux

Nicolas Gendron (nicolas.gendron@xxxxxxxxx):

> I'm looking for a way to play video media in a SWT interface.  I was
> looking for JMF (java media framework) but it is slow on my computer.
> 
> So I discovered FFMPEG, a codec library.  They provide a little
> application called ffplay which uses the plugin and play video files
> in a X11 Window.  They use X11 Display.  Is it possible to go deep in
> the implementation of SWT to obtain a X11 Display?
> 
> I know the application will not be multi platform if I do that, but
> for the moment it is ok for me.

  You don't have to go too deep.  If you create a Composite with the
style bit SWT.EMBEDDED, it will create a GtkSocket.  This will set the
variable composite.embeddedHandle on that composite to be the window ID
which you can pass to clients which support XEMBED.

  http://developer.gnome.org/doc/API/2.0/gtk/GtkSocket.html

  IIRC, ffplay uses SDL to display video.  If so, you could probably
fork off an ffplay process after setting the SDL_WINDOWID environment
variable to be the embeddedHandle of the composite.  I think this might
"just work".

  -Billy



Back to the top