Commit efdc1993 authored by Angad Sidhu's avatar Angad Sidhu Committed by Commit Bot

Clean up android video capture factory

Cleaned up android video capture factory methods to have consistent
usage of camera API version.

Change-Id: I835ea6debd5fe5fcc758207355c7936f0dccd84c
Reviewed-on: https://chromium-review.googlesource.com/1185534
Commit-Queue: Angad Sidhu <angadsidhu@google.com>
Reviewed-by: default avatarChristian Fremerey <chfremer@chromium.org>
Cr-Commit-Position: refs/heads/master@{#585279}
parent 40b3fb1f
......@@ -69,10 +69,10 @@ class VideoCaptureFactory {
// Factory methods.
@CalledByNative
static VideoCapture createVideoCapture(int id, long nativeVideoCaptureDeviceAndroid) {
if (isLReleaseOrLater() && !VideoCaptureCamera2.isLegacyDevice(id)) {
return new VideoCaptureCamera2(id, nativeVideoCaptureDeviceAndroid);
if (isLegacyOrDeprecatedDevice(id)) {
return new VideoCaptureCamera(id, nativeVideoCaptureDeviceAndroid);
}
return new VideoCaptureCamera(id, nativeVideoCaptureDeviceAndroid);
return new VideoCaptureCamera2(id, nativeVideoCaptureDeviceAndroid);
}
@CalledByNative
......@@ -82,34 +82,34 @@ class VideoCaptureFactory {
@CalledByNative
static int getCaptureApiType(int id) {
if (isLReleaseOrLater()) {
return VideoCaptureCamera2.getCaptureApiType(id);
if (isLegacyOrDeprecatedDevice(id)) {
return VideoCaptureCamera.getCaptureApiType(id);
}
return VideoCaptureCamera.getCaptureApiType(id);
return VideoCaptureCamera2.getCaptureApiType(id);
}
@CalledByNative
static int getFacingMode(int id) {
if (isLReleaseOrLater() && !VideoCaptureCamera2.isLegacyDevice(id)) {
return VideoCaptureCamera2.getFacingMode(id);
if (isLegacyOrDeprecatedDevice(id)) {
return VideoCaptureCamera.getFacingMode(id);
}
return VideoCaptureCamera.getFacingMode(id);
return VideoCaptureCamera2.getFacingMode(id);
}
@CalledByNative
static String getDeviceName(int id) {
if (isLReleaseOrLater() && !VideoCaptureCamera2.isLegacyDevice(id)) {
return VideoCaptureCamera2.getName(id);
if (isLegacyOrDeprecatedDevice(id)) {
return VideoCaptureCamera.getName(id);
}
return VideoCaptureCamera.getName(id);
return VideoCaptureCamera2.getName(id);
}
@CalledByNative
static VideoCaptureFormat[] getDeviceSupportedFormats(int id) {
if (isLReleaseOrLater() && !VideoCaptureCamera2.isLegacyDevice(id)) {
return VideoCaptureCamera2.getDeviceSupportedFormats(id);
if (isLegacyOrDeprecatedDevice(id)) {
return VideoCaptureCamera.getDeviceSupportedFormats(id);
}
return VideoCaptureCamera.getDeviceSupportedFormats(id);
return VideoCaptureCamera2.getDeviceSupportedFormats(id);
}
@CalledByNative
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment