Improve Android camera error handling.
- Set Camera.ErrorCallback callback when opening camera to receive camera server error notifications. - Allow user to provide interface for handling camera errors happening on camera thread. - Run camera observer on camera thread and monitor camera fps and amount of callback buffers, print statistics and report error if camera stops generating frames. - Query camera formats starting from front camera instead of back camera to detect camera failures as fast as possible. - Change all DCHECK to CHECK in androidvideocapturer.cc to detect camera error on release builds. - Plus adding some extra logging. R=hbos@webrtc.org Review URL: https://webrtc-codereview.appspot.com/52519004 Cr-Commit-Position: refs/heads/master@{#9221}
This commit is contained in:
@@ -439,7 +439,7 @@ public class PeerConnectionClient {
|
||||
cameraDeviceName = frontCameraDeviceName;
|
||||
}
|
||||
Log.d(TAG, "Opening camera: " + cameraDeviceName);
|
||||
videoCapturer = VideoCapturerAndroid.create(cameraDeviceName);
|
||||
videoCapturer = VideoCapturerAndroid.create(cameraDeviceName, null);
|
||||
if (videoCapturer == null) {
|
||||
reportError("Failed to open camera");
|
||||
return;
|
||||
|
||||
Reference in New Issue
Block a user