Giter Site home page Giter Site logo

Comments (9)

alistairsykes avatar alistairsykes commented on June 30, 2024

Hi @TurKurT656. Your welcome!

Is there a particular block of code which makes you think the lib is processing bitmaps on the main thread?
Does everything still work, you're just getting lag?
Have you tried on any other "mid level" devices?

I admit it's been a little while since being deep in this code, but I thought I had made everything threaded correctly.

from kbarcode.

TurKurT656 avatar TurKurT656 commented on June 30, 2024

no, i double checked everything. yes everything works fine but with lag (almost every 2sec)
yes it lags on some devices (mid level and high level).

from kbarcode.

TurKurT656 avatar TurKurT656 commented on June 30, 2024

i found the problem:
app:formats="data" it lags on "data" and "all" mode

from kbarcode.

alistairsykes avatar alistairsykes commented on June 30, 2024

I think I have identified that this line is causing some dropped frames:
FirebaseVisionImage.fromMediaImage(image, frameMetadata.rotation) from VisionImageProcessorSingleBase.convertToVisionImage()

It appears that on some devices this call can be quite intensive and therefore cause jumps. I will have a think about a solution.

from kbarcode.

alistairsykes avatar alistairsykes commented on June 30, 2024

I have attempted a solution on this branch: https://github.com/brightec/KBarcode/tree/fix/Lag.

I add Kotlin Coroutines as a dependency in order to aid with the threading. And then made FirebaseVisionImage.fromMediaImage(image, frameMetadata.rotation) run on a background thread.

@TurKurT656 Fancy taking a look and seeing if this performs better on your devices too?

from kbarcode.

TurKurT656 avatar TurKurT656 commented on June 30, 2024

@alistairsykes Ok i will test application with this branch and see if lag problem fixed.

from kbarcode.

alistairsykes avatar alistairsykes commented on June 30, 2024

Closing for inactivity. Hopefully that did solve your issue.

from kbarcode.

TurKurT656 avatar TurKurT656 commented on June 30, 2024

srry for the delay, yes it is fixed on this version

from kbarcode.

alistairsykes avatar alistairsykes commented on June 30, 2024

FYI: https://github.com/brightec/KBarcode/releases/tag/v1.0.4

from kbarcode.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.