diff --git a/device/libcamera/buffer.cc b/device/libcamera/buffer.cc index 87522c6..9736d7e 100644 --- a/device/libcamera/buffer.cc +++ b/device/libcamera/buffer.cc @@ -1,3 +1,4 @@ +#ifdef USE_LIBCAMERA #include "libcamera.hh" int libcamera_buffer_open(buffer_t *buf) @@ -122,3 +123,4 @@ int libcamera_buffer_list_pollfd(buffer_list_t *buf_list, struct pollfd *pollfd, pollfd->revents = 0; return 0; } +#endif // USE_LIBCAMERA diff --git a/device/libcamera/buffer_list.cc b/device/libcamera/buffer_list.cc index 826117d..a6d93b3 100644 --- a/device/libcamera/buffer_list.cc +++ b/device/libcamera/buffer_list.cc @@ -1,3 +1,4 @@ +#ifdef USE_LIBCAMERA #include "libcamera.hh" int libcamera_buffer_list_open(buffer_list_t *buf_list, unsigned width, unsigned height, unsigned format, unsigned bytesperline, int nbufs) @@ -104,3 +105,4 @@ int libcamera_buffer_list_set_stream(buffer_list_t *buf_list, bool do_on) error: return -1; } +#endif // USE_LIBCAMERA diff --git a/device/libcamera/device.cc b/device/libcamera/device.cc index 5a620f0..e2bbc8a 100644 --- a/device/libcamera/device.cc +++ b/device/libcamera/device.cc @@ -1,3 +1,4 @@ +#ifdef USE_LIBCAMERA #include "libcamera.hh" int libcamera_device_open(device_t *dev) @@ -65,3 +66,4 @@ int libcamera_device_set_option(device_t *dev, const char *key, const char *valu { return -1; } +#endif // USE_LIBCAMERA diff --git a/device/libcamera/libcamera.cc b/device/libcamera/libcamera.cc index 053efa5..e82cf42 100644 --- a/device/libcamera/libcamera.cc +++ b/device/libcamera/libcamera.cc @@ -1,5 +1,6 @@ #include "libcamera.hh" +#ifdef USE_LIBCAMERA device_hw_t libcamera_device_hw = { .device_open = libcamera_device_open, .device_close = libcamera_device_close, @@ -23,3 +24,10 @@ extern "C" device_t *device_libcamera_open(const char *name, const char *path) { return device_open(name, path, &libcamera_device_hw); } +#else // USE_LIBCAMERA +extern "C" device_t *device_libcamera_open(const char *name, const char *path) +{ + E_LOG_INFO(NULL, "libcamera is not supported"); + return NULL; +} +#endif // USE_LIBCAMERA diff --git a/device/libcamera/libcamera.hh b/device/libcamera/libcamera.hh index 460dcff..75e3ddf 100644 --- a/device/libcamera/libcamera.hh +++ b/device/libcamera/libcamera.hh @@ -14,6 +14,7 @@ extern "C" { #include "opts/fourcc.h" }; +#ifdef USE_LIBCAMERA #include #include @@ -69,3 +70,4 @@ int libcamera_buffer_list_pollfd(buffer_list_t *buf_list, struct pollfd *pollfd, int libcamera_buffer_list_open(buffer_list_t *buf_list, unsigned width, unsigned height, unsigned format, unsigned bytesperline, int nbufs); void libcamera_buffer_list_close(buffer_list_t *buf_list); int libcamera_buffer_list_set_stream(buffer_list_t *buf_list, bool do_on); +#endif // USE_LIBCAMERA