diff --git a/device/libcamera/buffer.cc b/device/libcamera/buffer.cc index bf23b93..44678c6 100644 --- a/device/libcamera/buffer.cc +++ b/device/libcamera/buffer.cc @@ -1,6 +1,8 @@ #ifdef USE_LIBCAMERA #include "libcamera.hh" +#include + int libcamera_buffer_open(buffer_t *buf) { buf->libcamera = new buffer_libcamera_t{}; @@ -37,7 +39,7 @@ int libcamera_buffer_open(buffer_t *buf) } if (offset + length != plane.offset) { - LOG_ERROR(buf, "Plane is not continuous: offset=%u, expected=%lu", plane.offset, offset + length); + LOG_ERROR(buf, "Plane is not continuous: offset=%u, expected=%" PRIu64, plane.offset, offset + length); } length += plane.length; @@ -51,7 +53,7 @@ int libcamera_buffer_open(buffer_t *buf) buf->dma_fd = dma_fd.get(); buf->length = length; - LOG_DEBUG(buf, "Mapped buffer: start=%p, length=%zu, fd=%d, planes=%lu", + LOG_DEBUG(buf, "Mapped buffer: start=%p, length=%zu, fd=%d, planes=%zu", buf->start, buf->length, buf->dma_fd, buffer->planes().size()); } diff --git a/device/libcamera/device.cc b/device/libcamera/device.cc index 0d6acea..667f38d 100644 --- a/device/libcamera/device.cc +++ b/device/libcamera/device.cc @@ -7,6 +7,11 @@ std::string libcamera_device_option_normalize(std::string key) return key; } +libcamera::ControlInfoMap libcamera_control_list(device_t *dev) +{ + return dev->libcamera->camera->controls(); +} + int libcamera_device_open(device_t *dev) { dev->libcamera = new device_libcamera_t{}; @@ -35,7 +40,7 @@ int libcamera_device_open(device_t *dev) LOG_INFO(dev, "Device path=%s opened", dev->path); - for (auto const &control : dev->libcamera->camera->controls()) { + for (auto const &control : libcamera_control_list(dev)) { if (!control.first) continue; @@ -74,7 +79,7 @@ int libcamera_device_set_option(device_t *dev, const char *keyp, const char *val { auto key = libcamera_device_option_normalize(keyp); - for (auto const &control : dev->libcamera->camera->controls()) { + for (auto const &control : libcamera_control_list(dev)) { if (!control.first) continue;