Add override annotation to appropriate methods in Camera1Enumerator.
Also move getDeviceNames to a more appropriate location in the file. NOTRY=True Review-Url: https://codereview.webrtc.org/2105813002 Cr-Commit-Position: refs/heads/master@{#13312}
This commit is contained in:
@ -35,16 +35,29 @@ public class Camera1Enumerator implements CameraEnumerator {
|
||||
this.captureToTexture = captureToTexture;
|
||||
}
|
||||
|
||||
// Returns device names that can be used to create a new VideoCapturerAndroid.
|
||||
@Override
|
||||
public String[] getDeviceNames() {
|
||||
String[] names = new String[android.hardware.Camera.getNumberOfCameras()];
|
||||
for (int i = 0; i < android.hardware.Camera.getNumberOfCameras(); ++i) {
|
||||
names[i] = getDeviceName(i);
|
||||
}
|
||||
return names;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isFrontFacing(String deviceName) {
|
||||
android.hardware.Camera.CameraInfo info = getCameraInfo(getCameraIndex(deviceName));
|
||||
return info.facing == android.hardware.Camera.CameraInfo.CAMERA_FACING_FRONT;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isBackFacing(String deviceName) {
|
||||
android.hardware.Camera.CameraInfo info = getCameraInfo(getCameraIndex(deviceName));
|
||||
return info.facing == android.hardware.Camera.CameraInfo.CAMERA_FACING_BACK;
|
||||
}
|
||||
|
||||
@Override
|
||||
public CameraVideoCapturer createCapturer(String deviceName,
|
||||
CameraVideoCapturer.CameraEventsHandler eventsHandler) {
|
||||
return new VideoCapturerAndroid(deviceName, eventsHandler, captureToTexture);
|
||||
@ -134,15 +147,6 @@ public class Camera1Enumerator implements CameraEnumerator {
|
||||
return ranges;
|
||||
}
|
||||
|
||||
// Returns device names that can be used to create a new VideoCapturerAndroid.
|
||||
public String[] getDeviceNames() {
|
||||
String[] names = new String[android.hardware.Camera.getNumberOfCameras()];
|
||||
for (int i = 0; i < android.hardware.Camera.getNumberOfCameras(); ++i) {
|
||||
names[i] = getDeviceName(i);
|
||||
}
|
||||
return names;
|
||||
}
|
||||
|
||||
// Returns the camera index for camera with name |deviceName|, or throws IllegalArgumentException
|
||||
// if no such camera can be found.
|
||||
static int getCameraIndex(String deviceName) {
|
||||
|
||||
Reference in New Issue
Block a user