libcamera
v0.0.0
Supporting cameras in Linux since 2019
|
Wrap an ipa_context and expose it as an IPAInterface. More...
Public Member Functions | |
IPAContextWrapper (struct ipa_context *context) | |
Construct an IPAContextWrapper instance that wraps the context. More... | |
int | init (const IPASettings &settings) override |
Initialise the IPAInterface. More... | |
int | start () override |
Start the IPA. More... | |
void | stop () override |
Stop the IPA. More... | |
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. More... | |
void | mapBuffers (const std::vector< IPABuffer > &buffers) override |
Map buffers shared between the pipeline handler and the IPA. More... | |
void | unmapBuffers (const std::vector< unsigned int > &ids) override |
Unmap buffers shared by the pipeline to the IPA. More... | |
virtual void | processEvent (const IPAOperationData &data) override |
Process an event from the pipeline handler. More... | |
Additional Inherited Members | |
![]() | |
Signal< unsigned int, const IPAOperationData & > | queueFrameAction |
Queue an action associated with a frame to the pipeline handler. More... | |
Wrap an ipa_context and expose it as an IPAInterface.
The IPAContextWrapper class wraps an ipa_context, provided by an IPA module, and exposes an IPAInterface. This mechanism is used for IPAs that are not isolated in a separate process to allow direct calls from pipeline handler using the IPAInterface API instead of the lower-level ipa_context API.
The IPAInterface methods are converted to the ipa_context API by translating all C++ arguments into plain C structures or byte arrays that contain no pointer, as required by the ipa_context API.
libcamera::IPAContextWrapper::IPAContextWrapper | ( | struct ipa_context * | context | ) |
Construct an IPAContextWrapper instance that wraps the context.
[in] | context | The IPA module context |
Ownership of the context is passed to the IPAContextWrapper. The context remains valid for the whole lifetime of the wrapper and is destroyed automatically with it.
|
overridevirtual |
Configure the IPA stream and sensor settings.
[in] | sensorInfo | Camera sensor information |
[in] | streamConfig | Configuration of all active streams |
[in] | entityControls | Controls provided by the pipeline entities |
This method shall be called when the camera is started to inform the IPA of the camera's streams and the sensor settings. The meaning of the numerical keys in the streamConfig and entityControls maps is defined by the IPA protocol.
The sensorInfo conveys information about the camera sensor settings that the pipeline handler has selected for the configuration. The IPA may use that information to tune its algorithms.
Implements libcamera::IPAInterface.
|
overridevirtual |
Initialise the IPAInterface.
[in] | settings | The IPA initialization settings |
This function initializes the IPA interface. It shall be called before any other function of the IPAInterface. The settings carry initialization parameters that are valid for the whole life time of the IPA interface.
Implements libcamera::IPAInterface.
|
overridevirtual |
Map buffers shared between the pipeline handler and the IPA.
[in] | buffers | List of buffers to map |
This method informs the IPA module of memory buffers set up by the pipeline handler that the IPA needs to access. It provides dmabuf file handles for each buffer, and associates the buffers with unique numerical IDs.
IPAs shall map the dmabuf file handles to their address space and keep a cache of the mappings, indexed by the buffer numerical IDs. The IDs are used in all other IPA interface methods to refer to buffers, including the unmapBuffers() method.
All buffers that the pipeline handler wishes to share with an IPA shall be mapped with this method. Buffers may be mapped all at once with a single call, or mapped and unmapped dynamically at runtime, depending on the IPA protocol. Regardless of the protocol, all buffers mapped at a given time shall have unique numerical IDs.
The numerical IDs have no meaning defined by the IPA interface, and IPA protocols shall not give them any specific meaning either. They should be treated as opaque handles by IPAs, with the only exception that ID zero is invalid.
Implements libcamera::IPAInterface.
|
overridevirtual |
Process an event from the pipeline handler.
[in] | data | IPA operation data |
This operation is used by pipeline handlers to inform the IPA module of events that occurred during the on-going capture operation.
The event notified by the pipeline handler with this method is handled by the IPA, which interprets the operation parameters according to the separately documented IPA protocol.
Implements libcamera::IPAInterface.
|
overridevirtual |
Start the IPA.
This method informs the IPA module that the camera is about to be started. The IPA module shall prepare any resources it needs to operate.
Implements libcamera::IPAInterface.
|
overridevirtual |
Stop the IPA.
This method informs the IPA module that the camera is stopped. The IPA module shall release resources prepared in start().
Implements libcamera::IPAInterface.
|
overridevirtual |
Unmap buffers shared by the pipeline to the IPA.
[in] | ids | List of buffer IDs to unmap |
This method removes mappings set up with mapBuffers(). Buffers may be unmapped all at once with a single call, or selectively at runtime, depending on the IPA protocol. Numerical IDs of unmapped buffers may be reused when mapping new buffers.
Implements libcamera::IPAInterface.