Kamil Trzcinski f742c1a7fc Fix camera-vflip/hflip support on arm32v7
This adds `buffer_list_alloc_buffers` and `buffer_list_free_buffers`
to delay buffers allocation for `libcamera`.

Doing this allows to setup RAW stream afterwards.
2023-04-29 10:21:52 +02:00

36 lines
1.2 KiB
C++

#include "libcamera.hh"
#ifdef USE_LIBCAMERA
device_hw_t libcamera_device_hw = {
.device_open = libcamera_device_open,
.device_close = libcamera_device_close,
.device_dump_options = libcamera_device_dump_options,
.device_set_fps = libcamera_device_set_fps,
.device_set_rotation = libcamera_device_set_rotation,
.device_set_option = libcamera_device_set_option,
.buffer_open = libcamera_buffer_open,
.buffer_close = libcamera_buffer_close,
.buffer_enqueue = libcamera_buffer_enqueue,
.buffer_list_dequeue = libcamera_buffer_list_dequeue,
.buffer_list_pollfd = libcamera_buffer_list_pollfd,
.buffer_list_open = libcamera_buffer_list_open,
.buffer_list_close = libcamera_buffer_list_close,
.buffer_list_alloc_buffers = libcamera_buffer_list_alloc_buffers,
.buffer_list_free_buffers = libcamera_buffer_list_free_buffers,
.buffer_list_set_stream = libcamera_buffer_list_set_stream
};
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)
{
LOG_INFO(NULL, "libcamera is not supported");
return NULL;
}
#endif // USE_LIBCAMERA