-
@RequiresApi(value = Build.VERSION_CODES.LOLLIPOP) public interface Action
The 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(@NonNull() ActionHolder holder)Starts this action. abstract voidabort(@NonNull() ActionHolder holder)Aborts this action. abstract voidaddCallback(@NonNull() ActionCallback callback)Adds an ActionCallback to receive statechange events. abstract voidremoveCallback(@NonNull() ActionCallback callback)Removes a previously added callback. abstract voidonCaptureStarted(@NonNull() ActionHolder holder, @NonNull() CaptureRequest request)Called from onCaptureStarted. abstract voidonCaptureProgressed(@NonNull() ActionHolder holder, @NonNull() CaptureRequest request, @NonNull() CaptureResult result)Called from onCaptureProgressed. abstract voidonCaptureCompleted(@NonNull() ActionHolder holder, @NonNull() CaptureRequest request, @NonNull() TotalCaptureResult result)Called from onCaptureCompleted. -
-
Method Detail
-
getState
abstract int getState()
Returns the current state.
-
start
abstract void start(@NonNull() ActionHolder holder)
Starts this action.
- Parameters:
holder- the holder
-
abort
abstract void abort(@NonNull() ActionHolder holder)
Aborts this action.
- Parameters:
holder- the holder
-
addCallback
abstract void addCallback(@NonNull() ActionCallback callback)
Adds an ActionCallback to receive statechange events.
- Parameters:
callback- a callback
-
removeCallback
abstract void removeCallback(@NonNull() ActionCallback callback)
Removes a previously added callback.
- Parameters:
callback- a callback
-
onCaptureStarted
abstract void onCaptureStarted(@NonNull() ActionHolder holder, @NonNull() CaptureRequest request)
Called from onCaptureStarted.
- Parameters:
holder- the holderrequest- the request
-
onCaptureProgressed
abstract void onCaptureProgressed(@NonNull() ActionHolder holder, @NonNull() CaptureRequest request, @NonNull() CaptureResult result)
Called from onCaptureProgressed.
- Parameters:
holder- the holderrequest- the requestresult- the result
-
onCaptureCompleted
abstract void onCaptureCompleted(@NonNull() ActionHolder holder, @NonNull() CaptureRequest request, @NonNull() TotalCaptureResult result)
Called from onCaptureCompleted.
- Parameters:
holder- the holderrequest- the requestresult- the result
-
-
-
-