The V4L2 M2M converter implements the converter interface based on V4L2 M2M device.
More...
|
| V4L2M2MConverter (MediaDevice *media) |
| Construct a V4L2M2MConverter instance. More...
|
|
int | loadConfiguration ([[maybe_unused]] const std::string &filename) override |
|
bool | isValid () const override |
|
std::vector< PixelFormat > | formats (PixelFormat input) override |
|
SizeRange | sizes (const Size &input) override |
| Retrieve the range of minimum and maximum output sizes for an input size. More...
|
|
std::tuple< unsigned int, unsigned int > | strideAndFrameSize (const PixelFormat &pixelFormat, const Size &size) override |
| Retrieve the output stride and frame size for an input configutation. More...
|
|
Size | adjustInputSize (const PixelFormat &pixFmt, const Size &size, Alignment align=Alignment::Down) override |
| Adjust the converter input size to a valid value. More...
|
|
Size | adjustOutputSize (const PixelFormat &pixFmt, const Size &size, Alignment align=Alignment::Down) override |
| Adjust the converter output size to a valid value. More...
|
|
int | configure (const StreamConfiguration &inputCfg, const std::vector< std::reference_wrapper< StreamConfiguration >> &outputCfg) override |
| Configure a set of output stream conversion from an input stream. More...
|
|
bool | isConfigured (const Stream *stream) const override |
| Check if a given stream is configured. More...
|
|
int | exportBuffers (const Stream *stream, unsigned int count, std::vector< std::unique_ptr< FrameBuffer >> *buffers) override |
| Export buffers from the converter device. More...
|
|
int | start () override |
| Start the converter streaming operation. More...
|
|
void | stop () override |
| Stop the converter streaming operation. More...
|
|
int | validateOutput (StreamConfiguration *cfg, bool *adjusted, Alignment align=Alignment::Down) override |
| Validate and possibily adjust cfg to a valid converter output. More...
|
|
int | queueBuffers (FrameBuffer *input, const std::map< const Stream *, FrameBuffer *> &outputs) override |
| Queue buffers to converter device. More...
|
|
int | setInputCrop (const Stream *stream, Rectangle *rect) override |
| Set the crop rectangle rect for stream. More...
|
|
std::pair< Rectangle, Rectangle > | inputCropBounds () override |
| Retrieve the crop bounds of the converter. More...
|
|
std::pair< Rectangle, Rectangle > | inputCropBounds (const Stream *stream) override |
| Retrieve the crop bounds for stream. More...
|
|
| Converter (MediaDevice *media, Features features=Feature::None) |
| Construct a Converter instance. More...
|
|
virtual int | loadConfiguration (const std::string &filename)=0 |
| Load converter configuration from file. More...
|
|
const std::string & | deviceNode () const |
| The converter device node attribute accessor. More...
|
|
Features | features () const |
| Retrieve the features supported by the converter. More...
|
|
The V4L2 M2M converter implements the converter interface based on V4L2 M2M device.
Retrieve the crop bounds for stream.
- Parameters
-
[in] | stream | The output stream |
Retrieve the minimum and maximum crop bounds for stream. The converter should support cropping (Feature::InputCrop).
The crop bounds depend on the configuration of the output stream and hence this function should be called after the stream has been configured using configure().
When called with an unconfigured stream, this function returns a pair of null rectangles.
- Returns
- A pair containing the minimum and maximum crop bound in that order
Implements libcamera::Converter.
int libcamera::V4L2M2MConverter::setInputCrop |
( |
const Stream * |
stream, |
|
|
Rectangle * |
rect |
|
) |
| |
|
overridevirtual |
Set the crop rectangle rect for stream.
- Parameters
-
[in] | stream | The output stream |
[in,out] | rect | The crop rectangle to apply and return the rectangle that is actually applied |
Set the crop rectangle rect for stream provided the converter supports cropping. The converter has the Feature::InputCrop flag in this case.
The underlying hardware can adjust the rectangle supplied by the user due to hardware constraints. The caller can inspect rect to determine the actual rectangle that has been applied by the converter, after this function returns.
- Returns
- 0 on success or a negative error code otherwise
Implements libcamera::Converter.