I am attempting to create a memory mapped region so that I can read
the contents of the frame buffer.  I have changed the permission
accordingly so that I can access the framebuffer. (things work fine if
I just use the random access file directly, however I assume it's
slower)

When I run the following lines:

RandomAccessFile fin = new RandomAccessFile("/dev/graphics/fb0", "r");
IntBuffer ib = fin.getChannel().map(
        FileChannel.MapMode.READ_ONLY, 0, 4 * screenWidth *
screenHeight)
        .asIntBuffer();

I get the following error:

java.io.IOException: Invalid argument
        at org.apache.harmony.luni.platform.OSFileSystem.truncate(Native
Method)
        at
org.apache.harmony.nio.internal.FileChannelImpl.mapImpl(FileChannelImpl.java:
195)
        at
org.apache.harmony.nio.internal.ReadOnlyFileChannel.map(ReadOnlyFileChannel.java:
95)
        at ...

When I run the equivalent thing in C using mmap the code executes
fine.  One thing I have noticed is that the size() method of the file
channel returned from fin.getChannel() is 0 (which doesn't seem
right).

Does anyone have any idea what is going on here and if I can make this
work somehow?

-- 
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en

Reply via email to