【问题标题】:Samsung CameraCaptureSession in WAITING_LOCK - Need a workaroundWAITING_LOCK 中的三星 CameraCaptureSession - 需要解决方法
【发布时间】:2018-02-12 06:12:15
【问题描述】:

更新:请将此标记为重复Front Camera in Camera2 not capturing image三星 S7 前置摄像头不支持自动对焦,并且 lockfocus() 不会返回任何内容。

它适用于具有 API24 的其他设备,不适用于 GalaxyS7。

private CaptureRequest.Builder mPreviewRequestBuilder;
/**
 * Initiate a still image capture.
 */
private void takePicture() {
    Log.e("timer", "entered takepicture()");
    lockFocus();
    Log.e("timer", "exited lockfocus()");
}

/**
 * Lock the focus as the first step for a still image capture.
 */
private void lockFocus() {
    try {
        // This is how to tell the camera to lock focus.
        Log.e("timer", "entered lockfocus()");
        mPreviewRequestBuilder.set(CaptureRequest.CONTROL_AF_TRIGGER,
                CameraMetadata.CONTROL_AF_TRIGGER_START);
        // Tell #mCaptureCallback to wait for the lock.
        mState = STATE_WAITING_LOCK;
        mCaptureSession.capture(mPreviewRequestBuilder.build(), mCaptureCallback,
                mBackgroundHandler);
    } catch (CameraAccessException e) {
        e.printStackTrace();
    }
}

logcat 中没有错误/警告。

02-10 17:52:26.626 11402-11402/xxx E/timer: entered takepicture()
02-10 17:52:26.626 11402-11402/xxx E/timer: entered lockfocus()
02-10 17:52:26.634 11402-11402/xxx E/timer: exited lockfocus()
02-10 17:52:28.652 11402-11529/xxx V/FA: Inactivity, disconnecting from the service

如果您需要其他代码,请告诉我。

【问题讨论】:

    标签: android android-camera2 samsung-galaxy


    【解决方案1】:

    请将此标记为重复 Camera2 中的前置摄像头未捕获图像三星 S7 前置摄像头不支持自动对焦,并且 lockfocus() 不会返回任何内容。

    【讨论】:

      猜你喜欢
      • 2022-10-15
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2017-10-02
      • 1970-01-01
      相关资源
      最近更新 更多