public class

SessionConfig.Builder

extends androidx.camera.core.SessionConfig.BaseBuilder

 java.lang.Object

↳androidx.camera.core.SessionConfig.BaseBuilder

↳androidx.camera.core.SessionConfig.Builder

Overview

Builder for easy modification/rebuilding of a SessionConfig.

Summary

Constructors
publicBuilder()

Methods
public voidaddAllCameraCaptureCallbacks(java.util.Collection<CameraCaptureCallback> cameraCaptureCallbacks)

Adds all CameraCaptureCallback callbacks for single and repeating requests.

public voidaddAllDeviceStateCallbacks(java.util.Collection<CameraDevice.StateCallback> deviceStateCallbacks)

Adds all callbacks.

public voidaddAllRepeatingCameraCaptureCallbacks(java.util.Collection<CameraCaptureCallback> cameraCaptureCallbacks)

Adds all CameraCaptureCallback callbacks.

public voidaddAllSessionStateCallbacks(java.util.List<CameraCaptureSession.StateCallback> sessionStateCallbacks)

Adds all callbacks.

public voidaddCameraCaptureCallback(CameraCaptureCallback cameraCaptureCallback)

Adds a CameraCaptureCallback callback for single and repeating requests.

public voidaddDeviceStateCallback(CameraDevice.StateCallback deviceStateCallback)

Adds a callback.

public voidaddErrorListener(SessionConfig.ErrorListener errorListener)

Adds all SessionConfig.ErrorListener listeners repeating requests.

public voidaddImplementationOptions(Config config)

Add a set of Config to the implementation specific options.

public voidaddNonRepeatingSurface(DeferrableSurface surface)

Add a surface for the session which only used for single captures.

public voidaddRepeatingCameraCaptureCallback(CameraCaptureCallback cameraCaptureCallback)

Adds a CameraCaptureCallback callback for repeating requests.

public voidaddSessionStateCallback(CameraCaptureSession.StateCallback sessionStateCallback)

Adds a callback.

public voidaddSurface(DeferrableSurface surface)

Add a surface to the set that the session repeatedly writes data to.

public SessionConfigbuild()

Builds an instance of a SessionConfig that has all the combined parameters of the SessionConfig that have been added to the Builder.

public voidclearSurfaces()

Clears all surfaces from the set which the session writes to.

public static SessionConfig.BuildercreateFrom(UseCaseConfig<UseCase> config)

Creates a SessionConfig.Builder from a UseCaseConfig.

public java.util.List<CameraCaptureCallback>getSingleCameraCaptureCallbacks()

Obtain all CameraCaptureCallback callbacks for single requests.

public voidremoveSurface(DeferrableSurface surface)

Remove a surface from the set which the session repeatedly writes to.

public voidsetImplementationOptions(Config config)

Set the Config for options that are implementation specific.

public voidsetTag(java.lang.Object tag)

Set the tag of the SessionConfig.

public voidsetTemplateType(int templateType)

Set the template characteristics of the SessionConfig.

from java.lang.Objectclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Constructors

public Builder()

Methods

public static SessionConfig.Builder createFrom(UseCaseConfig<UseCase> config)

Creates a SessionConfig.Builder from a UseCaseConfig.

Populates the builder with all the properties defined in the base configuration.

public void setTemplateType(int templateType)

Set the template characteristics of the SessionConfig.

Parameters:

templateType: Template constant that must match those defined by CameraDevice

TODO(b/120949879): This is camera2 implementation detail that should be moved

public void setTag(java.lang.Object tag)

Set the tag of the SessionConfig. For tracking the source.

public void addDeviceStateCallback(CameraDevice.StateCallback deviceStateCallback)

Adds a callback.

public void addAllDeviceStateCallbacks(java.util.Collection<CameraDevice.StateCallback> deviceStateCallbacks)

Adds all callbacks. * @throws IllegalArgumentException if any callback already exists in the configuration.

public void addSessionStateCallback(CameraCaptureSession.StateCallback sessionStateCallback)

Adds a callback.

public void addAllSessionStateCallbacks(java.util.List<CameraCaptureSession.StateCallback> sessionStateCallbacks)

Adds all callbacks.

public void addRepeatingCameraCaptureCallback(CameraCaptureCallback cameraCaptureCallback)

Adds a CameraCaptureCallback callback for repeating requests.

This callback does not call for single requests.

public void addAllRepeatingCameraCaptureCallbacks(java.util.Collection<CameraCaptureCallback> cameraCaptureCallbacks)

Adds all CameraCaptureCallback callbacks.

These callbacks do not call for single requests.

public void addCameraCaptureCallback(CameraCaptureCallback cameraCaptureCallback)

Adds a CameraCaptureCallback callback for single and repeating requests.

Listeners added here are available in both the SessionConfig.getRepeatingCameraCaptureCallbacks() and SessionConfig.Builder.getSingleCameraCaptureCallbacks() methods.

public void addAllCameraCaptureCallbacks(java.util.Collection<CameraCaptureCallback> cameraCaptureCallbacks)

Adds all CameraCaptureCallback callbacks for single and repeating requests.

Listeners added here are available in both the SessionConfig.getRepeatingCameraCaptureCallbacks() and SessionConfig.Builder.getSingleCameraCaptureCallbacks() methods.

public java.util.List<CameraCaptureCallback> getSingleCameraCaptureCallbacks()

Obtain all CameraCaptureCallback callbacks for single requests.

public void addErrorListener(SessionConfig.ErrorListener errorListener)

Adds all SessionConfig.ErrorListener listeners repeating requests.

public void addSurface(DeferrableSurface surface)

Add a surface to the set that the session repeatedly writes data to.

public void addNonRepeatingSurface(DeferrableSurface surface)

Add a surface for the session which only used for single captures.

public void removeSurface(DeferrableSurface surface)

Remove a surface from the set which the session repeatedly writes to.

public void clearSurfaces()

Clears all surfaces from the set which the session writes to.

public void setImplementationOptions(Config config)

Set the Config for options that are implementation specific.

public void addImplementationOptions(Config config)

Add a set of Config to the implementation specific options.

public SessionConfig build()

Builds an instance of a SessionConfig that has all the combined parameters of the SessionConfig that have been added to the Builder.