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

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

Merge "Camera2: Many docs updates" into lmp-preview-dev

parents 99d4dd27 b67a3b36
Loading
Loading
Loading
Loading
+8 −12
Original line number Diff line number Diff line
@@ -29,19 +29,19 @@ import java.util.List;
 *
 * <p>Creating a session is an expensive operation and can take several hundred milliseconds, since
 * it requires configuring the camera device's internal pipelines and allocating memory buffers for
 * sending images to the desired targets. While
 * {@link CameraDevice#createCaptureSession createCaptureSession} will provide a
 * CameraCaptureSession object immediately, configuration won't be complete until the
 * {@link CameraCaptureSession.StateListener#onConfigured onConfigured} callback is called for the
 * first time. If configuration cannot be completed, then the
 * sending images to the desired targets. Therefore the setup is done asynchronously, and
 * {@link CameraDevice#createCaptureSession createCaptureSession} will send the ready-to-use
 * CameraCaptureSession to the provided listener's
 * {@link CameraCaptureSession.StateListener#onConfigured onConfigured} callback. If configuration
 * cannot be completed, then the
 * {@link CameraCaptureSession.StateListener#onConfigureFailed onConfigureFailed} is called, and the
 * session will not become active.</p>
 *
 *<!--
 * <p>Any capture requests (repeating or non-repeating) submitted before the session is ready will
 * be queued up and will begin capture once the session becomes ready. In case the session cannot be
 * configured and {@link StateListener#onConfigureFailed onConfigureFailed} is called, all queued
 * capture requests are discarded.</p>
 *
 *-->
 * <p>If a new session is created by the camera device, then the previous session is closed, and its
 * associated {@link StateListener#onClosed onClosed} callback will be invoked.  All
 * of the session methods will throw an IllegalStateException if called once the session is
@@ -166,10 +166,6 @@ public abstract class CameraCaptureSession implements AutoCloseable {
     * capture request will be processed before any further repeating
     * requests are processed.<p>
     *
     * <p>Repeating requests are a simple way for an application to maintain a
     * preview or other continuous stream of frames, without having to submit
     * requests through {@link #capture} at video rates.</p>
     *
     * <p>To stop the repeating capture, call {@link #stopRepeating}. Calling
     * {@link #abortCaptures} will also clear the request.</p>
     *
@@ -323,7 +319,7 @@ public abstract class CameraCaptureSession implements AutoCloseable {
     *
     * @see #setRepeatingRequest
     * @see #setRepeatingBurst
     * @see #configureOutputs
     * @see CameraDevice#createCaptureSession
     */
    public abstract void abortCaptures() throws CameraAccessException;

+35 −17
Original line number Diff line number Diff line
@@ -320,7 +320,7 @@ public final class CameraCharacteristics extends CameraMetadata<CameraCharacteri

    /**
     * <p>List of frame rate ranges supported by the
     * AE algorithm/hardware</p>
     * auto-exposure (AE) algorithm/hardware</p>
     */
    public static final Key<android.util.Range<Integer>[]> CONTROL_AE_AVAILABLE_TARGET_FPS_RANGES =
            new Key<android.util.Range<Integer>[]>("android.control.aeAvailableTargetFpsRanges", new TypeReference<android.util.Range<Integer>[]>() {{ }});
@@ -343,7 +343,7 @@ public final class CameraCharacteristics extends CameraMetadata<CameraCharacteri
            new Key<Rational>("android.control.aeCompensationStep", Rational.class);

    /**
     * <p>List of AF modes that can be
     * <p>List of auto-focus (AF) modes that can be
     * selected with {@link CaptureRequest#CONTROL_AF_MODE android.control.afMode}.</p>
     * <p>Not all the auto-focus modes may be supported by a
     * given camera device. This entry lists the valid modes for
@@ -496,7 +496,7 @@ public final class CameraCharacteristics extends CameraMetadata<CameraCharacteri
            new Key<int[]>("android.hotPixel.availableHotPixelModes", int[].class);

    /**
     * <p>Supported resolutions for the JPEG thumbnail</p>
     * <p>Supported resolutions for the JPEG thumbnail.</p>
     * <p>Below condiditions will be satisfied for this size list:</p>
     * <ul>
     * <li>The sizes will be sorted by increasing pixel area (width x height).
@@ -784,11 +784,12 @@ public final class CameraCharacteristics extends CameraMetadata<CameraCharacteri
     * may be delivered to the application layer from the camera device as
     * soon as they are available.</p>
     * <p>A value of 1 means that partial results are not supported.</p>
     * <p>A typical use case for this might be: after requesting an AF lock the
     * new AF state might be available 50% of the way through the pipeline.
     * The camera device could then immediately dispatch this state via a
     * partial result to the framework/application layer, and the rest of
     * the metadata via later partial results.</p>
     * <p>A typical use case for this might be: after requesting an
     * auto-focus (AF) lock the new AF state might be available 50%
     * of the way through the pipeline.  The camera device could
     * then immediately dispatch this state via a partial result to
     * the framework/application layer, and the rest of the
     * metadata via later partial results.</p>
     */
    public static final Key<Integer> REQUEST_PARTIAL_RESULT_COUNT =
            new Key<Integer>("android.request.partialResultCount", int.class);
@@ -1326,7 +1327,13 @@ public final class CameraCharacteristics extends CameraMetadata<CameraCharacteri
            new Key<android.graphics.Rect>("android.sensor.info.activeArraySize", android.graphics.Rect.class);

    /**
     * <p>Range of valid sensitivities</p>
     * <p>Range of valid sensitivities.</p>
     * <p>The minimum and maximum valid values for the
     * {@link CaptureRequest#SENSOR_SENSITIVITY android.sensor.sensitivity} control.</p>
     * <p>The values are the standard ISO sensitivity values,
     * as defined in ISO 12232:2006.</p>
     *
     * @see CaptureRequest#SENSOR_SENSITIVITY
     */
    public static final Key<android.util.Range<Integer>> SENSOR_INFO_SENSITIVITY_RANGE =
            new Key<android.util.Range<Integer>>("android.sensor.info.sensitivityRange", new TypeReference<android.util.Range<Integer>>() {{ }});
@@ -1372,8 +1379,11 @@ public final class CameraCharacteristics extends CameraMetadata<CameraCharacteri

    /**
     * <p>The physical dimensions of the full pixel
     * array</p>
     * <p>Needed for FOV calculation for old API</p>
     * array.</p>
     * <p>This is the physical size of the sensor pixel
     * array defined by {@link CameraCharacteristics#SENSOR_INFO_PIXEL_ARRAY_SIZE android.sensor.info.pixelArraySize}.</p>
     *
     * @see CameraCharacteristics#SENSOR_INFO_PIXEL_ARRAY_SIZE
     */
    public static final Key<android.util.SizeF> SENSOR_INFO_PHYSICAL_SIZE =
            new Key<android.util.SizeF>("android.sensor.info.physicalSize", android.util.SizeF.class);
@@ -1381,9 +1391,17 @@ public final class CameraCharacteristics extends CameraMetadata<CameraCharacteri
    /**
     * <p>Dimensions of full pixel array, possibly
     * including black calibration pixels.</p>
     * <p>Maximum output resolution for raw format must
     * match this in
     * android.scaler.availableStreamConfigurations.</p>
     * <p>The pixel count of the full pixel array,
     * which covers {@link CameraCharacteristics#SENSOR_INFO_PHYSICAL_SIZE android.sensor.info.physicalSize} area.</p>
     * <p>If a camera device supports raw sensor formats, either this
     * or {@link CameraCharacteristics#SENSOR_INFO_ACTIVE_ARRAY_SIZE android.sensor.info.activeArraySize} is the maximum output
     * raw size listed in {@link CameraCharacteristics#SCALER_STREAM_CONFIGURATION_MAP android.scaler.streamConfigurationMap}.
     * If a size corresponding to pixelArraySize is listed, the resulting
     * raw sensor image will include black pixels.</p>
     *
     * @see CameraCharacteristics#SCALER_STREAM_CONFIGURATION_MAP
     * @see CameraCharacteristics#SENSOR_INFO_ACTIVE_ARRAY_SIZE
     * @see CameraCharacteristics#SENSOR_INFO_PHYSICAL_SIZE
     */
    public static final Key<android.util.Size> SENSOR_INFO_PIXEL_ARRAY_SIZE =
            new Key<android.util.Size>("android.sensor.info.pixelArraySize", android.util.Size.class);
@@ -1638,8 +1656,8 @@ public final class CameraCharacteristics extends CameraMetadata<CameraCharacteri
            new Key<Integer>("android.sensor.orientation", int.class);

    /**
     * <p>Optional. Defaults to [OFF]. Lists the supported test
     * pattern modes for {@link CaptureRequest#SENSOR_TEST_PATTERN_MODE android.sensor.testPatternMode}.</p>
     * <p>Lists the supported sensor test pattern modes for {@link CaptureRequest#SENSOR_TEST_PATTERN_MODE android.sensor.testPatternMode}.</p>
     * <p>Optional. Defaults to [OFF].</p>
     * <p><b>Optional</b> - This value may be {@code null} on some devices.</p>
     *
     * @see CaptureRequest#SENSOR_TEST_PATTERN_MODE
@@ -1649,7 +1667,7 @@ public final class CameraCharacteristics extends CameraMetadata<CameraCharacteri

    /**
     * <p>Which face detection modes are available,
     * if any</p>
     * if any.</p>
     * <p>OFF means face detection is disabled, it must
     * be included in the list.</p>
     * <p>SIMPLE means the device supports the
+30 −609

File changed.

Preview size limit exceeded, changes collapsed.

+7 −3
Original line number Diff line number Diff line
@@ -35,7 +35,7 @@ import android.util.ArrayMap;
import java.util.ArrayList;

/**
 * <p>An interface for iterating, listing, and connecting to
 * <p>A system service manager for detecting, characterizing, and connecting to
 * {@link CameraDevice CameraDevices}.</p>
 *
 * <p>You can get an instance of this class by calling
@@ -358,14 +358,18 @@ public final class CameraManager {
    }

    /**
     * Interface for listening to camera devices becoming available or
     * unavailable.
     * A listener for camera devices becoming available or
     * unavailable to open.
     *
     * <p>Cameras become available when they are no longer in use, or when a new
     * removable camera is connected. They become unavailable when some
     * application or service starts using a camera, or when a removable camera
     * is disconnected.</p>
     *
     * <p>Extend this listener and pass an instance of the subclass to
     * {@link CameraManager#addAvailabilityListener} to be notified of such availability
     * changes.</p>
     *
     * @see addAvailabilityListener
     */
    public static abstract class AvailabilityListener {
+18 −9
Original line number Diff line number Diff line
@@ -355,12 +355,14 @@ public abstract class CameraMetadata<TKey> {
     * <li>RAW16 is reprocessable into both YUV_420_888 and JPEG
     * formats.</li>
     * <li>The maximum available resolution for RAW16 streams (both
     * input/output) will match the value in
     * {@link CameraCharacteristics#SENSOR_INFO_PIXEL_ARRAY_SIZE android.sensor.info.pixelArraySize}.</li>
     * input/output) will match the either value in
     * {@link CameraCharacteristics#SENSOR_INFO_PIXEL_ARRAY_SIZE android.sensor.info.pixelArraySize} or
     * {@link CameraCharacteristics#SENSOR_INFO_ACTIVE_ARRAY_SIZE android.sensor.info.activeArraySize}.</li>
     * <li>All DNG-related optional metadata entries are provided
     * by the camera device.</li>
     * </ul>
     *
     * @see CameraCharacteristics#SENSOR_INFO_ACTIVE_ARRAY_SIZE
     * @see CameraCharacteristics#SENSOR_INFO_PIXEL_ARRAY_SIZE
     * @see CameraCharacteristics#REQUEST_AVAILABLE_CAPABILITIES
     */
@@ -760,12 +762,14 @@ public abstract class CameraMetadata<TKey> {
    public static final int CONTROL_AF_MODE_OFF = 0;

    /**
     * <p>If lens is not fixed focus.</p>
     * <p>Use {@link CameraCharacteristics#LENS_INFO_MINIMUM_FOCUS_DISTANCE android.lens.info.minimumFocusDistance} to determine if lens
     * is fixed-focus. In this mode, the lens does not move unless
     * <p>Basic automatic focus mode.</p>
     * <p>In this mode, the lens does not move unless
     * the autofocus trigger action is called. When that trigger
     * is activated, AF must transition to ACTIVE_SCAN, then to
     * is activated, AF will transition to ACTIVE_SCAN, then to
     * the outcome of the scan (FOCUSED or NOT_FOCUSED).</p>
     * <p>Always supported if lens is not fixed focus.</p>
     * <p>Use {@link CameraCharacteristics#LENS_INFO_MINIMUM_FOCUS_DISTANCE android.lens.info.minimumFocusDistance} to determine if lens
     * is fixed-focus.</p>
     * <p>Triggering AF_CANCEL resets the lens position to default,
     * and sets the AF state to INACTIVE.</p>
     *
@@ -775,9 +779,14 @@ public abstract class CameraMetadata<TKey> {
    public static final int CONTROL_AF_MODE_AUTO = 1;

    /**
     * <p>Close-up focusing mode.</p>
     * <p>In this mode, the lens does not move unless the
     * autofocus trigger action is called.</p>
     * <p>When that trigger is activated, AF must transition to
     * autofocus trigger action is called. When that trigger is
     * activated, AF will transition to ACTIVE_SCAN, then to
     * the outcome of the scan (FOCUSED or NOT_FOCUSED). This
     * mode is optimized for focusing on objects very close to
     * the camera.</p>
     * <p>When that trigger is activated, AF will transition to
     * ACTIVE_SCAN, then to the outcome of the scan (FOCUSED or
     * NOT_FOCUSED). Triggering cancel AF resets the lens
     * position to default, and sets the AF state to
Loading