mirror of https://github.com/status-im/qzxing.git
Add simple FPS counter to QZXingLive example
This commit is contained in:
parent
69e05c1ff1
commit
0e10d8aeca
|
@ -34,6 +34,15 @@ ApplicationWindow
|
||||||
z: 50
|
z: 50
|
||||||
text: "Tags detected: " + detectedTags
|
text: "Tags detected: " + detectedTags
|
||||||
}
|
}
|
||||||
|
Text
|
||||||
|
{
|
||||||
|
id: fps
|
||||||
|
font.pixelSize: 20
|
||||||
|
anchors.top: parent.top
|
||||||
|
anchors.right: parent.right
|
||||||
|
z: 50
|
||||||
|
text: (1000 / zxingFilter.timePerFrameDecode).toFixed(0) + "fps"
|
||||||
|
}
|
||||||
|
|
||||||
Camera
|
Camera
|
||||||
{
|
{
|
||||||
|
@ -103,9 +112,14 @@ ApplicationWindow
|
||||||
// console.log("started");
|
// console.log("started");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
property int framesDecoded: 0
|
||||||
|
property real timePerFrameDecode: 0
|
||||||
|
|
||||||
onDecodingFinished:
|
onDecodingFinished:
|
||||||
{
|
{
|
||||||
console.log("frame finished: " + succeeded, decodeTime);
|
timePerFrameDecode = (decodeTime + framesDecoded * timePerFrameDecode) / (framesDecoded + 1);
|
||||||
|
framesDecoded++;
|
||||||
|
console.log("frame finished: " + succeeded, decodeTime, timePerFrameDecode, framesDecoded);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue