diff options
author | Andrew Harp <andrewharp@users.noreply.github.com> | 2017-12-13 16:34:33 -0500 |
---|---|---|
committer | GitHub <noreply@github.com> | 2017-12-13 16:34:33 -0500 |
commit | 18c864cdae3e5a2d444deac2a2b23e08096ee4e2 (patch) | |
tree | 1d1748a62dc4f93a318398cd0fc158c69795b1c0 /tensorflow/examples | |
parent | df9189cc4671facfecd3e8249c9e8b01b11c0df5 (diff) | |
parent | 4bc510c17b23af1adac83b148c0c7dfd978a20be (diff) |
Merge pull request #15163 from lihanchen/AndroidTVUSBCamera
Fix problem with camera on Android TV
Diffstat (limited to 'tensorflow/examples')
-rw-r--r-- | tensorflow/examples/android/src/org/tensorflow/demo/CameraActivity.java | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/tensorflow/examples/android/src/org/tensorflow/demo/CameraActivity.java b/tensorflow/examples/android/src/org/tensorflow/demo/CameraActivity.java index 4e45f42d0c..8bd4abb154 100644 --- a/tensorflow/examples/android/src/org/tensorflow/demo/CameraActivity.java +++ b/tensorflow/examples/android/src/org/tensorflow/demo/CameraActivity.java @@ -333,8 +333,12 @@ public abstract class CameraActivity extends Activity continue; } - useCamera2API = isHardwareLevelSupported(characteristics, - CameraCharacteristics.INFO_SUPPORTED_HARDWARE_LEVEL_FULL); + // Fallback to camera1 API for internal cameras that don't have full support. + // This should help with legacy situations where using the camera2 API causes + // distorted or otherwise broken previews. + useCamera2API = (facing == CameraCharacteristics.LENS_FACING_EXTERNAL) + || isHardwareLevelSupported(characteristics, + CameraCharacteristics.INFO_SUPPORTED_HARDWARE_LEVEL_FULL); LOGGER.i("Camera API lv2?: %s", useCamera2API); return cameraId; } |