MSDK版本4.15.1,固件已更新最新,飞机M300,镜头H20,点击拍照后,刷新获取SD卡图片时,无拍照图片,只...
已完成MSDK版本4.15.1,固件已更新最新,飞机M300,镜头H20,点击拍照后,刷新获取SD卡图片时,无拍照图片,只有再次拍照才会有图片更新出来,sdmMediaManager.refreshFileListOfStorageLocation(SettingsDefinitions.StorageLocation.SDCARD
https://github.com/DJI-Mobile-SDK-Tutorials/Android-MediaManagerDemo
-
已经格式化测试,效果和之前一样,通过测试对比,在pilot通过控件拍照是有一组照片有2张WIDE与ZOOM,但是通过遥控器快捷键和Android-MediaManagerDemo的拍照一组照片一张WIDE,现在的问题我想明确一点,Android-MediaManagerDemo这个demo的代码逻辑是否是正常的,这个是大疆github那边提供的MediaManagerDemo,现在按照回复所说,固件环境一致,但您那边测试正常,这样出现的问题代码问题的可能性很大,或者能否帮忙运行下此案例,排除一下,是否是代码问题
1.private void initMediaManager() {
if (DemoApplication.getProductInstance() == null) {
mediaFileList.clear();
mListAdapter.notifyDataSetChanged();
DJILog.e(TAG, "Product disconnected");
return;
} else {
if (null != DemoApplication.getCameraInstance() && DemoApplication.getCameraInstance().isMediaDownloadModeSupported()) {
mMediaManager = DemoApplication.getCameraInstance().getMediaManager();
if (null != mMediaManager) {
mMediaManager.addUpdateFileListStateListener(this.updateFileListStateListener);
mMediaManager.addMediaUpdatedVideoPlaybackStateListener(this.updatedVideoPlaybackStateListener);
if (isMavicAir2() || isM300()) {
DemoApplication.getCameraInstance().enterPlayback(djiError -> {
if (djiError == null) {
DJILog.e(TAG, "Set cameraMode success");
showProgressDialog();
getFileList();
} else {
setResultToToast("Set cameraMode failed");
}
});
} else {
DemoApplication.getCameraInstance().setMode(SettingsDefinitions.CameraMode.MEDIA_DOWNLOAD, error -> {
if (error == null) {
DJILog.e(TAG, "Set cameraMode success");
showProgressDialog();
getFileList();
} else {
setResultToToast("Set cameraMode failed");
}
});
}
if (mMediaManager.isVideoPlaybackSupported()) {
DJILog.e(TAG, "Camera support video playback!");
} else {
setResultToToast("Camera does not support video playback!");
}
scheduler = mMediaManager.getScheduler();
}
} else if (null != DemoApplication.getCameraInstance()
&& !DemoApplication.getCameraInstance().isMediaDownloadModeSupported()) {
setResultToToast("Media Download Mode not Supported");
}
}
return;
}
2.private void getFileList() {
mMediaManager = DemoApplication.getCameraInstance().getMediaManager();
if (mMediaManager != null) {
if ((currentFileListState == MediaManager.FileListState.SYNCING) || (currentFileListState == MediaManager.FileListState.DELETING)){
DJILog.e(TAG, "Media Manager is busy.");
}else{
mMediaManager.refreshFileListOfStorageLocation(SettingsDefinitions.StorageLocation.SDCARD, djiError -> {
if (null == djiError) {
hideProgressDialog();
//Reset data
if (currentFileListState != MediaManager.FileListState.INCOMPLETE) {
mediaFileList.clear();
lastClickViewIndex = -1;
lastClickView = null;
}
mediaFileList = mMediaManager.getSDCardFileListSnapshot();
if(mediaFileList != null) {
Collections.sort(mediaFileList, (lhs, rhs) -> {
if (lhs.getTimeCreated() < rhs.getTimeCreated()) {
return 1;
} else if (lhs.getTimeCreated() > rhs.getTimeCreated()) {
return -1;
}
return 0;
});
}
scheduler.resume(error -> {
if (error == null) {
getThumbnails();
}
});
} else {
hideProgressDialog();
setResultToToast("Get Media File List Failed:" + djiError.getDescription());
}
});
}
}
}
请先登录再写评论。
评论
8 条评论