Camera 参数设置、传递、下发

流程图

Camera 参数设置、传递、下发_第1张图片
applySettings.png



APP 层应用参数设置

mCameraDevice.applySettings(mCameraSettings);


frameworks 层获取参数设置发送获取图像的请求

    private void applyToRequest(AndroidCamera2Settings settings) {
        // TODO: If invoked when in PREVIEW_READY state, a new preview size will not take effect
        // 获取所有的参数设置,然后放到一个 Map 集合
        // 创建捕获请求时会调用 CaptureRequest.Builder.set() 设置捕获请求的参数设置
        mPersistentSettings.union(settings.getRequestSettings());
        ...
        // If we're already previewing, reflect most settings immediately
        try {
            // 向相机设备发送获取图像的请求
            mSession.setRepeatingRequest(
                    mPersistentSettings.createRequest(mCamera,
                            CameraDevice.TEMPLATE_PREVIEW, mPreviewSurface)/*创建一次捕获请求*/,
                    /*listener*/mCameraResultStateCallback, /*handler*/this);
        } catch (CameraAccessException ex) {
            Log.e(TAG, "Failed to apply updated request settings", ex);
        }
        ...
    }

你可能感兴趣的:(Camera 参数设置、传递、下发)