From 7ef99716cc658e1aa6708e26120bbda2f1de1792 Mon Sep 17 00:00:00 2001 From: FrogAi <91348155+FrogAi@users.noreply.github.com> Date: Tue, 27 Feb 2024 16:34:47 -0700 Subject: [PATCH] Higher bitrate uploads Added toggle to increase the bitrate for uploads to comma connect --- common/params.cc | 1 + selfdrive/frogpilot/ui/control_settings.cc | 3 ++- selfdrive/frogpilot/ui/control_settings.h | 2 +- system/loggerd/loggerd.h | 2 +- 4 files changed, 5 insertions(+), 3 deletions(-) diff --git a/common/params.cc b/common/params.cc index 58e9e93..2cf559f 100644 --- a/common/params.cc +++ b/common/params.cc @@ -275,6 +275,7 @@ std::unordered_map keys = { {"GreenLightAlert", PERSISTENT}, {"HideSpeed", PERSISTENT}, {"HideSpeedUI", PERSISTENT}, + {"HigherBitrate", PERSISTENT}, {"LaneLinesWidth", PERSISTENT}, {"LateralTune", PERSISTENT}, {"LeadInfo", PERSISTENT}, diff --git a/selfdrive/frogpilot/ui/control_settings.cc b/selfdrive/frogpilot/ui/control_settings.cc index 14e73fe..ab72c5f 100644 --- a/selfdrive/frogpilot/ui/control_settings.cc +++ b/selfdrive/frogpilot/ui/control_settings.cc @@ -34,6 +34,7 @@ FrogPilotControlsPanel::FrogPilotControlsPanel(SettingsWindow *parent) : FrogPil {"QOLControls", "Quality of Life", "Miscellaneous quality of life changes to improve your overall openpilot experience.", "../frogpilot/assets/toggle_icons/quality_of_life.png"}, {"DisableOnroadUploads", "Disable Onroad Uploads", "Prevent large data uploads when onroad.", ""}, + {"HigherBitrate", "Higher Bitrate Recording", "Increases the quality of the footage uploaded to comma connect.", ""}, }; for (const auto &[param, title, desc, icon] : controlToggles) { @@ -254,7 +255,7 @@ FrogPilotControlsPanel::FrogPilotControlsPanel(SettingsWindow *parent) : FrogPil } }); - std::set rebootKeys = {"AlwaysOnLateral"}; + std::set rebootKeys = {"AlwaysOnLateral", "HigherBitrate"}; for (const std::string &key : rebootKeys) { QObject::connect(toggles[key], &ToggleControl::toggleFlipped, [this, key]() { if (started) { diff --git a/selfdrive/frogpilot/ui/control_settings.h b/selfdrive/frogpilot/ui/control_settings.h index b3c0307..e7da1dc 100644 --- a/selfdrive/frogpilot/ui/control_settings.h +++ b/selfdrive/frogpilot/ui/control_settings.h @@ -42,7 +42,7 @@ private: std::set lateralTuneKeys = {"ForceAutoTune"}; std::set longitudinalTuneKeys = {"AccelerationProfile", "DecelerationProfile", "AggressiveAcceleration"}; std::set mtscKeys = {}; - std::set qolKeys = {"DisableOnroadUploads"}; + std::set qolKeys = {"DisableOnroadUploads", "HigherBitrate"}; std::set speedLimitControllerKeys = {}; std::set speedLimitControllerControlsKeys = {}; std::set speedLimitControllerQOLKeys = {}; diff --git a/system/loggerd/loggerd.h b/system/loggerd/loggerd.h index ea288f4..5476148 100644 --- a/system/loggerd/loggerd.h +++ b/system/loggerd/loggerd.h @@ -14,7 +14,7 @@ #include "system/loggerd/logger.h" constexpr int MAIN_FPS = 20; -const int MAIN_BITRATE = 1e7; +const int MAIN_BITRATE = Params().getBool("HigherBitrate") ? 20000000 : 1e7; const int LIVESTREAM_BITRATE = 1e6; const int QCAM_BITRATE = 256000;