记录开发中遇到的问题

版权声明:本文为博主原创文章,未经博主允许不得转载。 https://blog.csdn.net/MrJarvisDong/article/details/79863716

记录 遇到的问题:

  • 问题1:

小米手机5C 录制视频的时候,开启人脸识别功能会使 Camera Error 100 错误;
具体:

surfaceChanged中:
try {
 mCamera.setPreviewDisplay(mHolder);
 mCamera.startPreview();
startFaceDetection(); // re-start face detection feature
} catch (Exception e) {
 LogUtils.e(TAG, "Error starting camera preview: " + e.getMessage());
        }

    /**
     * 开始人脸识别;
     */
    public void startFaceDetection() {
        // Try starting Face Detection
        Camera.Parameters params = mCamera.getParameters();
        // start face detection only *after* preview has started
        if (params.getMaxNumDetectedFaces() > 0) {
            // camera supports face detection, so can start it:
            mCamera.startFaceDetection();
        }
    }

小米手机5C直接Error 100 ,预览固定住不动;经测试其他手机魅族,华为,一加均可以正常打开和拍摄,不知什么原因;
注释掉startFaceDetection()此方法后又可以正常使用了,不知跟小米的照相机有没有关系?!


猜你喜欢

转载自blog.csdn.net/MrJarvisDong/article/details/79863716