react-native-rectangle-doc-scanner 10.1.0 → 10.3.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.
|
@@ -90,16 +90,21 @@ class CameraController(
|
|
|
90
90
|
// Preview UseCase
|
|
91
91
|
Log.d(TAG, "[CAMERAX] PreviewView size: ${previewView.width}x${previewView.height}")
|
|
92
92
|
Log.d(TAG, "[CAMERAX] PreviewView visibility: ${previewView.visibility}")
|
|
93
|
+
Log.d(TAG, "[CAMERAX] PreviewView scaleType: ${previewView.scaleType}")
|
|
94
|
+
Log.d(TAG, "[CAMERAX] PreviewView implementationMode: ${previewView.implementationMode}")
|
|
93
95
|
preview = Preview.Builder()
|
|
96
|
+
.setTargetResolution(android.util.Size(1920, 1080)) // 16:9 resolution
|
|
94
97
|
.build()
|
|
95
|
-
.also {
|
|
96
|
-
|
|
98
|
+
.also { previewUseCase ->
|
|
99
|
+
Log.d(TAG, "[CAMERAX] Setting SurfaceProvider...")
|
|
100
|
+
previewUseCase.setSurfaceProvider(previewView.surfaceProvider)
|
|
97
101
|
Log.d(TAG, "[CAMERAX] SurfaceProvider set successfully")
|
|
98
102
|
}
|
|
99
103
|
|
|
100
104
|
// ImageAnalysis UseCase for document detection
|
|
101
105
|
imageAnalyzer = ImageAnalysis.Builder()
|
|
102
106
|
.setBackpressureStrategy(ImageAnalysis.STRATEGY_KEEP_ONLY_LATEST)
|
|
107
|
+
.setTargetResolution(android.util.Size(1280, 960)) // Limit resolution for analysis
|
|
103
108
|
.build()
|
|
104
109
|
.also {
|
|
105
110
|
it.setAnalyzer(cameraExecutor) { imageProxy ->
|
|
@@ -131,6 +136,19 @@ class CameraController(
|
|
|
131
136
|
|
|
132
137
|
Log.d(TAG, "[CAMERAX] Camera bound successfully")
|
|
133
138
|
|
|
139
|
+
// Monitor preview stream state
|
|
140
|
+
previewView.previewStreamState.observe(lifecycleOwner) { state ->
|
|
141
|
+
Log.d(TAG, "[CAMERAX] PreviewStreamState changed: $state")
|
|
142
|
+
when (state) {
|
|
143
|
+
androidx.camera.view.PreviewView.StreamState.IDLE ->
|
|
144
|
+
Log.w(TAG, "[CAMERAX] Preview stream is IDLE")
|
|
145
|
+
androidx.camera.view.PreviewView.StreamState.STREAMING ->
|
|
146
|
+
Log.d(TAG, "[CAMERAX] Preview stream is STREAMING ✓")
|
|
147
|
+
else ->
|
|
148
|
+
Log.d(TAG, "[CAMERAX] Preview stream state: $state")
|
|
149
|
+
}
|
|
150
|
+
}
|
|
151
|
+
|
|
134
152
|
} catch (e: Exception) {
|
|
135
153
|
Log.e(TAG, "[CAMERAX] Use case binding failed", e)
|
|
136
154
|
}
|