From fd554f9dba3171b624e584d50c7554f9c5f9cc52 Mon Sep 17 00:00:00 2001 From: Jacopo Mondi Date: Fri, 24 Apr 2020 12:01:49 +0200 Subject: libcamera: ipa: Add support for CameraSensorInfo Add support for camera sensor information in the libcamera IPA protocol. Define a new 'struct ipa_sensor_info' structure in the IPA context and use it to perform translation between the C and the C++ API. Update the IPAInterface::configure() operation to accept a new CameraSensorInfo parameter and port all users of that function to the new interface. Signed-off-by: Jacopo Mondi --- include/ipa/ipa_interface.h | 27 ++++++++++++++++++++++++++- 1 file changed, 26 insertions(+), 1 deletion(-) (limited to 'include') diff --git a/include/ipa/ipa_interface.h b/include/ipa/ipa_interface.h index ef3d6507..a2d5e3dd 100644 --- a/include/ipa/ipa_interface.h +++ b/include/ipa/ipa_interface.h @@ -22,6 +22,27 @@ struct ipa_settings { const char *configuration_file; }; +struct ipa_sensor_info { + const char *model; + uint8_t bits_per_pixel; + struct { + uint32_t width; + uint32_t height; + } active_area; + struct { + int32_t left; + int32_t top; + uint32_t width; + uint32_t height; + } analog_crop; + struct { + uint32_t width; + uint32_t height; + } output_size; + uint64_t pixel_rate; + uint32_t line_length; +}; + struct ipa_stream { unsigned int id; unsigned int pixel_format; @@ -75,6 +96,7 @@ struct ipa_context_ops { const struct ipa_callback_ops *callbacks, void *cb_ctx); void (*configure)(struct ipa_context *ctx, + const struct ipa_sensor_info *sensor_info, const struct ipa_stream *streams, unsigned int num_streams, const struct ipa_control_info_map *maps, @@ -125,6 +147,8 @@ struct IPAOperationData { std::vector controls; }; +struct CameraSensorInfo; + class IPAInterface { public: @@ -134,7 +158,8 @@ public: virtual int start() = 0; virtual void stop() = 0; - virtual void configure(const std::map &streamConfig, + virtual void configure(const CameraSensorInfo &sensorInfo, + const std::map &streamConfig, const std::map &entityControls) = 0; virtual void mapBuffers(const std::vector &buffers) = 0; -- cgit v1.2.1