chooseOptimalSize

private fun chooseOptimalSize(choices: Array<Size>, textureViewWidth: Int, textureViewHeight: Int, maxWidth: Int, maxHeight: Int, aspectRatio: Size): Size?

Helper method for choosing a Size of a given set of choices, which best fits the given constraints.

Parameters

choices

All available camera output sizes

textureViewWidth

The width of previewTextureView

textureViewHeight

The height of previewTextureView

maxWidth

The maximum width

maxHeight

The maximum height

aspectRatio

The aspect ratio