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

ExtensionCameraFilter

public final class ExtensionCameraFilter
extends Object implements CameraFilter

java.lang.Object
   ↳ androidx.camera.extensions.ExtensionCameraFilter


A filter that filters camera based on extender implementation. If the implementation is unavailable, the camera will be considered available.

Summary

Public methods

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

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

Inherited methods

Public methods

filter

public 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.