Comments (9)
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.
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.
i found the problem:
app:formats="data" it lags on "data" and "all" mode
from kbarcode.
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.
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.
@alistairsykes Ok i will test application with this branch and see if lag problem fixed.
from kbarcode.
Closing for inactivity. Hopefully that did solve your issue.
from kbarcode.
srry for the delay, yes it is fixed on this version
from kbarcode.
FYI: https://github.com/brightec/KBarcode/releases/tag/v1.0.4
from kbarcode.
Related Issues (20)
- [FEATURE] Click to focus in barcode view HOT 6
- Surface had no valid native window. on barcodeView.start() HOT 7
- [BUG] Samsung Galaxy S9 HOT 2
- [FEATURE] Ui test HOT 6
- [QUESTION] - minSDK HOT 1
- RTFM: Does this lib support QrCode? HOT 1
- [FEATURE] Add a way to pause the camera preview, or clear the list of scanned barcodes. HOT 4
- Dim light
- The image quality is fairly poor. HOT 1
- [FEATURE] Toggle flash on/off HOT 2
- [BUG] Crash on VisionImageProcessorSingleBase$startDetection$2.onComplete() HOT 2
- [FEATURE] Black screen when Camera permission denied. HOT 1
- How to capture or retreive the Image frame being scanned HOT 3
- [BUG] Library doesn't work at all HOT 2
- [FEATURE] FirebaseVisionBarcode is deprecated, migrate to ML Kit SDK HOT 2
- [BUG] Black bar on the right HOT 1
- Crash on back HOT 2
- [FEATURE] Add Data Safety information HOT 1
- [BUG] Detection stops working when toggling flash HOT 3
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from kbarcode.