我使用以下方法拍照。
takePicture(ShutterCallback shutter, PictureCallback raw,
PictureCallback postview, PictureCallback jpeg)
如下所示的ShutterCallback快门。
private final Camera.ShutterCallback mShutterCallback = new Camera.ShutterCallback() {
@Override
public void onShutter() {
long spendTime = System.currentTimeMillis() - mCaptureStartTime;
LogHelper.d(TAG, "[mShutterCallback], spend time : " + spendTime + "ms");
}
};
PictureCallback jpeg如下。
private final Camera.PictureCallback mJpegCallback = new Camera.PictureCallback() {
@Override
public void onPictureTaken(byte[] bytes, Camera camera) {
long jpegTime = System.currentTimeMillis() - mCaptureStartTime;
LogHelper.d(TAG, "[mJpegCallback],spend time :" + jpegTime + "ms" + "," +
"mPostViewCallbackNumber = " + mPostViewCallbackNumber.get()
+ " mP2DoneCallBackCount = " + mP2DoneCallBackCount.get()
+ " mIsNeedStartPreviewAfterCapture = " + mIsNeedStartPreviewAfterCapture
+ " mCaptureCount = " + mCaptureCount.get());
}
};
外观onShutter()记录5次,而onPictureTaken()记录7次。 我只是想知道为什么他们的时间不相等