Loading core/api/system-current.txt +7 −1 Original line number Diff line number Diff line Loading @@ -5341,7 +5341,7 @@ package android.hardware.camera2.extension { public abstract class SessionProcessor { ctor public SessionProcessor(); method public abstract void deInitSession(@NonNull android.os.IBinder); method @FlaggedApi("com.android.internal.camera.flags.efv_capture_latency") @Nullable public android.util.Pair<java.lang.Long,java.lang.Long> getRealtimeStillCaptureLatency(); method @FlaggedApi("com.android.internal.camera.flags.efv_capture_latency") @Nullable public android.hardware.camera2.extension.SessionProcessor.CaptureLatencyInfo getRealtimeStillCaptureLatency(); method @NonNull public abstract android.hardware.camera2.extension.ExtensionConfiguration initSession(@NonNull android.os.IBinder, @NonNull String, @NonNull android.hardware.camera2.extension.CharacteristicsMap, @NonNull android.hardware.camera2.extension.CameraOutputSurface, @NonNull android.hardware.camera2.extension.CameraOutputSurface); method @FlaggedApi("com.android.internal.camera.flags.efv_capture_latency") @NonNull public android.hardware.camera2.extension.ExtensionConfiguration initSession(@NonNull android.os.IBinder, @NonNull String, @NonNull android.hardware.camera2.extension.CharacteristicsMap, @NonNull android.hardware.camera2.extension.CameraConfiguration); method public abstract void onCaptureSessionEnd(); Loading @@ -5364,6 +5364,12 @@ package android.hardware.camera2.extension { method public void onCaptureStarted(int, long); } @FlaggedApi("com.android.internal.camera.flags.efv_capture_latency") public static final class SessionProcessor.CaptureLatencyInfo { ctor public SessionProcessor.CaptureLatencyInfo(long, long); field public final long captureLatency; field public final long processingLatency; } } package android.hardware.camera2.params { core/java/android/hardware/camera2/extension/AdvancedExtender.java +2 −1 Original line number Diff line number Diff line Loading @@ -293,10 +293,11 @@ public abstract class AdvancedExtender { * resolution exists for the provided capture size then an empty map is returned. * An example of how the map is parsed can be found in {@link #initializeParcelable(Map)}.</p> * @param captureSize The still capture resolution * @see ImageFormat */ @FlaggedApi(Flags.FLAG_EFV_CAPTURE_LATENCY) @NonNull public Map<Integer, List<Size>> getSupportedPostviewOutputResolutions( public Map<@ImageFormat.Format Integer, List<Size>> getSupportedPostviewOutputResolutions( @NonNull Size captureSize) { throw new UnsupportedOperationException("Subclasses must override this method"); } Loading core/java/android/hardware/camera2/extension/SessionProcessor.java +68 −14 Original line number Diff line number Diff line Loading @@ -16,6 +16,7 @@ package android.hardware.camera2.extension; import android.annotation.DurationMillisLong; import android.annotation.FlaggedApi; import android.annotation.IntRange; import android.annotation.NonNull; Loading @@ -27,12 +28,12 @@ import android.hardware.camera2.CaptureRequest; import android.hardware.camera2.CaptureResult; import android.hardware.camera2.impl.CameraExtensionUtils.HandlerExecutor; import android.hardware.camera2.impl.CameraMetadataNative; import android.hardware.camera2.utils.HashCodeHelpers; import android.os.Handler; import android.os.IBinder; import android.os.Looper; import android.os.RemoteException; import android.util.Log; import android.util.Pair; import com.android.internal.camera.flags.Flags; Loading Loading @@ -196,6 +197,62 @@ public abstract class SessionProcessor { } } /** * Realtime calculated still capture {@link #startMultiFrameCapture} latency. * * @see #getRealtimeStillCaptureLatency() */ @FlaggedApi(Flags.FLAG_EFV_CAPTURE_LATENCY) public final static class CaptureLatencyInfo { /** * The estimated still capture latency in milliseconds * from {@link CaptureCallback#onCaptureStarted} until * {@link CaptureCallback#onCaptureProcessStarted}. */ @DurationMillisLong public final long captureLatency; /** * The estimated post-processing latency in milliseconds from * {@link CaptureCallback#onCaptureProcessStarted} until the processed frame * returns to the client. */ @DurationMillisLong public final long processingLatency; public CaptureLatencyInfo(@DurationMillisLong long captureLatency, @DurationMillisLong long processingLatency) { this.captureLatency = captureLatency; this.processingLatency = processingLatency; } @Override public boolean equals(Object o) { if (this == o) return true; if (o == null || getClass() != o.getClass()) return false; CaptureLatencyInfo latency = (CaptureLatencyInfo) o; if (captureLatency != latency.captureLatency) return false; if (processingLatency != latency.processingLatency) return false; return true; } @Override public int hashCode() { return HashCodeHelpers.hashCode((float) captureLatency, (float) processingLatency); } @Override public String toString() { return "CaptureLatencyInfo(processingLatency:" + processingLatency + ", captureLatency: " + captureLatency + ")"; } } /** * Initializes the session for the extension. This is where the * extension implementations allocate resources for Loading Loading @@ -354,6 +411,10 @@ public abstract class SessionProcessor { * another capture is running will cause onCaptureFailed to be called * immediately.</p> * * <p>This method will not generate postview images and it behaves essentially * the same as calling {@link #startMultiFrameCapture(boolean, Executor, CaptureCallback)} * with the postview argument set to false.</p> * * @param executor the executor which will be used for * invoking the callbacks * @param callback a callback to report the status. Loading Loading @@ -396,18 +457,11 @@ public abstract class SessionProcessor { * state and will include the time spent processing the multi-frame capture request along with * any additional time for encoding of the processed buffer if necessary.</p> * * @return {@code null} if the estimation is not supported or a pair that includes the estimated * input frame/frames camera capture latency as the * first field. This is the time between * {@link CaptureCallback#onCaptureStarted} and * {@link CaptureCallback#onCaptureProcessStarted}. The second field value includes the * estimated post-processing latency. This is the time between * {@link CaptureCallback#onCaptureProcessStarted} until * the processed frame returns back to * the client registered surface. Both first and second values will be in milliseconds. The * total still capture latency will be the sum of both the first and second values of the pair. * @return {@link CaptureLatencyInfo} or {@code null} if the estimation is not supported. */ @FlaggedApi(Flags.FLAG_EFV_CAPTURE_LATENCY) @Nullable public Pair<Long, Long> getRealtimeStillCaptureLatency() { public CaptureLatencyInfo getRealtimeStillCaptureLatency() { throw new UnsupportedOperationException("Subclasses must override this method"); } Loading Loading @@ -558,13 +612,13 @@ public abstract class SessionProcessor { @Override public LatencyPair getRealtimeCaptureLatency() throws RemoteException { if (Flags.efvCaptureLatency()) { Pair<Long, Long> pair = SessionProcessor.this.getRealtimeStillCaptureLatency(); if (pair == null) { CaptureLatencyInfo info = SessionProcessor.this.getRealtimeStillCaptureLatency(); if (info == null) { return null; } LatencyPair ret = new LatencyPair(); ret.first = pair.first; ret.second = pair.second; ret.first = info.captureLatency; ret.second = info.processingLatency; return ret; } return null; Loading graphics/java/android/graphics/ImageFormat.java +3 −0 Original line number Diff line number Diff line Loading @@ -21,12 +21,15 @@ import android.annotation.IntDef; import com.android.internal.camera.flags.Flags; import java.lang.annotation.ElementType; import java.lang.annotation.Retention; import java.lang.annotation.RetentionPolicy; import java.lang.annotation.Target; @android.ravenwood.annotation.RavenwoodKeepWholeClass public class ImageFormat { /** @hide */ @Target(ElementType.TYPE_USE) @Retention(RetentionPolicy.SOURCE) @IntDef(value = { UNKNOWN, Loading Loading
core/api/system-current.txt +7 −1 Original line number Diff line number Diff line Loading @@ -5341,7 +5341,7 @@ package android.hardware.camera2.extension { public abstract class SessionProcessor { ctor public SessionProcessor(); method public abstract void deInitSession(@NonNull android.os.IBinder); method @FlaggedApi("com.android.internal.camera.flags.efv_capture_latency") @Nullable public android.util.Pair<java.lang.Long,java.lang.Long> getRealtimeStillCaptureLatency(); method @FlaggedApi("com.android.internal.camera.flags.efv_capture_latency") @Nullable public android.hardware.camera2.extension.SessionProcessor.CaptureLatencyInfo getRealtimeStillCaptureLatency(); method @NonNull public abstract android.hardware.camera2.extension.ExtensionConfiguration initSession(@NonNull android.os.IBinder, @NonNull String, @NonNull android.hardware.camera2.extension.CharacteristicsMap, @NonNull android.hardware.camera2.extension.CameraOutputSurface, @NonNull android.hardware.camera2.extension.CameraOutputSurface); method @FlaggedApi("com.android.internal.camera.flags.efv_capture_latency") @NonNull public android.hardware.camera2.extension.ExtensionConfiguration initSession(@NonNull android.os.IBinder, @NonNull String, @NonNull android.hardware.camera2.extension.CharacteristicsMap, @NonNull android.hardware.camera2.extension.CameraConfiguration); method public abstract void onCaptureSessionEnd(); Loading @@ -5364,6 +5364,12 @@ package android.hardware.camera2.extension { method public void onCaptureStarted(int, long); } @FlaggedApi("com.android.internal.camera.flags.efv_capture_latency") public static final class SessionProcessor.CaptureLatencyInfo { ctor public SessionProcessor.CaptureLatencyInfo(long, long); field public final long captureLatency; field public final long processingLatency; } } package android.hardware.camera2.params {
core/java/android/hardware/camera2/extension/AdvancedExtender.java +2 −1 Original line number Diff line number Diff line Loading @@ -293,10 +293,11 @@ public abstract class AdvancedExtender { * resolution exists for the provided capture size then an empty map is returned. * An example of how the map is parsed can be found in {@link #initializeParcelable(Map)}.</p> * @param captureSize The still capture resolution * @see ImageFormat */ @FlaggedApi(Flags.FLAG_EFV_CAPTURE_LATENCY) @NonNull public Map<Integer, List<Size>> getSupportedPostviewOutputResolutions( public Map<@ImageFormat.Format Integer, List<Size>> getSupportedPostviewOutputResolutions( @NonNull Size captureSize) { throw new UnsupportedOperationException("Subclasses must override this method"); } Loading
core/java/android/hardware/camera2/extension/SessionProcessor.java +68 −14 Original line number Diff line number Diff line Loading @@ -16,6 +16,7 @@ package android.hardware.camera2.extension; import android.annotation.DurationMillisLong; import android.annotation.FlaggedApi; import android.annotation.IntRange; import android.annotation.NonNull; Loading @@ -27,12 +28,12 @@ import android.hardware.camera2.CaptureRequest; import android.hardware.camera2.CaptureResult; import android.hardware.camera2.impl.CameraExtensionUtils.HandlerExecutor; import android.hardware.camera2.impl.CameraMetadataNative; import android.hardware.camera2.utils.HashCodeHelpers; import android.os.Handler; import android.os.IBinder; import android.os.Looper; import android.os.RemoteException; import android.util.Log; import android.util.Pair; import com.android.internal.camera.flags.Flags; Loading Loading @@ -196,6 +197,62 @@ public abstract class SessionProcessor { } } /** * Realtime calculated still capture {@link #startMultiFrameCapture} latency. * * @see #getRealtimeStillCaptureLatency() */ @FlaggedApi(Flags.FLAG_EFV_CAPTURE_LATENCY) public final static class CaptureLatencyInfo { /** * The estimated still capture latency in milliseconds * from {@link CaptureCallback#onCaptureStarted} until * {@link CaptureCallback#onCaptureProcessStarted}. */ @DurationMillisLong public final long captureLatency; /** * The estimated post-processing latency in milliseconds from * {@link CaptureCallback#onCaptureProcessStarted} until the processed frame * returns to the client. */ @DurationMillisLong public final long processingLatency; public CaptureLatencyInfo(@DurationMillisLong long captureLatency, @DurationMillisLong long processingLatency) { this.captureLatency = captureLatency; this.processingLatency = processingLatency; } @Override public boolean equals(Object o) { if (this == o) return true; if (o == null || getClass() != o.getClass()) return false; CaptureLatencyInfo latency = (CaptureLatencyInfo) o; if (captureLatency != latency.captureLatency) return false; if (processingLatency != latency.processingLatency) return false; return true; } @Override public int hashCode() { return HashCodeHelpers.hashCode((float) captureLatency, (float) processingLatency); } @Override public String toString() { return "CaptureLatencyInfo(processingLatency:" + processingLatency + ", captureLatency: " + captureLatency + ")"; } } /** * Initializes the session for the extension. This is where the * extension implementations allocate resources for Loading Loading @@ -354,6 +411,10 @@ public abstract class SessionProcessor { * another capture is running will cause onCaptureFailed to be called * immediately.</p> * * <p>This method will not generate postview images and it behaves essentially * the same as calling {@link #startMultiFrameCapture(boolean, Executor, CaptureCallback)} * with the postview argument set to false.</p> * * @param executor the executor which will be used for * invoking the callbacks * @param callback a callback to report the status. Loading Loading @@ -396,18 +457,11 @@ public abstract class SessionProcessor { * state and will include the time spent processing the multi-frame capture request along with * any additional time for encoding of the processed buffer if necessary.</p> * * @return {@code null} if the estimation is not supported or a pair that includes the estimated * input frame/frames camera capture latency as the * first field. This is the time between * {@link CaptureCallback#onCaptureStarted} and * {@link CaptureCallback#onCaptureProcessStarted}. The second field value includes the * estimated post-processing latency. This is the time between * {@link CaptureCallback#onCaptureProcessStarted} until * the processed frame returns back to * the client registered surface. Both first and second values will be in milliseconds. The * total still capture latency will be the sum of both the first and second values of the pair. * @return {@link CaptureLatencyInfo} or {@code null} if the estimation is not supported. */ @FlaggedApi(Flags.FLAG_EFV_CAPTURE_LATENCY) @Nullable public Pair<Long, Long> getRealtimeStillCaptureLatency() { public CaptureLatencyInfo getRealtimeStillCaptureLatency() { throw new UnsupportedOperationException("Subclasses must override this method"); } Loading Loading @@ -558,13 +612,13 @@ public abstract class SessionProcessor { @Override public LatencyPair getRealtimeCaptureLatency() throws RemoteException { if (Flags.efvCaptureLatency()) { Pair<Long, Long> pair = SessionProcessor.this.getRealtimeStillCaptureLatency(); if (pair == null) { CaptureLatencyInfo info = SessionProcessor.this.getRealtimeStillCaptureLatency(); if (info == null) { return null; } LatencyPair ret = new LatencyPair(); ret.first = pair.first; ret.second = pair.second; ret.first = info.captureLatency; ret.second = info.processingLatency; return ret; } return null; Loading
graphics/java/android/graphics/ImageFormat.java +3 −0 Original line number Diff line number Diff line Loading @@ -21,12 +21,15 @@ import android.annotation.IntDef; import com.android.internal.camera.flags.Flags; import java.lang.annotation.ElementType; import java.lang.annotation.Retention; import java.lang.annotation.RetentionPolicy; import java.lang.annotation.Target; @android.ravenwood.annotation.RavenwoodKeepWholeClass public class ImageFormat { /** @hide */ @Target(ElementType.TYPE_USE) @Retention(RetentionPolicy.SOURCE) @IntDef(value = { UNKNOWN, Loading