Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ggfan/1ac911fc1fae81dd29d845d12dbdc5bc to your computer and use it in GitHub Desktop.
Save ggfan/1ac911fc1fae81dd29d845d12dbdc5bc to your computer and use it in GitHub Desktop.
@androidx.annotation.OptIn(ExperimentalCamera2Interop::class)
val cameraSelector = CameraSelector.Builder()
.addCameraFilter {
it.filter { camInfo ->
val level = Camera2CameraInfo.from(camInfo)
.getCameraCharacteristic(
CameraCharacteristics.INFO_SUPPORTED_HARDWARE_LEVEL
)
level == CameraCharacteristics.INFO_SUPPORTED_HARDWARE_LEVEL_3
}
}.build()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment