如何在 Google Project Tango 上渲染和检索图像数据?

How to render and retrieve image data on Google Project Tango?

我想在 GL 表面上渲染实时图像数据(如各种 Project Tango 示例所示),同时通过 MediaCodec 记录(编码)它。 (在 Android Lollipop 设备上,我已经使用 camera2 接口和多个表面目标实现了这一点,效果很好,但到目前为止 Tango 是 Lollipop 之前的...)

other answers 看来,您必须使用 C API 来访问图像数据。

C API 提供了两个相机帧函数 -- TangoService_connectTextureId() 和 TangoService_connectOnFrameAvailable()。但是,documentation 表示 "Use either TangoService_connectTextureId() or TangoService_connectOnFrameAvailable() but not both."

为什么不两者兼而有之?

如何最好地呈现 检索图像数据?

Pythagoras 版本现在允许同时使用颜色和颜色纹理回调。也就是说,如果你想处理图像,你想使用 connectOnFrameAvailable,如果你试图将它从纹理中剥离出来,你最终会做额外的不必要的工作。