libcamera: pipeline: simple: converter: Replace open() with isValid()

Simplify the SimpleConverter interface by opening the M2M device in the
constructor. The explicit call to open() is replaced by a check through
a new isValid() function, and the unused close() function is removed.

Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Tested-by: Phi-Bang Nguyen <pnguyen@baylibre.com>
Reviewed-by: Kieran Bingham <kieran.bingham@ideasonboard.com>
Reviewed-by: Paul Elder <paul.elder@ideasonboard.com>
This commit is contained in:
Laurent Pinchart
2020-12-26 23:45:04 +02:00
parent 4502635b72
commit fb8c63d69c
3 changed files with 9 additions and 18 deletions
+2 -2
View File
@@ -763,9 +763,9 @@ bool SimplePipelineHandler::match(DeviceEnumerator *enumerator)
/* Open the converter, if any. */
if (converter) {
converter_ = std::make_unique<SimpleConverter>(converter);
if (converter_->open() < 0) {
if (!converter_->isValid()) {
LOG(SimplePipeline, Warning)
<< "Failed to open converter, disabling format conversion";
<< "Failed to create converter, disabling format conversion";
converter_.reset();
} else {
converter_->bufferReady.connect(this, &SimplePipelineHandler::converterDone);