VLCJ and custom painting on top of a Java component
Posted: 13 Apr 2010 15:48
All,
I’m using JNA in combination with VLC to embed video within a standard Java application. In particular I’m using VLCJ (http://code.google.com/p/vlcj/) to provide a binding between Java and the VLC libraries. Here’s a quick summary of how video is started on a java.awt.Canvas object:
I have no problem getting video to play and stop but what I’d like to also be able to do is add some custom painting on top of the java.awt.Canvas object (for example, draw some lines or text on top of the video). I tried to override the paint(Graphics g) method within the java.awt.Canvas object but when the video actually starts it appears that the video sits on top of my custom painting and in turn you don’t see the custom painting.
I don't think this really is an issue at all with VLC (and I do have a support question into the folks at JNA and VLCJ) but I thought I’d throw it out there and see if anyone had any suggestions or ideas.
Thanks,
Dave Irwin
I’m using JNA in combination with VLC to embed video within a standard Java application. In particular I’m using VLCJ (http://code.google.com/p/vlcj/) to provide a binding between Java and the VLC libraries. Here’s a quick summary of how video is started on a java.awt.Canvas object:
Code: Select all
java.awt.Canvas videoSurface = new MyCustomCanvas();
…
long drawable = Native.getComponentID(videoSurface);
libvlc_exception_t exception = new libvlc_exception_t();
libvlc.libvlc_media_player_set_drawable(mediaPlayerInstance, (int) drawable, exception);
I don't think this really is an issue at all with VLC (and I do have a support question into the folks at JNA and VLCJ) but I thought I’d throw it out there and see if anyone had any suggestions or ideas.
Thanks,
Dave Irwin