libcamera  v0.0.0
Supporting cameras in Linux since 2019
ipa_context_wrapper.h
Go to the documentation of this file.
1 /* SPDX-License-Identifier: LGPL-2.1-or-later */
2 /*
3  * Copyright (C) 2019, Google Inc.
4  *
5  * ipa_context_wrapper.h - Image Processing Algorithm context wrapper
6  */
7 #ifndef __LIBCAMERA_INTERNAL_IPA_CONTEXT_WRAPPER_H__
8 #define __LIBCAMERA_INTERNAL_IPA_CONTEXT_WRAPPER_H__
9 
11 
13 
14 namespace libcamera {
15 
16 class IPAContextWrapper final : public IPAInterface
17 {
18 public:
19  IPAContextWrapper(struct ipa_context *context);
21 
22  int init(const IPASettings &settings) override;
23  int start() override;
24  void stop() override;
25  void configure(const CameraSensorInfo &sensorInfo,
26  const std::map<unsigned int, IPAStream> &streamConfig,
27  const std::map<unsigned int, const ControlInfoMap &> &entityControls) override;
28 
29  void mapBuffers(const std::vector<IPABuffer> &buffers) override;
30  void unmapBuffers(const std::vector<unsigned int> &ids) override;
31 
32  virtual void processEvent(const IPAOperationData &data) override;
33 
34 private:
35  static void queue_frame_action(void *ctx, unsigned int frame,
36  struct ipa_operation_data &data);
37  static const struct ipa_callback_ops callbacks_;
38 
39  void doQueueFrameAction(unsigned int frame,
40  const IPAOperationData &data);
41 
42  struct ipa_context *ctx_;
43  IPAInterface *intf_;
44 
45  ControlSerializer serializer_;
46 };
47 
48 } /* namespace libcamera */
49 
50 #endif /* __LIBCAMERA_INTERNAL_IPA_CONTEXT_WRAPPER_H__ */
Serializer and deserializer for control-related classes.
Definition: control_serializer.h:21
Wrap an ipa_context and expose it as an IPAInterface.
Definition: ipa_context_wrapper.h:17
int init(const IPASettings &settings) override
Initialise the IPAInterface.
Definition: ipa_context_wrapper.cpp:73
int start() override
Start the IPA.
Definition: ipa_context_wrapper.cpp:89
void mapBuffers(const std::vector< IPABuffer > &buffers) override
Map buffers shared between the pipeline handler and the IPA.
Definition: ipa_context_wrapper.cpp:181
void configure(const CameraSensorInfo &sensorInfo, const std::map< unsigned int, IPAStream > &streamConfig, const std::map< unsigned int, const ControlInfoMap & > &entityControls) override
Configure the IPA stream and sensor settings.
Definition: ipa_context_wrapper.cpp:111
IPAContextWrapper(struct ipa_context *context)
Construct an IPAContextWrapper instance that wraps the context.
Definition: ipa_context_wrapper.cpp:47
void unmapBuffers(const std::vector< unsigned int > &ids) override
Unmap buffers shared by the pipeline to the IPA.
Definition: ipa_context_wrapper.cpp:209
virtual void processEvent(const IPAOperationData &data) override
Process an event from the pipeline handler.
Definition: ipa_context_wrapper.cpp:220
void stop() override
Stop the IPA.
Definition: ipa_context_wrapper.cpp:100
C++ Interface for IPA implementation.
Definition: ipa_interface.h:151
Serialization and deserialization helpers for controls.
Image Processing Algorithm interface.
IPA context operations as a set of function pointers.
Definition: ipa_interface.h:83
IPA module context of execution.
Definition: ipa_interface.h:17
IPA operation data for the IPA context operations.
Definition: ipa_interface.h:75
Report the image sensor characteristics.
Definition: camera_sensor.h:27
Parameters for IPA operations.
Definition: ipa_interface.h:142
IPA interface initialization settings.
Definition: ipa_interface.h:128