mardi 27 janvier 2015

connectOnFrameAvailable() provides TangoImageBuffer with curious format infos


Vote count:

0




Also trying to get access to color data bytes from color cam of Tango, i was stuck on java API by beeing able to connect tango Cam to a surface for display (but just ok for display in fact, no easy access to raw data, nor timestamp)... so finally i swicth using C API on native code (latest FERMAT lib and header) and follow recommendation i found on stackOverflow by registering a derivated sample code to connectOnFrameAvailable()... (I start using PointCloudActivity sample for that test).



  • First problem i found is somewhat a side effect of registering to that callback, that works usually fine (callbacks gets fire regularly), but then another callback that i also registered, to get xyz clouds, start to fail to fire. Like in sample code i mentionned, clouds are get through a onXYZijAvailable() callback, that the app registers using TangoService_connectOnXYZijAvailable(onXYZijAvailable)


So failing to get xyz callback fired is not happening always, but usually half of the time, during tests, with a awful workaround that is by taking the app in background then foreground again ... this is curious, is this "recover" related to OnPause/OnResume low level stuff??). If someone has clues .... By the way in Java Api, same side effect was observed, once connecting cam texture for display (through Tango adequate API ...)


But here is my second "problem", back to acquiring YV12 color data from camera : through registering to TangoService_connectOnFrameAvailable( TangoCameraId::TANGO_CAMERA_COLOR, nullptr, onFrameAvailable) and providing static funtion onFrameAvailable defined like this :



static void onFrameAvailable(void* ctx, TangoCameraId id, const TangoImageBuffer* buffer)
{
...
LOGI("OnFrameAvailable(): Cam frame data received");
// Check if data format of expected type : YV12 , i.e.
// TangoImageFormatType::TANGO_HAL_PIXEL_FORMAT_YV12
// i.e. = 0x32315659 // YCrCb 4:2:0 Planar
//LOGI("OnFrameAvailable(): Frame data format (%x)", buffer->format);
....
}


the problem is that width, height, stride information of received TangoImageBuffer structure seems valid (1280x720, ...), BUT the format returned is changing everytime, and not the expected magic number (here 0x32315659) ... I am doing wometing wrong there ? (but other info are ok ...)


Also, there is apparently only one data format defined (YV12 ) here, but seeing Fish Eye images from demo app, it seems grey level image, is it using same format as low level capture than the RGB cam ???


Thanks a lot for your help !



asked 32 secs ago







connectOnFrameAvailable() provides TangoImageBuffer with curious format infos

Aucun commentaire:

Enregistrer un commentaire