public interface

Camera2CameraFilter.Camera2Filter

 androidx.camera.camera2.interop.Camera2CameraFilter.Camera2Filter

Overview

An interface that filters cameras based on camera IDs and characteristics. Applications can implement the filter method for custom camera selection.

Summary

Methods
public java.util.LinkedHashMap<java.lang.String, CameraCharacteristics>filter(java.util.LinkedHashMap<java.lang.String, CameraCharacteristics> idCharacteristicsMap)

Filters a map of camera IDs and their CameraCharacteristics then returns those matching the requirements.

Methods

public java.util.LinkedHashMap<java.lang.String, CameraCharacteristics> filter(java.util.LinkedHashMap<java.lang.String, CameraCharacteristics> idCharacteristicsMap)

Filters a map of camera IDs and their CameraCharacteristics then returns those matching the requirements.

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

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

Parameters:

idCharacteristicsMap: The input map of camera IDs and their CameraCharacteristics of the cameras being filtered. It's not expected to be modified.

Returns:

The output map of camera IDs and their CameraCharacteristics that match the requirements. Users are expected to create a new map to return with.