Instantly share code, notes, and snippets.

Embed
What would you like to do?
val characteristics: CameraCharacteristics = ...
val context = this as Context // assuming we are inside of an activity
val surfaceViewSize = getPreviewOutputSize(
context, characteristics, SurfaceView::class.java)
val imageReaderSize = getPreviewOutputSize(
context, characteristics, ImageReader::class.java, format = ImageFormat.YUV_420_888)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment