Hardware Accelleration / Playing Video
I'm trying to display video using Java, but I'm having real problems getting the speed I desire.
I get an array of bytes which represents the uncompressed pixels of the current video frame from some C code using the JNI. This Byte array is part of a DataBufferByte, which is part of a WritableRaster, which is part of a BufferedImage. Loading the bytes this way can be done at a full 30 frames per second (fps) and uses less than half of my CPU. However, when I try to render this BufferedImage to the screen or to a VolitileImage, it takes all of my CPU and I can achieve at best a mere 15 fps.
I think my problem is that the pixels are being loaded into system memory instead of video memory. No matter what priority settings or -D command line options I use, the BufferedImage I create never seems to be hardware accelerated. I've tried both Java 1.5 and 1.6 also, but isAccelerated() always returns false for my BufferedImages made from WritableRasters.
I can create a VolitileImage that is hardware accelerated, but I have no way of accessing the pixel buffer associated with it, in order to load new video frames in. Rendering the BufferedImage into this VolitileImage is almost as slow as rendering it straight to the screen (but not quite, oddly enough). Does anyone have any ideas on how to load raw, uncompressed pixel data into an accelerated image?
Background:
The application I'm working on must play video in a Java window. This application must run on both Linux and Windows (so no using Quicktime for Java) and it must handle multiple videos at once (so I can't use OpenGL in C since OpenGL doesn't support multiple threads at all). I tried using IBM's MPEG for Java but it was far too slow. I lookd at the JMF, but it seems to be old, unsupported and disliked, plus it does not support all the formats I need. The only solution that seems fast enough (and platform independent) is to use the ffmpeg library (which is also used by mplayer and vlc). However, since ffmpeg is a C library, this requires using the JNI.
If there is no way to improve the rendering speed in Java, I may have to write separate rendering algorithms in C using DirectX for Windows and XVideo for Linux. I would like to avoid this if possible. Thanks for any help.

