Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save ggfan/46ac5a9289fc33f465f050f61095c561 to your computer and use it in GitHub Desktop.
Save ggfan/46ac5a9289fc33f465f050f61095c561 to your computer and use it in GitHub Desktop.
fun getResolutions(selector:CameraSelector,
provider:ProcessCameraProvider
): Map<Quality, Size> {
return selector.filter(provider.availableCameraInfos).firstOrNull()
?.let { camInfo ->
QualitySelector.getSupportedQualities(camInfo)
.associateWith { quality ->
QualitySelector.getResolution(camInfo, quality)!!
}
} ?: emptyMap()
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment