fix: port OmxEncoder safety fixes from upstream FrogPilot

- OMX_Init/OMX_Deinit managed per encoder instance lifecycle
- Proper error handling in constructor, encoder_open, encoder_close
- Null guards on done_out.pop() and handle in destructor
- Codec config written directly to codecpar (no codec_ctx)
- ffmpeg faststart remux on segment close
- Crash handler in dashcamd for diagnostics
- DashcamFrames param for live frame count in status window

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
2026-04-16 01:13:41 -05:00
parent 9ac334b7cf
commit dfb7b7404f
10 changed files with 345 additions and 444 deletions

View File

@@ -266,7 +266,7 @@ static StatusWindow::StatusData collectStatus() {
// Dashcam
QString dashcam_pid = shellCmd("pgrep -x dashcamd");
d.dashcam_status = dashcam_pid.isEmpty() ? "stopped" : "recording";
d.dashcam_size = shellCmd("du -sh /data/media/0/videos 2>/dev/null | awk '{print $1}'");
d.dashcam_frames = readFile("/dev/shm/params/d/DashcamFrames");
// Panda: checked on UI thread in applyResults() via scene.pandaType
@@ -385,7 +385,7 @@ void StatusWindow::applyResults() {
if (d.dashcam_status == "recording") {
QString text = "Recording";
if (!d.dashcam_size.isEmpty()) text += " (" + d.dashcam_size + ")";
if (!d.dashcam_frames.isEmpty() && d.dashcam_frames != "0") text += " (" + d.dashcam_frames + " frames)";
dashcam_label->setText(text);
dashcam_label->setStyleSheet("color: #17c44d; font-size: 38px;");
} else {