# Print output for @column tags ?>
public
final
class
SessionConfiguration
extends Object
implements
Parcelable
java.lang.Object | |
↳ | android.hardware.camera2.params.SessionConfiguration |
A helper class that aggregates all supported arguments for capture session initialization.
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 |
Inherited constants |
---|
Fields | |
---|---|
public
static
final
Creator<SessionConfiguration> |
CREATOR
|
Public constructors | |
---|---|
SessionConfiguration(int sessionType, List<OutputConfiguration> outputs, Executor executor, CameraCaptureSession.StateCallback cb)
Create a new |
Public methods | |
---|---|
int
|
describeContents()
Describe the kinds of special objects contained in this Parcelable instance's marshaled representation. |
boolean
|
equals(Object obj)
Check if this |
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 |
int
|
hashCode()
Returns a hash code value for the object. |
void
|
setInputConfiguration(InputConfiguration input)
Sets the |
void
|
setSessionParameters(CaptureRequest params)
Sets the session wide camera parameters (see |
void
|
writeToParcel(Parcel dest, int flags)
Flatten this object in to a Parcel. |
Inherited methods | |
---|---|
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.
When using this type, the CameraCaptureSession returned by
CameraCaptureSession.StateCallback
can be cast to a
CameraConstrainedHighSpeedCaptureSession
to access the extra
methods for constrained high speed recording.
Constant Value: 1 (0x00000001)
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 SessionConfiguration (int sessionType, List<OutputConfiguration> outputs, Executor executor, CameraCaptureSession.StateCallback cb)
Create a new SessionConfiguration
.
Parameters | |
---|---|
sessionType |
int : The session type.
Value is SESSION_REGULAR , or SESSION_HIGH_SPEED |
outputs |
List : A list of output configurations for the capture session.
This value cannot be null . |
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 cannot be null .
Callback and listener events are dispatched through this
Executor , providing an easy way to control which thread is
used. To dispatch events through the main thread of your
application, you can use
Context.getMainExecutor() .
To dispatch events through a shared thread pool, you can use
AsyncTask#THREAD_POOL_EXECUTOR . |
cb |
CameraCaptureSession.StateCallback : A state callback interface implementation.
This value cannot be null . |
See also:
SESSION_REGULAR
SESSION_HIGH_SPEED
CameraDevice.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 int describeContents ()
Describe the kinds of special objects contained in this Parcelable
instance's marshaled representation. For example, if the object will
include a file descriptor in the output of writeToParcel(android.os.Parcel, int)
,
the return value of this method must include the
CONTENTS_FILE_DESCRIPTOR
bit.
Returns | |
---|---|
int |
a bitmask indicating the set of special object types marshaled
by this Parcelable object instance.
Value is either 0 or CONTENTS_FILE_DESCRIPTOR |
public boolean equals (Object obj)
Check if this SessionConfiguration
is equal to another SessionConfiguration
.
Two output session configurations are only equal if and only if the underlying input configuration, output configurations, and session type are equal.
Parameters | |
---|---|
obj |
Object : This value may be null . |
Returns | |
---|---|
boolean |
true if the objects were equal, false otherwise |
public Executor getExecutor ()
Retrieve the Executor
for the capture session.
Returns | |
---|---|
Executor |
The Executor on which the callback will be invoked. |
public InputConfiguration getInputConfiguration ()
Retrieve the InputConfiguration
.
Returns | |
---|---|
InputConfiguration |
The capture session input configuration. |
public List<OutputConfiguration> getOutputConfigurations ()
Retrieve the OutputConfiguration
list for the capture session.
Returns | |
---|---|
List<OutputConfiguration> |
A list of output configurations for the capture session. |
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. |
public int getSessionType ()
Retrieve the type of the capture session.
Returns | |
---|---|
int |
The capture session type.
Value is SESSION_REGULAR , or SESSION_HIGH_SPEED |
public CameraCaptureSession.StateCallback getStateCallback ()
Retrieve the CameraCaptureSession.StateCallback
for the capture session.
Returns | |
---|---|
CameraCaptureSession.StateCallback |
A state callback interface implementation. |
public int hashCode ()
Returns a hash code value for the object. This method is
supported for the benefit of hash tables such as those provided by
HashMap
.
The general contract of hashCode
is:
hashCode
method
must consistently return the same integer, provided no information
used in equals
comparisons on the object is modified.
This integer need not remain consistent from one execution of an
application to another execution of the same application.
equals(Object)
method, then calling the hashCode
method on each of
the two objects must produce the same integer result.
equals(java.lang.Object)
method, then calling the hashCode
method on each of the
two objects must produce distinct integer results. However, the
programmer should be aware that producing distinct integer results
for unequal objects may improve the performance of hash tables.
As much as is reasonably practical, the hashCode method defined by
class Object
does return distinct integers for distinct
objects. (This is typically implemented by converting the internal
address of the object into an integer, but this implementation
technique is not required by the
Java™ programming language.)
Returns | |
---|---|
int |
a hash code value for this object. |
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 cannot be null . |
Throws | |
---|---|
UnsupportedOperationException |
In case it is called for SESSION_HIGH_SPEED
type session configuration. |
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 ) and
output targets (see CaptureRequest.Builder#addTarget ) 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. |
public void writeToParcel (Parcel dest, int flags)
Flatten this object in to a Parcel.
Parameters | |
---|---|
dest |
Parcel : The Parcel in which the object should be written. |
flags |
int : Additional flags about how the object should be written.
May be 0 or Parcelable.PARCELABLE_WRITE_RETURN_VALUE .
Value is either 0 or a combination of Parcelable.PARCELABLE_WRITE_RETURN_VALUE , and android.os.Parcelable.PARCELABLE_ELIDE_DUPLICATES |