[英]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. 我正在开发一个使用NDK进行大量图像处理的AR应用程序。 The result is 10 frames at best.
结果最多为10帧。
I believe that part of the problem is the way I work with the camera in Android. 我认为部分问题是我在Android中使用相机的方式。
I wonder what is the most efficient way to get the frames from the camera on Android 4 and above. 我想知道从Android 4及更高版本的相机中获取帧的最有效方法是什么。
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). PS-我使用的是旧的'setPreviewCallback'技术,我知道它在内存方面效率很低(为每个帧分配内存,然后GC必须清除)。
Thanks! 谢谢!
Definitely, using setPreviewCallbackWithBuffer() is more efficient. 当然,使用setPreviewCallbackWithBuffer()会更有效。 Your mileage may vary, but the Samsung Note 10 is capable of serving 30 WVGA frames per second (and encoding).
您的里程可能会有所不同,但是Samsung Note 10每秒可以提供30个WVGA帧(和编码)。 You don't need 4.0 for that, this API is available since 2.2.
您不需要4.0,此API自2.2起可用。
PS Have you measured the time your heavy image processing takes? PS您是否测量了沉重的图像处理时间?
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.