I'm trying to process bitmaps from frames I grabbed from MediaMetadataretriever using native function. But I got a fatal crash saying
SIGNAL 11 (SIGSEGV) at 0x422d8f20 (code=2)
SIGNAL 11 (SIGSEGV) at 0x42311320 (code=2)
I tried logging to see where it went wrong. it appears that it crashes when i call for the native function. Below is the function that I called for native function.
protected Bitmap processFrame(Bitmap l_frame) {
WarnC='a';
int[] rgba = mRGBA;
byte[] src_array =stream;
ByteArrayOutputStream src_stream = new ByteArrayOutputStream();
l_frame.compress(Bitmap.CompressFormat.PNG, 0, src_stream);
src_array = src_stream.toByteArray();
Log.i("test", "ok");
WarnC= processcaller.LaneDetection(mFrameWidth, mFrameHeight, src_array, rgba);
Bitmap bmp = g_frame;
bmp.setPixels(rgba, 0/* offset */, mFrameWidth /* stride */, 0, 0, mFrameWidth,mFrameHeight);
rgba =null;
src_array=null;
return bmp;
}
The crash signal came out right after the Log.i("test","ok");
I searched around the net and got saw most say it's segmentation fault and might be cause by calling uninitialized or functions that does not exist. But scanning through my code, I just can't find any of it. Any pointers?