dji-sdk / Mobile-SDK-Android

DJI Mobile SDK for Android: http://developer.dji.com/mobile-sdk/
Other
972 stars 580 forks source link

Camera's setFlatMode fails with error #1299

Closed huongta157 closed 1 month ago

huongta157 commented 1 month ago

I'm trying to setFlatMode through the SDK, and found that I need to set the camera's flat mode to:

The code (Kotlin) I'm using to do this is:

val product = ProductManager.getInstance(requireContext())?.getProductInstance()
        (product as? Aircraft)?.camera?.setFlatMode(mode) { error ->
            if (error != null) {
                setResultToToast(error.description)
            }
            Log.i(TAG, "set camera mode to: $mode -- ${error?.description}")
 }

Making this call returns an error: Camera received invalid parameters.

Any help is appreciated.

Device: DJI Air 2 Firmware: 01.05.0000 SDK Version: 4.17

dji-dev commented 1 month ago

Agent comment from yating.liao in Zendesk ticket #106586:

The AIR 2 can be used with setFlatMode. Is the mode you are passing supported by AIR 2? The mode PHOTO_HDR listed above is not supported by AIR 2. If you need the photo to be HDR type, you should set the camera mode to PHOTO_SMART.

°°°

huongta157 commented 1 month ago

@dji-dev thank you so much. How about with another device that does not support setFlatMode? Which function to change the camera mode?

dji-dev commented 1 month ago

Agent comment from yating.liao in Zendesk ticket #106586:

If the value returned by isFlatCameraModeSupported is false, it means that FlatMode is not supported. You can set it using setMode.

°°°