libcamera v0.7.2+rpt20261009
Supporting cameras in Linux since 2019
Loading...
Searching...
No Matches
libcamera::SoftwareIsp Class Reference

Class for the Software ISP. More...

Inheritance diagram for libcamera::SoftwareIsp:
Collaboration diagram for libcamera::SoftwareIsp:

Public Member Functions

 SoftwareIsp (PipelineHandler *pipe, const CameraSensor *sensor, ControlInfoMap *ipaControls)
 Constructs SoftwareIsp object.
 
int loadConfiguration (const std::string &filename)
 Load a configuration from a file.
 
bool isValid () const
 Check the validity of Software Isp object.
 
std::vector< PixelFormat > formats (PixelFormat input)
 Get the output formats supported for the given input format.
 
SizeRange sizes (PixelFormat inputFormat, const Size &inputSize)
 Get the supported output sizes for the given input format and size.
 
std::tuple< unsigned int, unsigned int > strideAndFrameSize (const PixelFormat &outputFormat, const Size &size)
 
uint32_t preferredInputStride (const PixelFormat &inputFormat, const Size &size)
 
int configure (const StreamConfiguration &inputCfg, const std::vector< std::reference_wrapper< const StreamConfiguration > > &outputCfgs, const ipa::softisp::IPAConfigInfo &configInfo, ControlInfoMap *ipaControls)
 Configure the SoftwareIsp object according to the passed in parameters.
 
int exportBuffers (const Stream *stream, unsigned int count, std::vector< std::unique_ptr< FrameBuffer > > *buffers)
 Export the buffers from the Software ISP.
 
void processStats (const uint32_t frame, const uint32_t bufferId, const ControlList &sensorControls)
 Process the statistics gathered.
 
int start ()
 Starts the Software ISP streaming operation.
 
void stop ()
 Stops the Software ISP streaming operation.
 
void queueRequest (const uint32_t frame, const ControlList &controls)
 Queue a request and process the control list from the application.
 
int queueBuffers (uint32_t frame, FrameBuffer *input, const std::map< const Stream *, FrameBuffer * > &outputs)
 Queue buffers to Software ISP.
 
void process (uint32_t frame, FrameBuffer *input, FrameBuffer *output)
 Passes the input framebuffer to the ISP worker to process.
 
- Public Member Functions inherited from libcamera::Object
 Object (Object *parent=nullptr)
 Construct an Object instance.
 
virtual ~Object ()
 Destroy an Object instance.
 
void deleteLater ()
 Schedule deletion of the instance in the thread it belongs to.
 
void postMessage (std::unique_ptr< Message > msg)
 Post a message to the object's thread.
 
template<typename T , typename R , typename... FuncArgs, typename... Args, std::enable_if_t< std::is_base_of< Object, T >::value > * = nullptr>
R invokeMethod (R(T::*func)(FuncArgs...), ConnectionType type, Args &&... args)
 Invoke a method asynchronously on an Object instance.
 
Thread * thread () const
 Retrieve the thread the object is bound to.
 
void moveToThread (Thread *thread)
 Move the object and all its children to a different thread.
 
Object * parent () const
 Retrieve the object's parent.
 

Public Attributes

Signal< FrameBuffer * > inputBufferReady
 A signal emitted when the input frame buffer completes.
 
Signal< FrameBuffer * > outputBufferReady
 A signal emitted when the output frame buffer completes.
 
Signal< uint32_t, uint32_t > ispStatsReady
 A signal emitted when the statistics for IPA are ready.
 
Signal< uint32_t, const ControlList & > metadataReady
 A signal emitted when the metadata for IPA is ready.
 
Signal< const ControlList & > setSensorControls
 A signal emitted when the values to write to the sensor controls are ready.
 

Additional Inherited Members

- Protected Member Functions inherited from libcamera::Object
virtual void message (Message *msg)
 Message handler for the object.
 
bool assertThreadBound (const char *message)
 Check if the caller complies with thread-bound constraints.
 

Detailed Description

Class for the Software ISP.

Constructor & Destructor Documentation

◆ SoftwareIsp()

libcamera::SoftwareIsp::SoftwareIsp ( PipelineHandler *  pipe,
const CameraSensor *  sensor,
ControlInfoMap *  ipaControls 
)

Constructs SoftwareIsp object.

Parameters
[in]pipeThe pipeline handler in use
[in]sensorPointer to the CameraSensor instance owned by the pipeline handler
[out]ipaControlsThe IPA controls to update

Member Function Documentation

◆ configure()

int libcamera::SoftwareIsp::configure ( const StreamConfiguration &  inputCfg,
const std::vector< std::reference_wrapper< const StreamConfiguration > > &  outputCfgs,
const ipa::softisp::IPAConfigInfo &  configInfo,
ControlInfoMap *  ipaControls 
)

Configure the SoftwareIsp object according to the passed in parameters.

Parameters
[in]inputCfgThe input configuration
[in]outputCfgsThe output configurations
[in]configInfoThe IPA configuration data, received from the pipeline handler
[out]ipaControlsThe IPA controls to update
Returns
0 on success, a negative errno on failure

◆ exportBuffers()

int libcamera::SoftwareIsp::exportBuffers ( const Stream *  stream,
unsigned int  count,
std::vector< std::unique_ptr< FrameBuffer > > *  buffers 
)

Export the buffers from the Software ISP.

Parameters
[in]streamOutput stream exporting the buffers
[in]countNumber of buffers to allocate
[out]buffersVector to store the allocated buffers
Returns
The number of allocated buffers on success or a negative error code otherwise

◆ formats()

std::vector< PixelFormat > libcamera::SoftwareIsp::formats ( PixelFormat  inputFormat)

Get the output formats supported for the given input format.

Parameters
[in]inputFormatThe input format
Returns
All the supported output formats or an empty vector if there are none

◆ isValid()

bool libcamera::SoftwareIsp::isValid ( ) const

Check the validity of Software Isp object.

Returns
True if Software Isp is valid, false otherwise

◆ loadConfiguration()

int libcamera::SoftwareIsp::loadConfiguration ( const std::string &  filename)
inline

Load a configuration from a file.

Parameters
[in]filenameThe file to load the configuration data from

Currently is a stub doing nothing and always returning "success".

Returns
0 on success

◆ preferredInputStride()

uint32_t libcamera::SoftwareIsp::preferredInputStride ( const PixelFormat &  inputFormat,
const Size &  size 
)

Get the preferred input stride in bytes for the given input format and size

Parameters
[in]inputFormatThe input format
[in]sizeThe input size (width and height in pixels)
Returns
The preferred input stride in bytes or 0 if there is no preference

◆ process()

void libcamera::SoftwareIsp::process ( uint32_t  frame,
FrameBuffer *  input,
FrameBuffer *  output 
)

Passes the input framebuffer to the ISP worker to process.

Parameters
[in]frameThe frame number
[in]inputThe input framebuffer
[out]outputThe framebuffer to write the processed frame to

◆ processStats()

void libcamera::SoftwareIsp::processStats ( const uint32_t  frame,
const uint32_t  bufferId,
const ControlList &  sensorControls 
)

Process the statistics gathered.

Parameters
[in]frameThe frame number
[in]bufferIdID of the statistics buffer
[in]sensorControlsThe sensor controls

Requests the IPA to calculate new parameters for ISP and new control values for the sensor.

◆ queueBuffers()

int libcamera::SoftwareIsp::queueBuffers ( uint32_t  frame,
FrameBuffer *  input,
const std::map< const Stream *, FrameBuffer * > &  outputs 
)

Queue buffers to Software ISP.

Parameters
[in]frameThe frame number
[in]inputThe input framebuffer
[in]outputsThe container holding the output stream pointers and their respective frame buffer outputs
Returns
0 on success, a negative errno on failure

◆ queueRequest()

void libcamera::SoftwareIsp::queueRequest ( const uint32_t  frame,
const ControlList &  controls 
)

Queue a request and process the control list from the application.

Parameters
[in]frameThe number of the frame which will be processed next
[in]controlsThe controls for the frame

◆ sizes()

SizeRange libcamera::SoftwareIsp::sizes ( PixelFormat  inputFormat,
const Size &  inputSize 
)

Get the supported output sizes for the given input format and size.

Parameters
[in]inputFormatThe input format
[in]inputSizeThe input frame size
Returns
The valid size range or an empty range if there are none

◆ start()

int libcamera::SoftwareIsp::start ( )

Starts the Software ISP streaming operation.

Returns
0 on success, any other value indicates an error

◆ stop()

void libcamera::SoftwareIsp::stop ( )

Stops the Software ISP streaming operation.

All pending buffers are returned back as canceled before this function returns.

This function will not take any action when the ISP is not already running.

◆ strideAndFrameSize()

std::tuple< unsigned int, unsigned int > libcamera::SoftwareIsp::strideAndFrameSize ( const PixelFormat &  outputFormat,
const Size &  size 
)

Get the output stride and the frame size in bytes for the given output format and size

Parameters
[in]outputFormatThe output format
[in]sizeThe output size (width and height in pixels)
Returns
A tuple of the stride and the frame size in bytes, or a tuple of 0,0 if there is no valid output config

The documentation for this class was generated from the following files: