Add CONTROL_VIDEO_STABILIZATION_MODE_PREVIEW_STABILIZATION to allow for better preview stabilization.

Add CONTROL_VIDEO_STABILIZATION_MODE_PREVIEW_STABILIZATION. This CaptureRequest key may be
advertised by devices which can support applying the same quality of
stabilization to preview and all non RAW streams. This helps clients
achieve a what you see is what you get effect.

Bug: 170230992

Test: builds

Change-Id: Ida56d335716a10861d2b9e60e7c4b237965dec9c
Signed-off-by: Jayant Chowdhary <jchowdhary@google.com>
This commit is contained in:
Jayant Chowdhary
2021-09-28 17:22:11 -07:00
parent dc89b4340c
commit 7f789bc503
4 changed files with 47 additions and 0 deletions

View File

@@ -18325,6 +18325,7 @@ package android.hardware.camera2 {
field public static final int CONTROL_SCENE_MODE_THEATRE = 7; // 0x7
field public static final int CONTROL_VIDEO_STABILIZATION_MODE_OFF = 0; // 0x0
field public static final int CONTROL_VIDEO_STABILIZATION_MODE_ON = 1; // 0x1
field public static final int CONTROL_VIDEO_STABILIZATION_MODE_PREVIEW_STABILIZATION = 2; // 0x2
field public static final int DISTORTION_CORRECTION_MODE_FAST = 1; // 0x1
field public static final int DISTORTION_CORRECTION_MODE_HIGH_QUALITY = 2; // 0x2
field public static final int DISTORTION_CORRECTION_MODE_OFF = 0; // 0x0

View File

@@ -2657,6 +2657,18 @@ public abstract class CameraMetadata<TKey> {
*/
public static final int CONTROL_VIDEO_STABILIZATION_MODE_ON = 1;
/**
* <p>Preview stabilization, where the preview in addition to all other non-RAW streams are
* stabilized with the same quality of stabilization, is enabled. This mode aims to give
* clients a 'what you see is what you get' effect. In this mode, the FoV reduction will
* be a maximum of 20 % both horizontally and vertically
* (10% from left, right, top, bottom) for the given zoom ratio / crop region.
* The resultant FoV will also be the same across all processed streams
* (that have the same aspect ratio).</p>
* @see CaptureRequest#CONTROL_VIDEO_STABILIZATION_MODE
*/
public static final int CONTROL_VIDEO_STABILIZATION_MODE_PREVIEW_STABILIZATION = 2;
//
// Enumeration values for CaptureRequest#CONTROL_EXTENDED_SCENE_MODE
//

View File

@@ -2081,10 +2081,20 @@ public final class CaptureRequest extends CameraMetadata<CaptureRequest.Key<?>>
* ({@link CaptureRequest#LENS_OPTICAL_STABILIZATION_MODE android.lens.opticalStabilizationMode}), turning both modes on may
* produce undesirable interaction, so it is recommended not to enable
* both at the same time.</p>
* <p>If video stabilization is set to "PREVIEW_STABILIZATION",
* {@link CaptureRequest#LENS_OPTICAL_STABILIZATION_MODE android.lens.opticalStabilizationMode} is overridden. The camera sub-system may choose
* to turn on hardware based image stabilization in addition to software based stabilization
* if it deems that appropriate.
* This key may be a part of the available session keys, which camera clients may
* query via
* {@link android.hardware.camera2.CameraCharacteristics#getAvailableSessionKeys }.
* If this is the case, changing this key over the life-time of a capture session may
* cause delays / glitches.</p>
* <p><b>Possible values:</b></p>
* <ul>
* <li>{@link #CONTROL_VIDEO_STABILIZATION_MODE_OFF OFF}</li>
* <li>{@link #CONTROL_VIDEO_STABILIZATION_MODE_ON ON}</li>
* <li>{@link #CONTROL_VIDEO_STABILIZATION_MODE_PREVIEW_STABILIZATION PREVIEW_STABILIZATION}</li>
* </ul>
*
* <p>This key is available on all devices.</p>
@@ -2094,6 +2104,7 @@ public final class CaptureRequest extends CameraMetadata<CaptureRequest.Key<?>>
* @see CaptureRequest#SCALER_CROP_REGION
* @see #CONTROL_VIDEO_STABILIZATION_MODE_OFF
* @see #CONTROL_VIDEO_STABILIZATION_MODE_ON
* @see #CONTROL_VIDEO_STABILIZATION_MODE_PREVIEW_STABILIZATION
*/
@PublicKey
@NonNull
@@ -2785,6 +2796,11 @@ public final class CaptureRequest extends CameraMetadata<CaptureRequest.Key<?>>
* <p>If a camera device supports both OIS and digital image stabilization
* ({@link CaptureRequest#CONTROL_VIDEO_STABILIZATION_MODE android.control.videoStabilizationMode}), turning both modes on may produce undesirable
* interaction, so it is recommended not to enable both at the same time.</p>
* <p>If {@link CaptureRequest#CONTROL_VIDEO_STABILIZATION_MODE android.control.videoStabilizationMode} is set to "PREVIEW_STABILIZATION",
* {@link CaptureRequest#LENS_OPTICAL_STABILIZATION_MODE android.lens.opticalStabilizationMode} is overridden. The camera sub-system may choose
* to turn on hardware based image stabilization in addition to software based stabilization
* if it deems that appropriate. This key's value in the capture result will reflect which
* OIS mode was chosen.</p>
* <p>Not all devices will support OIS; see
* {@link CameraCharacteristics#LENS_INFO_AVAILABLE_OPTICAL_STABILIZATION android.lens.info.availableOpticalStabilization} for
* available controls.</p>
@@ -2804,6 +2820,7 @@ public final class CaptureRequest extends CameraMetadata<CaptureRequest.Key<?>>
* @see CaptureRequest#CONTROL_VIDEO_STABILIZATION_MODE
* @see CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL
* @see CameraCharacteristics#LENS_INFO_AVAILABLE_OPTICAL_STABILIZATION
* @see CaptureRequest#LENS_OPTICAL_STABILIZATION_MODE
* @see #LENS_OPTICAL_STABILIZATION_MODE_OFF
* @see #LENS_OPTICAL_STABILIZATION_MODE_ON
*/

View File

@@ -2335,10 +2335,20 @@ public class CaptureResult extends CameraMetadata<CaptureResult.Key<?>> {
* ({@link CaptureRequest#LENS_OPTICAL_STABILIZATION_MODE android.lens.opticalStabilizationMode}), turning both modes on may
* produce undesirable interaction, so it is recommended not to enable
* both at the same time.</p>
* <p>If video stabilization is set to "PREVIEW_STABILIZATION",
* {@link CaptureRequest#LENS_OPTICAL_STABILIZATION_MODE android.lens.opticalStabilizationMode} is overridden. The camera sub-system may choose
* to turn on hardware based image stabilization in addition to software based stabilization
* if it deems that appropriate.
* This key may be a part of the available session keys, which camera clients may
* query via
* {@link android.hardware.camera2.CameraCharacteristics#getAvailableSessionKeys }.
* If this is the case, changing this key over the life-time of a capture session may
* cause delays / glitches.</p>
* <p><b>Possible values:</b></p>
* <ul>
* <li>{@link #CONTROL_VIDEO_STABILIZATION_MODE_OFF OFF}</li>
* <li>{@link #CONTROL_VIDEO_STABILIZATION_MODE_ON ON}</li>
* <li>{@link #CONTROL_VIDEO_STABILIZATION_MODE_PREVIEW_STABILIZATION PREVIEW_STABILIZATION}</li>
* </ul>
*
* <p>This key is available on all devices.</p>
@@ -2348,6 +2358,7 @@ public class CaptureResult extends CameraMetadata<CaptureResult.Key<?>> {
* @see CaptureRequest#SCALER_CROP_REGION
* @see #CONTROL_VIDEO_STABILIZATION_MODE_OFF
* @see #CONTROL_VIDEO_STABILIZATION_MODE_ON
* @see #CONTROL_VIDEO_STABILIZATION_MODE_PREVIEW_STABILIZATION
*/
@PublicKey
@NonNull
@@ -3072,6 +3083,11 @@ public class CaptureResult extends CameraMetadata<CaptureResult.Key<?>> {
* <p>If a camera device supports both OIS and digital image stabilization
* ({@link CaptureRequest#CONTROL_VIDEO_STABILIZATION_MODE android.control.videoStabilizationMode}), turning both modes on may produce undesirable
* interaction, so it is recommended not to enable both at the same time.</p>
* <p>If {@link CaptureRequest#CONTROL_VIDEO_STABILIZATION_MODE android.control.videoStabilizationMode} is set to "PREVIEW_STABILIZATION",
* {@link CaptureRequest#LENS_OPTICAL_STABILIZATION_MODE android.lens.opticalStabilizationMode} is overridden. The camera sub-system may choose
* to turn on hardware based image stabilization in addition to software based stabilization
* if it deems that appropriate. This key's value in the capture result will reflect which
* OIS mode was chosen.</p>
* <p>Not all devices will support OIS; see
* {@link CameraCharacteristics#LENS_INFO_AVAILABLE_OPTICAL_STABILIZATION android.lens.info.availableOpticalStabilization} for
* available controls.</p>
@@ -3091,6 +3107,7 @@ public class CaptureResult extends CameraMetadata<CaptureResult.Key<?>> {
* @see CaptureRequest#CONTROL_VIDEO_STABILIZATION_MODE
* @see CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL
* @see CameraCharacteristics#LENS_INFO_AVAILABLE_OPTICAL_STABILIZATION
* @see CaptureRequest#LENS_OPTICAL_STABILIZATION_MODE
* @see #LENS_OPTICAL_STABILIZATION_MODE_OFF
* @see #LENS_OPTICAL_STABILIZATION_MODE_ON
*/