Google berkomitmen untuk mendorong terwujudnya keadilan ras bagi komunitas Kulit Hitam. Lihat caranya.

Camera2CameraFilter.Camera2Filter

public static interface Camera2CameraFilter.Camera2Filter

androidx.camera.camera2.interop.Camera2CameraFilter.Camera2Filter


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

Summary

Public methods

abstract LinkedHashMap<String, CameraCharacteristics> filter(LinkedHashMap<String, CameraCharacteristics> idCharacteristicsMap)

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

Public methods

filter

public abstract LinkedHashMap<String, CameraCharacteristics> filter (LinkedHashMap<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 LinkedHashMap: The input map of camera IDs and their CameraCharacteristics of the cameras being filtered. It's not expected to be modified.

Returns
LinkedHashMap<String, CameraCharacteristics> The output map of camera IDs and their CameraCharacteristics that match the requirements. Users are expected to create a new map to return with.