OSDN Git Service

Camera3: Add PASSIVE_UNFOCUSED AF state and clean up INACTIVE
authorEino-Ville Talvala <etalvala@google.com>
Sat, 21 Sep 2013 00:24:50 +0000 (17:24 -0700)
committerEino-Ville Talvala <etalvala@google.com>
Sat, 21 Sep 2013 01:02:06 +0000 (18:02 -0700)
Needed to support the real case of continuous focus giving up on a
scene for a while (say, a blank wall), during which we shouldn't claim
the lens is in motion.

Also add new states for INACTIVE to clarify it as the starting state
after mode transitions or enabling AF/AE/AWB.

Bug: 10860639
Bug: 10446772

Change-Id: Ie4c1ac73e5a9eb6d1894d83dbded49a2767a8ffd

include/hardware/camera3.h

index 01203ff..afc9d9f 100644 (file)
  *        well focused. The lens is not moving. The HAL may spontaneously leave
  *        this state.
  *
+ *     AF_STATE_PASSIVE_UNFOCUSED: A continuous focus algorithm believes it is
+ *        not well focused. The lens is not moving. The HAL may spontaneously
+ *        leave this state.
+ *
  *     AF_STATE_ACTIVE_SCAN: A scan triggered by the user is underway.
  *
  *     AF_STATE_FOCUSED_LOCKED: The AF algorithm believes it is focused. The
  *
  * S4.5. AF state machines
  *
+ *                       when enabling AF or changing AF mode
+ *| state              | trans. cause  | new state          | notes            |
+ *+--------------------+---------------+--------------------+------------------+
+ *| Any                | AF mode change| INACTIVE           |                  |
+ *+--------------------+---------------+--------------------+------------------+
+ *
  *                            mode = AF_MODE_OFF or AF_MODE_EDOF
  *| state              | trans. cause  | new state          | notes            |
  *+--------------------+---------------+--------------------+------------------+
- *| INACTIVE           |               |                    | AF is disabled   |
+ *| INACTIVE           |               | INACTIVE           | Never changes    |
  *+--------------------+---------------+--------------------+------------------+
  *
  *                            mode = AF_MODE_AUTO or AF_MODE_MACRO
  *| PASSIVE_SCAN       | HAL completes | PASSIVE_FOCUSED    | End AF scan      |
  *|                    | current scan  |                    | Lens now locked  |
  *+--------------------+---------------+--------------------+------------------+
+ *| PASSIVE_SCAN       | HAL fails     | PASSIVE_UNFOCUSED  | End AF scan      |
+ *|                    | current scan  |                    | Lens now locked  |
+ *+--------------------+---------------+--------------------+------------------+
  *| PASSIVE_SCAN       | AF_TRIGGER    | FOCUSED_LOCKED     | Immediate trans. |
  *|                    |               |                    | if focus is good |
  *|                    |               |                    | Lens now locked  |
  *| PASSIVE_FOCUSED    | HAL initiates | PASSIVE_SCAN       | Start AF scan    |
  *|                    | new scan      |                    | Lens now moving  |
  *+--------------------+---------------+--------------------+------------------+
+ *| PASSIVE_UNFOCUSED  | HAL initiates | PASSIVE_SCAN       | Start AF scan    |
+ *|                    | new scan      |                    | Lens now moving  |
+ *+--------------------+---------------+--------------------+------------------+
  *| PASSIVE_FOCUSED    | AF_TRIGGER    | FOCUSED_LOCKED     | Immediate trans. |
- *|                    |               |                    | if focus is good |
  *|                    |               |                    | Lens now locked  |
  *+--------------------+---------------+--------------------+------------------+
- *| PASSIVE_FOCUSED    | AF_TRIGGER    | NOT_FOCUSED_LOCKED | Immediate trans. |
- *|                    |               |                    | if focus is bad  |
+ *| PASSIVE_UNFOCUSED  | AF_TRIGGER    | NOT_FOCUSED_LOCKED | Immediate trans. |
  *|                    |               |                    | Lens now locked  |
  *+--------------------+---------------+--------------------+------------------+
  *| FOCUSED_LOCKED     | AF_TRIGGER    | FOCUSED_LOCKED     | No effect        |
  *| PASSIVE_SCAN       | HAL completes | PASSIVE_FOCUSED    | End AF scan      |
  *|                    | current scan  |                    | Lens now locked  |
  *+--------------------+---------------+--------------------+------------------+
+ *| PASSIVE_SCAN       | HAL fails     | PASSIVE_UNFOCUSED  | End AF scan      |
+ *|                    | current scan  |                    | Lens now locked  |
+ *+--------------------+---------------+--------------------+------------------+
  *| PASSIVE_SCAN       | AF_TRIGGER    | FOCUSED_LOCKED     | Eventual trans.  |
  *|                    |               |                    | once focus good  |
  *|                    |               |                    | Lens now locked  |
  *| PASSIVE_FOCUSED    | HAL initiates | PASSIVE_SCAN       | Start AF scan    |
  *|                    | new scan      |                    | Lens now moving  |
  *+--------------------+---------------+--------------------+------------------+
+ *| PASSIVE_UNFOCUSED  | HAL initiates | PASSIVE_SCAN       | Start AF scan    |
+ *|                    | new scan      |                    | Lens now moving  |
+ *+--------------------+---------------+--------------------+------------------+
  *| PASSIVE_FOCUSED    | AF_TRIGGER    | FOCUSED_LOCKED     | Immediate trans. |
- *|                    |               |                    | if focus is good |
  *|                    |               |                    | Lens now locked  |
  *+--------------------+---------------+--------------------+------------------+
- *| PASSIVE_FOCUSED    | AF_TRIGGER    | NOT_FOCUSED_LOCKED | Immediate trans. |
- *|                    |               |                    | if focus is bad  |
+ *| PASSIVE_UNFOCUSED  | AF_TRIGGER    | NOT_FOCUSED_LOCKED | Immediate trans. |
  *|                    |               |                    | Lens now locked  |
  *+--------------------+---------------+--------------------+------------------+
  *| FOCUSED_LOCKED     | AF_TRIGGER    | FOCUSED_LOCKED     | No effect        |
  *   FLASH_REQUIRED and PRECAPTURE states. So rows below that refer to those two
  *   states should be ignored for the AWB state machine.
  *
+ *                  when enabling AE/AWB or changing AE/AWB mode
+ *| state              | trans. cause  | new state          | notes            |
+ *+--------------------+---------------+--------------------+------------------+
+ *| Any                |  mode change  | INACTIVE           |                  |
+ *+--------------------+---------------+--------------------+------------------+
+ *
  *                            mode = AE_MODE_OFF / AWB mode not AUTO
  *| state              | trans. cause  | new state          | notes            |
  *+--------------------+---------------+--------------------+------------------+
- *| INACTIVE           |               |                    | AE/AWB disabled  |
+ *| INACTIVE           |               | INACTIVE           | AE/AWB disabled  |
  *+--------------------+---------------+--------------------+------------------+
  *
  *                            mode = AE_MODE_ON_* / AWB_MODE_AUTO