Hi all, I've been trying to support generic UVC cameras on android and have been successful so far with getting the native camera app to display preview images until I tested my code with skype video call and got stuck with a buffer memory problem. To break it down,
1. I'm using the yuv422i-yuyv format since it's the only pixel format supported by the uvc camera (Vimicro chipset) that i'm testing. I have also set CameraService::Client::registerPreviewBuffers() to support HAL_PIXEL_FORMAT_YCbCr_422_I in CameraService.cpp. 2. I set the size of my preview heap to 'PreviewHeap = width x height x 2' since YUV422 takes up 4 bytes per 2 pixels. >From logcat, I get this: D/CameraHardware(28343): PREVIEW SIZE: w=320 h=240 framerate=30 E/CameraHardware(28343): virtual android::status_t android::CameraHardware::startPreview() : D/V4L2Camera(28343): USB Camera now streaming... D/libEGL (28734): loaded /system/lib/egl/libGLES_android.so D/libEGL (28734): loaded /vendor/lib/egl/libEGL_POWERVR_SGX540_120.so D/libEGL (28734): loaded /vendor/lib/egl/libGLESv1_CM_POWERVR_SGX540_120.so D/libEGL (28734): loaded /vendor/lib/egl/libGLESv2_POWERVR_SGX540_120.so *E/Camera-JNI(28734): Manually set buffer was too small! Expected 153600 bytes, but got 115201!* *E/Camera-JNI(28734): Manually set buffer was too small! Expected 153600 bytes, but got 115201!* *E/Camera-JNI(28734): Manually set buffer was too small! Expected 153600 bytes, but got 115201!* W/com.skype.je(28734): not showing I traced it down to the camera jni and it seems like somewhere above the HAL, a buffer was set to accommodate only up to 'width x height x 1.5'. Hence, 320x240x1.5 = 115200 instead of 320x240x2 = 153600. Could it be that the skype application only provided support for NV21 (YUV420) which takes up 'width x height x 1.5' bytes of data? Thank you in advance. -- unsubscribe: android-porting+unsubscr...@googlegroups.com website: http://groups.google.com/group/android-porting