SessionConfiguration
public
final
class
SessionConfiguration
extends Object
| java.lang.Object | |
| ↳ | android.hardware.camera2.params.SessionConfiguration |
A helper class that aggregates all supported arguments for capture session initialization.
Summary
Constants | |
|---|---|
int |
SESSION_HIGH_SPEED
A high speed session type that can only contain instances of |
int |
SESSION_REGULAR
A regular session type containing instances of |
Public constructors | |
|---|---|
SessionConfiguration(int sessionType, List<OutputConfiguration> outputs, Executor executor, CameraCaptureSession.StateCallback cb)
Create a new |
|
Public methods | |
|---|---|
Executor
|
getExecutor()
Retrieve the |
InputConfiguration
|
getInputConfiguration()
Retrieve the |
List<OutputConfiguration>
|
getOutputConfigurations()
Retrieve the |
CaptureRequest
|
getSessionParameters()
Retrieve the session wide camera parameters (see |
int
|
getSessionType()
Retrieve the type of the capture session. |
CameraCaptureSession.StateCallback
|
getStateCallback()
Retrieve the |
void
|
setInputConfiguration(InputConfiguration input)
Sets the |
void
|
setSessionParameters(CaptureRequest params)
Sets the session wide camera parameters (see |
Inherited methods | |
|---|---|
Constants
SESSION_HIGH_SPEED
public static final int SESSION_HIGH_SPEED
A high speed session type that can only contain instances of OutputConfiguration.
The outputs can run using high speed FPS ranges. Calls to setInputConfiguration(InputConfiguration)
are not supported.
Constant Value: 1 (0x00000001)
SESSION_REGULAR
public static final int SESSION_REGULAR
A regular session type containing instances of OutputConfiguration running
at regular non high speed FPS ranges and optionally InputConfiguration for
reprocessable sessions.
See also:
Constant Value: 0 (0x00000000)
Public constructors
SessionConfiguration
public SessionConfiguration (int sessionType,
List<OutputConfiguration> outputs,
Executor executor,
CameraCaptureSession.StateCallback cb)
Create a new SessionConfiguration.
| Parameters | |
|---|---|
sessionType |
int: The session type.Value is |
outputs |
List: A list of output configurations for the capture session.This value must never be |
executor |
Executor: The executor which should be used to invoke the callback. In general it is
recommended that camera operations are not done on the main (UI) thread.This value must never be Callback and listener events are dispatched through this
|
cb |
CameraCaptureSession.StateCallback: A state callback interface implementation.This value must never be |
See also:
SESSION_REGULARSESSION_HIGH_SPEEDCameraDevice.createCaptureSession(List, CameraCaptureSession.StateCallback, Handler)CameraDevice.createCaptureSessionByOutputConfigurations(List, CameraCaptureSession.StateCallback, Handler) CameraDevice.createReprocessableCaptureSession(InputConfiguration, List, CameraCaptureSession.StateCallback, Handler) CameraDevice.createConstrainedHighSpeedCaptureSession(List, CameraCaptureSession.StateCallback, Handler)
Public methods
getExecutor
public Executor getExecutor ()
Retrieve the Executor for the capture session.
| Returns | |
|---|---|
Executor |
The Executor on which the callback will be invoked. |
getInputConfiguration
public InputConfiguration getInputConfiguration ()
Retrieve the InputConfiguration.
| Returns | |
|---|---|
InputConfiguration |
The capture session input configuration. |
getOutputConfigurations
public List<OutputConfiguration> getOutputConfigurations ()
Retrieve the OutputConfiguration list for the capture session.
| Returns | |
|---|---|
List<OutputConfiguration> |
A list of output configurations for the capture session. |
getSessionParameters
public CaptureRequest getSessionParameters ()
Retrieve the session wide camera parameters (see CaptureRequest).
| Returns | |
|---|---|
CaptureRequest |
A capture request that includes the initial values for any available session wide capture keys. |
getSessionType
public int getSessionType ()
Retrieve the type of the capture session.
| Returns | |
|---|---|
int |
The capture session type.
Value is |
getStateCallback
public CameraCaptureSession.StateCallback getStateCallback ()
Retrieve the CameraCaptureSession.StateCallback for the capture session.
| Returns | |
|---|---|
CameraCaptureSession.StateCallback |
A state callback interface implementation. |
setInputConfiguration
public void setInputConfiguration (InputConfiguration input)
Sets the InputConfiguration for a reprocessable session. Input configuration are not
supported for SESSION_HIGH_SPEED.
| Parameters | |
|---|---|
input |
InputConfiguration: Input configuration.This value must never be |
| Throws | |
|---|---|
UnsupportedOperationException |
In case it is called for SESSION_HIGH_SPEED
type session configuration.
|
setSessionParameters
public void setSessionParameters (CaptureRequest params)
Sets the session wide camera parameters (see CaptureRequest). This argument can
be set for every supported session type and will be passed to the camera device as part
of the capture session initialization. Session parameters are a subset of the available
capture request parameters (see CameraCharacteristics.getAvailableSessionKeys())
and their application can introduce internal camera delays. To improve camera performance
it is suggested to change them sparingly within the lifetime of the capture session and
to pass their initial values as part of this method.
| Parameters | |
|---|---|
params |
CaptureRequest: A capture request that includes the initial values for any available
session wide capture keys. Tags (see CaptureRequest.Builder.setTag(Object)) and
output targets (see CaptureRequest.Builder.addTarget(Surface)) are ignored if
set. Parameter values not part of
CameraCharacteristics.getAvailableSessionKeys() will also be ignored. It
is recommended to build the session parameters using the same template type as
the initial capture request, so that the session and initial request parameters
match as much as possible.
|