android平台jpeg数据流转换成rgb直接显示的so库
使用方式:
byte[] jpegRaw = V4L2Camera.decode(dataBuf, ret);
rgb2Buffer(jpegRaw, WIDTH, HEIGHT, rgbBuffer);
ByteBuffer jpegBuffer = ByteBuffer.wrap(rgbBuffer);
bmp.copyPixelsFromBuffer(jpegBuffer);
canvas.drawBitmap(bmp, null, rect, null); // draw camera bitmap
native接口如下
package lzt.drv;
public class V4L2Camera {
static {
System.loadLibrary("jpeg");
}
public native static byte[] decode(byte[] jpegData, int length);
public native static void release();
}
1