[21/27] libcamera: software_isp: debayer_egl: Make DebayerEGL the default debayer method
diff mbox series

Message ID 20250422215920.4297-22-bryan.odonoghue@linaro.org
State RFC
Headers show
Series
  • RFC: Add in a eGL based GPUISP in libcamera
Related show

Commit Message

Bryan O'Donoghue April 22, 2025, 9:59 p.m. UTC
Try the EGL debayer method, if that fails then try the CPU version
before bailing out entirely.

Signed-off-by: Bryan O'Donoghue <bryan.odonoghue@linaro.org>
---
 src/libcamera/software_isp/software_isp.cpp | 13 ++++++++++++-
 1 file changed, 12 insertions(+), 1 deletion(-)

Patch
diff mbox series

diff --git a/src/libcamera/software_isp/software_isp.cpp b/src/libcamera/software_isp/software_isp.cpp
index c3dc21de..e4c7fda1 100644
--- a/src/libcamera/software_isp/software_isp.cpp
+++ b/src/libcamera/software_isp/software_isp.cpp
@@ -25,6 +25,7 @@ 
 #include "libcamera/internal/software_isp/debayer_params.h"
 
 #include "debayer_cpu.h"
+#include "debayer_egl.h"
 
 /**
  * \file software_isp.cpp
@@ -114,7 +115,17 @@  SoftwareIsp::SoftwareIsp(PipelineHandler *pipe, const CameraSensor *sensor,
 	}
 	stats->statsReady.connect(this, &SoftwareIsp::statsReady);
 
-	debayer_ = std::make_unique<DebayerCpu>(std::move(stats));
+	//TODO: derive the selection from file/environment variable
+	debayer_ = std::make_unique<DebayerEGL>(std::move(stats));
+	if (!debayer_) {
+		LOG(SoftwareIsp, Error) << "Failed to create DebayerEGL object";
+		debayer_ = std::make_unique<DebayerCpu>(std::move(stats));
+		if (!debayer_) {
+			LOG(SoftwareIsp, Error) << "Failed to create DebayerCPUGL object";
+			return;
+		}
+	}
+
 	debayer_->inputBufferReady.connect(this, &SoftwareIsp::inputReady);
 	debayer_->outputBufferReady.connect(this, &SoftwareIsp::outputReady);