diff --git a/src/uvc/uvc-v4l2.cc b/src/uvc/uvc-v4l2.cc index 11616ad..1f960a9 100755 --- a/src/uvc/uvc-v4l2.cc +++ b/src/uvc/uvc-v4l2.cc @@ -368,11 +368,11 @@ struct device { } if (callback) { - callback(buffers[buf.index].start); + callback(buffers[buf.index].start, + [buf, this]() mutable { + if(xioctl(fd, VIDIOC_QBUF, &buf) < 0) throw_error("VIDIOC_QBUF"); + }); } - - if (xioctl(fd, VIDIOC_QBUF, &buf) < 0) - LOG_ERROR(FATAL, "VIDIOC_QBUF"); } } @@ -496,7 +496,7 @@ bool xu_control_range( int32_t *min, int32_t *max, int32_t *def) { bool ret = true; std::uint8_t data[3]{}; - std::uint8_t query_id[3]{(id | 0x80), 0, 0}; + std::uint8_t query_id[3]{static_cast(id | 0x80), 0, 0}; if(!xu_control_query(device, xu, selector, XU_QUERY_SET, 3, query_id)) { LOG(WARNING) << "xu_control_range query failed"; diff --git a/src/uvc/uvc-wmf.cc b/src/uvc/uvc-wmf.cc index 29aaf6d..b7f0b48 100644 --- a/src/uvc/uvc-wmf.cc +++ b/src/uvc/uvc-wmf.cc @@ -700,9 +700,9 @@ bool xu_control_range( const device &device, const xu &xu, uint8_t selector, uint8_t id, int32_t *min, int32_t *max, int32_t *def) { VLOG_INFO << __func__ << " " << static_cast(selector); - *min = xu_control_range_basic(device,xu,selector,id|0x90); - *max = xu_control_range_basic(device,xu,selector,id|0xa0); - *def = xu_control_range_basic(device,xu,selector,id|0xc0); + *min = xu_control_range_basic(device,xu,selector,static_cast(id|0x90)); + *max = xu_control_range_basic(device,xu,selector,static_cast(id|0xa0)); + *def = xu_control_range_basic(device,xu,selector,static_cast(id|0xc0)); return true; }