change the callback's parameter in uvc-v4l2.cc

This commit is contained in:
KalmanSLightech 2018-05-31 16:10:55 +08:00 committed by kalman
parent 8bf0d982ea
commit 84103d91bb
2 changed files with 8 additions and 8 deletions

View File

@ -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<uint8_t>(id | 0x80), 0, 0};
if(!xu_control_query(device, xu, selector, XU_QUERY_SET, 3, query_id)) {
LOG(WARNING) << "xu_control_range query failed";

View File

@ -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<int>(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<uint8_t>(id|0x90));
*max = xu_control_range_basic(device,xu,selector,static_cast<uint8_t>(id|0xa0));
*def = xu_control_range_basic(device,xu,selector,static_cast<uint8_t>(id|0xc0));
return true;
}