There seems to be an issue concering the reception of color frames in the Leibniz Release 1.10 as well: when having registered a callback using
TangoService_connectOnFrameAvailable(TANGO_CAMERA_COLOR,NULL,onFrameAvailable)
the callback onFrameAvailable()
will either never ever be called or TangoService_connectOnFrameAvailable()
crashes with the following error:
04-20 13:29:44.384: E/tango_client_api(4712): TangoErrorType TangoService_connectOnFrameAvailable(TangoCameraId, void*, void ()(void, TangoCameraId, const TangoImageBuffer*)): Internal Error: connectSurface(), cam id 0, failed internally.
The release notes say
[...] config_enable_color_camera has been added to the configuration flags. We recommend you always explicitly set this flag to true if accessing the color camera. You must set the flag true for TangoService_connectOnFrameAvailable() or TangoService_connectTextureId() to succeed after TangoService_connect() is called. [...]
Thus, if I set that flag to true between the calls of TangoService_connect()
and TangoService_connectOnFrameAvailable()
, the callback onFrameAvailable()
will never ever be called, if I set that flag to true before TangoService_connect()
TangoService_connectOnFrameAvailable()
will always crash.
Thus, what am I doing wrong? Is there a code snippet available or something? That would be really helpful... Unfortunately, none of the examples use color frames...
Man, after having had similar problems with the Kalman Release 1.9, I begin to wonder if the SDKs are thoroughly tested before being released in the first place...
Here is my code for converting an NV21 to an RGB frame. Maybe it is of any use...
Alright assuming that the problem is not what I mentioned in the comments section. Here is code snippet testing the onFrameAvailable Callback.
Note: I have modified the HelloTangoJni Example from the Tango-examples-c repository for this.
In TangoHandler.h add
Modify TangoHandler.cc
In TangoNative.cc add
In TangoJNINative.java add
In HelloTangoActivity.java modify onResume()