I am building a Nougat AOSP image for Raspberry Pi 3 following these instructions: https://github.com/tab-pi/platform_manifest. And I have a UVC-compatible USB webcam (Logitech C525) that I would like to access through Android Camera API.
So far the webcam is visible in UsbManager.getDeviceList() but Camera.getNumberOfCameras() returns 0.
I have customized the kernel so that there's a /dev/video0
appearing with the appropriate permissions when plugging the webcam:
$ adb shell ls -l /dev/video0
crw-rw---- 1 system camera 81, 0 2018-09-20 10:16 /dev/video0
I've tried to build the following HALs against my AOSP tree but they all fail:
https://github.com/jollen/libv4l2-android:
fatal error: 'ui/CameraHardwareInterface.h' file not found
https://github.com/antmicro/android-camera-hal:
error: use of undeclared identifier 'kMaxStride'
no member named 'I422ToABGRRow_NEON' in namespace 'libyuv'
https://github.com/aosp-mirror/platform_hardware_libhardware/tree/master/modules/camera/3_4
ninja: error: 'out/target/product/rpi3/obj/STATIC_LIBRARIES/libgtest_prod_intermediates/export_includes', needed by 'out/target/product/rpi3/obj/SHARED_LIBRARIES/camera.v4l2_intermediates/import_includes', missing and no known rule to make it
To put it in a nutshell, how can I access a USB camera through the Android Camera API on the Raspberry Pi ?
camera
class is deprecated; later API level tend to usecamera2
instead. – Grano