[libcamera-devel,v3,5/6,HACK] pipeline: simple: simple.cpp: Hack to test the GL converter
diff mbox series

Message ID 20220814160747.52093-5-kunalagarwal1072002@gmail.com
State New
Headers show
Series
  • [libcamera-devel,v3,1/6] pipeline: simple: shader: Shaders for debayering
Related show

Commit Message

Kunal Agarwal Aug. 14, 2022, 4:07 p.m. UTC
Includes converter_gl header file and add unicam to list of
supported devices to run on RaspberryPi

Removes parameterized constructor call for SimpleConverter,
which passed Mediadevice converter

Sets Number of streams to 1 when converter is in use

Signed-off-by: Kunal Agarwal <kunalagarwal1072002@gmail.com>
---
 src/libcamera/pipeline/simple/simple.cpp | 27 ++++++++++++------------
 1 file changed, 13 insertions(+), 14 deletions(-)

Patch
diff mbox series

diff --git a/src/libcamera/pipeline/simple/simple.cpp b/src/libcamera/pipeline/simple/simple.cpp
index bc0cb1a0..485282fb 100644
--- a/src/libcamera/pipeline/simple/simple.cpp
+++ b/src/libcamera/pipeline/simple/simple.cpp
@@ -36,7 +36,7 @@ 
 #include "libcamera/internal/v4l2_subdevice.h"
 #include "libcamera/internal/v4l2_videodevice.h"
 
-#include "converter.h"
+#include "converter_gl.h"
 
 namespace libcamera {
 
@@ -187,6 +187,7 @@  static const SimplePipelineInfo supportedDevices[] = {
 	{ "imx7-csi", { { "pxp", 1 } } },
 	{ "qcom-camss", {} },
 	{ "sun6i-csi", {} },
+	{ "unicam", {} },
 };
 
 } /* namespace */
@@ -452,18 +453,16 @@  int SimpleCameraData::init()
 	SimplePipelineHandler *pipe = SimpleCameraData::pipe();
 	int ret;
 
-	/* Open the converter, if any. */
-	MediaDevice *converter = pipe->converter();
-	if (converter) {
-		converter_ = std::make_unique<SimpleConverter>(converter);
-		if (!converter_->isValid()) {
-			LOG(SimplePipeline, Warning)
-				<< "Failed to create converter, disabling format conversion";
-			converter_.reset();
-		} else {
-			converter_->inputBufferReady.connect(this, &SimpleCameraData::converterInputDone);
-			converter_->outputBufferReady.connect(this, &SimpleCameraData::converterOutputDone);
-		}
+	/* Open the converter. */
+
+	converter_ = std::make_unique<SimpleConverter>();
+	if (!converter_->isValid()) {
+		LOG(SimplePipeline, Warning)
+			<< "Failed to create converter, disabling format conversion";
+		converter_.reset();
+	} else {
+		converter_->inputBufferReady.connect(this, &SimpleCameraData::converterInputDone);
+		converter_->outputBufferReady.connect(this, &SimpleCameraData::converterOutputDone);
 	}
 
 	video_ = pipe->video(entities_.back().entity);
@@ -1281,7 +1280,7 @@  bool SimplePipelineHandler::match(DeviceEnumerator *enumerator)
 		DeviceMatch converterMatch(name);
 		converter_ = acquireMediaDevice(enumerator, converterMatch);
 		if (converter_) {
-			numStreams = streams;
+			numStreams = 1;
 			break;
 		}
 	}