public final class

Recorder.Builder

extends java.lang.Object

 java.lang.Object

↳androidx.camera.video.Recorder.Builder

Overview

Builder class for Recorder objects.

Summary

Constructors
publicBuilder()

Constructor for Recorder.Builder.

Methods
public Recorderbuild()

Builds the Recorder instance.

public Recorder.BuildersetExecutor(java.util.concurrent.Executor executor)

Sets the java.util.concurrent.Executor that runs the Recorder background task.

public Recorder.BuildersetQualitySelector(QualitySelector qualitySelector)

Sets the QualitySelector of this Recorder.

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

Constructors

public Builder()

Constructor for Recorder.Builder.

Creates a builder which is pre-populated with appropriate default configuration options.

Methods

public Recorder.Builder setExecutor(java.util.concurrent.Executor executor)

Sets the java.util.concurrent.Executor that runs the Recorder background task.

The executor is used to run the Recorder tasks, the audio encoding and the video encoding. For the best performance, it's recommended to be an java.util.concurrent.Executor that is capable of running at least two tasks concurrently, such as a java.util.concurrent.ThreadPoolExecutor backed by 2 or more threads.

If not set, the Recorder will be run on the IO executor internally managed by CameraX.

public Recorder.Builder setQualitySelector(QualitySelector qualitySelector)

Sets the QualitySelector of this Recorder.

The provided quality selector is used to select the resolution of the recording depending on the resolutions supported by the camera and codec capabilities.

If no quality selector is provided, the default is Recorder.DEFAULT_QUALITY_SELECTOR.

See also: QualitySelector

public Recorder build()

Builds the Recorder instance.

The {code build()} method can be called multiple times, generating a new Recorder instance each time. The returned instance is configured with the options set on this builder.