4

In Android, is the following possible (if so, how) :

I'd like to set up a layout in my java and add a view to it where the view contains a surfaceView for rendering the camera preview. But, I dont want to instantiate and start the camera in Java. I just want to set up the view so that I can keep the layout structure.

Then, I have a native C++ component accessed via JNI where I'd like to actually start the camera and have it's preview rendered in the SurfaceView mentioned above.

The reason for this setup is that I'd like to keep the layout that I defined in Java but access the camera and its preview frames in C++. I dont want to handle the preview frames in Java and then pass them to C++ as that is not efficient.

The other option would be to set up my java layout in C++, but not sure if that is even possible ?

Drake Amara
  • 3,072
  • 3
  • 19
  • 18
  • have you solved this, i am having same requirement, as i have SurfaceView on java side, i am stuck how to pass surface from java to C++ JNI?? please suggest some solution if you had done it.. – Nishant Feb 16 '16 at 13:09

0 Answers0