|
libcamera v0.7.0+1-4ceceb68
Supporting cameras in Linux since 2019
|
A converter module for the dw100 dewarper. More...

Public Member Functions | |
| int | init (const YamlObject ¶ms) |
| Initialize the module with configuration data. | |
| int | configure (const StreamConfiguration &inputCfg, const std::vector< std::reference_wrapper< StreamConfiguration > > &outputCfg) |
| Configure a set of output stream conversion from an input stream. | |
| bool | isConfigured (const Stream *stream) const |
| Check if a given stream is configured. | |
| Size | adjustInputSize (const PixelFormat &pixFmt, const Size &size, Converter::Alignment align=Converter::Alignment::Down) |
| Adjust the converter input size to a valid value. | |
| Size | adjustOutputSize (const PixelFormat &pixFmt, const Size &size, Converter::Alignment align=Converter::Alignment::Down) |
| Adjust the converter output size to a valid value. | |
| int | exportBuffers (const Stream *stream, unsigned int count, std::vector< std::unique_ptr< FrameBuffer > > *buffers) |
| Export buffers from the converter device. | |
| int | validateOutput (StreamConfiguration *cfg, bool *adjusted, Converter::Alignment align=Converter::Alignment::Down) |
| Validate and possibily adjust cfg to a valid converter output. | |
| int | queueBuffers (FrameBuffer *input, const std::map< const Stream *, FrameBuffer * > &outputs) |
| Queue buffers to converter device. | |
| int | start () |
| Start the converter streaming operation. | |
| void | stop () |
| Stop the converter streaming operation. | |
| void | updateControlInfos (const Stream *stream, ControlInfoMap::Map &infos) |
| Update the controls. | |
| void | setControls (const Stream *stream, const ControlList &controls) |
| Set libcamera controls. | |
| void | populateMetadata (const Stream *stream, ControlList &meta) |
| Retrieve updated metadata. | |
| void | setSensorCrop (const Rectangle &rect) |
| Set sensor crop rectangle. | |
| void | setTransform (const Stream *stream, const Transform &transform) |
| Set transform. | |
Static Public Member Functions | |
| static std::unique_ptr< ConverterDW100Module > | createModule (DeviceEnumerator *enumerator) |
| Create a ConverterDW100Module. | |
Public Attributes | |
| Signal< FrameBuffer * > | inputBufferReady |
| A signal emitted when the input frame buffer completes. | |
| Signal< FrameBuffer * > | outputBufferReady |
| A signal emitted on each frame buffer completion of the output queue. | |
A converter module for the dw100 dewarper.
This class implements a converter module with direct support for libcamera controls. Functionality wise it closely resembles the libcamera::Converter interface. The main difference is that V4L2 requests are handled internally and it has direct support for libcamera controls.
| Size libcamera::ConverterDW100Module::adjustInputSize | ( | const PixelFormat & | pixFmt, |
| const Size & | size, | ||
| Converter::Alignment | align = Converter::Alignment::Down |
||
| ) |
Adjust the converter input size to a valid value.
| [in] | pixFmt | The pixel format of the converter input stream |
| [in] | size | The converter input size to adjust to a valid value |
| [in] | align | The desired alignment |
| Size libcamera::ConverterDW100Module::adjustOutputSize | ( | const PixelFormat & | pixFmt, |
| const Size & | size, | ||
| Converter::Alignment | align = Converter::Alignment::Down |
||
| ) |
Adjust the converter output size to a valid value.
| [in] | pixFmt | The pixel format of the converter output stream |
| [in] | size | The converter output size to adjust to a valid value |
| [in] | align | The desired alignment |
| int libcamera::ConverterDW100Module::configure | ( | const StreamConfiguration & | inputCfg, |
| const std::vector< std::reference_wrapper< StreamConfiguration > > & | outputCfgs | ||
| ) |
Configure a set of output stream conversion from an input stream.
| [in] | inputCfg | Input stream configuration |
| [out] | outputCfgs | A list of output stream configurations |
|
static |
Create a ConverterDW100Module.
| [in] | enumerator | The enumerator |
Static factory function that searches for the dw100 device using the provided enumerator. If found, a ConverterDW100Module is instantiated and returned.
| int libcamera::ConverterDW100Module::exportBuffers | ( | const Stream * | stream, |
| unsigned int | count, | ||
| std::vector< std::unique_ptr< FrameBuffer > > * | buffers | ||
| ) |
Export buffers from the converter device.
| [in] | stream | Output stream pointer exporting the buffers |
| [in] | count | Number of buffers to allocate |
| [out] | buffers | Vector to store allocated buffers |
This function operates similarly to V4L2VideoDevice::exportBuffers() on the output stream indicated by the output.
| int libcamera::ConverterDW100Module::init | ( | const YamlObject & | params | ) |
Initialize the module with configuration data.
| [in] | params | The config parameters |
This function shall be called from the pipeline handler to initialize the module with the provided parameters.
A typical tuning file entry for the dewarper looks like this:
The cm and coefficients parameters are documented in Dw100VertexMap::setDewarpParams()
| bool libcamera::ConverterDW100Module::isConfigured | ( | const Stream * | stream | ) | const |
Check if a given stream is configured.
| [in] | stream | The output stream |
| void libcamera::ConverterDW100Module::populateMetadata | ( | const Stream * | stream, |
| ControlList & | meta | ||
| ) |
Retrieve updated metadata.
| [in] | stream | The stream |
| [in] | meta | The metadata list |
This function retrieves the metadata for the provided stream and writes it to list. It shall be called after queueBuffers().
| int libcamera::ConverterDW100Module::queueBuffers | ( | FrameBuffer * | input, |
| const std::map< const Stream *, FrameBuffer * > & | outputs | ||
| ) |
Queue buffers to converter device.
| [in] | input | The frame buffer to apply the conversion |
| [out] | outputs | The container holding the output stream pointers and their respective frame buffer outputs. |
This function queues the input frame buffer and the output frame buffers contained in outputs to the device for processing.
Controls are automatically applied to the device before queuing buffers. V4L2 requests are used to atomically apply the controls if the kernel supports it.
| void libcamera::ConverterDW100Module::setControls | ( | const Stream * | stream, |
| const ControlList & | controls | ||
| ) |
Set libcamera controls.
| [in] | stream | The stream to update |
| [in] | controls | The controls |
Looks up all supported controls in controls and sets them on stream stream. The controls will be applied to the device on the next call to queueBuffers().
| void libcamera::ConverterDW100Module::setSensorCrop | ( | const Rectangle & | rect | ) |
Set sensor crop rectangle.
| [in] | rect | The crop rectangle |
Set the sensor crop rectangle to rect. This rectangle describes the area covered by the input buffers in sensor coordinates. It is used internally to handle the ScalerCrop control and related metadata.
| void libcamera::ConverterDW100Module::setTransform | ( | const Stream * | stream, |
| const Transform & | transform | ||
| ) |
Set transform.
| [in] | stream | The stream |
| [in] | transform | The transform |
Set the transform that shall be applied by the dewarper on the given stream. As orientation is a property of libcamera::CameraConfiguration, the transform needs to be set at configure time.
| int libcamera::ConverterDW100Module::start | ( | ) |
Start the converter streaming operation.
| void libcamera::ConverterDW100Module::stop | ( | ) |
Stop the converter streaming operation.
| void libcamera::ConverterDW100Module::updateControlInfos | ( | const Stream * | stream, |
| ControlInfoMap::Map & | controls | ||
| ) |
Update the controls.
| [in] | stream | The stream |
| [in,out] | controls | The controls info map to update |
Updated the controls map with all the controls and limits provided by this class.
| int libcamera::ConverterDW100Module::validateOutput | ( | StreamConfiguration * | cfg, |
| bool * | adjusted, | ||
| Converter::Alignment | align = Converter::Alignment::Down |
||
| ) |
Validate and possibily adjust cfg to a valid converter output.
| [in,out] | cfg | The StreamConfiguration to validate and adjust |
| [out] | adjusted | Set to true if cfg has been adjusted |
| [in] | align | The desired alignment |