Read filename using new setNewGeneratedMediaFileInfoCallback

已完成

评论

7 条评论

  • DJI Developer Support
    The setMediaFileCallback often carries the wrong file name so we use setNewGeneratedMediaFileInfoCallback instead and deprecate the setMediaFileCallback . If you are ok with the setMediaFileCallback then you can still use it. The bug only occurs to some models such as M300RTK.
    0
    评论操作 固定链接
  • Kenneth Argo

    I'm using the M300RTK.

    So this is a bug in 4.16.2?  What about 5.x?

    How can I use setNewGeneratedMediaFileInfoCallback, and get the filename of a newly added image WITHOUT refreshing the complete image list?

    0
    评论操作 固定链接
  • DJI Developer Support
    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.
    0
    评论操作 固定链接
  • Kenneth Argo

    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.

    0
    评论操作 固定链接
  • DJI Developer Support
    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)
    0
    评论操作 固定链接
  • Kenneth Argo

    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=IDLE

    Second call: 

    ::refreshFileList: djiError: null
    ::sdCardFileListSnapshot
    ::refreshFileList: Size=476, TaskScheduler=IDLE

    djiCamera!!.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}"
                                            )

     

    0
    评论操作 固定链接
  • DJI Developer Support
    refreshFileList will return a complate list, it will only fetch the newly generated file and apend to the list. It will not fetch the whole list.
    0
    评论操作 固定链接

请先登录再写评论。