I have an Android 8.1 rk3399 board with an OV13850 camera module.
This module's interface is mipi-csi and protocol is I2C.
When I log the camera characteristics, it was CameraCharacteristics.INFO_SUPPORTED_HARDWARE_LEVEL_LEGACY.
I really really want to use an ndk camera.
But people say that the native camera does not support legacy.
Question 1:
I have a Raspberry b+ mipi camera.
If I simply change the camera module, would it be compatible?
I think the interfaces are the same, so there is no need to edit board SDK code.
Just adding to the .rc file might work.
Question 2:
I want to support legacy camera on the native side.
If I edit some code on the ndk framework code and build my own.m, would it be possible to support legacy?
Question 3:
Which part decides if the camera module is legacy or not (physical module, module's kernel driver, Android OS camera code, ndk framework, etc.)?
What method should I choose between changing physical camera module or editing code for native processing?
Question 4:
What is different between the legacy camera and full camera?
Yes, you can modify the framework to have some support for a LEGACY camera2 without Java. See my POC that backports the NDK Camera2 support to Android 6, you will need to cherry pick some changes. My code does work with LEGACY camera, but I never tested it beyond the very basic functionality.
You cannot run my code as is on Android 8, because it forbids linking the system libraries from user code.
The official docs describe in detail what limitations LEGACY camera has, but TL;NR: LEGACY camera has an old camera HAL and some wrapper that emulates camera2 API to the user apps. The rule of thumb is to use the old deprecated Camera API when you detect a LEGACY camera, this way you avoid some extra wrappers and bugs therein.
Unfortunately, this cannot help your cause because the our Camera does not have public C++ API. Also, I don't think changing the camera module can help. The LEGACY nature of the camera is determined on the level of firmware.