ShutterCallback和PictureCallback的时代不是风浪

时间:2018-11-01 11:13:37

标签: android

我使用以下方法拍照。

 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次。 我只是想知道为什么他们的时间不相等

0 个答案:

没有答案