summaryrefslogtreecommitdiff
path: root/camera2
diff options
context:
space:
mode:
authorEmilian Peev <epeev@google.com>2022-10-18 09:43:44 -0700
committerRavneet Dhanjal <rdhanjal@google.com>2022-12-01 22:49:40 +0000
commit2fdf009469414f175bc8198146922cc3d8eab2bd (patch)
treeb8a32134a76251c6de082032f065179a4d497de3 /camera2
parent10e47142f9fdef2e204c7d2cfa58a33c9aa94797 (diff)
downloadex-2fdf009469414f175bc8198146922cc3d8eab2bd.tar.gz
Camera Extension sample: Update CaptureProcessorImpl
It appears that we have a delta in the sample vs. stub inheritance hierarchy that was uncovered by a recent JVM update. Sync the CaptureProcessorImpl with the stubs to avoid possible exceptions. Bug: 259341345 Test: atest -c -d cts/tests/camera/src/android/hardware/camera2/cts/CameraExtensionSessionTest.java Change-Id: Ic415c6c5889e856140b85384f2eacad05d360af3
Diffstat (limited to 'camera2')
-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);
}