spa: libcamera: add libcamera version check for properties::SystemDevices

This commit is contained in:
Robert Mader 2023-07-17 16:02:04 +02:00 committed by Wim Taymans
parent 6cd29aed05
commit 5bac089229
3 changed files with 6 additions and 0 deletions

View file

@ -94,6 +94,7 @@ if get_option('spa-plugins').allowed()
libcamera_dep = dependency('libcamera', required: get_option('libcamera'))
summary({'libcamera': libcamera_dep.found()}, bool_yn: true, section: 'Backend')
cdata.set('HAVE_LIBCAMERA_SYSTEM_DEVICES', libcamera_dep.version().version_compare('>= 0.1.0'))
compress_offload_option = get_option('compress-offload')
summary({'Compress-Offload': compress_offload_option.allowed()}, bool_yn: true, section: 'Backend')

View file

@ -4,6 +4,8 @@
/* SPDX-FileCopyrightText: Copyright © 2021 Wim Taymans <wim.taymans@gmail.com> */
/* SPDX-License-Identifier: MIT */
#include "config.h"
#include <stddef.h>
#include <sys/types.h>
#include <sys/stat.h>
@ -59,10 +61,12 @@ struct impl {
static const libcamera::Span<const int64_t> cameraDevice(
const Camera *camera)
{
#ifdef HAVE_LIBCAMERA_SYSTEM_DEVICES
const ControlList &props = camera->properties();
if (auto devices = props.get(properties::SystemDevices))
return devices.value();
#endif
return {};
}

View file

@ -7,6 +7,7 @@ libcamera_sources = [
libcameralib = shared_library('spa-libcamera',
libcamera_sources,
include_directories : [ configinc ],
dependencies : [ spa_dep, libudev_dep, libcamera_dep, pthread_lib ],
install : true,
install_dir : spa_plugindir / 'libcamera')