Accessing Android Camera with NDK

I was trying to figure out how to use the NDK to access the camera on android using my HAL interface. I downloaded all related files from here: https://github.com/android/platform_hardware_libhardware/blob/master/include/hardware/camera.h

and here:

https://github.com/android/platform_system_core

it seems to me that I managed to get all the relevant files, but the project won't compile due to numerous errors ranging from problematic makefiles to missing features such as:

C:/android-ndk-r10d/samples/hello-jni/jni/camera/Camera.cpp:409:55: error: 'clone_camera_metadata' was not declared in this scope
         mSettings = clone_camera_metadata(new_settings);

      

could someone who has managed to use the HAL camera shed some light on this

Thank you

+3


source to share


1 answer


I know 2 solutions for your problem:

  • You can use OpenCV to get the current camera frame. OpenCV is great for Android.
  • Use some not very attractive java calls.


Although I would be glad to see that you only manage to use the ndk code :) (maybe check out how the guys at OpenCV managed to get it to work)

0


source







All Articles