mirror of
				https://github.com/SimpleMobileTools/Simple-Camera.git
				synced 2025-06-27 09:02:59 +02:00 
			
		
		
		
	make sure the aspect ratio is always updated on the main thread
This commit is contained in:
		| @@ -351,7 +351,9 @@ class PreviewCameraTwo : ViewGroup, TextureView.SurfaceTextureListener, MyPrevie | |||||||
|                 val outputSizes = if (mIsInVideoMode) configMap.getOutputSizes(MediaRecorder::class.java) else configMap.getOutputSizes(SurfaceTexture::class.java) |                 val outputSizes = if (mIsInVideoMode) configMap.getOutputSizes(MediaRecorder::class.java) else configMap.getOutputSizes(SurfaceTexture::class.java) | ||||||
|                 mPreviewSize = chooseOptimalPreviewSize(outputSizes, rotatedPreviewWidth, rotatedPreviewHeight, maxPreviewWidth, maxPreviewHeight, currentResolution) |                 mPreviewSize = chooseOptimalPreviewSize(outputSizes, rotatedPreviewWidth, rotatedPreviewHeight, maxPreviewWidth, maxPreviewHeight, currentResolution) | ||||||
|  |  | ||||||
|                 mTextureView.setAspectRatio(mPreviewSize!!.height, mPreviewSize!!.width) |                 mActivity.runOnUiThread { | ||||||
|  |                     mTextureView.setAspectRatio(mPreviewSize!!.height, mPreviewSize!!.width) | ||||||
|  |                 } | ||||||
|                 characteristics.apply { |                 characteristics.apply { | ||||||
|                     mIsFlashSupported = get(CameraCharacteristics.FLASH_INFO_AVAILABLE) ?: false |                     mIsFlashSupported = get(CameraCharacteristics.FLASH_INFO_AVAILABLE) ?: false | ||||||
|                     mIsZoomSupported = get(CameraCharacteristics.SCALER_AVAILABLE_MAX_DIGITAL_ZOOM) ?: 0f > 0f |                     mIsZoomSupported = get(CameraCharacteristics.SCALER_AVAILABLE_MAX_DIGITAL_ZOOM) ?: 0f > 0f | ||||||
|   | |||||||
		Reference in New Issue
	
	Block a user