0

I'd like to render the live image data on a GL surface (as shown in various Project Tango samples), and at the same time record (encode) it via a MediaCodec. (On an Android Lollipop device, I've accomplished that using the camera2 interface and multiple surface targets, which works fine, but thus far Tango is pre-Lollipop...)

From other answers, it appears that you have to use the C API to access the image data.

The C API provides two camera frame functions -- TangoService_connectTextureId() and TangoService_connectOnFrameAvailable(). However, the documentation states "Use either TangoService_connectTextureId() or TangoService_connectOnFrameAvailable() but not both."

Why not both?

How do I best render and retrieve the image data?

Community
  • 1
  • 1
Steffen G.
  • 195
  • 1
  • 9

1 Answers1

1

The Pythagoras release now allows for simultaneous use of color and color texture callbacks now. That said, you want to use the connectOnFrameAvailable if you want to process the image, you'd end up doing extra unnecessary work if you try and peel it out of the texture.

Mark Mullin
  • 1,340
  • 1
  • 9
  • 21
  • Mark, thanks for your input. Just to clarify (not sure if I'm understanding your last sentence correctly): 1. since Pythagoras it should be ok to use both TangoService_connectTextureId() and TangoService_connectOnFrameAvailable() simultaneously; and 2. calling TangoService_connectTextureId() to obtaining the texture for rendering and calling TangoService_connectOnFrameAvailable() to obtain the image for processing (i.e., thus avoiding to have to peel it out of the texture) would be the suggested way to go? – Steffen G. Jun 25 '15 at 13:22
  • 1
    Yes - its also not that hard to use the image you get from the onFrameAvailable callbacks as a texture, but being able to use both is certainly the easiest – Mark Mullin Jun 25 '15 at 15:23