Skip to content

Commit

Permalink
Slightly slows down the maximum map framerate
Browse files Browse the repository at this point in the history
Experiment to try to fix #536 crashing the headunit
  • Loading branch information
hufman committed Apr 18, 2022
1 parent 410aae5 commit 42177ed
Showing 1 changed file with 4 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -23,16 +23,17 @@ class FrameUpdater(val display: VirtualDisplayScreenCapture, val modeListener: F
display.registerImageListener(ImageReader.OnImageAvailableListener // Called from the UI thread to say a new image is available
{
// let the car thread consume the image
schedule()
// we were probably waiting for the image to start, so fire immediately
schedule(5)
})
schedule() // check for a first image
}

override fun run() {
var bitmap = display.getFrame()
val bitmap = display.getFrame()
if (bitmap != null) {
sendImage(bitmap)
schedule() // check if there's another frame ready for us right now
schedule(30) // check if there's another frame ready for us right now
} else {
// wait for the next frame, unless the callback comes back sooner
schedule(1000)
Expand Down

0 comments on commit 42177ed

Please sign in to comment.