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

Commit 5e32d1ae authored by Emilian Peev's avatar Emilian Peev Committed by Android (Google) Code Review
Browse files

Merge "Camera: Enable 10-bit output camera API"

parents 82e77821 14694546
Loading
Loading
Loading
Loading
+28 −0
Original line number Diff line number Diff line
@@ -18536,12 +18536,14 @@ package android.hardware.camera2 {
    field @NonNull public static final android.hardware.camera2.CameraCharacteristics.Key<int[]> NOISE_REDUCTION_AVAILABLE_NOISE_REDUCTION_MODES;
    field @NonNull public static final android.hardware.camera2.CameraCharacteristics.Key<java.lang.Integer> REPROCESS_MAX_CAPTURE_STALL;
    field @NonNull public static final android.hardware.camera2.CameraCharacteristics.Key<int[]> REQUEST_AVAILABLE_CAPABILITIES;
    field @NonNull public static final android.hardware.camera2.CameraCharacteristics.Key<android.hardware.camera2.params.DynamicRangeProfiles> REQUEST_AVAILABLE_DYNAMIC_RANGE_PROFILES;
    field @NonNull public static final android.hardware.camera2.CameraCharacteristics.Key<java.lang.Integer> REQUEST_MAX_NUM_INPUT_STREAMS;
    field @NonNull public static final android.hardware.camera2.CameraCharacteristics.Key<java.lang.Integer> REQUEST_MAX_NUM_OUTPUT_PROC;
    field @NonNull public static final android.hardware.camera2.CameraCharacteristics.Key<java.lang.Integer> REQUEST_MAX_NUM_OUTPUT_PROC_STALLING;
    field @NonNull public static final android.hardware.camera2.CameraCharacteristics.Key<java.lang.Integer> REQUEST_MAX_NUM_OUTPUT_RAW;
    field @NonNull public static final android.hardware.camera2.CameraCharacteristics.Key<java.lang.Integer> REQUEST_PARTIAL_RESULT_COUNT;
    field @NonNull public static final android.hardware.camera2.CameraCharacteristics.Key<java.lang.Byte> REQUEST_PIPELINE_MAX_DEPTH;
    field @NonNull public static final android.hardware.camera2.CameraCharacteristics.Key<java.lang.Integer> REQUEST_RECOMMENDED_TEN_BIT_DYNAMIC_RANGE_PROFILE;
    field @NonNull public static final android.hardware.camera2.CameraCharacteristics.Key<java.lang.Float> SCALER_AVAILABLE_MAX_DIGITAL_ZOOM;
    field @NonNull public static final android.hardware.camera2.CameraCharacteristics.Key<int[]> SCALER_AVAILABLE_ROTATE_AND_CROP_MODES;
    field @NonNull public static final android.hardware.camera2.CameraCharacteristics.Key<java.lang.Integer> SCALER_CROPPING_TYPE;
@@ -18549,6 +18551,7 @@ package android.hardware.camera2 {
    field @NonNull public static final android.hardware.camera2.CameraCharacteristics.Key<android.hardware.camera2.params.MandatoryStreamCombination[]> SCALER_MANDATORY_CONCURRENT_STREAM_COMBINATIONS;
    field @NonNull public static final android.hardware.camera2.CameraCharacteristics.Key<android.hardware.camera2.params.MandatoryStreamCombination[]> SCALER_MANDATORY_MAXIMUM_RESOLUTION_STREAM_COMBINATIONS;
    field @NonNull public static final android.hardware.camera2.CameraCharacteristics.Key<android.hardware.camera2.params.MandatoryStreamCombination[]> SCALER_MANDATORY_STREAM_COMBINATIONS;
    field @NonNull public static final android.hardware.camera2.CameraCharacteristics.Key<android.hardware.camera2.params.MandatoryStreamCombination[]> SCALER_MANDATORY_TEN_BIT_OUTPUT_STREAM_COMBINATIONS;
    field @NonNull public static final android.hardware.camera2.CameraCharacteristics.Key<android.hardware.camera2.params.MultiResolutionStreamConfigurationMap> SCALER_MULTI_RESOLUTION_STREAM_CONFIGURATION_MAP;
    field @NonNull public static final android.hardware.camera2.CameraCharacteristics.Key<android.hardware.camera2.params.StreamConfigurationMap> SCALER_STREAM_CONFIGURATION_MAP;
    field @NonNull public static final android.hardware.camera2.CameraCharacteristics.Key<android.hardware.camera2.params.StreamConfigurationMap> SCALER_STREAM_CONFIGURATION_MAP_MAXIMUM_RESOLUTION;
@@ -18865,6 +18868,7 @@ package android.hardware.camera2 {
    field public static final int REQUEST_AVAILABLE_CAPABILITIES_BURST_CAPTURE = 6; // 0x6
    field public static final int REQUEST_AVAILABLE_CAPABILITIES_CONSTRAINED_HIGH_SPEED_VIDEO = 9; // 0x9
    field public static final int REQUEST_AVAILABLE_CAPABILITIES_DEPTH_OUTPUT = 8; // 0x8
    field public static final int REQUEST_AVAILABLE_CAPABILITIES_DYNAMIC_RANGE_TEN_BIT = 18; // 0x12
    field public static final int REQUEST_AVAILABLE_CAPABILITIES_LOGICAL_MULTI_CAMERA = 11; // 0xb
    field public static final int REQUEST_AVAILABLE_CAPABILITIES_MANUAL_POST_PROCESSING = 2; // 0x2
    field public static final int REQUEST_AVAILABLE_CAPABILITIES_MANUAL_SENSOR = 1; // 0x1
@@ -19218,6 +19222,25 @@ package android.hardware.camera2.params {
    field public static final long NORMAL = 0L; // 0x0L
  }
  public final class DynamicRangeProfiles {
    ctor public DynamicRangeProfiles(@NonNull int[]);
    method @NonNull public java.util.Set<java.lang.Integer> getProfileCaptureRequestConstraints(int);
    method @NonNull public java.util.Set<java.lang.Integer> getSupportedProfiles();
    field public static final int DOLBY_VISION_10B_HDR_OEM = 64; // 0x40
    field public static final int DOLBY_VISION_10B_HDR_OEM_PO = 128; // 0x80
    field public static final int DOLBY_VISION_10B_HDR_REF = 16; // 0x10
    field public static final int DOLBY_VISION_10B_HDR_REF_PO = 32; // 0x20
    field public static final int DOLBY_VISION_8B_HDR_OEM = 1024; // 0x400
    field public static final int DOLBY_VISION_8B_HDR_OEM_PO = 2048; // 0x800
    field public static final int DOLBY_VISION_8B_HDR_REF = 256; // 0x100
    field public static final int DOLBY_VISION_8B_HDR_REF_PO = 512; // 0x200
    field public static final int HDR10 = 4; // 0x4
    field public static final int HDR10_PLUS = 8; // 0x8
    field public static final int HLG10 = 2; // 0x2
    field public static final int PUBLIC_MAX = 4096; // 0x1000
    field public static final int STANDARD = 1; // 0x1
  }
  public final class ExtensionSessionConfiguration {
    ctor public ExtensionSessionConfiguration(int, @NonNull java.util.List<android.hardware.camera2.params.OutputConfiguration>, @NonNull java.util.concurrent.Executor, @NonNull android.hardware.camera2.CameraExtensionSession.StateCallback);
    method @NonNull public java.util.concurrent.Executor getExecutor();
@@ -19264,8 +19287,10 @@ package android.hardware.camera2.params {
  }
  public static final class MandatoryStreamCombination.MandatoryStreamInformation {
    method public int get10BitFormat();
    method @NonNull public java.util.List<android.util.Size> getAvailableSizes();
    method public int getFormat();
    method public boolean is10BitCapable();
    method public boolean isInput();
    method public boolean isMaximumSize();
    method public boolean isUltraHighResolution();
@@ -19319,12 +19344,14 @@ package android.hardware.camera2.params {
    method @NonNull public static java.util.Collection<android.hardware.camera2.params.OutputConfiguration> createInstancesForMultiResolutionOutput(@NonNull android.hardware.camera2.MultiResolutionImageReader);
    method public int describeContents();
    method public void enableSurfaceSharing();
    method public int getDynamicRangeProfile();
    method public int getMaxSharedSurfaceCount();
    method @Nullable public android.view.Surface getSurface();
    method public int getSurfaceGroupId();
    method @NonNull public java.util.List<android.view.Surface> getSurfaces();
    method public void removeSensorPixelModeUsed(int);
    method public void removeSurface(@NonNull android.view.Surface);
    method public void setDynamicRangeProfile(int);
    method public void setPhysicalCameraId(@Nullable String);
    method public void writeToParcel(android.os.Parcel, int);
    field @NonNull public static final android.os.Parcelable.Creator<android.hardware.camera2.params.OutputConfiguration> CREATOR;
@@ -19350,6 +19377,7 @@ package android.hardware.camera2.params {
    method @Nullable public java.util.Set<java.lang.Integer> getValidOutputFormatsForInput(int);
    method public boolean isOutputSupportedFor(int);
    method public boolean isOutputSupportedFor(@NonNull android.view.Surface);
    field public static final int USECASE_10BIT_OUTPUT = 8; // 0x8
    field public static final int USECASE_LOW_LATENCY_SNAPSHOT = 6; // 0x6
    field public static final int USECASE_PREVIEW = 0; // 0x0
    field public static final int USECASE_RAW = 5; // 0x5
+11 −1
Original line number Diff line number Diff line
@@ -15,6 +15,7 @@
 */
package android.hardware;

import android.hardware.camera2.params.DynamicRangeProfiles;
import android.os.Parcel;
import android.os.Parcelable;
import android.util.Log;
@@ -45,6 +46,7 @@ public class CameraStreamStats implements Parcelable {
    private int mHistogramType;
    private float[] mHistogramBins;
    private long[] mHistogramCounts;
    private int mDynamicRangeProfile;

    private static final String TAG = "CameraStreamStats";

@@ -60,11 +62,12 @@ public class CameraStreamStats implements Parcelable {
        mMaxHalBuffers = 0;
        mMaxAppBuffers = 0;
        mHistogramType = HISTOGRAM_TYPE_UNKNOWN;
        mDynamicRangeProfile = DynamicRangeProfiles.STANDARD;
    }

    public CameraStreamStats(int width, int height, int format,
            int dataSpace, long usage, long requestCount, long errorCount,
            int startLatencyMs, int maxHalBuffers, int maxAppBuffers) {
            int startLatencyMs, int maxHalBuffers, int maxAppBuffers, int dynamicRangeProfile) {
        mWidth = width;
        mHeight = height;
        mFormat = format;
@@ -76,6 +79,7 @@ public class CameraStreamStats implements Parcelable {
        mMaxHalBuffers = maxHalBuffers;
        mMaxAppBuffers = maxAppBuffers;
        mHistogramType = HISTOGRAM_TYPE_UNKNOWN;
        mDynamicRangeProfile = dynamicRangeProfile;
    }

    public static final @android.annotation.NonNull Parcelable.Creator<CameraStreamStats> CREATOR =
@@ -121,6 +125,7 @@ public class CameraStreamStats implements Parcelable {
        dest.writeInt(mHistogramType);
        dest.writeFloatArray(mHistogramBins);
        dest.writeLongArray(mHistogramCounts);
        dest.writeInt(mDynamicRangeProfile);
    }

    public void readFromParcel(Parcel in) {
@@ -137,6 +142,7 @@ public class CameraStreamStats implements Parcelable {
        mHistogramType = in.readInt();
        mHistogramBins = in.createFloatArray();
        mHistogramCounts = in.createLongArray();
        mDynamicRangeProfile = in.readInt();
    }

    public int getWidth() {
@@ -190,4 +196,8 @@ public class CameraStreamStats implements Parcelable {
    public long[] getHistogramCounts() {
        return mHistogramCounts;
    }

    public int getDynamicRangeProfile() {
        return mDynamicRangeProfile;
    }
}
+43 −8
Original line number Diff line number Diff line
@@ -321,6 +321,9 @@ public abstract class CameraCaptureSession implements AutoCloseable {
     * can submit reprocess capture requests. Submitting a reprocess request to a regular capture
     * session will result in an {@link IllegalArgumentException}.</p>
     *
     * <p>Submitting a request that targets Surfaces with an unsupported dynamic range combination
     * will result in an {@link IllegalArgumentException}.</p>
     *
     * @param request the settings for this capture
     * @param listener The callback object to notify once this request has been
     * processed. If null, no metadata will be produced for this capture,
@@ -347,13 +350,15 @@ public abstract class CameraCaptureSession implements AutoCloseable {
     *                                  a different session; or the capture targets a Surface in
     *                                  the middle of being {@link #prepare prepared}; or the
     *                                  handler is null, the listener is not null, and the calling
     *                                  thread has no looper.
     *                                  thread has no looper; or the request targets Surfaces with
     *                                  an unsupported dynamic range combination
     *
     * @see #captureBurst
     * @see #setRepeatingRequest
     * @see #setRepeatingBurst
     * @see #abortCaptures
     * @see CameraDevice#createReprocessableCaptureSession
     * @see android.hardware.camera2.params.DynamicRangeProfiles#getProfileCaptureRequestConstraints
     */
    public abstract int capture(@NonNull CaptureRequest request,
            @Nullable CaptureCallback listener, @Nullable Handler handler)
@@ -389,13 +394,16 @@ public abstract class CameraCaptureSession implements AutoCloseable {
     *                                  request was created with a {@link TotalCaptureResult} from
     *                                  a different session; or the capture targets a Surface in
     *                                  the middle of being {@link #prepare prepared}; or the
     *                                  executor is null, or the listener is not null.
     *                                  executor is null, or the listener is not null;
     *                                  or the request targets Surfaces with an unsupported dynamic
     *                                  range combination;
     *
     * @see #captureBurst
     * @see #setRepeatingRequest
     * @see #setRepeatingBurst
     * @see #abortCaptures
     * @see CameraDevice#createReprocessableCaptureSession
     * @see android.hardware.camera2.params.DynamicRangeProfiles#getProfileCaptureRequestConstraints
     */
    public int captureSingleRequest(@NonNull CaptureRequest request,
            @NonNull @CallbackExecutor Executor executor, @NonNull CaptureCallback listener)
@@ -427,6 +435,9 @@ public abstract class CameraCaptureSession implements AutoCloseable {
     * can submit reprocess capture requests. Submitting a reprocess request to a regular
     * capture session will result in an {@link IllegalArgumentException}.</p>
     *
     * <p>Submitting a request that targets Surfaces with an unsupported dynamic range combination
     * will result in an {@link IllegalArgumentException}.</p>
     *
     * @param requests the list of settings for this burst capture
     * @param listener The callback object to notify each time one of the
     * requests in the burst has been processed. If null, no metadata will be
@@ -454,12 +465,15 @@ public abstract class CameraCaptureSession implements AutoCloseable {
     *                                  {@link TotalCaptureResult} from a different session; or one
     *                                  of the captures targets a Surface in the middle of being
     *                                  {@link #prepare prepared}; or if the handler is null, the
     *                                  listener is not null, and the calling thread has no looper.
     *                                  listener is not null, and the calling thread has no looper;
     *                                  or the request targets Surfaces with an unsupported dynamic
     *                                  range combination.
     *
     * @see #capture
     * @see #setRepeatingRequest
     * @see #setRepeatingBurst
     * @see #abortCaptures
     * @see android.hardware.camera2.params.DynamicRangeProfiles#getProfileCaptureRequestConstraints
     */
    public abstract int captureBurst(@NonNull List<CaptureRequest> requests,
            @Nullable CaptureCallback listener, @Nullable Handler handler)
@@ -499,12 +513,15 @@ public abstract class CameraCaptureSession implements AutoCloseable {
     *                                  {@link TotalCaptureResult} from a different session; or one
     *                                  of the captures targets a Surface in the middle of being
     *                                  {@link #prepare prepared}; or if the executor is null; or if
     *                                  the listener is null.
     *                                  the listener is null;
     *                                  or the request targets Surfaces with an unsupported dynamic
     *                                  range combination.
     *
     * @see #capture
     * @see #setRepeatingRequest
     * @see #setRepeatingBurst
     * @see #abortCaptures
     * @see android.hardware.camera2.params.DynamicRangeProfiles#getProfileCaptureRequestConstraints
     */
    public int captureBurstRequests(@NonNull List<CaptureRequest> requests,
            @NonNull @CallbackExecutor Executor executor, @NonNull CaptureCallback listener)
@@ -545,6 +562,9 @@ public abstract class CameraCaptureSession implements AutoCloseable {
     * single reprocess input image. The request must be capturing images from the camera. If a
     * reprocess capture request is submitted, this method will throw IllegalArgumentException.</p>
     *
     * <p>Submitting a request that targets Surfaces with an unsupported dynamic range combination
     * will result in an {@link IllegalArgumentException}.</p>
     *
     * @param request the request to repeat indefinitely
     * @param listener The callback object to notify every time the
     * request finishes processing. If null, no metadata will be
@@ -567,13 +587,16 @@ public abstract class CameraCaptureSession implements AutoCloseable {
     *                                  is a reprocess capture request; or the capture targets a
     *                                  Surface in the middle of being {@link #prepare prepared}; or
     *                                  the handler is null, the listener is not null, and the
     *                                  calling thread has no looper; or no requests were passed in.
     *                                  calling thread has no looper; or no requests were passed in;
     *                                  or the request targets Surfaces with an unsupported dynamic
     *                                  range combination.
     *
     * @see #capture
     * @see #captureBurst
     * @see #setRepeatingBurst
     * @see #stopRepeating
     * @see #abortCaptures
     * @see android.hardware.camera2.params.DynamicRangeProfiles#getProfileCaptureRequestConstraints
     */
    public abstract int setRepeatingRequest(@NonNull CaptureRequest request,
            @Nullable CaptureCallback listener, @Nullable Handler handler)
@@ -604,13 +627,16 @@ public abstract class CameraCaptureSession implements AutoCloseable {
     *                                  that are not currently configured as outputs; or the request
     *                                  is a reprocess capture request; or the capture targets a
     *                                  Surface in the middle of being {@link #prepare prepared}; or
     *                                  the executor is null; or the listener is null.
     *                                  the executor is null; or the listener is null;
     *                                  or the request targets Surfaces with an unsupported dynamic
     *                                  range combination.
     *
     * @see #capture
     * @see #captureBurst
     * @see #setRepeatingBurst
     * @see #stopRepeating
     * @see #abortCaptures
     * @see android.hardware.camera2.params.DynamicRangeProfiles#getProfileCaptureRequestConstraints
     */
    public int setSingleRepeatingRequest(@NonNull CaptureRequest request,
            @NonNull @CallbackExecutor Executor executor, @NonNull CaptureCallback listener)
@@ -655,6 +681,9 @@ public abstract class CameraCaptureSession implements AutoCloseable {
     * single reprocess input image. The request must be capturing images from the camera. If a
     * reprocess capture request is submitted, this method will throw IllegalArgumentException.</p>
     *
     * <p>Submitting a request that targets Surfaces with an unsupported dynamic range combination
     * will result in an {@link IllegalArgumentException}.</p>
     *
     * @param requests the list of requests to cycle through indefinitely
     * @param listener The callback object to notify each time one of the
     * requests in the repeating bursts has finished processing. If null, no
@@ -678,13 +707,16 @@ public abstract class CameraCaptureSession implements AutoCloseable {
     *                                  targets a Surface in the middle of being
     *                                  {@link #prepare prepared}; or the handler is null, the
     *                                  listener is not null, and the calling thread has no looper;
     *                                  or no requests were passed in.
     *                                  or no requests were passed in;
     *                                  or the request targets Surfaces with an unsupported dynamic
     *                                  range combination.
     *
     * @see #capture
     * @see #captureBurst
     * @see #setRepeatingRequest
     * @see #stopRepeating
     * @see #abortCaptures
     * @see android.hardware.camera2.params.DynamicRangeProfiles#getProfileCaptureRequestConstraints
     */
    public abstract int setRepeatingBurst(@NonNull List<CaptureRequest> requests,
            @Nullable CaptureCallback listener, @Nullable Handler handler)
@@ -717,13 +749,16 @@ public abstract class CameraCaptureSession implements AutoCloseable {
     *                                  is a reprocess capture request; or one of the captures
     *                                  targets a Surface in the middle of being
     *                                  {@link #prepare prepared}; or the executor is null; or the
     *                                  listener is null.
     *                                  listener is null;
     *                                  or the request targets Surfaces with an unsupported dynamic
     *                                  range combination.
     *
     * @see #capture
     * @see #captureBurst
     * @see #setRepeatingRequest
     * @see #stopRepeating
     * @see #abortCaptures
     * @see android.hardware.camera2.params.DynamicRangeProfiles#getProfileCaptureRequestConstraints
     */
    public int setRepeatingBurstRequests(@NonNull List<CaptureRequest> requests,
            @NonNull @CallbackExecutor Executor executor, @NonNull CaptureCallback listener)
+109 −1

File changed.

Preview size limit exceeded, changes collapsed.

+45 −3

File changed.

Preview size limit exceeded, changes collapsed.

Loading