removing a redundant variable
This commit is contained in:
parent
7d5a60f13d
commit
250bf176c1
|
@ -18,7 +18,7 @@ import java.io.FileNotFoundException
|
|||
import java.io.FileOutputStream
|
||||
import java.io.OutputStream
|
||||
|
||||
class PhotoProcessor(val activity: MainActivity, val saveUri: Uri?, val currCameraId: Int, val deviceOrientation: Int, val previewRotation: Int, val isUsingFrontCamera: Boolean) :
|
||||
class PhotoProcessor(val activity: MainActivity, val saveUri: Uri?, val deviceOrientation: Int, val previewRotation: Int, val isUsingFrontCamera: Boolean) :
|
||||
AsyncTask<ByteArray, Void, String>() {
|
||||
|
||||
override fun doInBackground(vararg params: ByteArray): String {
|
||||
|
|
|
@ -383,7 +383,7 @@ class PreviewCameraOne : ViewGroup, SurfaceHolder.Callback, MyPreview {
|
|||
|
||||
private fun storePhoto(data: ByteArray) {
|
||||
val previewRotation = getPreviewRotation(mCurrCameraId)
|
||||
PhotoProcessor(mActivity!!, mTargetUri, mCurrCameraId, mRotationAtCapture, previewRotation, getIsUsingFrontCamera()).execute(data)
|
||||
PhotoProcessor(mActivity!!, mTargetUri, mRotationAtCapture, previewRotation, getIsUsingFrontCamera()).execute(data)
|
||||
}
|
||||
|
||||
private fun getIsUsingFrontCamera() = mCurrCameraId == mActivity!!.getMyCamera().getFrontCameraId()
|
||||
|
|
|
@ -132,7 +132,7 @@ class PreviewCameraTwo : ViewGroup, TextureView.SurfaceTextureListener, MyPrevie
|
|||
val buffer = reader.acquireNextImage().planes[0].buffer
|
||||
val bytes = ByteArray(buffer.remaining())
|
||||
buffer.get(bytes)
|
||||
PhotoProcessor(mActivity, mTargetUri, 0, mRotationAtCapture, mSensorOrientation, getIsUsingFrontCamera()).execute(bytes)
|
||||
PhotoProcessor(mActivity, mTargetUri, mRotationAtCapture, mSensorOrientation, getIsUsingFrontCamera()).execute(bytes)
|
||||
}
|
||||
|
||||
private fun getIsUsingFrontCamera(): Boolean {
|
||||
|
@ -182,8 +182,8 @@ class PreviewCameraTwo : ViewGroup, TextureView.SurfaceTextureListener, MyPrevie
|
|||
maxPreviewHeight = MAX_PREVIEW_HEIGHT
|
||||
}
|
||||
|
||||
mPreviewSize = chooseOptimalSize(configMap.getOutputSizes(SurfaceTexture::class.java),
|
||||
rotatedPreviewWidth, rotatedPreviewHeight, maxPreviewWidth, maxPreviewHeight, largest)
|
||||
val outputSizes = configMap.getOutputSizes(SurfaceTexture::class.java)
|
||||
mPreviewSize = chooseOptimalSize(outputSizes, rotatedPreviewWidth, rotatedPreviewHeight, maxPreviewWidth, maxPreviewHeight, largest)
|
||||
|
||||
mTextureView.setAspectRatio(mPreviewSize!!.height, mPreviewSize!!.width)
|
||||
mIsFlashSupported = characteristics.get(CameraCharacteristics.FLASH_INFO_AVAILABLE) ?: false
|
||||
|
|
Loading…
Reference in New Issue