Mobile SDK differences for M300/M2ED
Uploading and Loding Picture ...(0/1)
o(^-^)o
mick11
lvl.2

Australia
Offline

I have developed an app that posts frames from the camera along with metadata using HTTP.  To get the frames I have set a new SurfaceTextureListener on the fpvWidget in initUI:

fpvWidget = findViewById<View>(R.id.fpv_widget) as FPVWidget
fpvWidget?.surfaceTextureListener = object : SurfaceTextureListener {
  override fun onSurfaceTextureAvailable(surface: SurfaceTexture, surf_width: Int, surf_height: Int) {
    codecManager = DJICodecManager(applicationContext, surface, width, height)
  }
}

This means I can get the raw image data later with:

val data = codecManager?.getYuvData(width, height)

This works perfectly on the Mavic 2 Enterprise Dual.

This does not work on the M300 with H20T.

Setting the SurfaceTextureListener on the fpvWidget on the M300 kills the video display on the widget and I can't access the image data.  If I don't set the listener I can see the video display fine.

Can someone tell me why the behaviour is different, and how I can get screen grabs from the H20T feed on the M300?

Thanks,

Mick
2021-1-8
Use props
kv886
lvl.4

Hong Kong
Offline

Because UXSDK is not compatible with H20
2021-1-8
Use props
mick11
lvl.2

Australia
Offline

kv886 Posted at 1-8 02:45
Because UXSDK is not compatible with H20

Oh that's a shame, though it's weird that if I don't set the SurfaceTextureListener the FPVWidget works as you would expect (though I have not tried to do much else with it).

Can you suggest another way I could grab frames from the video feed?
2021-1-8
Use props
mick11
lvl.2

Australia
Offline

For anyone else who comes across this, the solution was to use a standard Android TextureView instead of an FPVWidget and then it worked as expected.
2021-1-24
Use props
Advanced
You need to log in before you can reply Login | Register now

Credit Rules