CameraXConfig
public final class CameraXConfig
A configuration for adding implementation and user-specific behavior to CameraX.
CameraXConfig provides customizable options for camera provider instances that persist for the lifetime of the provider.
An implementation of CameraXConfig can be provided by subclassing the Application object and implementing CameraXConfig.Provider. Alternatively, other methods configuration exist such as configureInstance. Examples of how this is used can be found in the androidx.camera.lifecycle package.
Applications can create and use the implementation of CameraXConfig provided in androidx.camera.camera2.
| See also | |
|---|---|
configureInstance |
|
CameraXConfig.Builder |
Summary
Nested types |
|---|
public final class CameraXConfig.BuilderA builder for generating |
public interface CameraXConfig.ProviderAn interface which can be implemented to provide the configuration for CameraX. |
Public methods |
|
|---|---|
@Nullable CameraSelector |
getAvailableCamerasLimiter(@Nullable CameraSelector valueIfMissing)Returns the |
@Nullable Executor |
getCameraExecutor(@Nullable Executor valueIfMissing)Returns the camera executor which CameraX will use to drive the camera stack. |
long |
Returns the camera open retry maximum timeout in milliseconds when in active resuming mode. |
@NonNull RetryPolicy |
Retrieves the |
int |
Returns the minimum logging level to be used for CameraX logs. |
@Nullable Handler |
getSchedulerHandler(@Nullable Handler valueIfMissing)Returns the scheduling handler that CameraX will use internally for scheduling future tasks. |
Public methods
getAvailableCamerasLimiter
public @Nullable CameraSelector getAvailableCamerasLimiter(@Nullable CameraSelector valueIfMissing)
Returns the CameraSelector used to determine the available cameras.
| See also | |
|---|---|
setAvailableCamerasLimiter |
getCameraExecutor
public @Nullable Executor getCameraExecutor(@Nullable Executor valueIfMissing)
Returns the camera executor which CameraX will use to drive the camera stack.
| See also | |
|---|---|
setCameraExecutor |
getCameraOpenRetryMaxTimeoutInMillisWhileResuming
public long getCameraOpenRetryMaxTimeoutInMillisWhileResuming()
Returns the camera open retry maximum timeout in milliseconds when in active resuming mode.
If this value is not set, -1L will be returned by default.
getCameraProviderInitRetryPolicy
@ExperimentalRetryPolicy
public @NonNull RetryPolicy getCameraProviderInitRetryPolicy()
Retrieves the RetryPolicy for the CameraProvider initialization. This policy determines whether to retry the CameraProvider initialization if it fails.
| Returns | |
|---|---|
@NonNull RetryPolicy |
The |
| See also | |
|---|---|
setCameraProviderInitRetryPolicy |
getMinimumLoggingLevel
public int getMinimumLoggingLevel()
Returns the minimum logging level to be used for CameraX logs.
| See also | |
|---|---|
setMinimumLoggingLevel |
getSchedulerHandler
public @Nullable Handler getSchedulerHandler(@Nullable Handler valueIfMissing)
Returns the scheduling handler that CameraX will use internally for scheduling future tasks.
| See also | |
|---|---|
setSchedulerHandler |