fix: dashcamd OMX crash on restart, add dashcam status indicator
Some checks failed
prebuilt / build prebuilt (push) Has been cancelled
badges / create badges (push) Has been cancelled

- Reset OMX subsystem (Deinit/Init) on dashcamd startup to clear stale
  encoder state from previous unclean exits
- Validate OMX output buffers before memcpy to prevent segfault
- Validate VisionBuf frame data before encoding
- Add dashcam row to status window showing recording state and disk usage

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
2026-04-16 00:44:13 -05:00
parent 3cbb81f9f1
commit 9ac334b7cf
5 changed files with 39 additions and 0 deletions

View File

@@ -446,6 +446,12 @@ OmxEncoder::OmxEncoder(const char* path, int width, int height, int fps, int bit
void OmxEncoder::handle_out_buf(OmxEncoder *e, OMX_BUFFERHEADERTYPE *out_buf) {
int err;
if (out_buf->pBuffer == nullptr || out_buf->nFilledLen == 0) {
OMX_CHECK(OMX_FillThisBuffer(e->handle, out_buf));
return;
}
uint8_t *buf_data = out_buf->pBuffer + out_buf->nOffset;
if (out_buf->nFlags & OMX_BUFFERFLAG_CODECCONFIG) {
@@ -613,6 +619,7 @@ int OmxEncoder::encode_frame_nv12(const uint8_t *y_ptr, int y_stride, const uint
handle_out_buf(this, out_buf);
}
this->dirty = true;
this->counter++;