Hey Gilles,
Are you using gnu classpath and jamvm ? At one point, I wrote a really
minimal patch for the two of those that actually allowed special (i.e.
device node) files to be memory mapped, so that a MappedByteBuffer
could be created.
The most brain-dead thing that I ever encountered with Java as a
language was the inability to memory-map special files. This wasn't
isolated to classpath / jamvm either - sun-jdk was also culprit.
I originally used the patch to write-to and flip a frame buffer device
in Java with minimal overhead, but there should be no reason why you
can't use it for a v4l device. That would significantly reduce the
amount of overhead in buffering frames, and probably increase the
frame rate for classpath / jamvm users.
It's been a long time since I've used v4l4j, and also a long time
since I posted those patches to classpath, so I have no idea if it's
even relevant today, but it certainly helped me out. Classpath
actually didn't incorporate the patch upstream for VM compliance
reasons, but there is no reason end users should not.
C
[1]
http://comments.gmane.org/gmane.comp.java.classpath.patches/13188