diff options
Diffstat (limited to 'include')
25 files changed, 70 insertions, 38 deletions
diff --git a/include/libcamera/base/compiler.h b/include/libcamera/base/compiler.h deleted file mode 100644 index fda8fdfd..00000000 --- a/include/libcamera/base/compiler.h +++ /dev/null @@ -1,14 +0,0 @@ -/* SPDX-License-Identifier: LGPL-2.1-or-later */ -/* - * Copyright (C) 2021, Google Inc. - * - * Compiler support - */ - -#pragma once - -#if __cplusplus >= 201703L -#define __nodiscard [[nodiscard]] -#else -#define __nodiscard -#endif diff --git a/include/libcamera/base/meson.build b/include/libcamera/base/meson.build index 2a0cee31..f28ae4d4 100644 --- a/include/libcamera/base/meson.build +++ b/include/libcamera/base/meson.build @@ -5,7 +5,6 @@ libcamera_base_include_dir = libcamera_include_dir / 'base' libcamera_base_public_headers = files([ 'bound_method.h', 'class.h', - 'compiler.h', 'flags.h', 'object.h', 'shared_fd.h', diff --git a/include/libcamera/base/unique_fd.h b/include/libcamera/base/unique_fd.h index c9a3b5d0..3066bf28 100644 --- a/include/libcamera/base/unique_fd.h +++ b/include/libcamera/base/unique_fd.h @@ -10,7 +10,6 @@ #include <utility> #include <libcamera/base/class.h> -#include <libcamera/base/compiler.h> namespace libcamera { @@ -43,7 +42,7 @@ public: return *this; } - __nodiscard int release() + [[nodiscard]] int release() { int fd = fd_; fd_ = -1; diff --git a/include/libcamera/base/utils.h b/include/libcamera/base/utils.h index 780aeda6..8d5c3578 100644 --- a/include/libcamera/base/utils.h +++ b/include/libcamera/base/utils.h @@ -13,6 +13,7 @@ #include <iterator> #include <ostream> #include <sstream> +#include <stdint.h> #include <string.h> #include <string> #include <sys/time.h> diff --git a/include/libcamera/geometry.h b/include/libcamera/geometry.h index e5f0a843..f322e3d5 100644 --- a/include/libcamera/geometry.h +++ b/include/libcamera/geometry.h @@ -11,8 +11,6 @@ #include <ostream> #include <string> -#include <libcamera/base/compiler.h> - namespace libcamera { class Rectangle; @@ -110,8 +108,8 @@ public: return *this; } - __nodiscard constexpr Size alignedDownTo(unsigned int hAlignment, - unsigned int vAlignment) const + [[nodiscard]] constexpr Size alignedDownTo(unsigned int hAlignment, + unsigned int vAlignment) const { return { width / hAlignment * hAlignment, @@ -119,8 +117,8 @@ public: }; } - __nodiscard constexpr Size alignedUpTo(unsigned int hAlignment, - unsigned int vAlignment) const + [[nodiscard]] constexpr Size alignedUpTo(unsigned int hAlignment, + unsigned int vAlignment) const { return { (width + hAlignment - 1) / hAlignment * hAlignment, @@ -128,7 +126,7 @@ public: }; } - __nodiscard constexpr Size boundedTo(const Size &bound) const + [[nodiscard]] constexpr Size boundedTo(const Size &bound) const { return { std::min(width, bound.width), @@ -136,7 +134,7 @@ public: }; } - __nodiscard constexpr Size expandedTo(const Size &expand) const + [[nodiscard]] constexpr Size expandedTo(const Size &expand) const { return { std::max(width, expand.width), @@ -144,7 +142,7 @@ public: }; } - __nodiscard constexpr Size grownBy(const Size &margins) const + [[nodiscard]] constexpr Size grownBy(const Size &margins) const { return { width + margins.width, @@ -152,7 +150,7 @@ public: }; } - __nodiscard constexpr Size shrunkBy(const Size &margins) const + [[nodiscard]] constexpr Size shrunkBy(const Size &margins) const { return { width > margins.width ? width - margins.width : 0, @@ -160,10 +158,10 @@ public: }; } - __nodiscard Size boundedToAspectRatio(const Size &ratio) const; - __nodiscard Size expandedToAspectRatio(const Size &ratio) const; + [[nodiscard]] Size boundedToAspectRatio(const Size &ratio) const; + [[nodiscard]] Size expandedToAspectRatio(const Size &ratio) const; - __nodiscard Rectangle centeredTo(const Point ¢er) const; + [[nodiscard]] Rectangle centeredTo(const Point ¢er) const; Size operator*(float factor) const; Size operator/(float factor) const; @@ -294,11 +292,11 @@ public: Rectangle &scaleBy(const Size &numerator, const Size &denominator); Rectangle &translateBy(const Point &point); - __nodiscard Rectangle boundedTo(const Rectangle &bound) const; - __nodiscard Rectangle enclosedIn(const Rectangle &boundary) const; - __nodiscard Rectangle scaledBy(const Size &numerator, - const Size &denominator) const; - __nodiscard Rectangle translatedBy(const Point &point) const; + [[nodiscard]] Rectangle boundedTo(const Rectangle &bound) const; + [[nodiscard]] Rectangle enclosedIn(const Rectangle &boundary) const; + [[nodiscard]] Rectangle scaledBy(const Size &numerator, + const Size &denominator) const; + [[nodiscard]] Rectangle translatedBy(const Point &point) const; Rectangle transformedBetween(const Rectangle &source, const Rectangle &target) const; diff --git a/include/libcamera/internal/camera.h b/include/libcamera/internal/camera.h index 2bb00bbc..18f5c32a 100644 --- a/include/libcamera/internal/camera.h +++ b/include/libcamera/internal/camera.h @@ -11,6 +11,7 @@ #include <list> #include <memory> #include <set> +#include <stdint.h> #include <string> #include <libcamera/base/class.h> diff --git a/include/libcamera/internal/camera_lens.h b/include/libcamera/internal/camera_lens.h index 5a4b993b..f347c5e0 100644 --- a/include/libcamera/internal/camera_lens.h +++ b/include/libcamera/internal/camera_lens.h @@ -7,6 +7,7 @@ #pragma once #include <memory> +#include <stdint.h> #include <string> #include <libcamera/base/class.h> diff --git a/include/libcamera/internal/camera_sensor.h b/include/libcamera/internal/camera_sensor.h index 605ea813..13048f32 100644 --- a/include/libcamera/internal/camera_sensor.h +++ b/include/libcamera/internal/camera_sensor.h @@ -8,6 +8,7 @@ #pragma once #include <memory> +#include <stdint.h> #include <string> #include <variant> #include <vector> @@ -62,6 +63,11 @@ public: Transform transform = Transform::Identity, V4L2SubdeviceFormat *sensorFormat = nullptr) = 0; + virtual V4L2Subdevice::Stream imageStream() const; + virtual std::optional<V4L2Subdevice::Stream> embeddedDataStream() const; + virtual V4L2SubdeviceFormat embeddedDataFormat() const; + virtual int setEmbeddedDataEnabled(bool enable); + virtual const ControlList &properties() const = 0; virtual int sensorInfo(IPACameraSensorInfo *info) const = 0; virtual Transform computeTransform(Orientation *orientation) const = 0; diff --git a/include/libcamera/internal/dma_buf_allocator.h b/include/libcamera/internal/dma_buf_allocator.h index fc5de2c1..13600915 100644 --- a/include/libcamera/internal/dma_buf_allocator.h +++ b/include/libcamera/internal/dma_buf_allocator.h @@ -8,6 +8,7 @@ #pragma once #include <memory> +#include <stdint.h> #include <string> #include <vector> @@ -60,9 +61,14 @@ public: explicit DmaSyncer(SharedFD fd, SyncType type = SyncType::ReadWrite); + DmaSyncer(DmaSyncer &&other) = default; + DmaSyncer &operator=(DmaSyncer &&other) = default; + ~DmaSyncer(); private: + LIBCAMERA_DISABLE_COPY(DmaSyncer) + void sync(uint64_t step); SharedFD fd_; diff --git a/include/libcamera/internal/framebuffer.h b/include/libcamera/internal/framebuffer.h index e6698a45..97b49d42 100644 --- a/include/libcamera/internal/framebuffer.h +++ b/include/libcamera/internal/framebuffer.h @@ -8,6 +8,7 @@ #pragma once #include <memory> +#include <stdint.h> #include <utility> #include <libcamera/base/class.h> diff --git a/include/libcamera/internal/ipa_data_serializer.h b/include/libcamera/internal/ipa_data_serializer.h index 66d9a19f..b4614f21 100644 --- a/include/libcamera/internal/ipa_data_serializer.h +++ b/include/libcamera/internal/ipa_data_serializer.h @@ -7,6 +7,7 @@ #pragma once +#include <stdint.h> #include <string.h> #include <tuple> #include <type_traits> diff --git a/include/libcamera/internal/ipc_pipe.h b/include/libcamera/internal/ipc_pipe.h index a4560752..418c4622 100644 --- a/include/libcamera/internal/ipc_pipe.h +++ b/include/libcamera/internal/ipc_pipe.h @@ -7,6 +7,7 @@ #pragma once +#include <stdint.h> #include <vector> #include <libcamera/base/shared_fd.h> diff --git a/include/libcamera/internal/ipc_pipe_unixsocket.h b/include/libcamera/internal/ipc_pipe_unixsocket.h index 8c972613..84512809 100644 --- a/include/libcamera/internal/ipc_pipe_unixsocket.h +++ b/include/libcamera/internal/ipc_pipe_unixsocket.h @@ -9,6 +9,7 @@ #include <map> #include <memory> +#include <stdint.h> #include "libcamera/internal/ipc_pipe.h" #include "libcamera/internal/ipc_unixsocket.h" diff --git a/include/libcamera/internal/pipeline_handler.h b/include/libcamera/internal/pipeline_handler.h index fb28a18d..972a2fa6 100644 --- a/include/libcamera/internal/pipeline_handler.h +++ b/include/libcamera/internal/pipeline_handler.h @@ -63,7 +63,8 @@ public: void cancelRequest(Request *request); std::string configurationFile(const std::string &subdir, - const std::string &name) const; + const std::string &name, + bool silent = false) const; const char *name() const { return name_; } diff --git a/include/libcamera/internal/request.h b/include/libcamera/internal/request.h index 4e7d05b1..73e9bb5c 100644 --- a/include/libcamera/internal/request.h +++ b/include/libcamera/internal/request.h @@ -10,6 +10,7 @@ #include <chrono> #include <map> #include <memory> +#include <stdint.h> #include <unordered_set> #include <libcamera/base/event_notifier.h> diff --git a/include/libcamera/internal/software_isp/software_isp.h b/include/libcamera/internal/software_isp/software_isp.h index d51b03fd..440a296d 100644 --- a/include/libcamera/internal/software_isp/software_isp.h +++ b/include/libcamera/internal/software_isp/software_isp.h @@ -18,6 +18,7 @@ #include <libcamera/base/class.h> #include <libcamera/base/log.h> +#include <libcamera/base/object.h> #include <libcamera/base/signal.h> #include <libcamera/base/thread.h> @@ -43,7 +44,7 @@ struct StreamConfiguration; LOG_DECLARE_CATEGORY(SoftwareIsp) -class SoftwareIsp +class SoftwareIsp : public Object { public: SoftwareIsp(PipelineHandler *pipe, const CameraSensor *sensor, diff --git a/include/libcamera/internal/tracepoints/request.tp b/include/libcamera/internal/tracepoints/request.tp index 4f367e91..42c59685 100644 --- a/include/libcamera/internal/tracepoints/request.tp +++ b/include/libcamera/internal/tracepoints/request.tp @@ -5,6 +5,8 @@ * request.tp - Tracepoints for the request object */ +#include <stdint.h> + #include <libcamera/framebuffer.h> #include "libcamera/internal/request.h" diff --git a/include/libcamera/internal/v4l2_device.h b/include/libcamera/internal/v4l2_device.h index f5aa5024..affe52c2 100644 --- a/include/libcamera/internal/v4l2_device.h +++ b/include/libcamera/internal/v4l2_device.h @@ -10,6 +10,7 @@ #include <map> #include <memory> #include <optional> +#include <stdint.h> #include <vector> #include <linux/videodev2.h> diff --git a/include/libcamera/internal/v4l2_pixelformat.h b/include/libcamera/internal/v4l2_pixelformat.h index c836346b..543eb21b 100644 --- a/include/libcamera/internal/v4l2_pixelformat.h +++ b/include/libcamera/internal/v4l2_pixelformat.h @@ -49,6 +49,8 @@ public: static const std::vector<V4L2PixelFormat> & fromPixelFormat(const PixelFormat &pixelFormat); + bool isGenericLineBasedMetadata() const; + private: uint32_t fourcc_; }; diff --git a/include/libcamera/internal/v4l2_subdevice.h b/include/libcamera/internal/v4l2_subdevice.h index 194382f8..fa2a4a21 100644 --- a/include/libcamera/internal/v4l2_subdevice.h +++ b/include/libcamera/internal/v4l2_subdevice.h @@ -10,6 +10,7 @@ #include <memory> #include <optional> #include <ostream> +#include <stdint.h> #include <string> #include <vector> diff --git a/include/linux/README b/include/linux/README index ef178681..f9f68641 100644 --- a/include/linux/README +++ b/include/linux/README @@ -1,4 +1,4 @@ # SPDX-License-Identifier: CC0-1.0 -Files in this directory are imported from next-media-rkisp1-20240814-14-ga043ea54bbb9 of the Linux kernel. Do not +Files in this directory are imported from v6.13-rc1-68-gf9bbbd9a696d of the Linux kernel. Do not modify them manually. diff --git a/include/linux/media-bus-format.h b/include/linux/media-bus-format.h index b6acf8c8..bf467168 100644 --- a/include/linux/media-bus-format.h +++ b/include/linux/media-bus-format.h @@ -188,4 +188,8 @@ #define MEDIA_BUS_FMT_META_20 0x8006 #define MEDIA_BUS_FMT_META_24 0x8007 +/* Specific metadata formats. Next is 0x9003. */ +#define MEDIA_BUS_FMT_CCS_EMBEDDED 0x9001 +#define MEDIA_BUS_FMT_OV2740_EMBEDDED 0x9002 + #endif /* __LINUX_MEDIA_BUS_FORMAT_H */ diff --git a/include/linux/media.h b/include/linux/media.h index b5a77bbf..4a733b9b 100644 --- a/include/linux/media.h +++ b/include/linux/media.h @@ -206,6 +206,7 @@ struct media_entity_desc { #define MEDIA_PAD_FL_SINK (1U << 0) #define MEDIA_PAD_FL_SOURCE (1U << 1) #define MEDIA_PAD_FL_MUST_CONNECT (1U << 2) +#define MEDIA_PAD_FL_INTERNAL (1U << 3) struct media_pad_desc { __u32 entity; /* entity ID */ diff --git a/include/linux/v4l2-subdev.h b/include/linux/v4l2-subdev.h index 2347e266..839b1329 100644 --- a/include/linux/v4l2-subdev.h +++ b/include/linux/v4l2-subdev.h @@ -204,6 +204,11 @@ struct v4l2_subdev_capability { * on a video node. */ #define V4L2_SUBDEV_ROUTE_FL_ACTIVE (1U << 0) +/* + * Is the route immutable? The ACTIVE flag of an immutable route may not be + * unset. + */ +#define V4L2_SUBDEV_ROUTE_FL_IMMUTABLE (1U << 1) /** * struct v4l2_subdev_route - A route inside a subdev diff --git a/include/linux/videodev2.h b/include/linux/videodev2.h index d2653b2e..317d063a 100644 --- a/include/linux/videodev2.h +++ b/include/linux/videodev2.h @@ -843,6 +843,18 @@ struct v4l2_pix_format { #define V4L2_META_FMT_MALI_C55_PARAMS v4l2_fourcc('C', '5', '5', 'P') /* ARM Mali-C55 Parameters */ #define V4L2_META_FMT_MALI_C55_3A_STATS v4l2_fourcc('C', '5', '5', 'S') /* ARM Mali-C55 3A Statistics */ +/* + * Line-based metadata formats. Remember to update v4l_fill_fmtdesc() when + * adding new ones! + */ +#define V4L2_META_FMT_GENERIC_8 v4l2_fourcc('M', 'E', 'T', '8') /* Generic 8-bit metadata */ +#define V4L2_META_FMT_GENERIC_CSI2_10 v4l2_fourcc('M', 'C', '1', 'A') /* 10-bit CSI-2 packed 8-bit metadata */ +#define V4L2_META_FMT_GENERIC_CSI2_12 v4l2_fourcc('M', 'C', '1', 'C') /* 12-bit CSI-2 packed 8-bit metadata */ +#define V4L2_META_FMT_GENERIC_CSI2_14 v4l2_fourcc('M', 'C', '1', 'E') /* 14-bit CSI-2 packed 8-bit metadata */ +#define V4L2_META_FMT_GENERIC_CSI2_16 v4l2_fourcc('M', 'C', '1', 'G') /* 16-bit CSI-2 packed 8-bit metadata */ +#define V4L2_META_FMT_GENERIC_CSI2_20 v4l2_fourcc('M', 'C', '1', 'K') /* 20-bit CSI-2 packed 8-bit metadata */ +#define V4L2_META_FMT_GENERIC_CSI2_24 v4l2_fourcc('M', 'C', '1', 'O') /* 24-bit CSI-2 packed 8-bit metadata */ + /* priv field value to indicates that subsequent fields are valid. */ #define V4L2_PIX_FMT_PRIV_MAGIC 0xfeedcafe |