Skip to content

Commit b4f95be

Browse files
author
Wu-cheng Li
committed
Update camera javadoc about AE and AWB lock.
- Autofocus does not lock AE and AWB. - stopPreview and takePicture do not clear AE and AWB locks. bug:5356404 Change-Id: I55d9b35f4ff746ecd2bff112c2674f1aa2543aca
1 parent 90fb9aa commit b4f95be

File tree

2 files changed

+29
-84
lines changed

2 files changed

+29
-84
lines changed

core/java/android/hardware/Camera.java

Lines changed: 23 additions & 68 deletions
Original file line numberDiff line numberDiff line change
@@ -766,15 +766,8 @@ public interface AutoFocusCallback
766766
* onAutoFocus will be called immediately with a fake value of
767767
* <code>success</code> set to <code>true</code>.
768768
*
769-
* The auto-focus routine may lock auto-exposure and auto-white balance
770-
* after it completes. To check for the state of these locks, use the
771-
* {@link android.hardware.Camera.Parameters#getAutoExposureLock()} and
772-
* {@link android.hardware.Camera.Parameters#getAutoWhiteBalanceLock()}
773-
* methods. If such locking is undesirable, use
774-
* {@link android.hardware.Camera.Parameters#setAutoExposureLock(boolean)}
775-
* and
776-
* {@link android.hardware.Camera.Parameters#setAutoWhiteBalanceLock(boolean)}
777-
* to release the locks.
769+
* The auto-focus routine does not lock auto-exposure and auto-white
770+
* balance after it completes.
778771
*
779772
* @param success true if focus was successful, false if otherwise
780773
* @param camera the Camera service object
@@ -805,16 +798,10 @@ public interface AutoFocusCallback
805798
* {@link android.hardware.Camera.Parameters#FLASH_MODE_OFF}, flash may be
806799
* fired during auto-focus, depending on the driver and camera hardware.<p>
807800
*
808-
* The auto-focus routine may lock auto-exposure and auto-white balance
809-
* after it completes. To check for the state of these locks, use the
810-
* {@link android.hardware.Camera.Parameters#getAutoExposureLock()} and
811-
* {@link android.hardware.Camera.Parameters#getAutoWhiteBalanceLock()}
812-
* methods after the {@link AutoFocusCallback#onAutoFocus(boolean, Camera)}
813-
* callback is invoked. If such locking is undesirable, use
814-
* {@link android.hardware.Camera.Parameters#setAutoExposureLock(boolean)}
815-
* and
816-
* {@link android.hardware.Camera.Parameters#setAutoWhiteBalanceLock(boolean)}
817-
* to release the locks.
801+
* Auto-exposure lock {@link android.hardware.Camera.Parameters#getAutoExposureLock()}
802+
* and auto-white balance locks {@link android.hardware.Camera.Parameters#getAutoWhiteBalanceLock()}
803+
* do not change during and after autofocus. But auto-focus routine may stop
804+
* auto-exposure and auto-white balance transiently during focusing.
818805
*
819806
* @param cb the callback to run
820807
* @see #cancelAutoFocus()
@@ -834,13 +821,7 @@ public final void autoFocus(AutoFocusCallback cb)
834821
* this function will return the focus position to the default.
835822
* If the camera does not support auto-focus, this is a no-op.
836823
*
837-
* Canceling auto-focus will return the auto-exposure lock and auto-white
838-
* balance lock to their state before {@link #autoFocus(AutoFocusCallback)}
839-
* was called.
840-
*
841824
* @see #autoFocus(Camera.AutoFocusCallback)
842-
* @see android.hardware.Camera.Parameters#setAutoExposureLock(boolean)
843-
* @see android.hardware.Camera.Parameters#setAutoWhiteBalanceLock(boolean)
844825
*/
845826
public final void cancelAutoFocus()
846827
{
@@ -2778,13 +2759,12 @@ public float getExposureCompensationStep() {
27782759
*
27792760
* <p>Stopping preview with {@link #stopPreview()}, or triggering still
27802761
* image capture with {@link #takePicture(Camera.ShutterCallback,
2781-
* Camera.PictureCallback, Camera.PictureCallback)}, will automatically
2782-
* set the lock to false. However, the lock can be re-enabled before
2783-
* preview is re-started to keep the same AE parameters.</p>
2762+
* Camera.PictureCallback, Camera.PictureCallback)}, will not change the
2763+
* lock.</p>
27842764
*
2785-
* <p>Exposure compensation, in conjunction with re-enabling the AE and
2786-
* AWB locks after each still capture, can be used to capture an
2787-
* exposure-bracketed burst of images, for example.</p>
2765+
* <p>Exposure compensation, auto-exposure lock, and auto-white balance
2766+
* lock can be used to capture an exposure-bracketed burst of images,
2767+
* for example.</p>
27882768
*
27892769
* <p>Auto-exposure state, including the lock state, will not be
27902770
* maintained after camera {@link #release()} is called. Locking
@@ -2793,14 +2773,6 @@ public float getExposureCompensationStep() {
27932773
* run at all, and may result in severely over- or under-exposed
27942774
* images.</p>
27952775
*
2796-
* <p>The driver may also independently lock auto-exposure after
2797-
* auto-focus completes. If this is undesirable, be sure to always set
2798-
* the auto-exposure lock to false after the
2799-
* {@link AutoFocusCallback#onAutoFocus(boolean, Camera)} callback is
2800-
* received. The {@link #getAutoExposureLock()} method can be used after
2801-
* the callback to determine if the camera has locked auto-exposure
2802-
* independently.</p>
2803-
*
28042776
* @param toggle new state of the auto-exposure lock. True means that
28052777
* auto-exposure is locked, false means that the auto-exposure
28062778
* routine is free to run normally.
@@ -2817,11 +2789,7 @@ public void setAutoExposureLock(boolean toggle) {
28172789
* {@link #setAutoExposureLock} for details about the lock.
28182790
*
28192791
* @return State of the auto-exposure lock. Returns true if
2820-
* auto-exposure is currently locked, and false otherwise. The
2821-
* auto-exposure lock may be independently enabled by the camera
2822-
* subsystem when auto-focus has completed. This method can be
2823-
* used after the {@link AutoFocusCallback#onAutoFocus(boolean,
2824-
* Camera)} callback to determine if the camera has locked AE.
2792+
* auto-exposure is currently locked, and false otherwise.
28252793
*
28262794
* @see #setAutoExposureLock(boolean)
28272795
*
@@ -2859,29 +2827,20 @@ public boolean isAutoExposureLockSupported() {
28592827
*
28602828
* <p>Stopping preview with {@link #stopPreview()}, or triggering still
28612829
* image capture with {@link #takePicture(Camera.ShutterCallback,
2862-
* Camera.PictureCallback, Camera.PictureCallback)}, will automatically
2863-
* set the lock to false. However, the lock can be re-enabled before
2864-
* preview is re-started to keep the same white balance parameters.</p>
2830+
* Camera.PictureCallback, Camera.PictureCallback)}, will not change the
2831+
* the lock.</p>
28652832
*
28662833
* <p> Changing the white balance mode with {@link #setWhiteBalance}
28672834
* will release the auto-white balance lock if it is set.</p>
28682835
*
2869-
* <p>Exposure compensation, in conjunction with re-enabling the AE and
2870-
* AWB locks after each still capture, can be used to capture an
2871-
* exposure-bracketed burst of images, for example. Auto-white balance
2872-
* state, including the lock state, will not be maintained after camera
2873-
* {@link #release()} is called. Locking auto-white balance after
2874-
* {@link #open()} but before the first call to {@link #startPreview()}
2875-
* will not allow the auto-white balance routine to run at all, and may
2876-
* result in severely incorrect color in captured images.</p>
2877-
*
2878-
* <p>The driver may also independently lock auto-white balance after
2879-
* auto-focus completes. If this is undesirable, be sure to always set
2880-
* the auto-white balance lock to false after the
2881-
* {@link AutoFocusCallback#onAutoFocus(boolean, Camera)} callback is
2882-
* received. The {@link #getAutoWhiteBalanceLock()} method can be used
2883-
* after the callback to determine if the camera has locked auto-white
2884-
* balance independently.</p>
2836+
* <p>Exposure compensation, AE lock, and AWB lock can be used to
2837+
* capture an exposure-bracketed burst of images, for example.
2838+
* Auto-white balance state, including the lock state, will not be
2839+
* maintained after camera {@link #release()} is called. Locking
2840+
* auto-white balance after {@link #open()} but before the first call to
2841+
* {@link #startPreview()} will not allow the auto-white balance routine
2842+
* to run at all, and may result in severely incorrect color in captured
2843+
* images.</p>
28852844
*
28862845
* @param toggle new state of the auto-white balance lock. True means
28872846
* that auto-white balance is locked, false means that the
@@ -2902,11 +2861,7 @@ public void setAutoWhiteBalanceLock(boolean toggle) {
29022861
*
29032862
* @return State of the auto-white balance lock. Returns true if
29042863
* auto-white balance is currently locked, and false
2905-
* otherwise. The auto-white balance lock may be independently
2906-
* enabled by the camera subsystem when auto-focus has
2907-
* completed. This method can be used after the
2908-
* {@link AutoFocusCallback#onAutoFocus(boolean, Camera)}
2909-
* callback to determine if the camera has locked AWB.
2864+
* otherwise.
29102865
*
29112866
* @see #setAutoWhiteBalanceLock(boolean)
29122867
*

include/camera/CameraParameters.h

Lines changed: 6 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -317,18 +317,13 @@ class CameraParameters
317317
// recalculate exposure values). Changing exposure compensation
318318
// settings will still affect the exposure settings while
319319
// auto-exposure is locked. Stopping preview or taking a still
320-
// image will release the lock. However, the lock can be
321-
// re-enabled prior to preview being re-started, to keep the
322-
// exposure values from the previous lock. In conjunction with
320+
// image will not change the lock. In conjunction with
323321
// exposure compensation, this allows for capturing multi-exposure
324322
// brackets with known relative exposure values. Locking
325323
// auto-exposure after open but before the first call to
326324
// startPreview may result in severely over- or under-exposed
327-
// images. The driver may independently enable the AE lock after
328-
// auto-focus completes. If it does so, this key must have its
329-
// value updated to reflect the lock's existence. Applications are
330-
// free to release such a lock, to re-enable AE without restarting
331-
// preview.
325+
// images. The driver will not change the AE lock after
326+
// auto-focus completes.
332327
static const char KEY_AUTO_EXPOSURE_LOCK[];
333328
// Whether locking the auto-exposure is supported. "true" means it is, and
334329
// "false" or this key not existing means it is not supported.
@@ -339,18 +334,13 @@ class CameraParameters
339334
// change white balance values. If auto-white balance is already
340335
// locked, setting this to true again has no effect (the driver
341336
// will not recalculate white balance values). Stopping preview or
342-
// taking a still image will release the lock. However, the lock
343-
// can be re-enabled prior to preview being re-started, to keep
344-
// the white balance values from the previous lock. In conjunction
337+
// taking a still image will not change the lock. In conjunction
345338
// with exposure compensation, this allows for capturing
346339
// multi-exposure brackets with fixed white balance. Locking
347340
// auto-white balance after open but before the first call to
348341
// startPreview may result in severely incorrect color. The
349-
// driver may independently enable the AWB lock after auto-focus
350-
// completes. If it does so, this key must have its value updated
351-
// to reflect the lock's existence. Applications are free to
352-
// release such a lock, to re-enable AWB without restarting
353-
// preview.
342+
// driver will not change the AWB lock after auto-focus
343+
// completes.
354344
static const char KEY_AUTO_WHITEBALANCE_LOCK[];
355345
// Whether locking the auto-white balance is supported. "true"
356346
// means it is, and "false" or this key not existing means it is

0 commit comments

Comments
 (0)