我想调整一下Adroid手机的曝光时间和画面时长。我看过一些报纸说Android不提供曝光时间设置API。我试过使用HTC m8x phone,它的摄像头本身支持从4到1/8000的不同曝光时间,所以我猜应该有一些方法可以在应用程序中更改它。
方法get(CaptureRequest.EXPOSURE_TIME)返回null。在我使用CaptureRequest.Builder.set(CaptureRequest.SENSOR_EXPOSURE_TIME,x)之后,CaptureRequest.SENSOR_EXPOSURE_TIME变成了x,但手机中的预览效果并没有改变。
我查看了HTC m8x的权限,代码如下:
Activity activity = getActivity();
CameraManager manager =(CameraManager)activity.getSystemService(Context.CAMERA_SERVICE);
for (String cameraId : manager.getCameraIdList()) {
CameraCharacteristics characteristics= manager.getCameraCharacteristics(cameraId);
// We don't use a front facing camera in this sample.
if (characteristics.get(CameraCharacteristics.LENS_FACING)== CameraCharacteristics.LENS_FACING_FRONT) {
continue;
}
int level = characteristics.get(CameraCharacteristics.INFO_SUPPORTED_HARDWARE_LEVEL);
boolean hasFullLevel
= (level == CameraCharacteristics.INFO_SUPPORTED_HARDWARE_LEVEL_FULL);
int[] capabilities = characteristics.get(CameraCharacteristics.REQUEST_AVAILABLE_CAPABILITIES);
int syncLatency = characteristics.get(CameraCharacteristics.SYNC_MAX_LATENCY);
boolean hasManualControl = hasCapability(capabilities,CameraCharacteristics.REQUEST_AVAILABLE_CAPABILITIES_MANUAL_SENSOR);
boolean hasEnoughCapability = hasManualControl &&syncLatency == CameraCharacteristics.SYNC_MAX_LATENCY_PER_FRAME_CONTROL;
// All these are guaranteed by
// CameraCharacteristics.INFO_SUPPORTED_HARDWARE_LEVEL_FULL, but checking for only
// the things we care about expands range of devices we can run on
// We want:
// - Back-facing camera
// - Manual sensor control
// - Per-frame synchronization (so that exposure can be changed every frame)
if ( hasFullLevel !! hasEnoughCapability) {
mCameraId = cameraId;
return;}
}没有返回摄像头id。
characteristics.get(CameraCharacteristics.INFO_SUPPORTED_HARDWARE_LEVEL) =2;
CameraCharacteristics.INFO_SUPPORTED_HARDWARE_LEVEL_FULL = 1;
CameraCharacteristics.REQUEST_AVAILABLE_CAPABILITIES_MANUAL_SENSOR = 1;
capabilities =0;
characteristics.get(CameraCharacteristics.SYNC_MAX_LATENCY) =-1
CameraCharacteristics.SYNC_MAX_LATENCY_PER_FRAME_CONTROL = 0;那么,这是否表明我无权更改HTC m8x手机的曝光时间?启动手机会有帮助吗?
发布于 2015-09-08 01:44:29
看起来你的手机安装了Android4.x,而新的camera2应用程序接口需要棒棒糖/API21。如果你已经升级到API21,是的,如果它有完全的控制,它会告诉你它确实支持手动曝光控制……如果它的支持有限...
在REQUEST_AVAILABLE_CAPABILITIES_MANUAL_SENSOR上查看你想要的单个控件,比如曝光...
如果它有传统的支持,不,它不支持手动控制。
https://stackoverflow.com/questions/29787058
复制相似问题