禅思H20T设置可见光,分屏的问题
0
看文档说明,流程是先将camera设置camera.setCameraVideoStreamSource(CameraVideoStreamSource.INFRARED_THERMAL, new CommonCallbacks.CompletionCallback() {});然后找到Zenmuse H20T Infrared Thermal Lens,给它设置lens.setDisplayMode(SettingsDefinitions.DisplayMode.VISUAL_ONLY,new CommonCallbacks.CompletionCallback() {});先说问题:
问题1. 设置VISUAL_ONLY(照大疆遥控器上的"可见光"按钮),设置出错,返回Camera received invalid parameters.
问题2,设置PIP,成功,但是界面没有分屏.
问题3.设置THERMAL_ONLY,界面也没反应(界面本身是全屏的红外镜头).
我的代码如下,前提已经设置好了CameraVideoStreamSource.INFRARED_THERMAL.
case R.id.btn_recx:
List<Camera> cameraList = DJIProductUtils.getCameraListInstance();
if (cameraList != null && cameraList.size() > 0) {
for (Camera camera : cameraList) {
if (camera.getDisplayName().equals("Zenmuse H20T")) {
camera.getCameraVideoStreamSource(new CommonCallbacks.CompletionCallbackWith<CameraVideoStreamSource>() {
@Override
public void onSuccess(CameraVideoStreamSource cameraVideoStreamSource) {
if (cameraVideoStreamSource.name().equals(CameraVideoStreamSource.INFRARED_THERMAL.name())) {
///////////////////////////////////
List<Lens> lensList = camera.getLenses();
if (lensList == null || lensList.size() < 1) {
toastShort("lensList is null");
return;
}
for (Lens lens : lensList) {
int lensIndex = lens.getCameraIndex();
String lensDisplayName = lens.getDisplayName();
SettingsDefinitions.LensType lensType = lens.getType();
String lensTypeName = lensType.name();
int lensTypue = lensType.value();
// LogUtil.logInfo("yuwj", "lensIndex=" + lensIndex + ",lensDisplayName=" + lensDisplayName + ",lensTypeName=" + lensTypeName + ",lensTypue=" + lensTypue);
switch (lensDisplayName) {
case "Zenmuse H20T Infrared Thermal Lens":
//设置相机模式, VISUAL_ONLY-仅显示来自可视摄像机的视频源;THERMAL_ONLY-仅显示来自热像仪的视频; PIP-画中画(分屏),MSX-多光谱
lens.setDisplayMode(SettingsDefinitions.DisplayMode.VISUAL_ONLY, new CommonCallbacks.CompletionCallback() {
@Override
public void onResult(DJIError djiError) {
if (djiError == null) {
LogUtil.logInfo("yuwj", "camera.setDisplayMode VISUAL_ONLY success");
toastShort("camera.setDisplayMode VISUAL_ONLY success");
} else {
LogUtil.logInfo("yuwj", "camera.setDisplayMode VISUAL_ONLY fail, error = " + djiError.getDeion());
toastShort("camera.setDisplayMode VISUAL_ONLY fail, error = " + djiError.getDeion());
}
}
});
break;
default:
break;
}
}
///////////////////////////////////
}
}
@Override
public void onFailure(DJIError djiError) {
}
});
}
}
} |
|
|
|