From 23742d046f952c4b75edbcf80dd6b83cd4bbdc72 Mon Sep 17 00:00:00 2001 From: DevTekVE Date: Tue, 28 May 2024 02:26:26 +0000 Subject: [PATCH] Disable Screen Recorder --- CHANGELOGS.md | 2 ++ selfdrive/ui/SConscript | 2 +- .../ui/qt/offroad/sunnypilot/display_settings.cc | 2 ++ selfdrive/ui/qt/screenrecorder/omx_encoder.cc | 16 +++++++++++++++- 4 files changed, 20 insertions(+), 2 deletions(-) diff --git a/CHANGELOGS.md b/CHANGELOGS.md index 850013c029..2fc0388fa0 100644 --- a/CHANGELOGS.md +++ b/CHANGELOGS.md @@ -57,6 +57,8 @@ sunnypilot - 0.9.7.0 (2024-05-xx) * NEW❗: Metrics is now being displayed below the chevron instead of above * NEW❗: Display both Distance and Speed simultaneously * NEW❗: View sunnylink connectivity status on the left sidebar! +* REMOVED: Screen Recorder + * A better/equivalent version of Screen Recorder will be supported in the near future. Stay tuned! sunnypilot - 0.9.6.1 (2024-02-27) ======================== diff --git a/selfdrive/ui/SConscript b/selfdrive/ui/SConscript index 155e790e7c..3c7662e6ce 100644 --- a/selfdrive/ui/SConscript +++ b/selfdrive/ui/SConscript @@ -10,7 +10,7 @@ if arch == 'larch64': base_libs.append('EGL') maps = arch in ['larch64', 'aarch64', 'x86_64'] -screenrecorder = arch in ['larch64'] +screenrecorder = False # arch in ['larch64'] if arch == "Darwin": del base_libs[base_libs.index('OpenCL')] diff --git a/selfdrive/ui/qt/offroad/sunnypilot/display_settings.cc b/selfdrive/ui/qt/offroad/sunnypilot/display_settings.cc index 3d83fce252..a09bc22565 100644 --- a/selfdrive/ui/qt/offroad/sunnypilot/display_settings.cc +++ b/selfdrive/ui/qt/offroad/sunnypilot/display_settings.cc @@ -13,12 +13,14 @@ DisplayPanel::DisplayPanel(QWidget *parent) : ListWidget(parent, false) { .arg(tr("Enabled: Wake the brightness of the screen to display all events.")) .arg(tr("Disabled: Wake the brightness of the screen to display critical events.")), "../assets/offroad/icon_blank.png", +#ifdef ENABLE_DASHCAM }, { "ScreenRecorder", tr("Enable Screen Recorder"), tr("Enable this will display a button on the onroad screen to toggle on or off real-time screen recording with UI elements."), "../assets/offroad/icon_blank.png" +#endif } }; diff --git a/selfdrive/ui/qt/screenrecorder/omx_encoder.cc b/selfdrive/ui/qt/screenrecorder/omx_encoder.cc index d051b600f8..29607ed921 100644 --- a/selfdrive/ui/qt/screenrecorder/omx_encoder.cc +++ b/selfdrive/ui/qt/screenrecorder/omx_encoder.cc @@ -10,6 +10,8 @@ #include #include +#include + #include #include #include @@ -18,6 +20,7 @@ #include "msm_media_info.h" #include "common/swaglog.h" #include "common/util.h" +#include "common/watchdog.h" using namespace libyuv; @@ -327,8 +330,19 @@ OmxEncoder::OmxEncoder(const char* path, int width, int height, int fps, int bit int err = OMX_GetHandle(&this->handle, component, this, &omx_callbacks); if (err != OMX_ErrorNone) { LOGE("error getting codec: %x", err); + // TODO: We force quit Qt UI, and trigger fast restart for now + qApp->exit(18); + watchdog_kick(0); } - assert(err == OMX_ErrorNone); + // TODO: Investigate the insufficient memory issue in prebuilts, we force quit Qt UI, and trigger fast restart for now + /* + if (err == OMX_ErrorInsufficientResources) { + qApp->exit(18); + watchdog_kick(0); + } else { + assert(err == OMX_ErrorNone); + } + */ // printf("handle: %p\n", this->handle); // setup input port