Read filename using new setNewGeneratedMediaFileInfoCallback
CompletedUsing the old setMediaFileCallback I was able to read the saved image's filename, that doesn't appear as part of the information passed when using the new setNewGeneratedMediaFileInfoCallback.
I know I can call refreshFileList on the MediaManager instance but that a lot of overkill to just be able to read the filename, and the call returns a complete list each time, meaning the more photos taken, the larger the list.
-
It is not an SDK bug, it is a firmware issue and unfixable. So it will be exist in both 4.x and 5.x version. The theory is we actually cannot get the real fileName, the fileName is created by the SDK according to the naming rules, sometimes it is mismatched with the real file name in SD card. -
Is there a way to read the last image filename without refreshing the complete list of all image files? It makes it nearly impossible to do image validation on the most recent image of I must download the complete list each time. It means the more images taken, the larger the list on the callback.
-
Actually everytime you call refreh it will only refresh the newly generated files not the complete list. Everytime you shoot photos, the fileListState should go into INCOMPLETE state. ![](https://djisdksupport.zendesk.com/attachments/token/SBKB7ks0wHzuwKxvuljF2uhQ4/?name=image.png) -
It appears that each call to
refreshFileListOfStorageLocation(SettingsDefinitions.StorageLocation.SDCARD)
is returning the complete list. Unless I misunderstand the documentation and the information in the link you listed above.
First call:
::refreshFileList: djiError: null
::sdCardFileListSnapshot
::refreshFileList: Size=474, TaskScheduler=IDLESecond call:
::refreshFileList: djiError: null
::sdCardFileListSnapshot
::refreshFileList: Size=476, TaskScheduler=IDLEdjiCamera!!.setNewGeneratedMediaFileInfoCallback { mediaFileInfo ->
// According to DJI, this should return ONLY the new images since the last refresh
// TODO:
mediaManager?.refreshFileListOfStorageLocation(SettingsDefinitions.StorageLocation.SDCARD) { djiError ->logInfo("AircraftDataSourceImpl::refreshFileList: djiError: $djiError")
if (djiError == null) {
logInfo("AircraftDataSourceImpl::sdCardFileListSnapshot")
mediaManager?.sdCardFileListSnapshot?.let { djiMedias ->
logInfo(
"AircraftDataSourceImpl::refreshFileList: Size=${djiMedias.size}, TaskScheduler=${fetchMediaTaskScheduler?.state}"
)
Please sign in to leave a comment.
Comments
7 comments