我正在尝试模拟使用Android模拟器拍照。我按下按钮拍摄照片的那一刻LogCat开始一遍又一遍地显示以下错误:
错误/ SurfaceFlinger(58):LayerBuffer :: BufferSource :: postBuffer()无效缓冲区(偏移= 1739520,大小= 111650,堆大小= 151552
有关它意味着什么以及如何修复的任何想法?相关代码如下:
public void takePicture(final ImageView imageView) {
Camera.ShutterCallback shutterCallback = new Camera.ShutterCallback() {
@Override
public void onShutter() {
Log.d(null, "onShutter called");
setIsShutterActivated(true);
}
};
Camera.PictureCallback pictureCallback = new Camera.PictureCallback() {
@Override
public void onPictureTaken(byte[] data, Camera camera) {
Log.d(null, "onPictureTaken called");
setIsShutterActivated(false);
Bitmap bMap = BitmapFactory.decodeByteArray(data, 0, data.length);
imageView.setImageBitmap(bMap);
}
};
mCamera.takePicture(shutterCallback, null, pictureCallback);
}