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:
Alex Glaznev
2015-05-19 10:56:32 -07:00
parent 68898a2652
commit 2f5be9ad63
5 changed files with 159 additions and 45 deletions

View File

@@ -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;