OLD | NEW |
1 /* | 1 /* |
2 * Copyright 2015 The WebRTC project authors. All Rights Reserved. | 2 * Copyright 2015 The WebRTC project authors. All Rights Reserved. |
3 * | 3 * |
4 * Use of this source code is governed by a BSD-style license | 4 * Use of this source code is governed by a BSD-style license |
5 * that can be found in the LICENSE file in the root of the source | 5 * that can be found in the LICENSE file in the root of the source |
6 * tree. An additional intellectual property rights grant can be found | 6 * tree. An additional intellectual property rights grant can be found |
7 * in the file PATENTS. All contributing project authors may | 7 * in the file PATENTS. All contributing project authors may |
8 * be found in the AUTHORS file in the root of the source tree. | 8 * be found in the AUTHORS file in the root of the source tree. |
9 */ | 9 */ |
10 | 10 |
(...skipping 54 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
65 } | 65 } |
66 | 66 |
67 @Override | 67 @Override |
68 public List<CaptureFormat> getSupportedFormats(String deviceName) { | 68 public List<CaptureFormat> getSupportedFormats(String deviceName) { |
69 return getSupportedFormats(getCameraIndex(deviceName)); | 69 return getSupportedFormats(getCameraIndex(deviceName)); |
70 } | 70 } |
71 | 71 |
72 @Override | 72 @Override |
73 public CameraVideoCapturer createCapturer( | 73 public CameraVideoCapturer createCapturer( |
74 String deviceName, CameraVideoCapturer.CameraEventsHandler eventsHandler)
{ | 74 String deviceName, CameraVideoCapturer.CameraEventsHandler eventsHandler)
{ |
75 return new VideoCapturerAndroid(deviceName, eventsHandler, captureToTexture)
; | 75 return new Camera1Capturer(deviceName, eventsHandler, captureToTexture); |
76 } | 76 } |
77 | 77 |
78 private static android.hardware.Camera.CameraInfo getCameraInfo(int index) { | 78 private static android.hardware.Camera.CameraInfo getCameraInfo(int index) { |
79 android.hardware.Camera.CameraInfo info = new android.hardware.Camera.Camera
Info(); | 79 android.hardware.Camera.CameraInfo info = new android.hardware.Camera.Camera
Info(); |
80 try { | 80 try { |
81 android.hardware.Camera.getCameraInfo(index, info); | 81 android.hardware.Camera.getCameraInfo(index, info); |
82 } catch (Exception e) { | 82 } catch (Exception e) { |
83 Logging.e(TAG, "getCameraInfo failed on index " + index, e); | 83 Logging.e(TAG, "getCameraInfo failed on index " + index, e); |
84 return null; | 84 return null; |
85 } | 85 } |
(...skipping 91 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
177 android.hardware.Camera.CameraInfo info = getCameraInfo(index); | 177 android.hardware.Camera.CameraInfo info = getCameraInfo(index); |
178 if (info == null) { | 178 if (info == null) { |
179 return null; | 179 return null; |
180 } | 180 } |
181 | 181 |
182 String facing = | 182 String facing = |
183 (info.facing == android.hardware.Camera.CameraInfo.CAMERA_FACING_FRONT)
? "front" : "back"; | 183 (info.facing == android.hardware.Camera.CameraInfo.CAMERA_FACING_FRONT)
? "front" : "back"; |
184 return "Camera " + index + ", Facing " + facing + ", Orientation " + info.or
ientation; | 184 return "Camera " + index + ", Facing " + facing + ", Orientation " + info.or
ientation; |
185 } | 185 } |
186 } | 186 } |
OLD | NEW |