verbose on-screen error messages

This commit is contained in:
Maxim Devaev
2025-05-26 20:06:06 +03:00
parent 5b18e29555
commit aec8431024
3 changed files with 30 additions and 6 deletions

View File

@@ -193,6 +193,12 @@ int us_capture_open(us_capture_s *cap) {
_LOG_DEBUG("Capture device fd=%d opened", run->fd);
if (cap->dv_timings && cap->persistent) {
struct v4l2_control ctl = {.id = V4L2_CID_DV_RX_POWER_PRESENT};
if (!us_xioctl(run->fd, VIDIOC_G_CTRL, &ctl)) {
if (!ctl.value) {
goto error_no_cable;
}
}
_LOG_DEBUG("Probing DV-timings or QuerySTD ...");
if (_capture_open_dv_timings(cap, false) < 0) {
US_ONCE_FOR(run->open_error_once, __LINE__, {
@@ -248,6 +254,10 @@ error_no_device:
us_capture_close(cap);
return US_ERROR_NO_DEVICE;
error_no_cable:
us_capture_close(cap);
return US_ERROR_NO_CABLE;
error_no_signal:
us_capture_close(cap);
return US_ERROR_NO_DATA;