summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRavneet Dhanjal <rdhanjal@google.com>2022-12-02 01:52:36 +0000
committerAutomerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>2022-12-02 01:52:36 +0000
commit854f3bf6040c3ff50c4819664734f48f86c36fa4 (patch)
treeb8a32134a76251c6de082032f065179a4d497de3
parenta1b274cdbaefa98846fadb7adb7d7d615174fab5 (diff)
parent3a00916d70e02c4af902139661f721f31b4213ff (diff)
downloadex-854f3bf6040c3ff50c4819664734f48f86c36fa4.tar.gz
Merge "Camera Extension sample: Update CaptureProcessorImpl" am: 1e7c9cc307 am: 3a00916d70
Original change: https://android-review.googlesource.com/c/platform/frameworks/ex/+/2323881 Change-Id: I1909ebf9bf6b202a82f48331ef503b66e63696a2 Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
-rw-r--r--camera2/extensions/advancedSample/src/java/androidx/camera/extensions/impl/CaptureProcessorImpl.java48
-rw-r--r--camera2/extensions/sample/src/java/androidx/camera/extensions/impl/CaptureProcessorImpl.java48
2 files changed, 18 insertions, 78 deletions
diff --git a/camera2/extensions/advancedSample/src/java/androidx/camera/extensions/impl/CaptureProcessorImpl.java b/camera2/extensions/advancedSample/src/java/androidx/camera/extensions/impl/CaptureProcessorImpl.java
index efd0afac..3eee146a 100644
--- a/camera2/extensions/advancedSample/src/java/androidx/camera/extensions/impl/CaptureProcessorImpl.java
+++ b/camera2/extensions/advancedSample/src/java/androidx/camera/extensions/impl/CaptureProcessorImpl.java
@@ -16,42 +16,32 @@
package androidx.camera.extensions.impl;
+import android.annotation.SuppressLint;
+import android.graphics.ImageFormat;
import android.hardware.camera2.TotalCaptureResult;
import android.media.Image;
import android.util.Pair;
-import android.util.Size;
import android.view.Surface;
-import java.util.concurrent.Executor;
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
- * @hide
*/
-public interface CaptureProcessorImpl {
- /**
- * This gets called to update where the CaptureProcessor should write the output of {@link
- * #process(Map)}.
- *
- * @param surface The {@link Surface} that the CaptureProcessor should write data into.
- * @param imageFormat The format of that the surface expects.
- * @hide
- */
- void onOutputSurface(Surface surface, int imageFormat);
-
+@SuppressLint("UnknownNullness")
+public interface CaptureProcessorImpl extends ProcessorImpl {
/**
* 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 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.
- * @hide
+ * @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.
*/
void process(Map<Integer, Pair<Image, TotalCaptureResult>> results);
@@ -66,31 +56,11 @@ public interface CaptureProcessorImpl {
* 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.
+ * 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);
-
- /**
- * 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.
- *
- * @param size for the surface.
- * @hide
- */
- void onResolutionUpdate(Size size);
-
- /**
- * This callback will be invoked when CameraX changes the configured input image format.
- * After this call, {@link CaptureProcessorImpl} should expect any {@link Image} received as
- * input to have the specified image format.
- *
- * @param imageFormat for the surface.
- * @hide
- */
- void onImageFormatUpdate(int imageFormat);
}
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 efd0afac..3eee146a 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
@@ -16,42 +16,32 @@
package androidx.camera.extensions.impl;
+import android.annotation.SuppressLint;
+import android.graphics.ImageFormat;
import android.hardware.camera2.TotalCaptureResult;
import android.media.Image;
import android.util.Pair;
-import android.util.Size;
import android.view.Surface;
-import java.util.concurrent.Executor;
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
- * @hide
*/
-public interface CaptureProcessorImpl {
- /**
- * This gets called to update where the CaptureProcessor should write the output of {@link
- * #process(Map)}.
- *
- * @param surface The {@link Surface} that the CaptureProcessor should write data into.
- * @param imageFormat The format of that the surface expects.
- * @hide
- */
- void onOutputSurface(Surface surface, int imageFormat);
-
+@SuppressLint("UnknownNullness")
+public interface CaptureProcessorImpl extends ProcessorImpl {
/**
* 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 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.
- * @hide
+ * @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.
*/
void process(Map<Integer, Pair<Image, TotalCaptureResult>> results);
@@ -66,31 +56,11 @@ public interface CaptureProcessorImpl {
* 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.
+ * 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);
-
- /**
- * 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.
- *
- * @param size for the surface.
- * @hide
- */
- void onResolutionUpdate(Size size);
-
- /**
- * This callback will be invoked when CameraX changes the configured input image format.
- * After this call, {@link CaptureProcessorImpl} should expect any {@link Image} received as
- * input to have the specified image format.
- *
- * @param imageFormat for the surface.
- * @hide
- */
- void onImageFormatUpdate(int imageFormat);
}