Android-Camera 2 API-无法拍照

问题描述 投票:3回答:1

我在Android中使用Camera 2 API时遇到问题。我在Android Studio中使用本机android。相机在TextureView上还可以,但是当我尝试拍照时。没用我在Camera 2 API的官方github页面上关注了Kotlin Basic Example。打开“相机活动”时,我看到了Logcat:

2018-11-14 09:37:59.963 4009-4009/sayurbox.com.oms E/libc: Access denied finding property "persist.camera.privapp.list"
2018-11-14 09:37:59.965 4009-4958/sayurbox.com.oms E/libc: Access denied finding property "camera.hal1.packagelist"
2018-11-14 09:38:00.166 4009-5002/sayurbox.com.oms E/libc: Access denied finding property "persist.camera.legacy_perf"
2018-11-14 09:38:01.971 4009-4957/sayurbox.com.oms E/RequestQueue: cancel failed: no repeating request exists.
android android-camera2
1个回答
0
投票

我不知道您的确切情况,但是在大多数情况下,如果没有在正确的线程中运行,就会发生这种情况。例如,仅运行mediaRecorder.start()会导致类似的错误,但是将媒体记录器运行在UI线程上可以解决此问题。

runOnUiThread(
        new Runnable() {
        @Override
        public void run() {
            mediaRecorder.start();
        }
});

但是正如我所说的,这只是一次场景,对于这个问题,可能还有其他场景。

希望这会帮助某人。

© www.soinside.com 2019 - 2024. All rights reserved.