CameraThreadConfig

@RequiresApi(21) abstract class CameraThreadConfig
kotlin.Any
   ↳ androidx.camera.core.impl.CameraThreadConfig

Configuration options for threads used by the camera stack implementation.

Summary

Public constructors

Configuration options for threads used by the camera stack implementation.

Public methods
open static CameraThreadConfig
create(@NonNull cameraExecutor: Executor, @NonNull schedulerHandler: Handler)

Creates a thread configuration given an executor and a scheduling handler.

abstract Executor

Returns the executor used to run all camera-related tasks.

abstract Handler

Returns the handler used for scheduling future tasks (such as with a delay).

Public constructors

CameraThreadConfig

CameraThreadConfig()

Configuration options for threads used by the camera stack implementation.

Public methods

create

@NonNull open static fun create(
    @NonNull cameraExecutor: Executor,
    @NonNull schedulerHandler: Handler
): CameraThreadConfig

Creates a thread configuration given an executor and a scheduling handler.

Parameters
cameraExecutor Executor: Executor used to run all camera-related tasks.
schedulerHandler Handler: Handler used for scheduling future tasks (such as with a delay) and for legacy APIs that require a handler. Tasks that are scheduled with this handler should always be executed by cameraExecutor. No business logic should be executed directly by this handler.
Return
CameraThreadConfig the camera thread configuration.

getCameraExecutor

@NonNull abstract fun getCameraExecutor(): Executor

Returns the executor used to run all camera-related tasks.

getSchedulerHandler

@NonNull abstract fun getSchedulerHandler(): Handler

Returns the handler used for scheduling future tasks (such as with a delay).

This scheduler may also be used for legacy APIs which require a Handler. Tasks that are scheduled with this handler should always be executed by cameraExecutor. No business logic should be executed directly by this handler.