diff options
4 files changed, 33 insertions, 33 deletions
diff --git a/apps/CameraITS/service/src/com/android/camera2/its/ItsService.java b/apps/CameraITS/service/src/com/android/camera2/its/ItsService.java index 8c0817f..ff17165 100644 --- a/apps/CameraITS/service/src/com/android/camera2/its/ItsService.java +++ b/apps/CameraITS/service/src/com/android/camera2/its/ItsService.java @@ -21,9 +21,9 @@ import android.content.Context; import android.content.Intent; import android.graphics.ImageFormat; import android.hardware.camera2.CameraAccessException; +import android.hardware.camera2.CameraCharacteristics; import android.hardware.camera2.CameraDevice; import android.hardware.camera2.CameraManager; -import android.hardware.camera2.CameraProperties; import android.hardware.camera2.CaptureFailure; import android.hardware.camera2.CaptureRequest; import android.hardware.camera2.CaptureResult; @@ -82,7 +82,7 @@ public class ItsService extends Service { private BlockingCameraManager mBlockingCameraManager = null; private CameraDevice mCamera = null; private ImageReader mCaptureReader = null; - private CameraProperties mCameraProperties = null; + private CameraCharacteristics mCameraCharacteristics = null; private HandlerThread mCommandThread; private Handler mCommandHandler; @@ -140,7 +140,7 @@ public class ItsService extends Service { // TODO: Add support for specifying which device to open. mCamera = mBlockingCameraManager.openCamera(devices[0], /*listener*/null, openHandler); - mCameraProperties = mCamera.getProperties(); + mCameraCharacteristics = mCamera.getProperties(); } catch (CameraAccessException e) { throw new ItsException("Failed to open camera", e); } catch (BlockingOpenException e) { @@ -291,7 +291,7 @@ public class ItsService extends Service { private void doGetProps() throws ItsException { String fileName = ItsUtils.getMetadataFileName(0); File mdFile = ItsUtils.getOutputFile(ItsService.this, fileName); - ItsUtils.storeCameraProperties(mCameraProperties, mdFile); + ItsUtils.storeCameraCharacteristics(mCameraCharacteristics, mdFile); Log.i(PYTAG, String.format("### FILE %s", ItsUtils.getExternallyVisiblePath(ItsService.this, mdFile.toString()))); @@ -322,8 +322,8 @@ public class ItsService extends Service { // Get the converged values for each "A", and package into JSON result for caller. // 3A happens on full-res frames. - android.hardware.camera2.Size sizes[] = mCameraProperties.get( - CameraProperties.SCALER_AVAILABLE_JPEG_SIZES); + android.hardware.camera2.Size sizes[] = mCameraCharacteristics.get( + CameraCharacteristics.SCALER_AVAILABLE_JPEG_SIZES); int width = sizes[0].getWidth(); int height = sizes[0].getHeight(); int format = ImageFormat.YUV_420_888; @@ -474,8 +474,8 @@ public class ItsService extends Service { // Capture full-frame images. Use the reported JPEG size rather than the sensor // size since this is more likely to be the unscaled size; the crop from sensor // size is probably for the ISP (e.g. demosaicking) rather than the encoder. - android.hardware.camera2.Size sizes[] = mCameraProperties.get( - CameraProperties.SCALER_AVAILABLE_JPEG_SIZES); + android.hardware.camera2.Size sizes[] = mCameraCharacteristics.get( + CameraCharacteristics.SCALER_AVAILABLE_JPEG_SIZES); int width = sizes[0].getWidth(); int height = sizes[0].getHeight(); int format = ImageFormat.YUV_420_888; @@ -680,7 +680,7 @@ public class ItsService extends Service { String fileName = ItsUtils.getMetadataFileName( result.get(CaptureResult.SENSOR_TIMESTAMP)); File mdFile = ItsUtils.getOutputFile(ItsService.this, fileName); - ItsUtils.storeResults(mCameraProperties, request, result, mdFile); + ItsUtils.storeResults(mCameraCharacteristics, request, result, mdFile); mCaptureCallbackLatch.countDown(); } } catch (ItsException e) { diff --git a/apps/CameraITS/service/src/com/android/camera2/its/ItsUtils.java b/apps/CameraITS/service/src/com/android/camera2/its/ItsUtils.java index 2160590..861f4ae 100644 --- a/apps/CameraITS/service/src/com/android/camera2/its/ItsUtils.java +++ b/apps/CameraITS/service/src/com/android/camera2/its/ItsUtils.java @@ -19,7 +19,7 @@ package com.android.camera2.its; import android.content.Context; import android.graphics.ImageFormat; import android.hardware.camera2.CameraDevice; -import android.hardware.camera2.CameraProperties; +import android.hardware.camera2.CameraCharacteristics; import android.hardware.camera2.CaptureRequest; import android.hardware.camera2.CaptureResult; import android.media.Image; @@ -61,7 +61,7 @@ public class ItsUtils { // The indent amount to use when printing the JSON objects out as strings. private static final int PPRINT_JSON_INDENT = 2; - public static void storeCameraProperties(CameraProperties props, + public static void storeCameraCharacteristics(CameraCharacteristics props, File file) throws ItsException { try { @@ -73,7 +73,7 @@ public class ItsUtils { } } - public static void storeResults(CameraProperties props, + public static void storeResults(CameraCharacteristics props, CaptureRequest request, CaptureResult result, File file) diff --git a/apps/TestingCamera2/src/com/android/testingcamera2/CameraOps.java b/apps/TestingCamera2/src/com/android/testingcamera2/CameraOps.java index 93fca91..a907ad4 100644 --- a/apps/TestingCamera2/src/com/android/testingcamera2/CameraOps.java +++ b/apps/TestingCamera2/src/com/android/testingcamera2/CameraOps.java @@ -22,7 +22,7 @@ import android.hardware.camera2.CameraAccessException; import android.hardware.camera2.CameraDevice; import android.hardware.camera2.CameraManager; import android.hardware.camera2.CameraMetadata; -import android.hardware.camera2.CameraProperties; +import android.hardware.camera2.CameraCharacteristics; import android.hardware.camera2.CaptureRequest; import android.hardware.camera2.Size; import android.media.Image; @@ -57,7 +57,7 @@ public class CameraOps { private CameraDevice mCamera; private ImageReader mCaptureReader; - private CameraProperties mCameraProperties; + private CameraCharacteristics mCameraCharacteristics; private int mEncodingBitRate; @@ -135,18 +135,18 @@ public class CameraOps { mCameraManager.addAvailabilityListener(listener, mOpsHandler); } - public CameraProperties getCameraProperties() { + public CameraCharacteristics getCameraCharacteristics() { checkOk(); - if (mCameraProperties == null) { - throw new IllegalStateException("CameraProperties is not available"); + if (mCameraCharacteristics == null) { + throw new IllegalStateException("CameraCharacteristics is not available"); } - return mCameraProperties; + return mCameraCharacteristics; } public void closeDevice() throws ApiFailureException { checkOk(); - mCameraProperties = null; + mCameraCharacteristics = null; if (mCamera == null) return; @@ -168,7 +168,7 @@ public class CameraOps { } mCamera = mBlockingCameraManager.openCamera(devices[0], /*listener*/null, mOpsHandler); - mCameraProperties = mCamera.getProperties(); + mCameraCharacteristics = mCamera.getProperties(); } catch (CameraAccessException e) { throw new ApiFailureException("open failure", e); } catch (BlockingOpenException e) { @@ -186,13 +186,13 @@ public class CameraOps { minimalOpenCamera(); try { - CameraProperties properties = mCamera.getProperties(); + CameraCharacteristics properties = mCamera.getProperties(); Size[] previewSizes = null; Size sz = DEFAULT_SIZE; if (properties != null) { previewSizes = properties.get( - CameraProperties.SCALER_AVAILABLE_PROCESSED_SIZES); + CameraCharacteristics.SCALER_AVAILABLE_PROCESSED_SIZES); } if (previewSizes != null && previewSizes.length != 0 && @@ -259,11 +259,11 @@ public class CameraOps { mCamera.stopRepeating(); mCamera.waitUntilIdle(); - CameraProperties properties = mCamera.getProperties(); + CameraCharacteristics properties = mCamera.getProperties(); Size[] jpegSizes = null; if (properties != null) { jpegSizes = properties.get( - CameraProperties.SCALER_AVAILABLE_JPEG_SIZES); + CameraCharacteristics.SCALER_AVAILABLE_JPEG_SIZES); } int width = 640; int height = 480; @@ -372,12 +372,12 @@ public class CameraOps { private Size getRecordingSize() throws ApiFailureException { try { - CameraProperties properties = mCamera.getProperties(); + CameraCharacteristics properties = mCamera.getProperties(); Size[] recordingSizes = null; if (properties != null) { recordingSizes = properties.get( - CameraProperties.SCALER_AVAILABLE_PROCESSED_SIZES); + CameraCharacteristics.SCALER_AVAILABLE_PROCESSED_SIZES); } mEncodingBitRate = ENC_BIT_RATE_LOW; diff --git a/apps/TestingCamera2/src/com/android/testingcamera2/TestingCamera2.java b/apps/TestingCamera2/src/com/android/testingcamera2/TestingCamera2.java index 00028c8..a3882df 100644 --- a/apps/TestingCamera2/src/com/android/testingcamera2/TestingCamera2.java +++ b/apps/TestingCamera2/src/com/android/testingcamera2/TestingCamera2.java @@ -21,8 +21,8 @@ import android.content.res.Configuration; import android.graphics.Bitmap; import android.graphics.BitmapFactory; import android.graphics.ImageFormat; +import android.hardware.camera2.CameraCharacteristics; import android.hardware.camera2.CameraDevice; -import android.hardware.camera2.CameraProperties; import android.hardware.camera2.CaptureFailure; import android.hardware.camera2.CaptureRequest; import android.hardware.camera2.CaptureResult; @@ -381,9 +381,9 @@ public class TestingCamera2 extends Activity implements SurfaceHolder.Callback { @Override public void onProgressChanged(SeekBar seekBar, int progress, boolean fromUser) { int[] defaultRange = {MIN_SENSITIVITY, MAX_SENSITIVITY}; - CameraProperties properties = mCameraOps.getCameraProperties(); + CameraCharacteristics properties = mCameraOps.getCameraCharacteristics(); int[] sensitivityRange = properties.get( - CameraProperties.SENSOR_INFO_SENSITIVITY_RANGE); + CameraCharacteristics.SENSOR_INFO_SENSITIVITY_RANGE); if (sensitivityRange == null || sensitivityRange.length < 2 || sensitivityRange[0] > MIN_SENSITIVITY || sensitivityRange[1] < MAX_SENSITIVITY) { Log.e(TAG, "unable to get sensitivity range, use default range"); @@ -417,9 +417,9 @@ public class TestingCamera2 extends Activity implements SurfaceHolder.Callback { @Override public void onProgressChanged(SeekBar seekBar, int progress, boolean fromUser) { long[] defaultRange = {MIN_EXPOSURE, MAX_EXPOSURE}; - CameraProperties properties = mCameraOps.getCameraProperties(); + CameraCharacteristics properties = mCameraOps.getCameraCharacteristics(); long[] exposureRange = properties.get( - CameraProperties.SENSOR_INFO_EXPOSURE_TIME_RANGE); + CameraCharacteristics.SENSOR_INFO_EXPOSURE_TIME_RANGE); // Not enforce the max value check here, most of the devices don't support // larger than 30s exposure time if (exposureRange == null || exposureRange.length < 2 || @@ -453,9 +453,9 @@ public class TestingCamera2 extends Activity implements SurfaceHolder.Callback { @Override public void onProgressChanged(SeekBar seekBar, int progress, boolean fromUser) { - CameraProperties properties = mCameraOps.getCameraProperties(); + CameraCharacteristics properties = mCameraOps.getCameraCharacteristics(); Long frameDurationMax = properties.get( - CameraProperties.SENSOR_INFO_MAX_FRAME_DURATION); + CameraCharacteristics.SENSOR_INFO_MAX_FRAME_DURATION); if (frameDurationMax == null || frameDurationMax <= 0) { frameDurationMax = MAX_FRAME_DURATION; Log.e(TAG, "max frame duration is invalid, set to " + frameDurationMax); |