/* * Copyright (C) 2024 The Android Open Source Project * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package android.hardware.camera2; import android.annotation.FlaggedApi; import android.annotation.NonNull; import android.hardware.camera2.CameraCharacteristics; import android.hardware.camera2.CaptureRequest; import android.hardware.camera2.CaptureRequest.Key; import android.hardware.camera2.impl.ExtensionKey; import android.hardware.camera2.impl.PublicKey; import com.android.internal.camera.flags.Flags; /** * ExtensionCaptureRequest contains definitions for extension-specific CaptureRequest keys that * can be used to configure a {@link android.hardware.camera2.CaptureRequest} during a * {@link android.hardware.camera2.CameraExtensionSession}. * * Note that ExtensionCaptureRequest is not intended to be used as a replacement * for CaptureRequest in the extensions. It serves as a supplementary class providing * extension-specific CaptureRequest keys. Developers should use these keys in conjunction * with regular CaptureRequest objects during a * {@link android.hardware.camera2.CameraExtensionSession}. * * @see CaptureRequest * @see CameraExtensionSession */ @FlaggedApi(Flags.FLAG_CONCERT_MODE_API) public final class ExtensionCaptureRequest { /** *
Used to apply an additional digital zoom factor for the * {@link android.hardware.camera2.CameraExtensionCharacteristics#EXTENSION_EYES_FREE_VIDEOGRAPHY } * extension in {@link android.hardware.camera2.ExtensionCaptureRequest#EFV_STABILIZATION_MODE_LOCKED } mode.
*For the {@link android.hardware.camera2.CameraExtensionCharacteristics#EXTENSION_EYES_FREE_VIDEOGRAPHY } * feature, an additional zoom factor is applied on top of the existing {@link CaptureRequest#CONTROL_ZOOM_RATIO android.control.zoomRatio}. * This additional zoom factor serves as a buffer to provide more flexibility for the * {@link android.hardware.camera2.ExtensionCaptureRequest#EFV_STABILIZATION_MODE_LOCKED } * mode. If {@link ExtensionCaptureRequest#EFV_PADDING_ZOOM_FACTOR } is not set, the default will be used. * The effectiveness of the stabilization may be influenced by the amount of padding zoom * applied. A higher padding zoom factor can stabilize the target region more effectively * with greater flexibility but may potentially impact image quality. Conversely, a lower * padding zoom factor may be used to prioritize preserving image quality, albeit with less * leeway in stabilizing the target region. It is recommended to set the * {@link android.hardware.camera2.ExtensionCaptureRequest#EFV_PADDING_ZOOM_FACTOR } to at least 1.5.
*If {@link ExtensionCaptureRequest#EFV_AUTO_ZOOM } is enabled, the requested {@link ExtensionCaptureRequest#EFV_PADDING_ZOOM_FACTOR } will be overridden. * {@link ExtensionCaptureRequest#EFV_MAX_PADDING_ZOOM_FACTOR } can be checked for more details on controlling the * padding zoom factor during {@link ExtensionCaptureRequest#EFV_AUTO_ZOOM }.
*Range of valid values:
* {@link CameraExtensionCharacteristics#EFV_PADDING_ZOOM_FACTOR_RANGE }
Optional - The value for this key may be {@code null} on some devices.
* * @see CaptureRequest#CONTROL_ZOOM_RATIO * @see ExtensionCaptureRequest#EFV_AUTO_ZOOM * @see ExtensionCaptureRequest#EFV_MAX_PADDING_ZOOM_FACTOR * @see ExtensionCaptureRequest#EFV_PADDING_ZOOM_FACTOR * @see CameraExtensionCharacteristics#EFV_PADDING_ZOOM_FACTOR_RANGE */ @PublicKey @NonNull @ExtensionKey @FlaggedApi(Flags.FLAG_CONCERT_MODE_API) public static final KeyUsed to enable or disable auto zoom for the * {@link android.hardware.camera2.CameraExtensionCharacteristics#EXTENSION_EYES_FREE_VIDEOGRAPHY } * extension in {@link android.hardware.camera2.ExtensionCaptureRequest#EFV_STABILIZATION_MODE_LOCKED } mode.
*Turn on auto zoom to let the * {@link android.hardware.camera2.CameraExtensionCharacteristics#EXTENSION_EYES_FREE_VIDEOGRAPHY } * feature decide at any given point a combination of * {@link CaptureRequest#CONTROL_ZOOM_RATIO android.control.zoomRatio} and {@link ExtensionCaptureRequest#EFV_PADDING_ZOOM_FACTOR } * to keep the target region in view and stabilized. The combination chosen by the * {@link android.hardware.camera2.CameraExtensionCharacteristics#EXTENSION_EYES_FREE_VIDEOGRAPHY } * will equal the requested {@link CaptureRequest#CONTROL_ZOOM_RATIO android.control.zoomRatio} multiplied with the requested * {@link ExtensionCaptureRequest#EFV_PADDING_ZOOM_FACTOR }. A limit can be set on the padding zoom if wanting * to control image quality further using {@link ExtensionCaptureRequest#EFV_MAX_PADDING_ZOOM_FACTOR }.
*Optional - The value for this key may be {@code null} on some devices.
* * @see CaptureRequest#CONTROL_ZOOM_RATIO * @see ExtensionCaptureRequest#EFV_MAX_PADDING_ZOOM_FACTOR * @see ExtensionCaptureRequest#EFV_PADDING_ZOOM_FACTOR */ @PublicKey @NonNull @ExtensionKey @FlaggedApi(Flags.FLAG_CONCERT_MODE_API) public static final KeyUsed to limit the {@link ExtensionCaptureRequest#EFV_PADDING_ZOOM_FACTOR } if * {@link ExtensionCaptureRequest#EFV_AUTO_ZOOM } is enabled for the * {@link android.hardware.camera2.CameraExtensionCharacteristics#EXTENSION_EYES_FREE_VIDEOGRAPHY } * extension in {@link android.hardware.camera2.ExtensionCaptureRequest#EFV_STABILIZATION_MODE_LOCKED } mode.
*If {@link ExtensionCaptureRequest#EFV_AUTO_ZOOM } is enabled, this key can be used to set a limit * on the {@link ExtensionCaptureRequest#EFV_PADDING_ZOOM_FACTOR } chosen by the * {@link android.hardware.camera2.CameraExtensionCharacteristics#EXTENSION_EYES_FREE_VIDEOGRAPHY } * extension in {@link android.hardware.camera2.ExtensionCaptureRequest#EFV_STABILIZATION_MODE_LOCKED } mode * to control image quality.
*Range of valid values:
* The range of {@link CameraExtensionCharacteristics#EFV_PADDING_ZOOM_FACTOR_RANGE Range}. Use a value greater than or equal to
* the {@link android.hardware.camera2.ExtensionCaptureRequest#EFV_PADDING_ZOOM_FACTOR } to
* effectively utilize this key.
Optional - The value for this key may be {@code null} on some devices.
* * @see ExtensionCaptureRequest#EFV_AUTO_ZOOM * @see ExtensionCaptureRequest#EFV_PADDING_ZOOM_FACTOR * @see CameraExtensionCharacteristics#EFV_PADDING_ZOOM_FACTOR_RANGE */ @PublicKey @NonNull @ExtensionKey @FlaggedApi(Flags.FLAG_CONCERT_MODE_API) public static final KeySet the stabilization mode for the * {@link android.hardware.camera2.CameraExtensionCharacteristics#EXTENSION_EYES_FREE_VIDEOGRAPHY } * extension
*The desired stabilization mode. Gimbal stabilization mode provides simple, non-locked * video stabilization. Locked mode uses the * {@link android.hardware.camera2.CameraExtensionCharacteristics#EXTENSION_EYES_FREE_VIDEOGRAPHY } * stabilization feature to fixate on the current region, utilizing it as the target area for * stabilization.
*Possible values:
*Optional - The value for this key may be {@code null} on some devices.
* @see #EFV_STABILIZATION_MODE_OFF * @see #EFV_STABILIZATION_MODE_GIMBAL * @see #EFV_STABILIZATION_MODE_LOCKED */ @PublicKey @NonNull @ExtensionKey @FlaggedApi(Flags.FLAG_CONCERT_MODE_API) public static final KeyUsed to update the target region for the * {@link android.hardware.camera2.CameraExtensionCharacteristics#EXTENSION_EYES_FREE_VIDEOGRAPHY } * extension in {@link android.hardware.camera2.ExtensionCaptureRequest#EFV_STABILIZATION_MODE_LOCKED } mode.
*A android.util.Pair
Range of valid values:
* android.util.Pair
Optional - The value for this key may be {@code null} on some devices.
* * @see ExtensionCaptureResult#EFV_PADDING_REGION */ @PublicKey @NonNull @ExtensionKey @FlaggedApi(Flags.FLAG_CONCERT_MODE_API) public static final KeyRepresenting the desired clockwise rotation * of the target region in degrees for the * {@link android.hardware.camera2.CameraExtensionCharacteristics#EXTENSION_EYES_FREE_VIDEOGRAPHY } * extension in {@link android.hardware.camera2.ExtensionCaptureRequest#EFV_STABILIZATION_MODE_LOCKED } mode.
*Value representing the desired clockwise rotation of the target * region in degrees.
*Range of valid values:
* 0 to 360
Optional - The value for this key may be {@code null} on some devices.
*/ @PublicKey @NonNull @ExtensionKey @FlaggedApi(Flags.FLAG_CONCERT_MODE_API) public static final KeyNo stabilization.
* @see ExtensionCaptureRequest#EFV_STABILIZATION_MODE */ @FlaggedApi(Flags.FLAG_CONCERT_MODE_API) public static final int EFV_STABILIZATION_MODE_OFF = CaptureRequest.EFV_STABILIZATION_MODE_OFF; /** *Gimbal stabilization mode.
* @see ExtensionCaptureRequest#EFV_STABILIZATION_MODE */ @FlaggedApi(Flags.FLAG_CONCERT_MODE_API) public static final int EFV_STABILIZATION_MODE_GIMBAL = CaptureRequest.EFV_STABILIZATION_MODE_GIMBAL; /** *Locked stabilization mode which uses the * {@link android.hardware.camera2.CameraExtensionCharacteristics#EXTENSION_EYES_FREE_VIDEOGRAPHY } * stabilization to directionally steady the target region.
* @see ExtensionCaptureRequest#EFV_STABILIZATION_MODE */ @FlaggedApi(Flags.FLAG_CONCERT_MODE_API) public static final int EFV_STABILIZATION_MODE_LOCKED = CaptureRequest.EFV_STABILIZATION_MODE_LOCKED; }