UI: fix getting stuck after vipc recv timeout

old-commit-hash: 86beb9a81a
commatwo_master
Adeeb Shihadeh 4 years ago
parent ed25cf30f4
commit b3a1f2c67d
  1. 10
      selfdrive/ui/qt/widgets/cameraview.cc

@ -252,17 +252,19 @@ void CameraViewWidget::updateFrame() {
resizeGL(width(), height()); resizeGL(width(), height());
} }
VisionBuf *buf = nullptr;
if (vipc_client->connected) { if (vipc_client->connected) {
VisionBuf *buf = vipc_client->recv(); buf = vipc_client->recv();
if (buf != nullptr) { if (buf != nullptr) {
latest_frame = buf; latest_frame = buf;
update(); update();
emit frameUpdated(); emit frameUpdated();
} else if (!Hardware::PC()) { } else {
LOGE("visionIPC receive timeout"); LOGE("visionIPC receive timeout");
} }
} else { }
// try to connect again quickly if (buf == nullptr) {
// try to connect or recv again
QTimer::singleShot(1000. / UI_FREQ, this, &CameraViewWidget::updateFrame); QTimer::singleShot(1000. / UI_FREQ, this, &CameraViewWidget::updateFrame);
} }
} }

Loading…
Cancel
Save