hi
I am new to android sdk. I need to write a program to process the
camera image frames. I found "setPreviewCallbackWithBuffer()" from
the sdk documentation, but did not figure out how to get it to work.
Here is my code skeleton:
public void onResume() {
super.onResume();
camera=Camera.open();
...
param.setPreviewSize(preview_size.width,preview_size.height);
camera.setParameters(param);
camera.addCallbackBuffer(new byte[bufSize]);
camera.setPreviewCallbackWithBuffer(bufPreviewCallback);
camera.startPreview();
}
PreviewCallback bufPreviewCallback = new PreviewCallback() {
public void onPreviewFrame(byte[] data, Camera camera) {
TextView tv = (TextView)findViewById(R.id.txReading);
tv.setText("frame done");
}
};
I was hoping that the bufPreviewCallback() function gets triggered
every time a frame is available, activated right after the
startPreview() call. However, when I started the program, my txReading
textview never got updated.
Can anyone tell me if this is the right way to work with
setPreviewCallbackWithBuffer? do I need to call startPreview() inside
bufPreviewCallback, like the case for takePicture?
thanks
Qianqian
--
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en