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

Unified Diff: media/capture/video/android/java/src/org/chromium/media/VideoCaptureCamera2.java

Issue 2933693002: Add Null checks in VideoCaptureCamera2.java (Closed)
Patch Set: Created 3 years, 6 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: media/capture/video/android/java/src/org/chromium/media/VideoCaptureCamera2.java
diff --git a/media/capture/video/android/java/src/org/chromium/media/VideoCaptureCamera2.java b/media/capture/video/android/java/src/org/chromium/media/VideoCaptureCamera2.java
index 5919ed1da303d5e3b7eacadf8b2b87f452515b56..1d5277c89545027361a0cafcb7ea8831923d29ae 100644
--- a/media/capture/video/android/java/src/org/chromium/media/VideoCaptureCamera2.java
+++ b/media/capture/video/android/java/src/org/chromium/media/VideoCaptureCamera2.java
@@ -268,7 +268,10 @@ public class VideoCaptureCamera2 extends VideoCapture {
@Override
public void onCaptureCompleted(CameraCaptureSession session,
CaptureRequest request, TotalCaptureResult result) {
- mLastExposureTimeNs = result.get(CaptureResult.SENSOR_EXPOSURE_TIME);
+ if (result.get(CaptureResult.SENSOR_EXPOSURE_TIME) != null) {
+ mLastExposureTimeNs =
+ result.get(CaptureResult.SENSOR_EXPOSURE_TIME);
+ }
}
}, handler);
@@ -762,7 +765,9 @@ public class VideoCaptureCamera2 extends VideoCapture {
maxIso = iso_range.getUpper();
}
builder.setMinIso(minIso).setMaxIso(maxIso).setStepIso(1);
- builder.setCurrentIso(mPreviewRequestBuilder.get(CaptureRequest.SENSOR_SENSITIVITY));
+ if (mPreviewRequestBuilder.get(CaptureRequest.SENSOR_SENSITIVITY) != null) {
mcasas 2017/06/10 14:47:26 micro-nit: perhaps mention here in a comment the b
+ builder.setCurrentIso(mPreviewRequestBuilder.get(CaptureRequest.SENSOR_SENSITIVITY));
+ }
final StreamConfigurationMap streamMap =
cameraCharacteristics.get(CameraCharacteristics.SCALER_STREAM_CONFIGURATION_MAP);
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698