react-native-rectangle-doc-scanner 10.6.0 → 10.7.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -104,28 +104,8 @@ class CameraController(
|
|
|
104
104
|
.also { previewUseCase ->
|
|
105
105
|
Log.d(TAG, "[CAMERAX] Setting SurfaceProvider...")
|
|
106
106
|
|
|
107
|
-
//
|
|
108
|
-
previewUseCase.setSurfaceProvider(ContextCompat.getMainExecutor(context))
|
|
109
|
-
Log.d(TAG, "[CAMERAX] ===== SURFACE REQUESTED =====")
|
|
110
|
-
Log.d(TAG, "[CAMERAX] Surface resolution: ${request.resolution}")
|
|
111
|
-
Log.d(TAG, "[CAMERAX] Surface camera: ${request.camera}")
|
|
112
|
-
|
|
113
|
-
// Get the surface from PreviewView and provide it to the request
|
|
114
|
-
val surfaceTexture = (previewView.getChildAt(0) as? android.view.TextureView)?.surfaceTexture
|
|
115
|
-
if (surfaceTexture != null) {
|
|
116
|
-
Log.d(TAG, "[CAMERAX] Got SurfaceTexture from PreviewView")
|
|
117
|
-
surfaceTexture.setDefaultBufferSize(request.resolution.width, request.resolution.height)
|
|
118
|
-
val surface = android.view.Surface(surfaceTexture)
|
|
119
|
-
request.provideSurface(surface, ContextCompat.getMainExecutor(context)) { result ->
|
|
120
|
-
Log.d(TAG, "[CAMERAX] Surface result: ${result.resultCode}")
|
|
121
|
-
surface.release()
|
|
122
|
-
}
|
|
123
|
-
} else {
|
|
124
|
-
Log.e(TAG, "[CAMERAX] Failed to get SurfaceTexture - using default provider")
|
|
125
|
-
// Fallback to default behavior
|
|
126
|
-
previewView.surfaceProvider.onSurfaceRequested(request)
|
|
127
|
-
}
|
|
128
|
-
}
|
|
107
|
+
// Use PreviewView's default SurfaceProvider
|
|
108
|
+
previewUseCase.setSurfaceProvider(ContextCompat.getMainExecutor(context), previewView.surfaceProvider)
|
|
129
109
|
|
|
130
110
|
Log.d(TAG, "[CAMERAX] SurfaceProvider set successfully")
|
|
131
111
|
}
|