Hi All,
I'm working on a real-time communication application on Android
platform. Due to the nature of the application, I am accessing the
Camera device from the native space by using the Android CameraService
using the interface provided by ui/Camera.h .
On Motorola Droid, I can register the CameraListener callback, and
receive both the Preview and the Record frames without any problem.
So everything is working fine for me on Droid.
Now I'm trying to get the application running on HTC Nexus One phone.
I can still receive the callbacks, but when I try to access the actual
frame bytes through:
sp<IMemoryHeap> heap = dataPtr->getMemory(&offset, &size);
I'm getting the following errors on the log:
E/IMemory ( 451): cannot map BpMemoryHeap (binder=0x38e408),
size=1851392, fd=44 (Invalid argument)
I searched the Android platform code for the error, I found out that
it is occurring in the:
platform/frameworks/base/libs/binder/IMemory.cpp line: 319
when the mmap fails.
Since mmap was returning EINVAL, I tried to identify which actual file/
pipe/socket is the fd=44 assigned to. I looked into /proc/451/fd,
and I found out that the file descriptor 44 is not even open when I'm
getting those errors. Which clarified the reason for mmap failing, but
not why the file is no longer open.
I repeated the same test on Droid, and I looked into the list of file
descriptors, and there was no gap.
The log messages does not give any clue, so I just wanted to ask if
anyone had a similar problem before?
The strange thing is that, when I initialize the Camera, if I set the
preview callback flag FRAME_CALLBACK_FLAG_COPY_OUT_MASK, then I can
receive frames on HTC Nexus One as well (only in postData callback).
But this is something I don't want to do since the copy out is
actually doing a memcpy internally for every frame and it is big
performance issue for the application.
Thanks in advance for your help.
Regards,
-Onur
---
www.zdo.com