FLIR One Developer / Blog / Topics / android / Multi threading issue with Android 1.1.1 SDK

Multi threading issue with Android 1.1.1 SDK

Home Forums FLIR Mobile SDK Development Android Development Multi threading issue with Android 1.1.1 SDK

Tagged: 

This topic contains 2 replies, has 2 voices, and was last updated by Profile photo of Gavin Gavin 4 months, 1 week ago.

Viewing 3 posts - 1 through 3 (of 3 total)

  • Author

    Posts

  • #12061

    Profile photo of Eugene
    Eugene

    Participant

    Hello.

    There’s an issues with trying to handle ThermalImagefrom cameraInstance.withImage in separate thread. Code looks like this:

    camera.subscribeStream {
      Thread {
        camera.withImage { handleImage(it) }
      }.start()
    }
    
    private fun handleImage(image: ThermalImage) {
      ...
      image.fusion?.setFusionMode(modeManager.current)
      image.palette = palettesManager.current
      val msxBitmap = BitmapAndroid.createBitmap(image.image).bitMap
      runOnUiThread { ivPreview.setImageBitmap(msxBitmap) }
    }

    When this code is executed, image in handleImage() function only receives visual data. In Visual mode i see clear picture, in Thermal mode – green screen.

    After trying the same approach in example project that I’ve downloaded from your site, everything work perfectly.

    In the end I had to copy old version androidsdk-release.aar and thermalsdk-release.aar from sample project into my work project for it to work properly.

    Would appreciate if this issue with threading will be fixed. Thank you in advance.

    #12062

    Profile photo of Eugene
    Eugene

    Participant

    To add. I was using Nexus 5X and Pixel 2 with Flir One Pro camera

    #12063

    Profile photo of Gavin
    Gavin

    Keymaster

    Hi Eugene,

    Thanks so much for reporting this. I will escalate to our technical support team and hopefully this will be fixed in the next version of the SDK.

    Best,
    Gavin
    FLIR Community Support

Viewing 3 posts - 1 through 3 (of 3 total)

You must be logged in to reply to this topic.