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

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

Issue 2187293002: Session based capturing for Camera1Capturer. (Closed) Base URL: https://chromium.googlesource.com/external/webrtc.git@camera2session
Patch Set: Cleanup. Created 4 years, 4 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
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 42 matching lines...) Expand 10 before | Expand all | Expand 10 after
53 53
54 @Override 54 @Override
55 public boolean isBackFacing(String deviceName) { 55 public boolean isBackFacing(String deviceName) {
56 android.hardware.Camera.CameraInfo info = getCameraInfo(getCameraIndex(devic eName)); 56 android.hardware.Camera.CameraInfo info = getCameraInfo(getCameraIndex(devic eName));
57 return info.facing == android.hardware.Camera.CameraInfo.CAMERA_FACING_BACK; 57 return info.facing == android.hardware.Camera.CameraInfo.CAMERA_FACING_BACK;
58 } 58 }
59 59
60 @Override 60 @Override
61 public CameraVideoCapturer createCapturer(String deviceName, 61 public CameraVideoCapturer createCapturer(String deviceName,
62 CameraVideoCapturer.CameraEventsHandler eventsHandler) { 62 CameraVideoCapturer.CameraEventsHandler eventsHandler) {
63 return new VideoCapturerAndroid(deviceName, eventsHandler, captureToTexture) ; 63 return new Camera1Capturer(deviceName, eventsHandler, captureToTexture);
64 } 64 }
65 65
66 private static android.hardware.Camera.CameraInfo getCameraInfo(int index) { 66 private static android.hardware.Camera.CameraInfo getCameraInfo(int index) {
67 android.hardware.Camera.CameraInfo info = new android.hardware.Camera.Camera Info(); 67 android.hardware.Camera.CameraInfo info = new android.hardware.Camera.Camera Info();
68 try { 68 try {
69 android.hardware.Camera.getCameraInfo(index, info); 69 android.hardware.Camera.getCameraInfo(index, info);
70 } catch (Exception e) { 70 } catch (Exception e) {
71 Logging.e(TAG, "getCameraInfo failed on index " + index,e); 71 Logging.e(TAG, "getCameraInfo failed on index " + index,e);
72 return null; 72 return null;
73 } 73 }
(...skipping 89 matching lines...) Expand 10 before | Expand all | Expand 10 after
163 // camera can not be used. 163 // camera can not be used.
164 static String getDeviceName(int index) { 164 static String getDeviceName(int index) {
165 android.hardware.Camera.CameraInfo info = getCameraInfo(index); 165 android.hardware.Camera.CameraInfo info = getCameraInfo(index);
166 166
167 String facing = 167 String facing =
168 (info.facing == android.hardware.Camera.CameraInfo.CAMERA_FACING_FRONT) ? "front" : "back"; 168 (info.facing == android.hardware.Camera.CameraInfo.CAMERA_FACING_FRONT) ? "front" : "back";
169 return "Camera " + index + ", Facing " + facing 169 return "Camera " + index + ", Facing " + facing
170 + ", Orientation " + info.orientation; 170 + ", Orientation " + info.orientation;
171 } 171 }
172 } 172 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698