fix: dashcamd OMX crash on restart, add dashcam status indicator
- 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:
@@ -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++;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user