mirror of
https://github.com/pikvm/ustreamer.git
synced 2026-03-01 21:26:33 +00:00
Small refactoring of #289 + manpage
This commit is contained in:
@@ -544,8 +544,11 @@ bool _capture_is_buffer_valid(const us_capture_s *cap, const struct v4l2_buffer
|
||||
const u8 *const eoi_ptr = end_ptr - 2;
|
||||
const u16 eoi_marker = (((u16)(eoi_ptr[0]) << 8) | eoi_ptr[1]);
|
||||
if (eoi_marker != 0xFFD9 && eoi_marker != 0xD900 && eoi_marker != 0x0000) {
|
||||
if (!cap->allow_truncated_frames) {
|
||||
_LOG_DEBUG("Discarding truncated JPEG frame: eoi_marker=0x%04x, bytesused=%u", eoi_marker, buf->bytesused);
|
||||
return false;
|
||||
}
|
||||
_LOG_DEBUG("Got truncated JPEG frame: eoi_marker=0x%04x, bytesused=%u", eoi_marker, buf->bytesused);
|
||||
return cap->allow_truncated_frames;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -115,11 +115,11 @@ typedef struct {
|
||||
bool dma_required;
|
||||
uint desired_fps;
|
||||
uz min_frame_size;
|
||||
bool allow_truncated_frames;
|
||||
bool persistent;
|
||||
uint timeout;
|
||||
us_controls_s ctl;
|
||||
us_capture_runtime_s *run;
|
||||
bool allow_truncated_frames;
|
||||
} us_capture_s;
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user