Snap for 8730993 from 22fb4de57353fda2492b599ae89725a8c821a401 to mainline-tzdata3-release
Change-Id: I41a1d1db6a0707b073bf64c2c910068c33d48311
diff --git a/camera2/extensions/sample/src/java/androidx/camera/extensions/impl/AutoImageCaptureExtenderImpl.java b/camera2/extensions/sample/src/java/androidx/camera/extensions/impl/AutoImageCaptureExtenderImpl.java
index 5f6cb2b..cabcaae 100755
--- a/camera2/extensions/sample/src/java/androidx/camera/extensions/impl/AutoImageCaptureExtenderImpl.java
+++ b/camera2/extensions/sample/src/java/androidx/camera/extensions/impl/AutoImageCaptureExtenderImpl.java
@@ -18,20 +18,17 @@
import android.content.Context;
import android.hardware.camera2.CameraCharacteristics;
import android.hardware.camera2.CaptureRequest;
-import android.hardware.camera2.CaptureResult;
import android.hardware.camera2.TotalCaptureResult;
import android.media.Image;
import android.media.ImageWriter;
import android.os.Build;
import android.util.Log;
import android.util.Pair;
-import android.util.Range;
import android.util.Size;
import android.view.Surface;
import java.nio.ByteBuffer;
import java.util.ArrayList;
-import java.util.concurrent.Executor;
import java.util.List;
import java.util.Map;
@@ -116,13 +113,6 @@
}
@Override
- public void process(Map<Integer, Pair<Image, TotalCaptureResult>> results,
- ProcessResultImpl resultCallback, Executor executor) {
- throw new RuntimeException("The extension doesn't support capture " +
- "results!");
- }
-
- @Override
public void process(Map<Integer, Pair<Image, TotalCaptureResult>> results) {
Log.d(TAG, "Started auto CaptureProcessor");
@@ -242,19 +232,4 @@
public List<Pair<Integer, Size[]>> getSupportedResolutions() {
return null;
}
-
- @Override
- public Range<Long> getEstimatedCaptureLatencyRange(Size captureOutputSize) {
- return null;
- }
-
- @Override
- public List<CaptureRequest.Key> getAvailableCaptureRequestKeys() {
- return new ArrayList<>();
- }
-
- @Override
- public List<CaptureResult.Key> getAvailableCaptureResultKeys() {
- return new ArrayList<>();
- }
}
diff --git a/camera2/extensions/sample/src/java/androidx/camera/extensions/impl/BeautyImageCaptureExtenderImpl.java b/camera2/extensions/sample/src/java/androidx/camera/extensions/impl/BeautyImageCaptureExtenderImpl.java
index 5c9b2d3..7297314 100755
--- a/camera2/extensions/sample/src/java/androidx/camera/extensions/impl/BeautyImageCaptureExtenderImpl.java
+++ b/camera2/extensions/sample/src/java/androidx/camera/extensions/impl/BeautyImageCaptureExtenderImpl.java
@@ -19,7 +19,6 @@
import android.graphics.ImageFormat;
import android.hardware.camera2.CameraCharacteristics;
import android.hardware.camera2.CaptureRequest;
-import android.hardware.camera2.CaptureResult;
import android.hardware.camera2.TotalCaptureResult;
import android.hardware.camera2.params.StreamConfigurationMap;
import android.media.Image;
@@ -27,13 +26,11 @@
import android.os.Build;
import android.util.Log;
import android.util.Pair;
-import android.util.Range;
import android.util.Size;
import android.view.Surface;
import java.nio.ByteBuffer;
import java.util.ArrayList;
-import java.util.concurrent.Executor;
import java.util.List;
import java.util.Map;
@@ -118,13 +115,6 @@
}
@Override
- public void process(Map<Integer, Pair<Image, TotalCaptureResult>> results,
- ProcessResultImpl resultCallback, Executor executor) {
- throw new RuntimeException("The extension doesn't support capture " +
- "results!");
- }
-
- @Override
public void process(Map<Integer, Pair<Image, TotalCaptureResult>> results) {
Log.d(TAG, "Started beauty CaptureProcessor");
@@ -265,19 +255,4 @@
return formatResolutionsPairList;
}
-
- @Override
- public Range<Long> getEstimatedCaptureLatencyRange(Size captureOutputSize) {
- return null;
- }
-
- @Override
- public List<CaptureRequest.Key> getAvailableCaptureRequestKeys() {
- return new ArrayList<>();
- }
-
- @Override
- public List<CaptureResult.Key> getAvailableCaptureResultKeys() {
- return new ArrayList<>();
- }
}
diff --git a/camera2/extensions/sample/src/java/androidx/camera/extensions/impl/BokehImageCaptureExtenderImpl.java b/camera2/extensions/sample/src/java/androidx/camera/extensions/impl/BokehImageCaptureExtenderImpl.java
index 5c3882b..db57461 100644
--- a/camera2/extensions/sample/src/java/androidx/camera/extensions/impl/BokehImageCaptureExtenderImpl.java
+++ b/camera2/extensions/sample/src/java/androidx/camera/extensions/impl/BokehImageCaptureExtenderImpl.java
@@ -18,21 +18,17 @@
import android.content.Context;
import android.hardware.camera2.CameraCharacteristics;
import android.hardware.camera2.CaptureRequest;
-import android.hardware.camera2.CaptureResult;
import android.hardware.camera2.TotalCaptureResult;
import android.media.Image;
import android.media.ImageWriter;
import android.os.Build;
import android.util.Log;
import android.util.Pair;
-import android.util.Range;
import android.util.Size;
import android.view.Surface;
import java.nio.ByteBuffer;
import java.util.ArrayList;
-import java.util.Arrays;
-import java.util.concurrent.Executor;
import java.util.List;
import java.util.Map;
@@ -79,8 +75,7 @@
return false;
}
- return CameraCharacteristicAvailability.isWBModeAvailable(cameraCharacteristics, MODE) &&
- CameraCharacteristicAvailability.hasFlashUnit(cameraCharacteristics);
+ return CameraCharacteristicAvailability.isWBModeAvailable(cameraCharacteristics, MODE);
}
/**
@@ -113,85 +108,6 @@
}
@Override
- public void process(Map<Integer, Pair<Image, TotalCaptureResult>> results,
- ProcessResultImpl resultCallback, Executor executor) {
- Pair<Image, TotalCaptureResult> result = results.get(DEFAULT_STAGE_ID);
-
- if ((resultCallback != null) && (result != null)) {
- ArrayList<Pair<CaptureResult.Key, Object>> captureResults =
- new ArrayList<>();
- Long shutterTimestamp =
- result.second.get(CaptureResult.SENSOR_TIMESTAMP);
- if (shutterTimestamp != null) {
- Integer aeMode = result.second.get(
- CaptureResult.CONTROL_AE_MODE);
- if (aeMode != null) {
- captureResults.add(new Pair<>(CaptureResult.CONTROL_AE_MODE,
- aeMode));
- }
-
- Integer aeTrigger = result.second.get(
- CaptureResult.CONTROL_AE_PRECAPTURE_TRIGGER);
- if (aeTrigger != null) {
- captureResults.add(new Pair<>(
- CaptureResult.CONTROL_AE_PRECAPTURE_TRIGGER,
- aeTrigger));
- }
-
- Boolean aeLock = result.second.get(CaptureResult.CONTROL_AE_LOCK);
- if (aeLock != null) {
- captureResults.add(new Pair<>(CaptureResult.CONTROL_AE_LOCK,
- aeLock));
- }
-
- Integer aeState = result.second.get(
- CaptureResult.CONTROL_AE_STATE);
- if (aeState != null) {
- captureResults.add(new Pair<>(CaptureResult.CONTROL_AE_STATE,
- aeState));
- }
-
- Integer flashMode = result.second.get(
- CaptureResult.FLASH_MODE);
- if (flashMode != null) {
- captureResults.add(new Pair<>(CaptureResult.FLASH_MODE,
- flashMode));
- }
-
- Integer flashState = result.second.get(
- CaptureResult.FLASH_STATE);
- if (flashState != null) {
- captureResults.add(new Pair<>(CaptureResult.FLASH_STATE,
- flashState));
- }
-
- Byte jpegQuality = result.second.get(CaptureResult.JPEG_QUALITY);
- if (jpegQuality != null) {
- captureResults.add(new Pair<>(CaptureResult.JPEG_QUALITY,
- jpegQuality));
- }
-
- Integer jpegOrientation = result.second.get(
- CaptureResult.JPEG_ORIENTATION);
- if (jpegOrientation != null) {
- captureResults.add(new Pair<>(CaptureResult.JPEG_ORIENTATION,
- jpegOrientation));
- }
-
- if (executor != null) {
- executor.execute(() -> resultCallback.onCaptureCompleted(
- shutterTimestamp, captureResults));
- } else {
- resultCallback.onCaptureCompleted(shutterTimestamp,
- captureResults);
- }
- }
- }
-
- process(results);
- }
-
- @Override
public void process(Map<Integer, Pair<Image, TotalCaptureResult>> results) {
Log.d(TAG, "Started bokeh CaptureProcessor");
@@ -215,13 +131,6 @@
yByteBuffer.put(result.first.getPlanes()[0].getBuffer());
uByteBuffer.put(result.first.getPlanes()[2].getBuffer());
vByteBuffer.put(result.first.getPlanes()[1].getBuffer());
- Long sensorTimestamp =
- result.second.get(CaptureResult.SENSOR_TIMESTAMP);
- if (sensorTimestamp != null) {
- image.setTimestamp(sensorTimestamp);
- } else {
- Log.e(TAG, "Sensor timestamp absent using default!");
- }
mImageWriter.queueInputImage(image);
}
@@ -320,25 +229,4 @@
return null;
}
- @Override
- public Range<Long> getEstimatedCaptureLatencyRange(Size captureOutputSize) {
- return null;
- }
-
- @Override
- public List<CaptureRequest.Key> getAvailableCaptureRequestKeys() {
- final CaptureRequest.Key [] CAPTURE_REQUEST_SET = {CaptureRequest.CONTROL_AE_MODE,
- CaptureRequest.CONTROL_AE_PRECAPTURE_TRIGGER, CaptureRequest.CONTROL_AE_LOCK,
- CaptureRequest.FLASH_MODE};
- return Arrays.asList(CAPTURE_REQUEST_SET);
- }
-
- @Override
- public List<CaptureResult.Key> getAvailableCaptureResultKeys() {
- final CaptureResult.Key [] CAPTURE_RESULT_SET = {CaptureResult.CONTROL_AE_MODE,
- CaptureResult.CONTROL_AE_PRECAPTURE_TRIGGER, CaptureResult.CONTROL_AE_LOCK,
- CaptureResult.CONTROL_AE_STATE, CaptureResult.FLASH_MODE,
- CaptureResult.FLASH_STATE};
- return Arrays.asList(CAPTURE_RESULT_SET);
- }
}
diff --git a/camera2/extensions/sample/src/java/androidx/camera/extensions/impl/BokehPreviewExtenderImpl.java b/camera2/extensions/sample/src/java/androidx/camera/extensions/impl/BokehPreviewExtenderImpl.java
index 45c7f47..8c43d34 100644
--- a/camera2/extensions/sample/src/java/androidx/camera/extensions/impl/BokehPreviewExtenderImpl.java
+++ b/camera2/extensions/sample/src/java/androidx/camera/extensions/impl/BokehPreviewExtenderImpl.java
@@ -68,8 +68,7 @@
return false;
}
- return CameraCharacteristicAvailability.isWBModeAvailable(cameraCharacteristics, MODE) &&
- CameraCharacteristicAvailability.hasFlashUnit(cameraCharacteristics);
+ return CameraCharacteristicAvailability.isWBModeAvailable(cameraCharacteristics, MODE);
}
/**
diff --git a/camera2/extensions/sample/src/java/androidx/camera/extensions/impl/CameraCharacteristicAvailability.java b/camera2/extensions/sample/src/java/androidx/camera/extensions/impl/CameraCharacteristicAvailability.java
index f7c6569..0b51c7c 100644
--- a/camera2/extensions/sample/src/java/androidx/camera/extensions/impl/CameraCharacteristicAvailability.java
+++ b/camera2/extensions/sample/src/java/androidx/camera/extensions/impl/CameraCharacteristicAvailability.java
@@ -18,7 +18,6 @@
import android.hardware.camera2.CameraCharacteristics;
import android.util.Log;
-import android.util.Range;
import java.util.Arrays;
@@ -32,54 +31,6 @@
}
/**
- * Check if the given device supports flash.
- *
- * @param cameraCharacteristics the camera characteristics.
- * @return {@code true} if the device supports flash
- * {@code false} otherwise.
- */
- static boolean hasFlashUnit(CameraCharacteristics cameraCharacteristics) {
- Boolean flashInfo = cameraCharacteristics.get(CameraCharacteristics.FLASH_INFO_AVAILABLE);
-
- return (flashInfo != null) ? flashInfo : false;
- }
-
- /**
- * Check if the given device supports zoom ratio.
- *
- * @param cameraCharacteristics the camera characteristics.
- * @return {@code true} if the device supports zoom ratio
- * {@code false} otherwise.
- */
- static boolean supportsZoomRatio(CameraCharacteristics cameraCharacteristics) {
- Range<Float> zoomRatioRange = cameraCharacteristics.get(
- CameraCharacteristics.CONTROL_ZOOM_RATIO_RANGE);
-
- return (zoomRatioRange != null) && (zoomRatioRange.getUpper() > 1.f);
- }
-
- /**
- * Check if the given device is fixed focus or not.
- *
- * @param cameraCharacteristics the camera characteristics.
- * @return {@code true} if the device is not fixed focus
- * {@code false} otherwise.
- */
- static boolean hasFocuser(CameraCharacteristics cameraCharacteristics) {
- Float minFocusDistance = cameraCharacteristics.get(
- CameraCharacteristics.LENS_INFO_MINIMUM_FOCUS_DISTANCE);
- if (minFocusDistance == null) {
- Log.d(TAG, "No LENS_INFO_MINIMUM_FOCUS_DISTANCE info");
- return false;
- }
-
- if (minFocusDistance > 0.f) {
- return true;
- }
- return false;
- }
-
- /**
* Check if the given white balance mode id is available in the camera characteristics.
*
* @param cameraCharacteristics the camera characteristics.
diff --git a/camera2/extensions/sample/src/java/androidx/camera/extensions/impl/CaptureProcessorImpl.java b/camera2/extensions/sample/src/java/androidx/camera/extensions/impl/CaptureProcessorImpl.java
index efd0afa..1a257e2 100644
--- a/camera2/extensions/sample/src/java/androidx/camera/extensions/impl/CaptureProcessorImpl.java
+++ b/camera2/extensions/sample/src/java/androidx/camera/extensions/impl/CaptureProcessorImpl.java
@@ -22,7 +22,6 @@
import android.util.Size;
import android.view.Surface;
-import java.util.concurrent.Executor;
import java.util.Map;
/**
@@ -56,25 +55,6 @@
void process(Map<Integer, Pair<Image, TotalCaptureResult>> results);
/**
- * Process a set images captured that were requested.
- *
- * <p> The result of the processing step should be written to the {@link Surface} that was
- * received by {@link #onOutputSurface(Surface, int)}.
- *
- * @param results The map of {@link ImageFormat#YUV_420_888} format images and metadata
- * to process. The {@link Image} that are contained within the map will
- * become invalid after this method completes, so no references to them
- * should be kept.
- * @param resultCallback Capture result callback to be called once the capture result
- * values are ready.
- * @param executor The executor to run the callback on. If null then the callback will
- * run on any arbitrary executor.
- * @since 1.3
- */
- void process(Map<Integer, Pair<Image, TotalCaptureResult>> results,
- ProcessResultImpl resultCallback, Executor executor);
-
- /**
* This callback will be invoked when CameraX changes the configured input resolution. After
* this call, {@link CaptureProcessorImpl} should expect any {@link Image} received as input
* to be at the specified resolution.
diff --git a/camera2/extensions/sample/src/java/androidx/camera/extensions/impl/ExtensionVersionImpl.java b/camera2/extensions/sample/src/java/androidx/camera/extensions/impl/ExtensionVersionImpl.java
index af147ed..76cc2c4 100644
--- a/camera2/extensions/sample/src/java/androidx/camera/extensions/impl/ExtensionVersionImpl.java
+++ b/camera2/extensions/sample/src/java/androidx/camera/extensions/impl/ExtensionVersionImpl.java
@@ -29,7 +29,7 @@
*/
public class ExtensionVersionImpl {
private static final String TAG = "ExtenderVersionImpl";
- private static final String VERSION = "1.3.0";
+ private static final String VERSION = "1.1.0";
/**
* @hide
diff --git a/camera2/extensions/sample/src/java/androidx/camera/extensions/impl/HdrImageCaptureExtenderImpl.java b/camera2/extensions/sample/src/java/androidx/camera/extensions/impl/HdrImageCaptureExtenderImpl.java
index 57b7fe6..d6f017f 100644
--- a/camera2/extensions/sample/src/java/androidx/camera/extensions/impl/HdrImageCaptureExtenderImpl.java
+++ b/camera2/extensions/sample/src/java/androidx/camera/extensions/impl/HdrImageCaptureExtenderImpl.java
@@ -18,22 +18,17 @@
import android.content.Context;
import android.hardware.camera2.CameraCharacteristics;
import android.hardware.camera2.CaptureRequest;
-import android.hardware.camera2.CaptureResult;
import android.hardware.camera2.TotalCaptureResult;
-import android.hardware.camera2.params.MeteringRectangle;
import android.media.Image;
import android.media.ImageWriter;
import android.os.Build;
import android.util.Log;
import android.util.Pair;
-import android.util.Range;
import android.util.Size;
import android.view.Surface;
import java.nio.ByteBuffer;
import java.util.ArrayList;
-import java.util.Arrays;
-import java.util.concurrent.Executor;
import java.util.List;
import java.util.Map;
import java.util.concurrent.TimeUnit;
@@ -73,14 +68,8 @@
@Override
public boolean isExtensionAvailable(String cameraId,
CameraCharacteristics cameraCharacteristics) {
- boolean zoomRatioSupported =
- CameraCharacteristicAvailability.supportsZoomRatio(cameraCharacteristics);
- boolean hasFocuser =
- CameraCharacteristicAvailability.hasFocuser(cameraCharacteristics);
-
// Requires API 23 for ImageWriter
- return (android.os.Build.VERSION.SDK_INT >= android.os.Build.VERSION_CODES.M) &&
- zoomRatioSupported && hasFocuser;
+ return android.os.Build.VERSION.SDK_INT >= android.os.Build.VERSION_CODES.M;
}
/**
@@ -130,74 +119,6 @@
}
@Override
- public void process(Map<Integer, Pair<Image, TotalCaptureResult>> results,
- ProcessResultImpl resultCallback, Executor executor) {
- Pair<Image, TotalCaptureResult> result = results.get(NORMAL_STAGE_ID);
-
- if ((resultCallback != null) && (result != null)) {
- ArrayList<Pair<CaptureResult.Key, Object>> captureResults =
- new ArrayList<>();
- Long shutterTimestamp = results.get(UNDER_STAGE_ID).second.get(
- CaptureResult.SENSOR_TIMESTAMP);
- if (shutterTimestamp != null) {
- Float zoomRatio = result.second.get(
- CaptureResult.CONTROL_ZOOM_RATIO);
- if (zoomRatio != null) {
- captureResults.add(new Pair<>(CaptureResult.CONTROL_ZOOM_RATIO,
- zoomRatio));
- }
- Integer afMode = result.second.get(
- CaptureResult.CONTROL_AF_MODE);
- if (afMode != null) {
- captureResults.add(new Pair<>(CaptureResult.CONTROL_AF_MODE,
- afMode));
- }
- Integer afTrigger = result.second.get(
- CaptureResult.CONTROL_AF_TRIGGER);
- if (afTrigger != null) {
- captureResults.add(new Pair<>(CaptureResult.CONTROL_AF_TRIGGER,
- afTrigger));
- }
- Integer afState = result.second.get(
- CaptureResult.CONTROL_AF_STATE);
- if (afState != null) {
- captureResults.add(new Pair<>(CaptureResult.CONTROL_AF_STATE,
- afState));
- }
- MeteringRectangle[] afRegions = result.second.get(
- CaptureResult.CONTROL_AF_REGIONS);
- if (afRegions != null) {
- captureResults.add(new Pair<>(CaptureResult.CONTROL_AF_REGIONS,
- afRegions));
- }
-
- Byte jpegQuality = result.second.get(CaptureResult.JPEG_QUALITY);
- if (jpegQuality != null) {
- captureResults.add(new Pair<>(CaptureResult.JPEG_QUALITY,
- jpegQuality));
- }
-
- Integer jpegOrientation = result.second.get(
- CaptureResult.JPEG_ORIENTATION);
- if (jpegOrientation != null) {
- captureResults.add(new Pair<>(CaptureResult.JPEG_ORIENTATION,
- jpegOrientation));
- }
-
- if (executor != null) {
- executor.execute(() -> resultCallback.onCaptureCompleted(
- shutterTimestamp, captureResults));
- } else {
- resultCallback.onCaptureCompleted(shutterTimestamp,
- captureResults);
- }
- }
- }
-
- process(results);
- }
-
- @Override
public void process(Map<Integer, Pair<Image, TotalCaptureResult>> results) {
Log.d(TAG, "Started HDR CaptureProcessor");
@@ -238,15 +159,10 @@
ByteBuffer vByteBuffer = image.getPlanes()[1].getBuffer();
// Sample here just simply return the normal image result
- yByteBuffer.put(imageDataPairs.get(
- NORMAL_STAGE_ID).first.getPlanes()[0].getBuffer());
- uByteBuffer.put(imageDataPairs.get(
- NORMAL_STAGE_ID).first.getPlanes()[2].getBuffer());
- vByteBuffer.put(imageDataPairs.get(
- NORMAL_STAGE_ID).first.getPlanes()[1].getBuffer());
+ yByteBuffer.put(imageDataPairs.get(1).first.getPlanes()[0].getBuffer());
+ uByteBuffer.put(imageDataPairs.get(1).first.getPlanes()[2].getBuffer());
+ vByteBuffer.put(imageDataPairs.get(1).first.getPlanes()[1].getBuffer());
- image.setTimestamp(imageDataPairs.get(
- UNDER_STAGE_ID).first.getTimestamp());
mImageWriter.queueInputImage(image);
}
@@ -331,24 +247,4 @@
return null;
}
- @Override
- public Range<Long> getEstimatedCaptureLatencyRange(Size captureOutputSize) {
- return null;
- }
-
- @Override
- public List<CaptureRequest.Key> getAvailableCaptureRequestKeys() {
- final CaptureRequest.Key [] CAPTURE_REQUEST_SET = {CaptureRequest.CONTROL_ZOOM_RATIO,
- CaptureRequest.CONTROL_AF_MODE, CaptureRequest.CONTROL_AF_REGIONS,
- CaptureRequest.CONTROL_AF_TRIGGER};
- return Arrays.asList(CAPTURE_REQUEST_SET);
- }
-
- @Override
- public List<CaptureResult.Key> getAvailableCaptureResultKeys() {
- final CaptureResult.Key [] CAPTURE_RESULT_SET = {CaptureResult.CONTROL_ZOOM_RATIO,
- CaptureResult.CONTROL_AF_MODE, CaptureResult.CONTROL_AF_REGIONS,
- CaptureResult.CONTROL_AF_TRIGGER, CaptureResult.CONTROL_AF_STATE};
- return Arrays.asList(CAPTURE_RESULT_SET);
- }
}
diff --git a/camera2/extensions/sample/src/java/androidx/camera/extensions/impl/HdrPreviewExtenderImpl.java b/camera2/extensions/sample/src/java/androidx/camera/extensions/impl/HdrPreviewExtenderImpl.java
index 78b0a9d..2a47109 100644
--- a/camera2/extensions/sample/src/java/androidx/camera/extensions/impl/HdrPreviewExtenderImpl.java
+++ b/camera2/extensions/sample/src/java/androidx/camera/extensions/impl/HdrPreviewExtenderImpl.java
@@ -18,17 +18,13 @@
import android.content.Context;
import android.hardware.camera2.CameraCharacteristics;
-import android.hardware.camera2.CaptureResult;
import android.hardware.camera2.TotalCaptureResult;
-import android.hardware.camera2.params.MeteringRectangle;
import android.media.ImageWriter;
import android.media.Image;
import android.util.Pair;
import android.util.Size;
import android.view.Surface;
-import java.util.ArrayList;
-import java.util.concurrent.Executor;
import java.util.List;
/**
@@ -63,14 +59,8 @@
@Override
public boolean isExtensionAvailable(String cameraId,
CameraCharacteristics cameraCharacteristics) {
- boolean zoomRatioSupported =
- CameraCharacteristicAvailability.supportsZoomRatio(cameraCharacteristics);
- boolean hasFocuser =
- CameraCharacteristicAvailability.hasFocuser(cameraCharacteristics);
-
- // Requires API 23 for ImageWriter
- return (android.os.Build.VERSION.SDK_INT >= android.os.Build.VERSION_CODES.M) &&
- zoomRatioSupported && hasFocuser;
+ // Implement the logic to check whether the extension function is supported or not.
+ return true;
}
/**
@@ -136,58 +126,6 @@
}
@Override
- public void process(Image image, TotalCaptureResult result,
- ProcessResultImpl resultCallback, Executor executor) {
- if ((resultCallback != null) && (result != null)) {
- ArrayList<Pair<CaptureResult.Key, Object>> captureResults = new ArrayList<>();
- Long shutterTimestamp = result.get(CaptureResult.SENSOR_TIMESTAMP);
- if (shutterTimestamp != null) {
- Float zoomRatio = result.get(CaptureResult.CONTROL_ZOOM_RATIO);
- if (zoomRatio != null) {
- captureResults.add(new Pair<>(CaptureResult.CONTROL_ZOOM_RATIO, zoomRatio));
- }
- Integer afMode = result.get(CaptureResult.CONTROL_AF_MODE);
- if (afMode != null) {
- captureResults.add(new Pair<>(CaptureResult.CONTROL_AF_MODE, afMode));
- }
- Integer afTrigger = result.get(CaptureResult.CONTROL_AF_TRIGGER);
- if (afTrigger != null) {
- captureResults.add(new Pair<>(CaptureResult.CONTROL_AF_TRIGGER, afTrigger));
- }
- Integer afState = result.get(CaptureResult.CONTROL_AF_STATE);
- if (afState != null) {
- captureResults.add(new Pair<>(CaptureResult.CONTROL_AF_STATE, afState));
- }
- MeteringRectangle[] afRegions = result.get(CaptureResult.CONTROL_AF_REGIONS);
- if (afRegions != null) {
- captureResults.add(new Pair<>(CaptureResult.CONTROL_AF_REGIONS, afRegions));
- }
-
-
- Byte jpegQuality = result.get(CaptureResult.JPEG_QUALITY);
- if (jpegQuality != null) {
- captureResults.add(new Pair<>(CaptureResult.JPEG_QUALITY, jpegQuality));
- }
-
- Integer jpegOrientation = result.get(CaptureResult.JPEG_ORIENTATION);
- if (jpegOrientation != null) {
- captureResults.add(new Pair<>(CaptureResult.JPEG_ORIENTATION,
- jpegOrientation));
- }
-
- if (executor != null) {
- executor.execute(() -> resultCallback.onCaptureCompleted(shutterTimestamp,
- captureResults));
- } else {
- resultCallback.onCaptureCompleted(shutterTimestamp, captureResults);
- }
- }
- }
-
- process(image, result);
- }
-
- @Override
public void onResolutionUpdate(Size size) {
}
diff --git a/camera2/extensions/sample/src/java/androidx/camera/extensions/impl/ImageCaptureExtenderImpl.java b/camera2/extensions/sample/src/java/androidx/camera/extensions/impl/ImageCaptureExtenderImpl.java
index c27a5db..b70038f 100644
--- a/camera2/extensions/sample/src/java/androidx/camera/extensions/impl/ImageCaptureExtenderImpl.java
+++ b/camera2/extensions/sample/src/java/androidx/camera/extensions/impl/ImageCaptureExtenderImpl.java
@@ -18,10 +18,7 @@
import android.graphics.ImageFormat;
import android.hardware.camera2.CameraCharacteristics;
-import android.hardware.camera2.CaptureRequest;
-import android.hardware.camera2.CaptureResult;
import android.util.Pair;
-import android.util.Range;
import android.util.Size;
import java.util.List;
@@ -89,54 +86,5 @@
* @hide
*/
List<Pair<Integer, Size[]>> getSupportedResolutions();
-
- /**
- * Returns the estimated capture latency range in milliseconds for the target capture
- * resolution.
- *
- * <p>This includes the time spent processing the multi-frame capture request along with any
- * additional time for encoding of the processed buffer in the framework if necessary.</p>
- *
- * @param captureOutputSize size of the capture output surface. If it is null or not in the
- * supported output sizes, maximum capture output size is used for
- * the estimation.
- * @return the range of estimated minimal and maximal capture latency in milliseconds, or
- * null if no capture latency info can be provided.
- * @since 1.2
- */
- Range<Long> getEstimatedCaptureLatencyRange(Size captureOutputSize);
-
- /**
- * Return a list of orthogonal capture request keys.
- *
- * <p>Any keys included in the list will be configurable by clients of the extension and will
- * affect the extension functionality.</p>
- *
- * <p>Do note that the list of keys applies to {@link PreviewExtenderImpl} as well.</p>
- *
- * @return List of supported orthogonal capture keys, or
- * null if no capture settings are not supported.
- * @since 1.3
- */
- List<CaptureRequest.Key> getAvailableCaptureRequestKeys();
-
- /**
- * Return a list of supported capture result keys.
- *
- * <p>Any keys included in this list must be available as part of the registered
- * {@link ProcessResultImpl} callback. In case frame processing is not supported,
- * then the Camera2/CameraX framework will use the list to filter and notify camera clients
- * using the respective camera results.</p>
- *
- * <p>At the very minimum, it is expected that the result key list is a superset of the
- * capture request keys.</p>
- *
- * <p>Do note that the list of keys applies to {@link PreviewExtenderImpl} as well.</p>
- *
- * @return List of supported capture result keys, or
- * null if capture results are not supported.
- * @since 1.3
- */
- List<CaptureResult.Key> getAvailableCaptureResultKeys();
}
diff --git a/camera2/extensions/sample/src/java/androidx/camera/extensions/impl/NightImageCaptureExtenderImpl.java b/camera2/extensions/sample/src/java/androidx/camera/extensions/impl/NightImageCaptureExtenderImpl.java
index f0821ed..3d00a46 100755
--- a/camera2/extensions/sample/src/java/androidx/camera/extensions/impl/NightImageCaptureExtenderImpl.java
+++ b/camera2/extensions/sample/src/java/androidx/camera/extensions/impl/NightImageCaptureExtenderImpl.java
@@ -18,20 +18,17 @@
import android.content.Context;
import android.hardware.camera2.CameraCharacteristics;
import android.hardware.camera2.CaptureRequest;
-import android.hardware.camera2.CaptureResult;
import android.hardware.camera2.TotalCaptureResult;
import android.media.Image;
import android.media.ImageWriter;
import android.os.Build;
import android.util.Log;
import android.util.Pair;
-import android.util.Range;
import android.util.Size;
import android.view.Surface;
import java.nio.ByteBuffer;
import java.util.ArrayList;
-import java.util.concurrent.Executor;
import java.util.List;
import java.util.Map;
@@ -116,13 +113,6 @@
}
@Override
- public void process(Map<Integer, Pair<Image, TotalCaptureResult>> results,
- ProcessResultImpl resultCallback, Executor executor) {
- throw new RuntimeException("The extension doesn't support capture " +
- "results!");
- }
-
- @Override
public void process(Map<Integer, Pair<Image, TotalCaptureResult>> results) {
Log.d(TAG, "Started night CaptureProcessor");
@@ -242,19 +232,4 @@
public List<Pair<Integer, Size[]>> getSupportedResolutions() {
return null;
}
-
- @Override
- public Range<Long> getEstimatedCaptureLatencyRange(Size captureOutputSize) {
- return null;
- }
-
- @Override
- public List<CaptureRequest.Key> getAvailableCaptureRequestKeys() {
- return new ArrayList<>();
- }
-
- @Override
- public List<CaptureResult.Key> getAvailableCaptureResultKeys() {
- return new ArrayList<>();
- }
}
diff --git a/camera2/extensions/sample/src/java/androidx/camera/extensions/impl/PreviewImageProcessorImpl.java b/camera2/extensions/sample/src/java/androidx/camera/extensions/impl/PreviewImageProcessorImpl.java
index 0ae84cf..3c750db 100644
--- a/camera2/extensions/sample/src/java/androidx/camera/extensions/impl/PreviewImageProcessorImpl.java
+++ b/camera2/extensions/sample/src/java/androidx/camera/extensions/impl/PreviewImageProcessorImpl.java
@@ -19,7 +19,6 @@
import android.hardware.camera2.TotalCaptureResult;
import android.media.Image;
-import java.util.concurrent.Executor;
/**
* Processing a single {@link Image} and {@link TotalCaptureResult} to produce an output to a
* stream.
@@ -40,24 +39,5 @@
* @hide
*/
void process(Image image, TotalCaptureResult result);
-
- /**
- * Processes the requested image capture.
- *
- * <p> The result of the processing step should be written to the {@link android.view.Surface}
- * that was received by {@link ProcessorImpl#onOutputSurface(android.view.Surface, int)}.
- *
- * @param image The {@link ImageFormat#YUV_420_888} format image to process. This will
- * be invalid after the method completes so no reference to it should be
- * kept.
- * @param result The metadata associated with the image to process.
- * @param resultCallback Capture result callback to be called once the capture result
- * values are ready.
- * @param executor The executor to run the callback on. If null then the callback will
- * run on any arbitrary executor.
- * @since 1.3
- */
- void process(Image image, TotalCaptureResult result, ProcessResultImpl resultCallback,
- Executor executor);
}
diff --git a/camera2/extensions/sample/src/java/androidx/camera/extensions/impl/ProcessResultImpl.java b/camera2/extensions/sample/src/java/androidx/camera/extensions/impl/ProcessResultImpl.java
deleted file mode 100644
index d4c2014..0000000
--- a/camera2/extensions/sample/src/java/androidx/camera/extensions/impl/ProcessResultImpl.java
+++ /dev/null
@@ -1,43 +0,0 @@
-/*
- * Copyright 2022 The Android Open Source Project
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package androidx.camera.extensions.impl;
-
-import android.hardware.camera2.CaptureResult;
-import android.util.Pair;
-
-import java.util.List;
-
-/**
- * Allows clients to receive information about the capture result values of processed frames.
- *
- * @since 1.3
- */
-public interface ProcessResultImpl {
- /**
- * Capture result callback that needs to be called when the process capture results are
- * ready as part of frame post-processing.
- *
- * @param shutterTimestamp The shutter time stamp of the processed frame.
- * @param result Key value pairs for all supported capture results. Do note that
- * if results 'android.jpeg.quality' and 'android.jpeg.orientation'
- * are present in the process capture input results, then the values
- * must also be passed as part of this callback. Both Camera2 and
- * CameraX guarantee that those two settings and results are always
- * supported and applied by the corresponding framework.
- */
- void onCaptureCompleted(long shutterTimestamp, List<Pair<CaptureResult.Key, Object>> result);
-}
diff --git a/camera2/extensions/stub/src/main/java/androidx/camera/extensions/impl/AutoImageCaptureExtenderImpl.java b/camera2/extensions/stub/src/main/java/androidx/camera/extensions/impl/AutoImageCaptureExtenderImpl.java
index ccb0dac..a364d4b 100755
--- a/camera2/extensions/stub/src/main/java/androidx/camera/extensions/impl/AutoImageCaptureExtenderImpl.java
+++ b/camera2/extensions/stub/src/main/java/androidx/camera/extensions/impl/AutoImageCaptureExtenderImpl.java
@@ -17,8 +17,6 @@
import android.content.Context;
import android.hardware.camera2.CameraCharacteristics;
-import android.hardware.camera2.CaptureRequest;
-import android.hardware.camera2.CaptureResult;
import android.util.Pair;
import android.util.Range;
import android.util.Size;
@@ -100,17 +98,4 @@
public Range<Long> getEstimatedCaptureLatencyRange(@NonNull Size captureOutputSize) {
throw new RuntimeException("Stub, replace with implementation.");
}
-
- @Nullable
- @Override
- public List<CaptureRequest.Key> getAvailableCaptureRequestKeys() {
- throw new RuntimeException("Stub, replace with implementation.");
- }
-
- @Nullable
- @Override
- public List<CaptureResult.Key> getAvailableCaptureResultKeys() {
- throw new RuntimeException("Stub, replace with implementation.");
- }
-
}
diff --git a/camera2/extensions/stub/src/main/java/androidx/camera/extensions/impl/BeautyImageCaptureExtenderImpl.java b/camera2/extensions/stub/src/main/java/androidx/camera/extensions/impl/BeautyImageCaptureExtenderImpl.java
index 2d26639..d68d8eb 100755
--- a/camera2/extensions/stub/src/main/java/androidx/camera/extensions/impl/BeautyImageCaptureExtenderImpl.java
+++ b/camera2/extensions/stub/src/main/java/androidx/camera/extensions/impl/BeautyImageCaptureExtenderImpl.java
@@ -17,8 +17,6 @@
import android.content.Context;
import android.hardware.camera2.CameraCharacteristics;
-import android.hardware.camera2.CaptureRequest;
-import android.hardware.camera2.CaptureResult;
import android.util.Pair;
import android.util.Range;
import android.util.Size;
@@ -100,16 +98,4 @@
public Range<Long> getEstimatedCaptureLatencyRange(@NonNull Size captureOutputSize) {
throw new RuntimeException("Stub, replace with implementation.");
}
-
- @Nullable
- @Override
- public List<CaptureRequest.Key> getAvailableCaptureRequestKeys() {
- throw new RuntimeException("Stub, replace with implementation.");
- }
-
- @Nullable
- @Override
- public List<CaptureResult.Key> getAvailableCaptureResultKeys() {
- throw new RuntimeException("Stub, replace with implementation.");
- }
}
diff --git a/camera2/extensions/stub/src/main/java/androidx/camera/extensions/impl/BokehImageCaptureExtenderImpl.java b/camera2/extensions/stub/src/main/java/androidx/camera/extensions/impl/BokehImageCaptureExtenderImpl.java
index 66c5839..b943e0a 100644
--- a/camera2/extensions/stub/src/main/java/androidx/camera/extensions/impl/BokehImageCaptureExtenderImpl.java
+++ b/camera2/extensions/stub/src/main/java/androidx/camera/extensions/impl/BokehImageCaptureExtenderImpl.java
@@ -17,8 +17,6 @@
import android.content.Context;
import android.hardware.camera2.CameraCharacteristics;
-import android.hardware.camera2.CaptureRequest;
-import android.hardware.camera2.CaptureResult;
import android.util.Pair;
import android.util.Range;
import android.util.Size;
@@ -100,17 +98,4 @@
public Range<Long> getEstimatedCaptureLatencyRange(@NonNull Size captureOutputSize) {
throw new RuntimeException("Stub, replace with implementation.");
}
-
- @Nullable
- @Override
- public List<CaptureRequest.Key> getAvailableCaptureRequestKeys() {
- throw new RuntimeException("Stub, replace with implementation.");
- }
-
- @Nullable
- @Override
- public List<CaptureResult.Key> getAvailableCaptureResultKeys() {
- throw new RuntimeException("Stub, replace with implementation.");
- }
-
}
diff --git a/camera2/extensions/stub/src/main/java/androidx/camera/extensions/impl/CaptureProcessorImpl.java b/camera2/extensions/stub/src/main/java/androidx/camera/extensions/impl/CaptureProcessorImpl.java
index 3eee146..90de15a 100644
--- a/camera2/extensions/stub/src/main/java/androidx/camera/extensions/impl/CaptureProcessorImpl.java
+++ b/camera2/extensions/stub/src/main/java/androidx/camera/extensions/impl/CaptureProcessorImpl.java
@@ -16,7 +16,6 @@
package androidx.camera.extensions.impl;
-import android.annotation.SuppressLint;
import android.graphics.ImageFormat;
import android.hardware.camera2.TotalCaptureResult;
import android.media.Image;
@@ -24,14 +23,12 @@
import android.view.Surface;
import java.util.Map;
-import java.util.concurrent.Executor;
/**
* The interface for processing a set of {@link Image}s that have captured.
*
* @since 1.0
*/
-@SuppressLint("UnknownNullness")
public interface CaptureProcessorImpl extends ProcessorImpl {
/**
* Process a set images captured that were requested.
@@ -44,23 +41,4 @@
* invalid after this method completes, so no references to them should be kept.
*/
void process(Map<Integer, Pair<Image, TotalCaptureResult>> results);
-
- /**
- * Process a set images captured that were requested.
- *
- * <p> The result of the processing step should be written to the {@link Surface} that was
- * received by {@link #onOutputSurface(Surface, int)}.
- *
- * @param results The map of {@link ImageFormat#YUV_420_888} format images and metadata
- * to process. The {@link Image} that are contained within the map will
- * become invalid after this method completes, so no references to them
- * should be kept.
- * @param resultCallback Capture result callback to be called once the capture result
- * values of the processed image are ready.
- * @param executor The executor to run the callback on. If null then the callback will
- * run on any arbitrary executor.
- * @since 1.3
- */
- void process(Map<Integer, Pair<Image, TotalCaptureResult>> results,
- ProcessResultImpl resultCallback, Executor executor);
}
diff --git a/camera2/extensions/stub/src/main/java/androidx/camera/extensions/impl/HdrImageCaptureExtenderImpl.java b/camera2/extensions/stub/src/main/java/androidx/camera/extensions/impl/HdrImageCaptureExtenderImpl.java
index f1191dc..66f4a50 100644
--- a/camera2/extensions/stub/src/main/java/androidx/camera/extensions/impl/HdrImageCaptureExtenderImpl.java
+++ b/camera2/extensions/stub/src/main/java/androidx/camera/extensions/impl/HdrImageCaptureExtenderImpl.java
@@ -17,8 +17,6 @@
import android.content.Context;
import android.hardware.camera2.CameraCharacteristics;
-import android.hardware.camera2.CaptureRequest;
-import android.hardware.camera2.CaptureResult;
import android.util.Pair;
import android.util.Range;
import android.util.Size;
@@ -100,16 +98,4 @@
public Range<Long> getEstimatedCaptureLatencyRange(@NonNull Size captureOutputSize) {
throw new RuntimeException("Stub, replace with implementation.");
}
-
- @Nullable
- @Override
- public List<CaptureRequest.Key> getAvailableCaptureRequestKeys() {
- throw new RuntimeException("Stub, replace with implementation.");
- }
-
- @Nullable
- @Override
- public List<CaptureResult.Key> getAvailableCaptureResultKeys() {
- throw new RuntimeException("Stub, replace with implementation.");
- }
}
diff --git a/camera2/extensions/stub/src/main/java/androidx/camera/extensions/impl/ImageCaptureExtenderImpl.java b/camera2/extensions/stub/src/main/java/androidx/camera/extensions/impl/ImageCaptureExtenderImpl.java
index 88bd105..571c2e3 100644
--- a/camera2/extensions/stub/src/main/java/androidx/camera/extensions/impl/ImageCaptureExtenderImpl.java
+++ b/camera2/extensions/stub/src/main/java/androidx/camera/extensions/impl/ImageCaptureExtenderImpl.java
@@ -16,15 +16,14 @@
package androidx.camera.extensions.impl;
-import android.annotation.SuppressLint;
import android.graphics.ImageFormat;
import android.hardware.camera2.CameraCharacteristics;
-import android.hardware.camera2.CaptureRequest;
-import android.hardware.camera2.CaptureResult;
import android.util.Pair;
import android.util.Range;
import android.util.Size;
+import androidx.annotation.Nullable;
+
import java.util.List;
/**
@@ -32,7 +31,6 @@
*
* @since 1.0
*/
-@SuppressLint("UnknownNullness")
public interface ImageCaptureExtenderImpl extends ExtenderStateListener {
/**
* Indicates whether the extension is supported on the device.
@@ -78,10 +76,10 @@
* returned list is not null, it will be used to find the best resolutions combination for
* the bound use cases.
*
- * @return the customized supported resolutions, or null to support all sizes retrieved from
- * {@link android.hardware.camera2.params.StreamConfigurationMap}.
+ * @return the customized supported resolutions.
* @since 1.1
*/
+ @Nullable
List<Pair<Integer, Size[]>> getSupportedResolutions();
/**
@@ -89,7 +87,7 @@
* resolution.
*
* <p>This includes the time spent processing the multi-frame capture request along with any
- * additional time for encoding of the processed buffer in the framework if necessary.</p>
+ * additional time for encoding of the processed buffer in the framework if necessary.
*
* @param captureOutputSize size of the capture output surface. If it is null or not in the
* supported output sizes, maximum capture output size is used for
@@ -98,65 +96,6 @@
* null if no capture latency info can be provided.
* @since 1.2
*/
- Range<Long> getEstimatedCaptureLatencyRange(Size captureOutputSize);
-
- /**
- * Return a list of orthogonal capture request keys.
- *
- * <p>Any keys included in the list will be configurable by clients of the extension and will
- * affect the extension functionality.</p>
- *
- * <p>Do note that the list of keys applies to {@link PreviewExtenderImpl} as well.</p>
- *
- * <p>Also note that the keys {@link CaptureRequest#JPEG_QUALITY} and
- * {@link CaptureRequest#JPEG_ORIENTATION} are always supported regardless being added in the
- * list or not. To support common camera operations like zoom, tap-to-focus, flash and
- * exposure compensation, we recommend supporting the following keys if possible.
- * <pre>
- * zoom: {@link CaptureRequest#CONTROL_ZOOM_RATIO}
- * {@link CaptureRequest#SCALER_CROP_REGION}
- * tap-to-focus:
- * {@link CaptureRequest#CONTROL_AF_MODE}
- * {@link CaptureRequest#CONTROL_AF_TRIGGER}
- * {@link CaptureRequest#CONTROL_AF_REGIONS}
- * {@link CaptureRequest#CONTROL_AE_REGIONS}
- * {@link CaptureRequest#CONTROL_AWB_REGIONS}
- * flash:
- * {@link CaptureRequest#CONTROL_AE_MODE}
- * {@link CaptureRequest#CONTROL_AE_PRECAPTURE_TRIGGER}
- * {@link CaptureRequest#FLASH_MODE}
- * exposure compensation:
- * {@link CaptureRequest#CONTROL_AE_EXPOSURE_COMPENSATION}
- * </pre>
- * On basic extensions that implement 1.2 or prior version, the above keys are all supported
- * explicitly. When migrating from 1.2 or prior to 1.3, please note that both CameraX and
- * Camera2 will honor the returned list and support only the keys contained in it. For
- * example, if OEM decides to return only {@link CaptureRequest#CONTROL_ZOOM_RATIO} and
- * {@link CaptureRequest#SCALER_CROP_REGION} in the 1.3 implementation, it means only zoom is
- * supported for the app while tap-to-focus , flash and exposure compensation are not allowed.
- *
- * @return List of supported orthogonal capture keys, or an empty list if no capture settings
- * are not supported.
- * @since 1.3
- */
- List<CaptureRequest.Key> getAvailableCaptureRequestKeys();
-
- /**
- * Return a list of supported capture result keys.
- *
- * <p>Any keys included in this list must be available as part of the registered
- * {@link ProcessResultImpl} callback. In case frame processing is not supported,
- * then the Camera2/CameraX framework will use the list to filter and notify camera clients
- * using the respective camera results.</p>
- *
- * <p>At the very minimum, it is expected that the result key list is a superset of the
- * capture request keys.</p>
- *
- * <p>Do note that the list of keys applies to {@link PreviewExtenderImpl} as well.</p>
- *
- * @return List of supported capture result keys, or an empty list if capture results are not
- * supported.
- * @since 1.3
- */
- List<CaptureResult.Key> getAvailableCaptureResultKeys();
+ @Nullable
+ Range<Long> getEstimatedCaptureLatencyRange(@Nullable Size captureOutputSize);
}
diff --git a/camera2/extensions/stub/src/main/java/androidx/camera/extensions/impl/NightImageCaptureExtenderImpl.java b/camera2/extensions/stub/src/main/java/androidx/camera/extensions/impl/NightImageCaptureExtenderImpl.java
index c8ac978..3b39cf1 100755
--- a/camera2/extensions/stub/src/main/java/androidx/camera/extensions/impl/NightImageCaptureExtenderImpl.java
+++ b/camera2/extensions/stub/src/main/java/androidx/camera/extensions/impl/NightImageCaptureExtenderImpl.java
@@ -17,8 +17,6 @@
import android.content.Context;
import android.hardware.camera2.CameraCharacteristics;
-import android.hardware.camera2.CaptureRequest;
-import android.hardware.camera2.CaptureResult;
import android.util.Pair;
import android.util.Range;
import android.util.Size;
@@ -100,16 +98,4 @@
public Range<Long> getEstimatedCaptureLatencyRange(@NonNull Size captureOutputSize) {
throw new RuntimeException("Stub, replace with implementation.");
}
-
- @Nullable
- @Override
- public List<CaptureRequest.Key> getAvailableCaptureRequestKeys() {
- throw new RuntimeException("Stub, replace with implementation.");
- }
-
- @Nullable
- @Override
- public List<CaptureResult.Key> getAvailableCaptureResultKeys() {
- throw new RuntimeException("Stub, replace with implementation.");
- }
}
diff --git a/camera2/extensions/stub/src/main/java/androidx/camera/extensions/impl/PreviewImageProcessorImpl.java b/camera2/extensions/stub/src/main/java/androidx/camera/extensions/impl/PreviewImageProcessorImpl.java
index f203eba..e7ecaa1 100644
--- a/camera2/extensions/stub/src/main/java/androidx/camera/extensions/impl/PreviewImageProcessorImpl.java
+++ b/camera2/extensions/stub/src/main/java/androidx/camera/extensions/impl/PreviewImageProcessorImpl.java
@@ -16,20 +16,16 @@
package androidx.camera.extensions.impl;
-import android.annotation.SuppressLint;
import android.graphics.ImageFormat;
import android.hardware.camera2.TotalCaptureResult;
import android.media.Image;
-import java.util.concurrent.Executor;
-
/**
* Processes a single {@link Image} and {@link TotalCaptureResult} to produce an output to a
* stream.
*
* @since 1.0
*/
-@SuppressLint("UnknownNullness")
public interface PreviewImageProcessorImpl extends ProcessorImpl {
/**
* Processes the requested image capture.
@@ -42,23 +38,4 @@
* @param result The metadata associated with the image to process.
*/
void process(Image image, TotalCaptureResult result);
-
- /**
- * Processes the requested image capture.
- *
- * <p> The result of the processing step should be written to the {@link android.view.Surface}
- * that was received by {@link ProcessorImpl#onOutputSurface(android.view.Surface, int)}.
- *
- * @param image The {@link ImageFormat#YUV_420_888} format image to process. This will
- * be invalid after the method completes so no reference to it should be
- * kept.
- * @param result The metadata associated with the image to process.
- * @param resultCallback Capture result callback to be called once the capture result
- * values of the processed image are ready.
- * @param executor The executor to run the callback on. If null then the callback will
- * run on any arbitrary executor.
- * @since 1.3
- */
- void process(Image image, TotalCaptureResult result, ProcessResultImpl resultCallback,
- Executor executor);
}
diff --git a/camera2/extensions/stub/src/main/java/androidx/camera/extensions/impl/ProcessResultImpl.java b/camera2/extensions/stub/src/main/java/androidx/camera/extensions/impl/ProcessResultImpl.java
deleted file mode 100644
index d0e3605..0000000
--- a/camera2/extensions/stub/src/main/java/androidx/camera/extensions/impl/ProcessResultImpl.java
+++ /dev/null
@@ -1,45 +0,0 @@
-/*
- * Copyright 2022 The Android Open Source Project
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package androidx.camera.extensions.impl;
-
-import android.annotation.SuppressLint;
-import android.hardware.camera2.CaptureResult;
-import android.util.Pair;
-
-import java.util.List;
-
-/**
- * Allows clients to receive information about the capture result values of processed frames.
- *
- * @since 1.3
- */
-@SuppressLint("UnknownNullness")
-public interface ProcessResultImpl {
- /**
- * Capture result callback that needs to be called when the process capture results are
- * ready as part of frame post-processing.
- *
- * @param shutterTimestamp The shutter time stamp of the processed frame.
- * @param result Key value pairs for all supported capture results. Do note that
- * if results 'android.jpeg.quality' and 'android.jpeg.orientation'
- * are present in the process capture input results, then the values
- * must also be passed as part of this callback. Both Camera2 and
- * CameraX guarantee that those two settings and results are always
- * supported and applied by the corresponding framework.
- */
- void onCaptureCompleted(long shutterTimestamp, List<Pair<CaptureResult.Key, Object>> result);
-}
diff --git a/camera2/extensions/stub/src/main/java/androidx/camera/extensions/impl/advanced/AdvancedExtenderImpl.java b/camera2/extensions/stub/src/main/java/androidx/camera/extensions/impl/advanced/AdvancedExtenderImpl.java
index 465bfe8..86424c4 100644
--- a/camera2/extensions/stub/src/main/java/androidx/camera/extensions/impl/advanced/AdvancedExtenderImpl.java
+++ b/camera2/extensions/stub/src/main/java/androidx/camera/extensions/impl/advanced/AdvancedExtenderImpl.java
@@ -18,8 +18,6 @@
import android.annotation.SuppressLint;
import android.hardware.camera2.CameraCharacteristics;
-import android.hardware.camera2.CaptureRequest;
-import android.hardware.camera2.CaptureResult;
import android.util.Range;
import android.util.Size;
@@ -127,7 +125,7 @@
* Returns supported output sizes for Image Analysis (YUV_420_888 format).
*
* <p>OEM can optionally support a YUV surface for ImageAnalysis along with Preview/ImageCapture
- * output surfaces. If imageAnalysis YUV surface is not supported, OEM should return null or
+ * output surfaces. If imageAnalysis YUV surface is not supported, OEM will return null or
* empty list.
*/
List<Size> getSupportedYuvAnalysisResolutions(String cameraId);
@@ -137,52 +135,4 @@
* required for starting a extension and cleanup.
*/
SessionProcessorImpl createSessionProcessor();
-
- /**
- * Returns a list of orthogonal capture request keys.
- *
- * <p>Any keys included in the list will be configurable by clients of the extension and will
- * affect the extension functionality.</p>
- *
- * <p>Please note that the keys {@link CaptureRequest#JPEG_QUALITY} and
- * {@link CaptureRequest#JPEG_ORIENTATION} are always supported regardless being added in the
- * list or not. To support common camera operations like zoom, tap-to-focus, flash and
- * exposure compensation, we recommend supporting the following keys if possible.
- * <pre>
- * zoom: {@link CaptureRequest#CONTROL_ZOOM_RATIO}
- * {@link CaptureRequest#SCALER_CROP_REGION}
- * tap-to-focus:
- * {@link CaptureRequest#CONTROL_AF_MODE}
- * {@link CaptureRequest#CONTROL_AF_TRIGGER}
- * {@link CaptureRequest#CONTROL_AF_REGIONS}
- * {@link CaptureRequest#CONTROL_AE_REGIONS}
- * {@link CaptureRequest#CONTROL_AWB_REGIONS}
- * flash:
- * {@link CaptureRequest#CONTROL_AE_MODE}
- * {@link CaptureRequest#CONTROL_AE_PRECAPTURE_TRIGGER}
- * {@link CaptureRequest#FLASH_MODE}
- * exposure compensation:
- * {@link CaptureRequest#CONTROL_AE_EXPOSURE_COMPENSATION}
- * </pre>
- *
- * @return List of supported orthogonal capture keys, or an empty list if no capture settings
- * are not supported.
- * @since 1.3
- */
- List<CaptureRequest.Key> getAvailableCaptureRequestKeys();
-
- /**
- * Returns a list of supported capture result keys.
- *
- * <p>Any keys included in this list must be available as part of the registered
- * {@link SessionProcessorImpl.CaptureCallback#onCaptureCompleted} callback.</p>
- *
- * <p>At the very minimum, it is expected that the result key list is a superset of the
- * capture request keys.</p>
- *
- * @return List of supported capture result keys, or
- * an empty list if capture results are not supported.
- * @since 1.3
- */
- List<CaptureResult.Key> getAvailableCaptureResultKeys();
}
diff --git a/camera2/extensions/stub/src/main/java/androidx/camera/extensions/impl/advanced/AutoAdvancedExtenderImpl.java b/camera2/extensions/stub/src/main/java/androidx/camera/extensions/impl/advanced/AutoAdvancedExtenderImpl.java
index 0d3bd4a..7753258 100644
--- a/camera2/extensions/stub/src/main/java/androidx/camera/extensions/impl/advanced/AutoAdvancedExtenderImpl.java
+++ b/camera2/extensions/stub/src/main/java/androidx/camera/extensions/impl/advanced/AutoAdvancedExtenderImpl.java
@@ -18,8 +18,6 @@
import android.annotation.SuppressLint;
import android.hardware.camera2.CameraCharacteristics;
-import android.hardware.camera2.CaptureRequest;
-import android.hardware.camera2.CaptureResult;
import android.util.Range;
import android.util.Size;
@@ -78,14 +76,4 @@
public SessionProcessorImpl createSessionProcessor() {
throw new RuntimeException("Stub, replace with implementation.");
}
-
- @Override
- public List<CaptureRequest.Key> getAvailableCaptureRequestKeys() {
- throw new RuntimeException("Stub, replace with implementation.");
- }
-
- @Override
- public List<CaptureResult.Key> getAvailableCaptureResultKeys() {
- throw new RuntimeException("Stub, replace with implementation.");
- }
}
diff --git a/camera2/extensions/stub/src/main/java/androidx/camera/extensions/impl/advanced/BeautyAdvancedExtenderImpl.java b/camera2/extensions/stub/src/main/java/androidx/camera/extensions/impl/advanced/BeautyAdvancedExtenderImpl.java
index 1dec326..91d8171 100644
--- a/camera2/extensions/stub/src/main/java/androidx/camera/extensions/impl/advanced/BeautyAdvancedExtenderImpl.java
+++ b/camera2/extensions/stub/src/main/java/androidx/camera/extensions/impl/advanced/BeautyAdvancedExtenderImpl.java
@@ -18,8 +18,6 @@
import android.annotation.SuppressLint;
import android.hardware.camera2.CameraCharacteristics;
-import android.hardware.camera2.CaptureRequest;
-import android.hardware.camera2.CaptureResult;
import android.util.Range;
import android.util.Size;
@@ -78,14 +76,4 @@
public SessionProcessorImpl createSessionProcessor() {
throw new RuntimeException("Stub, replace with implementation.");
}
-
- @Override
- public List<CaptureRequest.Key> getAvailableCaptureRequestKeys() {
- throw new RuntimeException("Stub, replace with implementation.");
- }
-
- @Override
- public List<CaptureResult.Key> getAvailableCaptureResultKeys() {
- throw new RuntimeException("Stub, replace with implementation.");
- }
}
diff --git a/camera2/extensions/stub/src/main/java/androidx/camera/extensions/impl/advanced/BokehAdvancedExtenderImpl.java b/camera2/extensions/stub/src/main/java/androidx/camera/extensions/impl/advanced/BokehAdvancedExtenderImpl.java
index bc41b4e..b05740d 100644
--- a/camera2/extensions/stub/src/main/java/androidx/camera/extensions/impl/advanced/BokehAdvancedExtenderImpl.java
+++ b/camera2/extensions/stub/src/main/java/androidx/camera/extensions/impl/advanced/BokehAdvancedExtenderImpl.java
@@ -18,8 +18,6 @@
import android.annotation.SuppressLint;
import android.hardware.camera2.CameraCharacteristics;
-import android.hardware.camera2.CaptureRequest;
-import android.hardware.camera2.CaptureResult;
import android.util.Range;
import android.util.Size;
@@ -78,14 +76,4 @@
public SessionProcessorImpl createSessionProcessor() {
throw new RuntimeException("Stub, replace with implementation.");
}
-
- @Override
- public List<CaptureRequest.Key> getAvailableCaptureRequestKeys() {
- throw new RuntimeException("Stub, replace with implementation.");
- }
-
- @Override
- public List<CaptureResult.Key> getAvailableCaptureResultKeys() {
- throw new RuntimeException("Stub, replace with implementation.");
- }
}
diff --git a/camera2/extensions/stub/src/main/java/androidx/camera/extensions/impl/advanced/Camera2OutputConfigImplBuilder.java b/camera2/extensions/stub/src/main/java/androidx/camera/extensions/impl/advanced/Camera2OutputConfigImplBuilder.java
index a66d3ce..1298d80 100644
--- a/camera2/extensions/stub/src/main/java/androidx/camera/extensions/impl/advanced/Camera2OutputConfigImplBuilder.java
+++ b/camera2/extensions/stub/src/main/java/androidx/camera/extensions/impl/advanced/Camera2OutputConfigImplBuilder.java
@@ -17,7 +17,6 @@
package androidx.camera.extensions.impl.advanced;
import android.annotation.SuppressLint;
-import android.hardware.camera2.params.OutputConfiguration;
import android.util.Size;
import android.view.Surface;
@@ -27,12 +26,13 @@
/**
* A builder implementation to help OEM build the {@link Camera2OutputConfigImpl} instance.
+ * Implementation will be provided in the stub.
*/
@SuppressLint("UnknownNullness")
public class Camera2OutputConfigImplBuilder {
static AtomicInteger sLastId = new AtomicInteger(0);
private OutputConfigImplImpl mOutputConfig;
- private int mSurfaceGroupId = OutputConfiguration.SURFACE_GROUP_ID_NONE;
+ private int mSurfaceGroupId;
private String mPhysicalCameraId;
private List<Camera2OutputConfigImpl> mSurfaceSharingConfigs;
diff --git a/camera2/extensions/stub/src/main/java/androidx/camera/extensions/impl/advanced/Camera2SessionConfigImplBuilder.java b/camera2/extensions/stub/src/main/java/androidx/camera/extensions/impl/advanced/Camera2SessionConfigImplBuilder.java
index a301166..6c052d1 100644
--- a/camera2/extensions/stub/src/main/java/androidx/camera/extensions/impl/advanced/Camera2SessionConfigImplBuilder.java
+++ b/camera2/extensions/stub/src/main/java/androidx/camera/extensions/impl/advanced/Camera2SessionConfigImplBuilder.java
@@ -28,6 +28,7 @@
/**
* A builder implementation to help OEM build the {@link Camera2SessionConfigImpl} instance.
+ * Implementation will be provided in the stub.
*/
@SuppressLint("UnknownNullness")
public class Camera2SessionConfigImplBuilder {
diff --git a/camera2/extensions/stub/src/main/java/androidx/camera/extensions/impl/advanced/HdrAdvancedExtenderImpl.java b/camera2/extensions/stub/src/main/java/androidx/camera/extensions/impl/advanced/HdrAdvancedExtenderImpl.java
index 06157dc..bfd8e9a 100644
--- a/camera2/extensions/stub/src/main/java/androidx/camera/extensions/impl/advanced/HdrAdvancedExtenderImpl.java
+++ b/camera2/extensions/stub/src/main/java/androidx/camera/extensions/impl/advanced/HdrAdvancedExtenderImpl.java
@@ -18,8 +18,6 @@
import android.annotation.SuppressLint;
import android.hardware.camera2.CameraCharacteristics;
-import android.hardware.camera2.CaptureRequest;
-import android.hardware.camera2.CaptureResult;
import android.util.Range;
import android.util.Size;
@@ -79,14 +77,4 @@
public SessionProcessorImpl createSessionProcessor() {
throw new RuntimeException("Stub, replace with implementation.");
}
-
- @Override
- public List<CaptureRequest.Key> getAvailableCaptureRequestKeys() {
- throw new RuntimeException("Stub, replace with implementation.");
- }
-
- @Override
- public List<CaptureResult.Key> getAvailableCaptureResultKeys() {
- throw new RuntimeException("Stub, replace with implementation.");
- }
}
diff --git a/camera2/extensions/stub/src/main/java/androidx/camera/extensions/impl/advanced/NightAdvancedExtenderImpl.java b/camera2/extensions/stub/src/main/java/androidx/camera/extensions/impl/advanced/NightAdvancedExtenderImpl.java
index 97da5c1..fc05224 100644
--- a/camera2/extensions/stub/src/main/java/androidx/camera/extensions/impl/advanced/NightAdvancedExtenderImpl.java
+++ b/camera2/extensions/stub/src/main/java/androidx/camera/extensions/impl/advanced/NightAdvancedExtenderImpl.java
@@ -18,8 +18,6 @@
import android.annotation.SuppressLint;
import android.hardware.camera2.CameraCharacteristics;
-import android.hardware.camera2.CaptureRequest;
-import android.hardware.camera2.CaptureResult;
import android.util.Range;
import android.util.Size;
@@ -78,14 +76,4 @@
public SessionProcessorImpl createSessionProcessor() {
throw new RuntimeException("Stub, replace with implementation.");
}
-
- @Override
- public List<CaptureRequest.Key> getAvailableCaptureRequestKeys() {
- throw new RuntimeException("Stub, replace with implementation.");
- }
-
- @Override
- public List<CaptureResult.Key> getAvailableCaptureResultKeys() {
- throw new RuntimeException("Stub, replace with implementation.");
- }
}
diff --git a/camera2/extensions/stub/src/main/java/androidx/camera/extensions/impl/advanced/RequestProcessorImpl.java b/camera2/extensions/stub/src/main/java/androidx/camera/extensions/impl/advanced/RequestProcessorImpl.java
index 5185333..e70ce37 100644
--- a/camera2/extensions/stub/src/main/java/androidx/camera/extensions/impl/advanced/RequestProcessorImpl.java
+++ b/camera2/extensions/stub/src/main/java/androidx/camera/extensions/impl/advanced/RequestProcessorImpl.java
@@ -26,7 +26,7 @@
import java.util.Map;
/**
- * An Interface to execute Camera2 capture requests.
+ * A Interface to execute requests.
*/
@SuppressLint("UnknownNullness")
public interface RequestProcessorImpl {
@@ -38,25 +38,24 @@
/**
* Submits a request.
* @return the id of the capture sequence or -1 in case the processor encounters a fatal error
- * or receives an invalid argument.
+ * or receives and invalid argument.
*/
int submit(Request request, Callback callback);
/**
* Submits a list of requests.
* @return the id of the capture sequence or -1 in case the processor encounters a fatal error
- * or receives an invalid argument.
+ * or receives and invalid argument.
*/
int submit(List<Request> requests, Callback callback);
/**
* Set repeating requests.
* @return the id of the capture sequence or -1 in case the processor encounters a fatal error
- * or receives an invalid argument.
+ * or receives and invalid argument.
*/
int setRepeating(Request request, Callback callback);
-
/**
* Abort captures.
*/
diff --git a/camera2/extensions/stub/src/main/java/androidx/camera/extensions/impl/advanced/SessionProcessorImpl.java b/camera2/extensions/stub/src/main/java/androidx/camera/extensions/impl/advanced/SessionProcessorImpl.java
index fabfc2b..9ac3eeb 100644
--- a/camera2/extensions/stub/src/main/java/androidx/camera/extensions/impl/advanced/SessionProcessorImpl.java
+++ b/camera2/extensions/stub/src/main/java/androidx/camera/extensions/impl/advanced/SessionProcessorImpl.java
@@ -20,17 +20,15 @@
import android.content.Context;
import android.hardware.camera2.CameraCharacteristics;
import android.hardware.camera2.CaptureRequest;
-import android.hardware.camera2.CaptureResult;
import android.view.Surface;
import java.util.Map;
/**
- * Interface for creating Camera2 CameraCaptureSessions with extension enabled based on
- * advanced vendor implementation.
+ * Interface for activating extension sessions.
*
* <p><pre>
- * The flow of a extension session is shown below:
+ * The flow of a extension session.
* (1) {@link #initSession}: CameraX prepares streams configuration for creating
* CameraCaptureSession. Output surfaces for Preview, ImageCapture and ImageAnalysis are passed
* in and vendor is responsible for outputting the results to these surfaces.
@@ -40,41 +38,43 @@
* single requests.
*
* (3) {@link #startRepeating}: CameraX will call this method to start the repeating request
- * after CameraCaptureSession is called. Vendor should start the repeating request by
- * {@link RequestProcessorImpl}. Vendor can also update the repeating request if needed later.
+ * after CameraCaptureSession is called. Vendor should start the repeating request by
+ * {@link RequestProcessorImpl}. Vendor can also update the repeating request at other
+ * time other than in this method.
*
* (4) {@link #setParameters(Map)}: The passed parameters will be attached to the repeating request
* and single requests but vendor can choose to apply some of them only.
*
* (5) {@link #startCapture(CaptureCallback)}: It is called when apps want to
* start a multi-frame image capture. {@link CaptureCallback} will be called
- * to report the status and the output image will be written to the capture output surface
+ * to report the statue and the output image will be written to the capture output surface
* specified in {@link #initSession}.
*
* (5) {@link #onCaptureSessionEnd}: It is called right BEFORE CameraCaptureSession.close() is
* called.
*
- * (6) {@link #deInitSession}: called when CameraCaptureSession is closed.
+ * (6) {@link #deInitSession}: called when CameraCaptureSession is destroyed
* </pre>
*/
@SuppressLint("UnknownNullness")
public interface SessionProcessorImpl {
/**
- * Initializes the session for the extension. This is where the OEMs allocate resources for
- * preparing a CameraCaptureSession. After initSession() is called, the camera ID,
+ * Notify to start the session for the extension. This is where the use case is started and
+ * would be able to allocate resources here. After onInit() is called, the camera ID,
* cameraCharacteristics and context will not change until deInitSession() has been called.
*
* <p>CameraX specifies the output surface configurations for preview, image capture and image
* analysis[optional]. And OEM returns a {@link Camera2SessionConfigImpl} which consists of a
* list of {@link Camera2OutputConfigImpl} and session parameters. The
- * {@link Camera2SessionConfigImpl} will be used to configure the CameraCaptureSession.
+ * {@link Camera2SessionConfigImpl} will be used to configure the
+ * CameraCaptureSession.
*
* <p>OEM is responsible for outputting correct camera images output to these output surfaces.
* OEM can have the following options to enable the output:
* <pre>
* (1) Add these output surfaces in CameraCaptureSession directly using
- * {@link Camera2OutputConfigImplBuilder#newSurfaceConfig(Surface)} }. Processing is done in
- * HAL.
+ * {@link Camera2OutputConfigImplBuilder#newSurfaceConfig(Surface)} }. Processing
+ * may be done in HAL.
*
* (2) Use surface sharing with other surface by calling
* {@link Camera2OutputConfigImplBuilder#addSurfaceSharingOutputConfig(Camera2OutputConfigImpl)}
@@ -85,6 +85,13 @@
* {@link Camera2SessionConfigImpl}.
* </pre>
*
+ * <p>To ensure the preview, image capture and image analysis are working properly, OEM is
+ * responsible for setting corresponding {@link Camera2OutputConfigImpl.UsageType} in the
+ * {@link Camera2OutputConfigImpl}. CameraX will examine if all usage types
+ * (USAGE_PREVIEW/USAGE_CAPTURE/USAGE_ANALYSIS) can be found in the returned
+ * {@link Camera2SessionConfigImpl} and throws an {@link IllegalArgumentException} if some
+ * usage type is not found.
+ *
* <p>{@link Camera2OutputConfigImplBuilder} and {@link Camera2SessionConfigImplBuilder}
* implementations are provided in the stub for OEM to construct the
* {@link Camera2OutputConfigImpl} and {@link Camera2SessionConfigImpl} instances.
@@ -94,7 +101,8 @@
* @param imageAnalysisSurfaceConfig an optional output config for image analysis
* (YUV_420_888).
* @return a {@link Camera2SessionConfigImpl} consisting of a list of
- * {@link Camera2OutputConfigImpl} and session parameters which will decide the
+ * {@link Camera2OutputConfigImpl}
+ * and session parameters which will decide the
* {@link android.hardware.camera2.params.SessionConfiguration} for configuring the
* CameraCaptureSession. Please note that the OutputConfiguration list may not be part of any
* supported or mandatory stream combination BUT OEM must ensure this list will always
@@ -109,10 +117,10 @@
OutputSurfaceImpl imageAnalysisSurfaceConfig);
/**
- * Notify to de-initialize the extension. This callback will be invoked after
- * CameraCaptureSession is closed. After onDeInit() was called, it is expected that the
- * camera ID, cameraCharacteristics will no longer hold and tear down any resources allocated
- * for this extension. Aborts all pending captures.
+ * Notify to de-initialize the extension. This callback will be invoked after unbind. After
+ * onDeInit() was called, it is expected that the camera ID, cameraCharacteristics will
+ * no longer hold and tear down any resources allocated for this extension. Aborts all pending
+ * captures.
*/
void deInitSession();
@@ -124,22 +132,6 @@
void setParameters(Map<CaptureRequest.Key<?>, Object> parameters);
/**
- * CameraX / Camera2 will call this interface in response to client requests involving
- * the output preview surface. Typical examples include requests that include AF/AE triggers.
- * Extensions can disregard any capture request keys that were not advertised in
- * {@link AdvancedExtenderImpl#getAvailableCaptureRequestKeys}.
- *
- * @param triggers Capture request key value map.
- * @param callback a callback to report the status.
- * @return the id of the capture sequence.
- *
- * @throws IllegalArgumentException If there are no valid settings that can be applied
- *
- * @since 1.3
- */
- int startTrigger(Map<CaptureRequest.Key<?>, Object> triggers, CaptureCallback callback);
-
- /**
* This will be invoked once after the {@link android.hardware.camera2.CameraCaptureSession}
* has been created. {@link RequestProcessorImpl} is passed for OEM to submit single
* requests or set repeating requests. This ExtensionRequestProcessor will be valid to use
@@ -157,7 +149,7 @@
/**
* Starts the repeating request after CameraCaptureSession is called. Vendor should start the
* repeating request by {@link RequestProcessorImpl}. Vendor can also update the
- * repeating request when needed later.
+ * repeating request at time other than in this method.
*
* @param callback a callback to report the status.
* @return the id of the capture sequence.
@@ -166,9 +158,10 @@
/**
* Stop the repeating request. To prevent OEM from not calling stopRepeating, CameraX will
- * first stop the repeating request of current CameraCaptureSession and call this API to signal
- * OEM that the repeating request was stopped and going forward calling
- * {@link RequestProcessorImpl#setRepeating} will simply do nothing.
+ * first stop repeating of current CameraCaptureSession and call this API to signal OEM that
+ * all repeating request should stopped and calling
+ * {@link RequestProcessorImpl#setRepeating(RequestProcessorImpl.Request)} will simply do
+ * nothing.
*/
void stopRepeating();
@@ -188,7 +181,7 @@
int startCapture(CaptureCallback callback);
/**
- * Abort all capture tasks.
+ * Abort capture tasks.
*/
void abortCapture(int captureSequenceId);
@@ -252,30 +245,5 @@
* @param captureSequenceId id of the current capture sequence
*/
void onCaptureSequenceAborted(int captureSequenceId);
-
- /**
- * Capture result callback that needs to be called when the process capture results are
- * ready as part of frame post-processing.
- *
- * This callback will fire after {@link #onCaptureStarted}, {@link #onCaptureProcessStarted}
- * and before {@link #onCaptureSequenceCompleted}. The callback is not expected to fire
- * in case of capture failure {@link #onCaptureFailed} or capture abort
- * {@link #onCaptureSequenceAborted}.
- *
- * @param timestamp The timestamp at start of capture. The same timestamp value
- * passed to {@link #onCaptureStarted}.
- * @param captureSequenceId the capture id of the request that generated the capture
- * results. This is the return value of either
- * {@link #startRepeating} or {@link #startCapture}.
- * @param result Map containing the supported capture results. Do note
- * that if results 'android.jpeg.quality' and
- * 'android.jpeg.orientation' are present in the process
- * capture input results, then the values must also be passed
- * as part of this callback. Both Camera2 and CameraX guarantee
- * that those two settings and results are always supported and
- * applied by the corresponding framework.
- */
- void onCaptureCompleted(long timestamp, int captureSequenceId,
- Map<CaptureResult.Key, Object> result);
}
}
diff --git a/common/BUILD b/common/BUILD
deleted file mode 100644
index 80893a0..0000000
--- a/common/BUILD
+++ /dev/null
@@ -1,19 +0,0 @@
-# TODO(b/198224074): auto-generate this file using bp2build.
-load("@rules_android//rules:rules.bzl", "android_library")
-load("//build/make/tools:event_log_tags.bzl", "event_log_tags")
-
-event_log_tags(
- name = "genlogtags",
- srcs = glob(["java/**/*.logtags"]),
-)
-
-android_library(
- name = "android-common",
- srcs = glob([
- "java/**/*.java",
- ]),
- custom_package = "com.android.common",
- manifest = "AndroidManifest.xml",
- visibility = ["//visibility:public"],
- deps = ["//prebuilts/sdk:public_current_android_sdk_java_import"],
-)