Compare commits
6 Commits
fix/hlsmux
...
45b16b5189
| Author | SHA1 | Date | |
|---|---|---|---|
| 45b16b5189 | |||
| 2d570c9af2 | |||
| 31e7b8bd35 | |||
| 3bb72d5d94 | |||
| ac5dac127f | |||
| e3de8c018c |
@@ -235,10 +235,19 @@ class PersistentCameraCaptureSession(private val cameraManager: CameraManager, p
|
||||
|
||||
// 1. Run a precapture sequence for AF, AE and AWB.
|
||||
focusJob = coroutineScope.launch {
|
||||
try {
|
||||
val request = repeatingRequest.createCaptureRequest(device, deviceDetails, outputs)
|
||||
val options =
|
||||
PrecaptureOptions(listOf(PrecaptureTrigger.AF, PrecaptureTrigger.AE), Flash.OFF, listOf(point), false, FOCUS_RESET_TIMEOUT)
|
||||
session.precapture(request, deviceDetails, options)
|
||||
} catch (e: CaptureTimedOutError) {
|
||||
// Focus timed out - this is non-fatal, just log and continue
|
||||
Log.w(TAG, "Focus timed out at point $point, continuing without focus lock")
|
||||
} catch (e: IllegalStateException) {
|
||||
Log.w(TAG, "Focus failed, camera device was already closed: ${e.message}")
|
||||
} catch (e: CameraAccessException) {
|
||||
Log.w(TAG, "Focus failed, camera not accessible: ${e.message}")
|
||||
}
|
||||
}
|
||||
focusJob?.join()
|
||||
|
||||
@@ -254,9 +263,15 @@ class PersistentCameraCaptureSession(private val cameraManager: CameraManager, p
|
||||
return@launch
|
||||
}
|
||||
Log.i(TAG, "Resetting focus to auto-focus...")
|
||||
try {
|
||||
repeatingRequest.createCaptureRequest(device, deviceDetails, outputs).also { request ->
|
||||
session.setRepeatingRequest(request.build(), null, null)
|
||||
}
|
||||
} catch (e: IllegalStateException) {
|
||||
Log.w(TAG, "Failed to reset focus, camera device was already closed: ${e.message}")
|
||||
} catch (e: CameraAccessException) {
|
||||
Log.w(TAG, "Failed to reset focus, camera not accessible: ${e.message}")
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -198,8 +198,10 @@ class PreviewView(context: Context, callback: SurfaceHolder.Callback) :
|
||||
val viewOrientation = Orientation.PORTRAIT
|
||||
|
||||
val rotated = point.rotatedBy(viewSize, cameraSize, viewOrientation, sensorOrientation)
|
||||
Log.i(TAG, "Converted layer point $point to camera point $rotated! ($sensorOrientation, $cameraSize -> $viewSize)")
|
||||
return rotated
|
||||
// Clamp to valid camera coordinates (must be non-negative for MeteringRectangle)
|
||||
val clamped = Point(maxOf(0, rotated.x), maxOf(0, rotated.y))
|
||||
Log.i(TAG, "Converted layer point $point to camera point $clamped! ($sensorOrientation, $cameraSize -> $viewSize)")
|
||||
return clamped
|
||||
}
|
||||
|
||||
private fun updateLayout() {
|
||||
|
||||
Reference in New Issue
Block a user