我只是想做个简单的申请。捕获时不应用SENSITIVITY和EXPOSURE_TIME设置。`cameraManager.openCamera(cameraId,object:CameraDevice.StateCallback(){ override fun onOpened(camera:CameraDevice){ cameraDevice = camera captureRequest = camera. THEMPERATURE CaptureRequest(CameraDevice.TEMPLATE_STILL_CAPTURE)
captureRequest.set(CaptureRequest.CONTROL_AE_MODE, CaptureRequest.CONTROL_AE_MODE_OFF)
captureRequest.set(CaptureRequest.SENSOR_SENSITIVITY, 2000)
captureRequest.set(CaptureRequest.SENSOR_EXPOSURE_TIME, 10000000000)
imageReader = ImageReader.newInstance(
3000, // Replace with the desired image width
3000, // Replace with the desired image height
ImageFormat.JPEG, // Image format, you can change it if needed
1 // Max images that can be accessed at once
)
val captureRequest = captureRequest.build()
cameraDevice.createCaptureSession(
listOf(imageReader.surface, imageReader!!.surface),
object : CameraCaptureSession.StateCallback() {
override fun onConfigured(session: CameraCaptureSession) {
try {
session.capture(captureRequest, object : CameraCaptureSession.CaptureCallback() {
override fun onCaptureCompleted(
session: CameraCaptureSession,
request: CaptureRequest,
result: TotalCaptureResult
) {
session.close()
}`
我得到一个错误Session 0: Exception while stopping repeating: android.hardware.camera2.CameraAccessException: CAMERA_ERROR (3): cancelRequest:652: Camera 0: Error clearing streaming request: Function not implemented (-38)
我会很高兴任何信息。
1条答案
按热度按时间4xrmg8kj1#
您的设备可能不支持您设置的值。例如,您可以通过以下方式获得有效的rage: