ConcurrentCamera


public class ConcurrentCamera


Concurrent camera is a new feature introduced from Android 11, which supports simultaneous streaming of camera devices, for example, it allows a device to have both the front and back cameras operating at the same time.

A concurrent camera object is returned after binding concurrent cameras to LifecycleOwner. It includes a list of Cameras which are operating at the same time. Before binding to LifecycleOwner, check FEATURE_CAMERA_CONCURRENT to see whether this device is supporting concurrent camera or not.

CameraX currently only supports dual concurrent camera, which allows two cameras operating at the same time, with at most two UseCases bound for each. The max resolution is 720p or 1440p, more details in the following link, see concurrent camera streaming

Summary

Nested types

Configuration for a single camera in concurrent camera mode, including CameraSelector, LifecycleOwner and UseCaseGroup.

Public constructors

Constructor of concurrent cameras.

Public methods

@NonNull List<Camera>

Gets the list of cameras.

Public constructors

ConcurrentCamera

Added in 1.3.0
public ConcurrentCamera(@NonNull List<Camera> cameras)

Constructor of concurrent cameras.

Parameters
@NonNull List<Camera> cameras

list of Camera.

Public methods

getCameras

Added in 1.3.0
public @NonNull List<CameragetCameras()

Gets the list of cameras.