-
public interface ActionThe Action class encapsulates logic for completing an action in a Camera2 environment. In this case, we are often interested in constantly receiving the CaptureResult and CaptureRequest callbacks, as well as applying changes to a CaptureRequest.Builder and having them applied to the sensor. The Action class receives the given callbacks and can operate over the engine through the ActionHolder object. Each Action operates on a given state in a given moment. This base class offers the STATE_COMPLETED state which is common to all actions. See BaseAction for a base implementation.
-
-
Method Summary
Modifier and Type Method Description abstract intgetState()Returns the current state. abstract voidstart(ActionHolder holder)Starts this action. abstract voidabort(ActionHolder holder)Aborts this action. abstract voidaddCallback(ActionCallback callback)Adds an ActionCallback to receive statechange events. abstract voidremoveCallback(ActionCallback callback)Removes a previously added callback. abstract voidonCaptureStarted(ActionHolder holder, CaptureRequest request)Called from onCaptureStarted. abstract voidonCaptureProgressed(ActionHolder holder, CaptureRequest request, CaptureResult result)Called from onCaptureProgressed. abstract voidonCaptureCompleted(ActionHolder holder, CaptureRequest request, TotalCaptureResult result)Called from onCaptureCompleted. -
-
Method Detail
-
getState
abstract int getState()
Returns the current state.
-
start
abstract void start(ActionHolder holder)
Starts this action.
- Parameters:
holder- the holder
-
abort
abstract void abort(ActionHolder holder)
Aborts this action.
- Parameters:
holder- the holder
-
addCallback
abstract void addCallback(ActionCallback callback)
Adds an ActionCallback to receive statechange events.
- Parameters:
callback- a callback
-
removeCallback
abstract void removeCallback(ActionCallback callback)
Removes a previously added callback.
- Parameters:
callback- a callback
-
onCaptureStarted
abstract void onCaptureStarted(ActionHolder holder, CaptureRequest request)
Called from onCaptureStarted.
- Parameters:
holder- the holderrequest- the request
-
onCaptureProgressed
abstract void onCaptureProgressed(ActionHolder holder, CaptureRequest request, CaptureResult result)
Called from onCaptureProgressed.
- Parameters:
holder- the holderrequest- the requestresult- the result
-
onCaptureCompleted
abstract void onCaptureCompleted(ActionHolder holder, CaptureRequest request, TotalCaptureResult result)
Called from onCaptureCompleted.
- Parameters:
holder- the holderrequest- the requestresult- the result
-
-
-
-