Google 致力于为黑人社区推动种族平等。查看具体举措

Camera2Filter

interface 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 MutableList<Camera2CameraInfo!>
filter(@NonNull cameraInfos: MutableList<Camera2CameraInfo!>)

Filters a list of Camera2CameraInfo then returns those matching the requirements.

Public methods

filter

@NonNull abstract fun filter(@NonNull cameraInfos: MutableList<Camera2CameraInfo!>): MutableList<Camera2CameraInfo!>

Filters a list of Camera2CameraInfo then returns those matching the requirements.

If the output list contains Camera2CameraInfo not in the input list, when used by a androidx.camera.core.CameraSelector then it will result in an IllegalArgumentException thrown when calling bindToLifecycle.

The Camera2CameraInfo that has lower index in the map has higher priority. When used by androidx.camera.core.CameraSelector.Builder#addCameraFilter(CameraFilter), the available cameras will be filtered by the Camera2Filter 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
cameraInfos MutableList<Camera2CameraInfo!>: An unmodifiable list of Camera2CameraInfos being filtered.
Return
MutableList<Camera2CameraInfo!> The output map of camera IDs and their CameraCharacteristics that match the requirements. Users are expected to create a new map to return with.