[libcamera-devel] [PATCH 2/3] libcamera: raspberrypi: Fail on unsupported stream role

Jacopo Mondi jacopo at jmondi.org
Sun Jun 28 18:17:22 CEST 2020


When an unsupported stream roles is requested to
generateConfiguration(), the function shall fail instead of simply
ignoring the request.

Signed-off-by: Jacopo Mondi <jacopo at jmondi.org>
---
 src/libcamera/pipeline/raspberrypi/raspberrypi.cpp | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/src/libcamera/pipeline/raspberrypi/raspberrypi.cpp b/src/libcamera/pipeline/raspberrypi/raspberrypi.cpp
index d1338b640e3c..aa7b7eb93aab 100644
--- a/src/libcamera/pipeline/raspberrypi/raspberrypi.cpp
+++ b/src/libcamera/pipeline/raspberrypi/raspberrypi.cpp
@@ -568,7 +568,8 @@ CameraConfiguration *PipelineHandlerRPi::generateConfiguration(Camera *camera,
 		default:
 			LOG(RPI, Error) << "Requested stream role not supported: "
 					<< role;
-			break;
+			delete config;
+			return nullptr;
 		}
 
 		if (rawCount > 1 || outCount > 2) {
-- 
2.27.0



More information about the libcamera-devel mailing list