简体   繁体   中英

What is the most efficient way to work with the Android camera?

I'm working on an AR app which does heavy image processing using NDK. The result is 10 frames at best.

I believe that part of the problem is the way I work with the camera in Android.

I wonder what is the most efficient way to get the frames from the camera on Android 4 and above.

PS - I'm using the old 'setPreviewCallback' technique which I understand is very inefficient with memory (allocates memory for each frame and then GC must clean in).

Thanks!

Definitely, using setPreviewCallbackWithBuffer() is more efficient. Your mileage may vary, but the Samsung Note 10 is capable of serving 30 WVGA frames per second (and encoding). You don't need 4.0 for that, this API is available since 2.2.

PS Have you measured the time your heavy image processing takes?

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM