I want to transfer byte [] the data (frame) captured by the camera to the JNI part. I need some frames to go through immediately, so I think if I can create byte [] [] to store byte [] so that I can get byte [] back from JNI. Is it possible? I know that getByteArrayElement()can help. Does anyone know how to achieve it?
Actually, I tried to use the queue to achieve the goal of passing the byte [] earlier, but this seems impossible, as some people answered me.
Past code (put byte [] in arraylist):
aCamera.setPreviewCallback(new PreviewCallback(){
public void onPreviewFrame(byte[] data, Camera camera) {
synchronized (TestClass.this){
AFrame = data;
int i = 0;
queue = new ArrayList<byte[]>(definedSize);
if(queue.size()<definedSize){
queue.add(data);
}
else{
queue.remove(0);
}
TestClass.this.notify();
}
}
});
Arraylist cannot return to JNI, so this time I think if I can do it with another byte array.
Android . - - ? , .