[DESCRIPTION]
ALPS01971961
在L版本的camera ap中,启动录像后,可以点击屏幕进行手动对焦,但切换场景,不能触发自动对焦(连续对焦)。
[SOLUTION]
1 将FocusManager.java (src\com\android\camera)中的getModeContinousFocusMode函数替换为,
private String getModeContinousFocusMode(intmode) {
mode = getSettingModeIndex(mode);
return MATRIX_FOCUS_MODE_CONTINUOUS[mode];
}
2 在VideoMode.java(src\com\mediatek\camera\mode)添加:
1) 在开始部分添加
importcom.mediatek.camera.platform.ICameraDeviceManager.ICameraDevice.AutoFocusMvCallback;
2) 在文件中合适位置添加一个AutoFocusMvCallback
protected final AutoFocusMvCallbackmAutoFocusMoveCallback = new AutoFocusMvCallback() {
@Override
public void onAutoFocusMoving(boolean moving,android.hardware.Camera camera) {
Log.i(TAG, "[onAutoFocusMoving]moving =" + moving);
mIFocusManager.onAutoFocusMoving(moving);
}
};
3) 在doStartPreview函数的mICameraDevice.startPreview();后面添加
mICameraDevice.setAutoFocusMoveCallback(mAutoFocusMoveCallback);
4) 将cancelAutoFocus函数替换为:
public void cancelAutoFocus() {
Log.i(TAG, "[cancelAutoFocus] " +" mICameraDevice = " + mICameraDevice+" mIsAutoFocusCallback ="+mIsAutoFocusCallback);
if (mICameraDevice != null) {
mICameraDevice.cancelAutoFocus();
}
setFocusState(FOCUS_IDLE);
setFocusParameters();
mIsAutoFocusCallback = false;
}
MtK Camera FAQ
最新推荐文章于 2022-08-19 16:04:48 发布