Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 1fd68ad9 authored by Eino-Ville Talvala's avatar Eino-Ville Talvala Committed by Android (Google) Code Review
Browse files

Merge "Camera2: Unhide deferred surface configuration APIs"

parents 7021998c 1a645803
Loading
Loading
Loading
Loading
+3 −0
Original line number Original line Diff line number Diff line
@@ -13843,6 +13843,7 @@ package android.hardware.camera2 {
    method public abstract int capture(android.hardware.camera2.CaptureRequest, android.hardware.camera2.CameraCaptureSession.CaptureCallback, android.os.Handler) throws android.hardware.camera2.CameraAccessException;
    method public abstract int capture(android.hardware.camera2.CaptureRequest, android.hardware.camera2.CameraCaptureSession.CaptureCallback, android.os.Handler) throws android.hardware.camera2.CameraAccessException;
    method public abstract int captureBurst(java.util.List<android.hardware.camera2.CaptureRequest>, android.hardware.camera2.CameraCaptureSession.CaptureCallback, android.os.Handler) throws android.hardware.camera2.CameraAccessException;
    method public abstract int captureBurst(java.util.List<android.hardware.camera2.CaptureRequest>, android.hardware.camera2.CameraCaptureSession.CaptureCallback, android.os.Handler) throws android.hardware.camera2.CameraAccessException;
    method public abstract void close();
    method public abstract void close();
    method public abstract void finishDeferredConfiguration(java.util.List<android.hardware.camera2.params.OutputConfiguration>) throws android.hardware.camera2.CameraAccessException;
    method public abstract android.hardware.camera2.CameraDevice getDevice();
    method public abstract android.hardware.camera2.CameraDevice getDevice();
    method public abstract android.view.Surface getInputSurface();
    method public abstract android.view.Surface getInputSurface();
    method public abstract boolean isReprocessable();
    method public abstract boolean isReprocessable();
@@ -14481,9 +14482,11 @@ package android.hardware.camera2.params {
  public final class OutputConfiguration implements android.os.Parcelable {
  public final class OutputConfiguration implements android.os.Parcelable {
    ctor public OutputConfiguration(android.view.Surface);
    ctor public OutputConfiguration(android.view.Surface);
    ctor public OutputConfiguration(int, android.view.Surface);
    ctor public OutputConfiguration(int, android.view.Surface);
    ctor public OutputConfiguration(android.util.Size, java.lang.Class<T>);
    method public int describeContents();
    method public int describeContents();
    method public android.view.Surface getSurface();
    method public android.view.Surface getSurface();
    method public int getSurfaceGroupId();
    method public int getSurfaceGroupId();
    method public void setDeferredSurface(android.view.Surface);
    method public void writeToParcel(android.os.Parcel, int);
    method public void writeToParcel(android.os.Parcel, int);
    field public static final android.os.Parcelable.Creator<android.hardware.camera2.params.OutputConfiguration> CREATOR;
    field public static final android.os.Parcelable.Creator<android.hardware.camera2.params.OutputConfiguration> CREATOR;
    field public static final int SURFACE_GROUP_ID_NONE = -1; // 0xffffffff
    field public static final int SURFACE_GROUP_ID_NONE = -1; // 0xffffffff
+3 −0
Original line number Original line Diff line number Diff line
@@ -14291,6 +14291,7 @@ package android.hardware.camera2 {
    method public abstract int capture(android.hardware.camera2.CaptureRequest, android.hardware.camera2.CameraCaptureSession.CaptureCallback, android.os.Handler) throws android.hardware.camera2.CameraAccessException;
    method public abstract int capture(android.hardware.camera2.CaptureRequest, android.hardware.camera2.CameraCaptureSession.CaptureCallback, android.os.Handler) throws android.hardware.camera2.CameraAccessException;
    method public abstract int captureBurst(java.util.List<android.hardware.camera2.CaptureRequest>, android.hardware.camera2.CameraCaptureSession.CaptureCallback, android.os.Handler) throws android.hardware.camera2.CameraAccessException;
    method public abstract int captureBurst(java.util.List<android.hardware.camera2.CaptureRequest>, android.hardware.camera2.CameraCaptureSession.CaptureCallback, android.os.Handler) throws android.hardware.camera2.CameraAccessException;
    method public abstract void close();
    method public abstract void close();
    method public abstract void finishDeferredConfiguration(java.util.List<android.hardware.camera2.params.OutputConfiguration>) throws android.hardware.camera2.CameraAccessException;
    method public abstract android.hardware.camera2.CameraDevice getDevice();
    method public abstract android.hardware.camera2.CameraDevice getDevice();
    method public abstract android.view.Surface getInputSurface();
    method public abstract android.view.Surface getInputSurface();
    method public abstract boolean isReprocessable();
    method public abstract boolean isReprocessable();
@@ -14931,10 +14932,12 @@ package android.hardware.camera2.params {
    ctor public OutputConfiguration(int, android.view.Surface);
    ctor public OutputConfiguration(int, android.view.Surface);
    ctor public OutputConfiguration(android.view.Surface, int);
    ctor public OutputConfiguration(android.view.Surface, int);
    ctor public OutputConfiguration(int, android.view.Surface, int);
    ctor public OutputConfiguration(int, android.view.Surface, int);
    ctor public OutputConfiguration(android.util.Size, java.lang.Class<T>);
    method public int describeContents();
    method public int describeContents();
    method public int getRotation();
    method public int getRotation();
    method public android.view.Surface getSurface();
    method public android.view.Surface getSurface();
    method public int getSurfaceGroupId();
    method public int getSurfaceGroupId();
    method public void setDeferredSurface(android.view.Surface);
    method public void writeToParcel(android.os.Parcel, int);
    method public void writeToParcel(android.os.Parcel, int);
    field public static final android.os.Parcelable.Creator<android.hardware.camera2.params.OutputConfiguration> CREATOR;
    field public static final android.os.Parcelable.Creator<android.hardware.camera2.params.OutputConfiguration> CREATOR;
    field public static final int ROTATION_0 = 0; // 0x0
    field public static final int ROTATION_0 = 0; // 0x0
+3 −0
Original line number Original line Diff line number Diff line
@@ -13859,6 +13859,7 @@ package android.hardware.camera2 {
    method public abstract int capture(android.hardware.camera2.CaptureRequest, android.hardware.camera2.CameraCaptureSession.CaptureCallback, android.os.Handler) throws android.hardware.camera2.CameraAccessException;
    method public abstract int capture(android.hardware.camera2.CaptureRequest, android.hardware.camera2.CameraCaptureSession.CaptureCallback, android.os.Handler) throws android.hardware.camera2.CameraAccessException;
    method public abstract int captureBurst(java.util.List<android.hardware.camera2.CaptureRequest>, android.hardware.camera2.CameraCaptureSession.CaptureCallback, android.os.Handler) throws android.hardware.camera2.CameraAccessException;
    method public abstract int captureBurst(java.util.List<android.hardware.camera2.CaptureRequest>, android.hardware.camera2.CameraCaptureSession.CaptureCallback, android.os.Handler) throws android.hardware.camera2.CameraAccessException;
    method public abstract void close();
    method public abstract void close();
    method public abstract void finishDeferredConfiguration(java.util.List<android.hardware.camera2.params.OutputConfiguration>) throws android.hardware.camera2.CameraAccessException;
    method public abstract android.hardware.camera2.CameraDevice getDevice();
    method public abstract android.hardware.camera2.CameraDevice getDevice();
    method public abstract android.view.Surface getInputSurface();
    method public abstract android.view.Surface getInputSurface();
    method public abstract boolean isReprocessable();
    method public abstract boolean isReprocessable();
@@ -14497,9 +14498,11 @@ package android.hardware.camera2.params {
  public final class OutputConfiguration implements android.os.Parcelable {
  public final class OutputConfiguration implements android.os.Parcelable {
    ctor public OutputConfiguration(android.view.Surface);
    ctor public OutputConfiguration(android.view.Surface);
    ctor public OutputConfiguration(int, android.view.Surface);
    ctor public OutputConfiguration(int, android.view.Surface);
    ctor public OutputConfiguration(android.util.Size, java.lang.Class<T>);
    method public int describeContents();
    method public int describeContents();
    method public android.view.Surface getSurface();
    method public android.view.Surface getSurface();
    method public int getSurfaceGroupId();
    method public int getSurfaceGroupId();
    method public void setDeferredSurface(android.view.Surface);
    method public void writeToParcel(android.os.Parcel, int);
    method public void writeToParcel(android.os.Parcel, int);
    field public static final android.os.Parcelable.Creator<android.hardware.camera2.params.OutputConfiguration> CREATOR;
    field public static final android.os.Parcelable.Creator<android.hardware.camera2.params.OutputConfiguration> CREATOR;
    field public static final int SURFACE_GROUP_ID_NONE = -1; // 0xffffffff
    field public static final int SURFACE_GROUP_ID_NONE = -1; // 0xffffffff
+30 −33
Original line number Original line Diff line number Diff line
@@ -221,34 +221,32 @@ public abstract class CameraCaptureSession implements AutoCloseable {
    public abstract void tearDown(@NonNull Surface surface) throws CameraAccessException;
    public abstract void tearDown(@NonNull Surface surface) throws CameraAccessException;


    /**
    /**
     * <p>
     * <p>Finish the deferred output configurations where the output Surface was not configured
     * Finish the deferred output configurations where the output Surface was not configured before.
     * before.</p>
     * </p>
     *
     * <p>
     * <p>For camera use cases where a preview and other output configurations need to be
     * For camera use cases where a preview and other output configurations need to be configured,
     * configured, it can take some time for the preview Surface to be ready. For example, if the
     * it can take some time for the preview Surface to be ready (e.g., if the preview Surface is
     * preview Surface is obtained from {@link android.view.SurfaceView}, the SurfaceView will only
     * obtained from {@link android.view.SurfaceView}, the SurfaceView is ready after the UI layout
     * be ready after the UI layout is done, potentially delaying camera startup.</p>
     * is done, then it takes some time to get the preview Surface).
     *
     * </p>
     * <p>To speed up camera startup time, the application can configure the
     * <p>
     * {@link CameraCaptureSession} with the eventual preview size (via
     * To speed up camera startup time, the application can configure the
     * {@link OutputConfiguration#OutputConfiguration(Size,Class) a deferred OutputConfiguration}),
     * {@link CameraCaptureSession} with the desired preview size, and defer the preview output
     * and defer the preview output configuration until the Surface is ready. After the
     * configuration until the Surface is ready. After the {@link CameraCaptureSession} is created
     * {@link CameraCaptureSession} is created successfully with this deferred output and other
     * successfully with this deferred configuration and other normal configurations, the
     * normal outputs, the application can start submitting requests as long as they do not include
     * application can submit requests that don't include deferred output Surfaces. Once the
     * deferred output Surfaces. Once a deferred Surface is ready, the application can set the
     * deferred Surface is ready, the application can set the Surface to the same deferred output
     * Surface on the deferred output configuration with the
     * configuration with the {@link OutputConfiguration#setDeferredSurface} method, and then finish
     * {@link OutputConfiguration#setDeferredSurface} method, and then finish the deferred output
     * the deferred output configuration via this method, before it can submit requests with this
     * configuration via this method, before it can submit capture requests with this output
     * output target.
     * target.</p>
     * </p>
     *
     * <p>
     * <p>The output Surfaces included by this list of deferred
     * The output Surfaces included by this list of deferred {@link OutputConfiguration
     * {@link OutputConfiguration OutputConfigurations} can be used as {@link CaptureRequest}
     * OutputConfigurations} can be used as {@link CaptureRequest} targets as soon as this call
     * targets as soon as this call returns.</p>
     * returns;
     *
     * </p>
     * <p>This method is not supported by
     * <p>
     * {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL_LEGACY LEGACY}-level devices.</p>
     * This method is not supported by Legacy devices.
     * </p>
     *
     *
     * @param deferredOutputConfigs a list of {@link OutputConfiguration OutputConfigurations} that
     * @param deferredOutputConfigs a list of {@link OutputConfiguration OutputConfigurations} that
     *            have had {@link OutputConfiguration#setDeferredSurface setDeferredSurface} invoked
     *            have had {@link OutputConfiguration#setDeferredSurface setDeferredSurface} invoked
@@ -256,13 +254,12 @@ public abstract class CameraCaptureSession implements AutoCloseable {
     * @throws CameraAccessException if the camera device is no longer connected or has encountered
     * @throws CameraAccessException if the camera device is no longer connected or has encountered
     *             a fatal error.
     *             a fatal error.
     * @throws IllegalStateException if this session is no longer active, either because the session
     * @throws IllegalStateException if this session is no longer active, either because the session
     *             was explicitly closed, a new session has been created or the camera device has
     *             was explicitly closed, a new session has been created, or the camera device has
     *             been closed. Or if this output configuration was already finished with the
     *             been closed.
     *             included surface before.
     * @throws IllegalArgumentException for invalid output configurations, including ones where the
     * @throws IllegalArgumentException for invalid output configurations, including ones where the
     *             source of the Surface is no longer valid or the Surface is from a unsupported
     *             source of the Surface is no longer valid or the Surface is from a unsupported
     *             source.
     *             source. Or if one of the output configuration was already finished with an
     * @hide
     *             included surface in a prior call.
     */
     */
    public abstract void finishDeferredConfiguration(
    public abstract void finishDeferredConfiguration(
            List<OutputConfiguration> deferredOutputConfigs) throws CameraAccessException;
            List<OutputConfiguration> deferredOutputConfigs) throws CameraAccessException;
+0 −2
Original line number Original line Diff line number Diff line
@@ -229,7 +229,6 @@ public final class OutputConfiguration implements Parcelable {
     * @param klass a non-{@code null} {@link Class} object reference that indicates the source of
     * @param klass a non-{@code null} {@link Class} object reference that indicates the source of
     *            this surface. Only {@link android.view.SurfaceHolder SurfaceHolder.class} and
     *            this surface. Only {@link android.view.SurfaceHolder SurfaceHolder.class} and
     *            {@link android.graphics.SurfaceTexture SurfaceTexture.class} are supported.
     *            {@link android.graphics.SurfaceTexture SurfaceTexture.class} are supported.
     * @hide
     */
     */
    public <T> OutputConfiguration(@NonNull Size surfaceSize, @NonNull Class<T> klass) {
    public <T> OutputConfiguration(@NonNull Size surfaceSize, @NonNull Class<T> klass) {
        checkNotNull(klass, "surfaceSize must not be null");
        checkNotNull(klass, "surfaceSize must not be null");
@@ -283,7 +282,6 @@ public final class OutputConfiguration implements Parcelable {
     * @throws IllegalArgumentException if the Surface is invalid.
     * @throws IllegalArgumentException if the Surface is invalid.
     * @throws IllegalStateException if a Surface was already set to this deferred
     * @throws IllegalStateException if a Surface was already set to this deferred
     *         OutputConfiguration.
     *         OutputConfiguration.
     * @hide
     */
     */
    public void setDeferredSurface(@NonNull Surface surface) {
    public void setDeferredSurface(@NonNull Surface surface) {
        checkNotNull(surface, "Surface must not be null");
        checkNotNull(surface, "Surface must not be null");