Builder
Functions
Uses the provided API token value to associate with Session. When no value is provided then the application's Android manifest will be queried for com.snap.camerakit.api.token
meta-data field. If no value is provided or found in the manifest, CameraKit will attempt to use built-in authorization token however it is scheduled to be removed in future releases, making this a required property to provide.
Uses the provided viewStub with a non-null parent view to inflate view hierarchy of Session which includes rendering camera preview with lenses. If no viewStub is provided then Session does not attempt to render any views while the output of camera preview can be attached to using ImageProcessor.connectOutput.
Uses the provided viewStub with a non-null parent view to inflate view hierarchy of Session. If withPreview is false then Session will not render camera preview within the inflated view hierarchy. To render camera preview, an output can be attached explicitly using ImageProcessor.connectOutput.
Uses the provided value to attach the Session audio processing pipeline to once built. The provided Source is normally attached to when audio input is required to either mutate it by applying audio effects (lenses voice changer) or/and process it to detect loudness, spectrum information etc. Providing the Source is optional as it is possible to connect input to Session.processor manually, once Session is built and running, if required.
Builds an instance of Session with the configuration of this builder and starts the internal lifecycle which can be disposed by calling Session.close. If configuration issues are detected then it should be expected that this method will throw an exception or deliver it to an error handler provided via handleErrorsWith, if any.
Allows to pre-configure LensesComponent with options that are applied to build the final LensesComponent available through Session.lenses.
Allows to provide a custom error handler that will be notified when this session and/or its sub-components encounter issues that are most likely unrecoverable. If no custom error handler is provided here, then all errors will be re-thrown to the main thread, leading to an immediate crash.
Uses the provided value to attach the Session image processing pipeline to once built. The provided Source will be attached to as soon as Session is created and de-attached from once the Session is closed. Providing a Source is optional as it is possible to connect input to Session.processor manually, if required.
Uses the provided value to attach the Session optional location data processing pipeline to once built. The provided Source is normally attached to when location data is required to be presented as part of image processing and de-attached once the location data is not needed anymore. Providing the Source is optional as location data is optional, it does not change the any aspect of business logic. The main advantage of providing the Source of location data is to enable certain types of location specific content such as Landmarker lenses that augment real life objects pinned to geographic co-ordinates.
Uses the provided value to attach the Session optional media data processing pipeline to once built. The provided Source is normally attached to when media data is required to be presented as part of image processing and de-attached once the media data is not needed anymore. Providing the Source is optional as media data is optional, it does not change the any aspect of business logic. The main advantage of providing the Source of media data is to enable certain content such as Image Picker lenses.
Uses the provided value to attach the Session optional safe render area processing pipeline to once built. The provided Source is normally attached to as soon as the Session is built and de-attached when Session is closed. Providing the Source is optional however certain content such as UI elements in lenses will be rendered without any consideration for the client's UI, possibly interfering with it, when no Source is provided.
Uses the provided value to attach the Session optional user data processing pipeline to once built. The provided Source is normally attached to when user data is required to be presented as part of image processing and de-attached once the user data is not needed anymore. Providing the Source is optional as user data is optional, it does not change the any aspect of business logic. The main advantage of providing the Source of user data is to get extra personalization in generated content such as displaying user name in lenses.