Mini 4 Pro cannot set KeyPhotoSize
Environment Drone: DJI Mini 4 Pro Controller: DJI RC-N2 Android Device: Pixel 6 Pro on Android 16 DJI Fly app version: 1.17.1 Mobile SDK version: 5.15.0 Aircraft Firmware version: 01.00.1000 RC Firmware version: 01.01.0300
Using the MSDK sample app, while in the Default Layout screen, KeyPhotoSize cannot be set to PhotoSize.SIZE_LARGE or PhotoSize.SIZE_DEFAULT. The request times out without calling either the success or failure callbacks, and this error can be seen in the logs:
V5_COMMON com.dji.sampleV5.aircraft E set KeyCameraVideoStreamSource failedErrorImp{errorType='COMMON', errorCode='UNSUPPORTED', innerCode='', description='Not supported.', hint='ZOOM_CAMERA is not in range'}
Agent comment from YIGUI LIU in Zendesk ticket #154538:
Dear Developer,
According to the error log, the issue occurs because the Mini 4 Pro does not have a zoom lens and thus does not support setting KeyCameraVideoStreamSource to ZOOM_CAMERA. You can use KeyCameraVideoStreamSourceRange to obtain the list of lens types supported by the current camera. For single-lens cameras, the DEFAULT_CAMERA type is used by default.
Unfortunately, I do not have a Mini 4 Pro device with me at the moment, so I cannot confirm whether it supports setting KeyPhotoSize. You can try the following steps:
- In the MSDK sample app, go to the key/value function under Testing Tools.
- Select CAMERA, then search for KeyPhotoSize to attempt setting it, and check if the setting is successful. Additionally, please verify whether such a setting is supported in the DJI Fly APP
Best Regards,
DJI Innovations SDK Technical Support Team.
°°°
KeyCameraVideoStreamSource Is not being set by the app, this seems to be happening internally to the SDK. I am calling KeyPhotoSize and not KeyCameraVideoStreamSource
They Key/Value portion of the sample app is able to set KeyPhotoSize, in isolation. The problem occurs while more complicated functionality is also implemented. I was able to reproduce by trying to set KeyPhotoSize in the Default Layout screen.
DJI Fly also supports setting photo size, the options are 48MP and 12MP. I used PhotoSize.SIZE_LARGE and PhotoSize.SIZE_DEFAULT to represent those two sizes. These sizes work for 48/12 on our Mavic 3T's and the Matrice 4e/t. (And in the sample app, key/value screen using the Mini 4 Pro, but not in the default layout screen)
My hunch is that there is a problem setting KeyPhotoSize while the SDK is streaming video to the SurfaceView.
Updating the title to more accurately reflect the issue. KeyPhotoSize cannot be set using the Kotlin extensions.
the MSDK sample app uses raw integers when using the Key/Value tool, which is why it works on the Mini 4 Pro. When implementing a photo size button in the MSDK sample app's Default Layout utility, using similar patterns as the other keys, it fails because it uses the overload for enums.
The Kotlin extension that our app uses (CameraKey.KeyPhotoSize.createCamera) lacks the overload for integers, and only provides an overload accepting the enums. So we are unable to set photo size on the Mini 4 Pro.
// Sample App Key/Value tool, in Java, works
KeyTools.createKey(CameraKey.KeyPhotoSize, 0, ComponentIndexType.LEFT_OR_MAIN.value(), CameraLensType.CAMERA_LENS_DEFAULT.value(), 0).set(
param = PhotoSize.SIZE_DEFAULT,
onSuccess = {},
onFailure = {}
)
// Sample App, in Java, doesn't work
KeyTools.createCameraKey(CameraKey.KeyPhotoSize, ComponentIndexType.LEFT_OR_MAIN, CameraLensType.CAMERA_LENS_DEFAULT).set(
param = PhotoSize.SIZE_DEFAULT,
onSuccess = {},
onFailure = {}
)
// In Kotlin app, doesn't work
CameraKey.KeyPhotoSize.createCamera(ComponentIndexType.LEFT_OR_MAIN, CameraLensType.CAMERA_LENS_DEFAULT).set(
param = PhotoSize.SIZE_DEFAULT,
onSuccess = {},
onFailure = {}
)