CombinationQuery

class CombinationQuery


A client for querying camera feature combination support using Google Play services.

Summary

Public companion functions

CombinationQuery

Returns a CombinationQuery instance.

Public functions

QueryResult
isSessionConfigurationSupported(
    cameraId: String,
    sessionConfig: SessionConfiguration
)

Returns whether the given camera session configuration is supported.

QueryResult
isSessionConfigurationSupportedLegacy(
    cameraId: String,
    outputConfigs: List<OutputConfiguration>,
    sessionParams: Map<CaptureRequest.Key<*>, Any>
)

Returns whether the given group of OutputConfigurations and Session Parameters is supported.

Public companion functions

getCombinationQueryClient

fun getCombinationQueryClient(context: Context): CombinationQuery

Returns a CombinationQuery instance. The first call initializes connection to Google Play Services and loads a database in memory. Subsequent calls will return the same instance.

As this may do a Binder call and a disk read, the first call should be delegated to a background thread in performance-sensitive applications. Further calls are lightweight and safe to call from any thread.

Parameters
context: Context

the context to use for loading the module

Public functions

isSessionConfigurationSupported

fun isSessionConfigurationSupported(
    cameraId: String,
    sessionConfig: SessionConfiguration
): QueryResult

Returns whether the given camera session configuration is supported.

Parameters
cameraId: String

the camera ID to use for the query

sessionConfig: SessionConfiguration

the session configuration to query

Returns
QueryResult

the query result. See QueryResult for more details.

Throws
android.os.RemoteException

if the connection to backing database fails.

isSessionConfigurationSupportedLegacy

fun isSessionConfigurationSupportedLegacy(
    cameraId: String,
    outputConfigs: List<OutputConfiguration>,
    sessionParams: Map<CaptureRequest.Key<*>, Any>
): QueryResult

Returns whether the given group of OutputConfigurations and Session Parameters is supported. This API must be called if and only if CombinationQuery.isSessionConfigurationSupported cannot be.

Parameters
cameraId: String

the camera ID to use for the query

outputConfigs: List<OutputConfiguration>

list of OutputConfigurations to query

sessionParams: Map<CaptureRequest.Key<*>, Any>

a map of CaptureRequest.Key to their corresponding values; these are the values that would typically be passed to SessionConfiguration.setSessionParameters

Returns
QueryResult

the query result. See QueryResult for more details.

Throws
android.os.RemoteException

if the connection to backing database fails.