public class SessionParametersLegacy


A compat class to store Session Parameters for querying support. This class is a simple holder class for holding CaptureRequest.Keys and associated values, similar to what CaptureRequest does in setSessionParameters.

This class allows querying on devices that do not support Camera2's android.hardware.camera2.CameraDevice.CameraDeviceSetup and need to query the camera capabilities before calling openCamera.

However, there are downsides to using the *Legacy classes.

  1. When *Legacy classes are used, only the non-Camera2 databases (if present) will be queried.
  2. The output of createCaptureRequest will often set defaults based on the Template passed to it. Without the capture request provided by the camera2 API, there is no reasonable way for this API to guarantee that the result returned is completely reliable.

With those downsides, the usage of the *Legacy classes is restricted to devices that do not support android.hardware.camera2.CameraDevice.CameraDeviceSetup. On devices that do not support android.hardware.camera2.CameraDevice.CameraDeviceSetup, it is strongly recommended that this class is used if and only if calling openCamera is not possible before the query.

Summary

Nested types

Simple builder class to build a SessionParametersLegacy object.

Public methods

@Nullable T

Return the capture request field value associated with key.

@NonNull Set<CaptureRequest.Key<Object>>

Returns a Set of the keys contained in this map.

Public methods

get

Added in 1.5.0-beta01
public @Nullable T <T> get(@NonNull CaptureRequest.Key<T> key)

Return the capture request field value associated with key.

The field definitions can be found in CaptureRequest.

Parameters
@NonNull CaptureRequest.Key<T> key

The key whose value should be returned

Returns
@Nullable T

The value of the passed key, or null if the key is not set

getKeys

Added in 1.5.0-beta01
public @NonNull Set<CaptureRequest.Key<Object>> getKeys()

Returns a Set of the keys contained in this map.

The returned set is not modifiable, so any attempts to modify it will throw an UnsupportedOperationException.

All values retrieved by a key from this set with get are guaranteed to be non-null.

Returns
@NonNull Set<CaptureRequest.Key<Object>>

set of all keys in the map