Add support for bottleneck stats

This commit is contained in:
Lauri Kasanen
2020-09-21 15:51:56 +03:00
parent 45e44a66e5
commit d5bdef121a
11 changed files with 164 additions and 4 deletions

View File

@@ -356,9 +356,10 @@ void EncodeManager::doUpdate(bool allowLossy, const Region& changed_,
changed = changed_;
gettimeofday(&start, NULL);
if (allowLossy && activeEncoders[encoderFullColour] == encoderTightWEBP) {
const unsigned rate = 1024 * 1000 / rfb::Server::frameRate;
gettimeofday(&start, NULL);
screenArea = pb->getRect().width() * pb->getRect().height();
screenArea *= 1024;
@@ -401,8 +402,7 @@ void EncodeManager::doUpdate(bool allowLossy, const Region& changed_,
writeSolidRects(&changed, pb);
writeRects(changed, pb,
allowLossy && activeEncoders[encoderFullColour] == encoderTightWEBP ?
&start : NULL, true);
&start, true);
if (!videoDetected) // In case detection happened between the calls
writeRects(cursorRegion, renderedCursor);
@@ -1136,6 +1136,9 @@ void EncodeManager::writeRects(const Region& changed, const PixelBuffer* pb,
checkWebpFallback(start);
}
if (start)
encodingTime = msSince(start);
if (webpTookTooLong)
activeEncoders[encoderFullColour] = encoderTightJPEG;