Websocket Stream Stats & Robustness Improvements (#605)

* wip support for a stats overlay

* WIP adding stream stats. But.... eeeh. Corporate.

* kbits over mbytes

* A ton more tweaks:

- Increased thread priority for streaming to reduce "stutter/slow" issues
- revised client side URL creation order to prevent the possibility of repeat-identical URL's
- Improved overlay to only be visible on mouseover, and fully centered in the screen

* wpiformat on js
This commit is contained in:
Chris Gerth
2022-12-01 13:42:21 -05:00
committed by GitHub
parent 4c004fc780
commit 678961e4f2
6 changed files with 147 additions and 42 deletions

View File

@@ -18,7 +18,6 @@
package org.photonvision.vision.videoStream;
import java.nio.ByteBuffer;
import java.util.Base64;
import java.util.concurrent.locks.Lock;
import java.util.concurrent.locks.ReentrantLock;
import java.util.function.Consumer;
@@ -77,16 +76,6 @@ public class SocketVideoStream implements Consumer<Frame> {
oldSchoolServer.accept(frame);
}
public String getJPEGBase64EncodedStr() {
String sendStr = null;
jpegBytesLock.lock();
if (jpegBytes != null) {
sendStr = Base64.getEncoder().encodeToString(jpegBytes.toArray());
}
jpegBytesLock.unlock();
return sendStr;
}
public ByteBuffer getJPEGByteBuffer() {
ByteBuffer sendStr = null;
jpegBytesLock.lock();