Google is committed to advancing racial equity for Black communities. See how.

CameraFilter

public interface CameraFilter

androidx.camera.core.CameraFilter


An interface for filtering cameras.

Summary

Public methods

abstract LinkedHashSet<Camera> filter(LinkedHashSet<Camera> cameras)

Filters a set of Cameras and returns those matching the requirements.

Public methods

filter

public abstract LinkedHashSet<Camera> filter (LinkedHashSet<Camera> cameras)

Filters a set of Cameras and returns those matching the requirements.

If the output set contains cameras not in the input set, when used by a CameraSelector then it will result in an IllegalArgumentException thrown when calling bindToLifecycle.

The camera that has lower index in the set has higher priority. When used by CameraSelector.Builder.addCameraFilter(CameraFilter), the available cameras will be filtered by all CameraFilters by the order they were added. The first camera in the result will be selected if there are multiple cameras left.

Parameters
cameras LinkedHashSet: The input set of Cameras being filtered. It's not expected to be modified.

Returns
LinkedHashSet<Camera> The output set of Cameras that match the requirements. Users are expected to create a new set to return with.