Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(62)

Side by Side Diff: webrtc/api/android/java/src/org/webrtc/Camera1Enumerator.java

Issue 2356073003: Change Camera1Enumerator to create a Camera1Capturer instead of VideoCapturerAndroid. (Closed)
Patch Set: Rebase. Created 4 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « no previous file | webrtc/api/android/java/src/org/webrtc/VideoCapturerAndroid.java » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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
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 }
OLDNEW
« no previous file with comments | « no previous file | webrtc/api/android/java/src/org/webrtc/VideoCapturerAndroid.java » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698