summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRavneet Dhanjal <rdhanjal@google.com>2022-12-02 00:48:33 +0000
committerAutomerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>2022-12-02 00:48:33 +0000
commit3a00916d70e02c4af902139661f721f31b4213ff (patch)
treeb8a32134a76251c6de082032f065179a4d497de3
parent158326cf151eccb939e56b55c633f1b05739df47 (diff)
parent1e7c9cc307b4b93a2c0575b4c185960cb67e0032 (diff)
downloadex-3a00916d70e02c4af902139661f721f31b4213ff.tar.gz
Merge "Camera Extension sample: Update CaptureProcessorImpl" am: 1e7c9cc307main-16k-with-phones
Original change: https://android-review.googlesource.com/c/platform/frameworks/ex/+/2323881 Change-Id: I50d058cec901d4667987b283dbaac3f96eb4d8da 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);
}